5 const string WIDGET_EDITBOX =
"EditBox";
6 const string WIDGET_WARNING =
"DialogWarning";
7 const string WIDGET_TEXT_WARNING =
"TxtDialogWarning";
9 protected Widget m_wWarningMessage;
10 protected TextWidget m_wTxtWarningMessage;
22 override protected void InitWidgets()
27 Widget wEditbox =
m_wRoot.FindAnyWidget(WIDGET_EDITBOX);
33 m_wWarningMessage =
m_wRoot.FindAnyWidget(WIDGET_WARNING);
34 if (m_wWarningMessage)
35 m_wTxtWarningMessage = TextWidget.Cast(m_wWarningMessage.FindAnyWidget(WIDGET_TEXT_WARNING));
45 GetGame().GetWorkspace().SetFocusedWidget(m_Editbox.GetRootWidget());
46 m_Editbox.m_OnTextChange.Insert(OnTextChange);
47 m_Editbox.m_OnWriteModeLeave.Insert(OnWriteModeLeave);
52 protected void OnWriteModeLeave(
string text)
54 m_OnWriteModeLeave.Invoke(m_Editbox.GetValue());
58 protected void OnTextChange(
string text)
60 m_OnTextChange.Invoke(text);
68 void DisplayWarningMessage(
bool display)
70 if (m_wWarningMessage)
71 m_wWarningMessage.SetVisible(display);
75 void SetWarningMessage(
string message)
77 if (!m_wWarningMessage)
80 m_wWarningMessage.SetVisible(!message.IsEmpty());
82 if (m_wTxtWarningMessage)
83 m_wTxtWarningMessage.SetText(message);