3 [
Attribute(
"-1",
UIWidgets.EditBox,
"Maximum size of the list without using scrollbar. -1 for no limit")]
4 float m_fMaxListHeight;
6 [
Attribute(
"true",
UIWidgets.CheckBox,
"Create the list below or above or below the root widget")]
7 bool m_bCreateListBelow;
9 [
Attribute(
"{B8C4345E3A833B05}UI/layouts/WidgetLibrary/ComboBox/WLib_OpenedComboRoot.layout",
UIWidgets.ResourceNamePicker,
"Combo box element",
"layout")]
12 [
Attribute(
"{323CF37F81DF9B8A}UI/layouts/Common/Settings/ComboBox/ARComboBoxElement.layout",
UIWidgets.ResourceNamePicker,
"Combo box element",
"layout")]
18 [
Attribute(
"0",
UIWidgets.EditBox,
"Extra pixels to the left from the center of the widget")]
19 float m_fExtraPaddingLeft;
21 [
Attribute(
"0",
UIWidgets.EditBox,
"Extra pixels to the right from the center of the widget")]
22 float m_fExtraPaddingRight;
24 [
Attribute(
"0",
UIWidgets.EditBox,
"Starting angle of arrow icon to coordinate texture rotation")]
57 [
Attribute(
"0",
desc:
"Should the arrow flip when the Combo box is opened")]
86 super.HandlerAttached(w);
116 Widget overlayText = w.FindAnyWidget(
"OverlayText");
130 super.HandlerDeattached(w);
177 super.OnFocusLost(
m_wRoot, 0, 0);
214 super.OnEnabled(animate);
223 super.OnDisabled(animate);
242 override bool SetCurrentItem(
int i,
bool playSound =
false,
bool animate =
false)
244 bool result = super.SetCurrentItem(i, playSound, animate);
260 w.RemoveFromHierarchy();
264 foreach (
int i,
string name : m_aElementNames)
281 GetGame().GetWorkspace().SetFocusedWidget(comp.GetRootWidget());
285 comp.
SetText(m_aElementNames[i]);
286 comp.m_OnClicked.Insert(OnElementSelected);
311 int initializedItems;
317 element.GetScreenSize(x, y);
323 if (initializedItems != totalItems)
364 x += m_fExtraPaddingLeft;
365 w -= m_fExtraPaddingLeft + m_fExtraPaddingRight;
379 if (m_bCreateListBelow)
381 y += h + m_fItemsGap;
386 m_wContent.SetFillOrigin(VerticalFillOrigin.BOTTOM);
389 separator.SetZOrder(-1);
397 size.EnableWidthOverride(
true);
402 size.SetWidthOverride(w);
404 if (m_fMaxListHeight > 0)
406 size.SetMaxDesiredHeight(m_fMaxListHeight);
407 size.EnableMaxDesiredHeight(
true);
473 comp.m_OnToggled.Remove(OnElementSelected);
504 override int AddItem(
string item,
bool last =
false, Managed
data = null)
506 int i = super.AddItem(item, last,
data);
526 super.RemoveItem(item, last);
550 element.SetEnabled(enable);
561 m_wText.SetText(m_aElementNames[i]);
574 int GetElementWidgets(notnull array<Widget> elementWidgets)
577 elementWidgets.Insert(w);
579 return elementWidgets.Count();
591 static SCR_ComboBoxComponent GetComboBoxComponent(
string name, Widget parent,
bool searchAllChildren =
true)
593 auto comp = SCR_ComboBoxComponent.Cast(
594 SCR_WLibComponentBase.GetComponent(SCR_ComboBoxComponent, name, parent, searchAllChildren)
643 if (!
m_Owner.GetRootWidget().IsVisibleInHierarchy())
ArmaReforgerScripted GetGame()
InputManager GetInputManager()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
override void SetToggled(bool toggled, bool animate=true, bool invokeChange=true, bool instant=false)
void SetText(string text)
ref ScriptInvoker m_OnChanged
ref Color m_BackgroundInteracting
void SetElementWidgetEnabled(int index, bool enable, bool animate=true)
void OnMenuFocusLost(ChimeraMenuBase menu)
void OnDisabled(bool animate)
ScrollLayoutWidget m_wScrollLayout
void OnHandlerFocusLost()
ref ScriptInvoker m_OnClosed
ref SCR_ComboModalHandler m_ModalHandler
InputManager m_InputManager
WorkspaceWidget m_Workspace
override void HandlerDeattached(Widget w)
override bool OnFocus(Widget w, int x, int y)
void OnEnabled(bool animate)
void OnCreateElement(Widget elementWidget, int index)
ImageWidget m_wArrowImage
override void RemoveItem(int item, bool last=false)
ref Color m_BackgroundDefault
override bool OnFocusLost(Widget w, int x, int y)
void OnHandlerUnhovered()
override void HandlerAttached(Widget w)
void CheckElementsInitialized()
const int INITIALIZATION_CHECK_FREQUENCY
ref array< Widget > m_aElementWidgets
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
ref Color m_ArrowInteracting
override int AddItem(string item, bool last=false, Managed data=null)
VerticalLayoutWidget m_wContent
ref ScriptInvoker m_OnOpened
float m_fArrowDefaultAngle
override void HandlerDeattached(Widget w)
ChimeraMenuBase m_OwnerMenu
override bool OnModalClickOut(Widget modalRoot, int x, int y, int button)
ref ScriptInvoker m_OnModalClickOut
void SetupOwners(SCR_ComboBoxComponent owner, ChimeraMenuBase menu)
SCR_ComboBoxComponent m_Owner
void OnMenuUpdate(float tDelta)
ScriptInvoker GetOnMouseLeave()
ScriptInvoker GetOnMouseEnter()
ScriptInvoker GetOnClick()
ScriptInvoker GetOnFocus()
ScriptInvoker GetOnFocusLost()
Base class for all final Reforger interactive elements.
void SetEnabled(bool enabled, bool animate=true)
void PlaySound(string sound)
SCR_FieldOfViewSettings Attribute
WidgetFlags
Widget flags. See enf::Widget::SetFlags().