6 [
Attribute(uiwidget: UIWidgets.LocaleEditBox)]
9 protected Widget m_wOverlay;
10 protected Widget m_wContent;
12 protected ref Color COLOR_BACKGROUND_DEFAULT =
UIColors.BACKGROUND_DEFAULT;
13 protected ref Color COLOR_BACKGROUND_HOVERED =
UIColors.BACKGROUND_HOVERED;
14 protected ref Color COLOR_BACKGROUND_FOCUSED =
UIColors.BACKGROUND_HOVERED;
15 protected ref Color COLOR_BACKGROUND_CLICKED =
UIColors.BACKGROUND_HOVERED;
17 protected ref Color COLOR_CONTENT_DEFAULT = Color.White;
18 protected ref Color COLOR_CONTENT_HOVERED = Color.White;
19 protected ref Color COLOR_CONTENT_FOCUSED = Color.White;
20 protected ref Color COLOR_CONTENT_CLICKED = Color.White;
23 ref ScriptInvoker m_OnHover =
new ScriptInvoker();
24 ref ScriptInvoker<Widget> m_OnHoverLeave =
new ScriptInvoker();
27 override void HandlerAttached(Widget w)
29 super.HandlerAttached(w);
35 SetContent(m_sContent);
92 override bool OnMouseEnter(Widget w,
int x,
int y)
94 super.OnMouseEnter(w, x, y);
103 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
105 super.OnMouseLeave(w, enterW, x, y);
106 m_OnHoverLeave.Invoke(w);
114 override bool OnFocus(Widget w,
int x,
int y)
116 super.OnFocus(w, x, y);
124 override bool OnFocusLost(Widget w,
int x,
int y)
126 super.OnFocusLost(w, x, y);
145 void ColorizeWidgets(Color colorBackground, Color colorContent,
float speed = -1)
148 speed = m_fAnimationRate;
151 AnimateWidget.Color(
m_wOverlay, colorContent, speed);
155 void SetHorizontalAlign(LayoutHorizontalAlign horizontalAlign)
160 TextWidget content = TextWidget.Cast(
m_wContent);
162 AlignableSlot.SetHorizontalAlign(content, horizontalAlign);
177 void SetContent(
string text)
182 TextWidget content = TextWidget.Cast(
m_wContent);
185 content.SetText(text);
189 ImageWidget img = ImageWidget.Cast(
m_wContent);
192 img.LoadImageTexture(0, text);
203 if (!info.SetNameTo(TextWidget.Cast(
m_wContent)))
216 static SCR_ButtonComponent GetButtonComponent(
string name, Widget parent,
bool searchAllChildren =
true)