23 m_Scroller = ScrollWidget.Cast(
m_Root.FindAnyWidget(
"dropdown_container" ) );
24 m_ContentContainer =
m_Root.FindAnyWidget(
"dropdown_content" );
26 m_Holder =
m_Root.FindAnyWidget(
"holder" );
29 m_Button =
m_Root.FindAnyWidget(
"dropdown_selector_button" );
30 m_ImageExpand = ImageWidget.Cast(
m_Root.FindAnyWidget(
"expand_image" ) );
31 m_ImageCollapse = ImageWidget.Cast(
m_Root.FindAnyWidget(
"collapse_image" ) );
40 Widget child = m_ContentContainer.GetChildren();
43 if( m_Content.Find( child ) > -1 )
45 m_Content.Insert( child );
49 m_ContentContainer.Update();
53 m_ContentContainer.GetScreenSize(
x,
y );
54 if(
y > m_Scroller.GetContentHeight() )
56 m_Scroller.SetAlpha( 1 );
60 m_Scroller.SetAlpha( 0 );
66 ButtonWidget element = ButtonWidget.Cast(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/dropdown_prefab/dropdown_element.layout", m_ContentContainer ) );
68 textWidget.SetText( text );
72 element.AddChild( content,
false );
74 m_ContentContainer.Update();
79 m_Content.Insert( element );
80 return m_Content.Count() - 1;
85 if( 0 < index && index < m_Content.Count() )
87 delete m_Content.Get( index );
88 m_ContentContainer.Update();
115 int index = m_Content.Find( w );
118 m_OnSelectItem.Invoke( index );
130 if ( (w == m_Button || w ==
m_Text || w == m_Holder) && button ==
MouseState.LEFT )
139 m_ContentContainer.Update();
protected Widget m_Parent
proto native WorkspaceWidget GetWorkspace()
ScriptInvoker Class provide list of callbacks usage:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()