6 protected bool m_bInitCalled;
10 Widget spingBoxWidget = w.FindAnyWidget(m_sUiComponentName);
12 if (!spingBoxWidget)
return;
15 if (!m_SpinboxWidgetComponent)
return;
16 m_SpinboxWidgetComponent.m_OnChanged.Insert(OnChangeSpinbox);
22 array<ref SCR_BaseEditorAttributeEntry> entries =
new array<ref SCR_BaseEditorAttributeEntry>;
23 attribute.GetEntries(entries);
25 foreach (SCR_BaseEditorAttributeEntry entry: entries)
30 int count = spinboxData.GetValueCount();
32 for (
int i = 0; i < count; i++)
34 m_SpinboxWidgetComponent.AddItem(spinboxData.GetValuesEntry(i).GetName(), i == count - 1);
44 int entriesCount = entries.Count();
45 for (
int i = 0; i < entriesCount; i++)
49 m_SpinboxWidgetComponent.AddItem(entry.GetText(), i == entriesCount - 1);
54 super.Init(w, attribute);
60 m_SpinboxWidgetComponent.SetCurrentItem(0);
68 super.SetFromVar(var);
73 m_SpinboxWidgetComponent.SetCurrentItem(var.GetInt(),
false,
false);
77 override bool OnChange(Widget w,
int x,
int y,
bool finished)
80 if (!attribute)
return false;
83 if (var.GetInt() == x)
87 super.OnChange(w, x, y, finished);
94 OnChange(spinbox.GetRootWidget(), value, 0,
false);
98 override void HandlerDeattached(Widget w)
100 if (m_SpinboxWidgetComponent)
101 m_SpinboxWidgetComponent.m_OnChanged.Remove(OnChangeSpinbox);