public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_isLayouted = true; base.loadDefaultParam(stage, win, parent, g, overrideAttribute); base.loadChild(stage, parent, g); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { ///Debug.Log("load : jGuiScrollView : " + g.GetTagName()); base.Load(stage, win, parent, g, overrideAttribute); jxA a; if (!m_isLayouted) { a = g.AttrVar("ViewRect"); if (a == null) { throw new System.Exception(this.ToString() + " must has ViewRect attribute"); } if (a.IsEType(nXML.EDataType.e_Rect) == false) { throw new System.Exception(this.ToString() + " is not e_Rect type"); } m_ViewRect = a.GetRect(); } a = g.AttrVar("AutoScroll"); if (a != null) { m_isAutoScroll = a.Get_bool(); } }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_ToggleValue = g.AttrVar("ToggleValue"); if (m_ToggleValue == null) { throw new System.Exception("jGuiToggle : attribute b_ToggleValue is null"); } }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_isLayouted = true; // only GUILayout mode ! base.Load(stage, win, parent, g, overrideAttribute); if (g.AttrVar("Rect") == null) { throw new System.Exception(g.GetTagName() + " : need r_Rect=..."); } }
//#-------------------------------------------------------------------------- // protectec member function //#-------------------------------------------------------------------------- //#-------------------------------------------------------------------------- // private member function //#-------------------------------------------------------------------------- //#-------------------------------------------------------------------------- // jGuiControl Event function //#-------------------------------------------------------------------------- public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_vColumn = g.AttrVar("Column"); if (m_vColumn == null) { throw new System.Exception(ToString() + " has not i_Column attribute"); } ReloadGridString(); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_listText = new string[g.size()]; int i = 0; foreach (jxE e in g) { m_listText[i++] = e.Get_string(); } }
public jGuiControl FindCtrl(string name) { jxA findA; jxE e = m_ejGuiList.FindByAttr("Name", name, out findA); if (e == null) { return(null); } jGuiControl ctrl = (jGuiControl)e.m_UserData; return(ctrl); }
override public jGuiControl FindCtrl(string name) { jxA findA; jxE e = m_jxE.FindByAttr("Name", name, out findA); if (e == null) { Debug.Log("jGuiControl FindCtrl : " + name + " is not found"); return(null); } jGuiControl ctrl = (jGuiControl)e.m_UserData; return(ctrl); }
virtual public void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { //////Debug.Log("load : jGuiControl : " + g.GetTagName()); loadDefaultParam(stage, win, parent, g, overrideAttribute); if (m_isLayouted == false) { m_Rect = stage.GetGuiRect(m_jxE); } else { m_jLayoutParam = new jGUILayoutOption(m_jxE, this); } }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_vMask = g.AttrVar("Mask"); if (m_vMask == null) { throw new System.Exception(ToString() + " has not Mask attribute"); } m_vMaxLength = g.AttrVar("MaxLength"); if (m_vMaxLength == null) { throw new System.Exception(ToString() + " has not i_MaxLength attribute"); } }
public void ShowModalWindow(string windowName) //gui xml에서 <Modal_Window>의 자식항목중에 해당 이름의 윈도우를 뛰운다. { if (m_eModal_Window == null) { Debug.LogWarning("gui xml file has not Modal_Window node"); return; } jxA findA; jxE e = m_eModal_Window.FindByAttr("Name", windowName, out findA); if (e == null) { Debug.LogWarning("Modal_Window is not found : " + windowName); return; } var modal = (jGuiWindow)e.m_UserData; if (modal == null) { Debug.LogWarning("Modal_Window jGuiControl==null : " + windowName); return; } foreach (jxE eCtrl in m_ejGuiList) { jGuiControl w = (jGuiControl)eCtrl.m_UserData; if (w == null) { continue; } if (w.IsEnabled()) { m_BackupEnableWindowStatus.Add(w); w.SetEnabled(false); } } Rect rect = modal.GetXmlRect(); rect.x = (Screen.width - rect.width) / 2; rect.y = (Screen.height - rect.height) / 2; modal.SetRect(rect); CallEventHandler_jGuiWindow("OnShowModal_" + modal.GetName(), modal); m_ModalWindowList.Add(modal); }
protected void loadChild(jGuiStage stage, jGuiControl parent, jxE g) { jGuiControl ctrl; foreach (jxE e in m_jxE) { ctrl = m_jGuiStage.CreateRTTI(e); if (ctrl == null) { continue; } ctrl.m_isLayouted = this.m_isLayouted; ctrl.Load(stage, this.m_jGuiWindow, this, e, this.m_OverrideAttribute); } }
//#-------------------------------------------------------------------------- public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) //#-------------------------------------------------------------------------- { base.Load(stage, this, parent, g, overrideAttribute); m_vDragWindow = g.AttrVar("DragWindow"); jxV v = g.AttrVar("IsScalable"); if (v != null && v.Get_bool()) { m_EScaleState = EScaleState.eREADY; m_rectScaleBox.x = m_Rect.x + m_Rect.width - fTOGGLEBOX_OFFSET; m_rectScaleBox.y = m_Rect.y + m_Rect.height; m_rectScaleBox.width = fSCALE_BOX_WIDTH; m_rectScaleBox.height = fSCALE_BOX_HEIGT; } m_jGuiStage.CallEventHandler_jGuiWindow("OnLoadedGUI_" + GetName(), this); }
public void CallEventHandler(jGuiControl ctrl, string sEventType = "") { if (ctrl == null || !ctrl.HasName()) { return; } if (sEventType.Length == 0) { sEventType = ctrl.m_jxE.GetTagName(); } else { sEventType = ctrl.m_jxE.GetTagName() + "_" + sEventType; } string sEventName = sEventType + "_" + ctrl.GetName(); m_EventHandler.SendMessage(sEventName, ctrl, SendMessageOptions.DontRequireReceiver); }
//#-------------------------------------------------------------------------- // private member function //#-------------------------------------------------------------------------- void AddPlayerCmd(string cmd, int idx) { // 맨처음 노드는 cmd용 original 탬플릿이다. jxE eCmdGroup; bool isReloadGui = false; if (idx >= m_scroll_CmdList.m_jxE.size()) { eCmdGroup = m_scroll_CmdList.m_jxE.begin().MakeClone(); m_scroll_CmdList.m_jxE.InsertChild(eCmdGroup); isReloadGui = true; } else { eCmdGroup = m_scroll_CmdList.m_jxE.GetChild(idx); } eCmdGroup.AttrVar("Enable").Set_bool(true); jxA a; jxE eCmdText = eCmdGroup.FindByAttr("Name", "CmdRun", out a); a = eCmdText.AttrVar("Text"); a.Set_string(cmd); if (isReloadGui) { // jGuiContorl 리로딩. jGuiControl ctrl = m_scroll_CmdList.GetStage().CreateRTTI(eCmdGroup); jDebug.jASSERT(ctrl != null); ctrl.m_isLayouted = m_scroll_CmdList.m_isLayouted; ctrl.Load(m_scroll_CmdList.GetStage() , m_scroll_CmdList.GetWindow() , m_scroll_CmdList , eCmdGroup , m_scroll_CmdList.Get_OverrideAttribute()); } else { jGuiButton btn = (jGuiButton)eCmdText.m_UserData; btn.SetText(cmd); } }
protected void loadDefaultParam(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_OverrideAttribute = g.Find("OverrideAttribute", 1); if (m_OverrideAttribute == null) { m_OverrideAttribute = overrideAttribute; } m_TextAnchor.t1 = false; m_jxE = g; m_jGuiStage = stage; m_jGuiParent = parent; m_Enable = m_jxE.AttrVar("Enable"); m_Text = AttrOverride("Text"); m_Name = m_jxE.Attr("Name"); if (m_Text == null) { m_Text = m_Name; } load_GUIStyle(); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); jxV v = g.AttrVar("MaxLength"); if (v != null) { m_iMaxLength = v.Get_int(); } if (m_Text == null) { throw new System.Exception(g.GetTagName() + "' Text is not found "); } v = g.AttrVar("ReadOnly"); if (v != null) { m_bReadOnly = v.Get_bool(); } }
public void OnGUI() { GUI.skin = m_GUISkin; if (m_ModalWindowList.Count > 0) { var mw = m_ModalWindowList[m_ModalWindowList.Count - 1]; mw.OnGUI(); return; } foreach (jxE e in m_ejGuiList) { jGuiControl w = (jGuiControl)e.m_UserData; if (w == null) { continue; } if (w.IsEnabled()) { w.OnGUI(); } } }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_isLayouted = parent.IsLayouted(); base.Load(stage, win, parent, g, overrideAttribute); }
public Auto_GUIStlyer(jGuiControl ctrl) { m_ctrl = ctrl; ctrl.Begin_GUIStyle(); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { ///Debug.Log("load : jGuiControlGroup : " + g.GetTagName()); base.Load(stage, win, parent, g, overrideAttribute); loadChild(stage, parent, g); }
void OnShowModal_ServerList(jGuiWindow win) // "ServerList"라는 모달 { jxE eServerList = m_CMD.GetCurrServerList(); if (eServerList == null) { m_CMD.LogWarning(m_CMD.m_DefaultServerListName + " is not found in ServerList xml"); return; } int iSize = eServerList.size() - m_guiServerList.m_jxE.size(); if (iSize > 0) // 다운로드 받은 서버리스트 보다 gui xml의 서버리스트 컨트롤이 적다면 컨트롤 추가. { for (int i = 0; i < iSize; ++i) { jxE eServer = m_guiServerList.m_jxE.begin().MakeClone(); m_guiServerList.m_jxE.InsertChild(eServer); // jGuiContorl 리로딩. jGuiControl new_ctrl = m_guiServerList.GetStage().CreateRTTI(eServer); if (new_ctrl == null) { eServer.DebugPrint(); throw new System.Exception("CreateRTTI : new_ctrl==null"); } new_ctrl.m_isLayouted = m_guiServerList.m_isLayouted; new_ctrl.Load(m_guiServerList.GetStage() , m_guiServerList.GetWindow() , m_guiServerList , eServer , m_guiServerList.Get_OverrideAttribute()); } } int idx = 0; foreach (jGuiControl gui in m_guiServerList) { if (idx >= eServerList.size()) { gui.SetEnabled(false); continue; } var btn = (jGuiButton)gui.FindCtrl("ServerOk"); jxE server = eServerList.GetChild(idx); string name = server.Attr("NAME"); string text = name + " " + server.Attr("IP") + ":" + server.AttrVar("PORT").Get_int().ToString(); var lbl = (jGuiLabel)gui.FindCtrl("ServerStatus"); if (name == m_CMD.m_ServerName) { lbl.SetText("Selected"); } else { lbl.SetText("Unkown"); } btn.SetText(text); ++idx; } UpdateServerStatus(); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_isLayouted = true; // only GUILayout mode ! base.Load(stage, win, parent, g, overrideAttribute); }
static jGuiControl get_rtti_control(string default_style_name, jGuiControl ctrl, jxE e) { ctrl.SetDefaultStyleName(default_style_name); e.m_UserData = ctrl; return(ctrl); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); }
public jGUILayoutOption(jxE g, jGuiControl c) { dictionary_option_t dic_o = new dictionary_option_t(); jxA a; a = c.AttrVarOverride("WH"); if (a != null) { jDebug.jASSERT(a.IsEType(nXML.EDataType.e_float_array), g.GetTagName() + " WH type is not e_float_array"); set_Width(a.Get_float(0), dic_o); set_Height(a.Get_float(1), dic_o); } else { a = c.AttrVarOverride("Width"); if (a != null) { jDebug.jASSERT(a.IsEType(nXML.EDataType.e_float), g.GetTagName() + " Width type is not e_float"); set_Width(a.Get_float(), dic_o); } a = c.AttrVarOverride("Height"); if (a != null) { jDebug.jASSERT(a.IsEType(nXML.EDataType.e_float), g.GetTagName() + " Height type is not e_float"); set_Height(a.Get_float(), dic_o); } } a = c.AttrVarOverride("MinMaxW"); if (a != null) { if (!a.IsEType(nXML.EDataType.e_float_array)) { throw new System.Exception(g.GetTagName() + " MinMaxW type is not e_float_array"); } set_MinMaxW(a.Get_float(0), a.Get_float(1), dic_o); } else { float fMax = 0; float fMin = 0; a = c.AttrVarOverride("MaxWidth"); if (a != null && a.Get_float() > 0) { fMax = a.Get_float(); } a = c.AttrVarOverride("MinWidth"); if (a != null && a.Get_float() > 0) { fMin = a.Get_float(); } set_MinMaxW(fMin, fMax, dic_o); } a = c.AttrVarOverride("MinMaxH"); if (a != null) { if (!a.IsEType(nXML.EDataType.e_float_array)) { throw new System.Exception(g.GetTagName() + " MinMaxH type is not e_float_array"); } set_MinMaxH(a.Get_float(0), a.Get_float(1), dic_o); } else { float fMax = 0; float fMin = 0; a = c.AttrVarOverride("MaxHeight"); if (a != null && a.Get_float() > 0) { fMax = a.Get_float(); } a = c.AttrVarOverride("MinHeight"); if (a != null && a.Get_float() > 0) { fMin = a.Get_float(); } set_MinMaxH(fMin, fMax, dic_o); } /* * a = c.AttrVarOverride("ExpandWidth"); * if (a != null && a.Get_bool() != false) * { * dic_o.Add(GUILayout.ExpandWidth(a.Get_bool())); * } * * a = c.AttrVarOverride("ExpandHeight"); * if (a != null && a.Get_bool() != false) * { * dic_o.Add(GUILayout.ExpandHeight(a.Get_bool())); * } */ m_GUILayoutOption = new GUILayoutOption[dic_o.Count]; int i = 0; foreach (var v in dic_o) { m_GUILayoutOption[i++] = v; } } //public jGUILayoutOption(jxE g)