Beispiel #1
0
            public jxE FindByAttr(string attribute_name, string value, out jxA a)
            {
                a = AttrVar(attribute_name);
                if (a != null)
                {
                    if (value == null)
                    {
                        return(this);
                    }

                    if (a.IsEType(EDataType.e_string))
                    {
                        if (a.Get_string() == value)
                        {
                            return(this);
                        }
                    }
                }
                for (jxE e = m_Child; e != null; e = e.m_Next)
                {
                    jxE eFind = e.FindByAttr(attribute_name, value, out a);
                    if (eFind != null)
                    {
                        return(eFind);
                    }
                }
                return(null);
            }
Beispiel #2
0
            public Rect GetGuiRect(jxE g)
            {
                jxV vRect = g.AttrVar("Rect");

                if (vRect == null)
                {
                    vRect = g.AttrVar("Name");
                }
                if (vRect == null)
                {
                    //jDebug.jWARN(" attribute not found Rect : " + g.GetTagName());
                    return(new Rect(0, 0, 0, 0));
                }

                if (vRect.GetEType() == nXML.EDataType.e_Rect)
                {
                    return(vRect.GetRect());
                }

                if (vRect.GetEType() != nXML.EDataType.e_string)
                {
                    throw new System.Exception("xml : vRect.GetEType() != nXML.EDataType.e_string : " + m_Doc.m_name);
                }

                jxE eRect = m_eNamedRect.Find(vRect.Get_string());

                if (eRect == null)
                {
                    throw new System.Exception(m_Doc.m_name + "  eRect==null");
                }

                return(eRect.GetRect());
            }
Beispiel #3
0
            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");
                }
            }
Beispiel #4
0
            //#--------------------------------------------------------------------------
            // 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();
            }
Beispiel #5
0
            public string AttrOverride(string attribute_name)
            {
                jxA v = AttrVarOverride(attribute_name);

                if (v == null)
                {
                    return(null);
                }
                if (!v.IsEType(nXML.EDataType.e_string))
                {
                    string sError = m_jxE.GetTagName() + "'s attribute<" + attribute_name + "> is not e_string : " + v.GetEType().ToString();
                    throw new System.Exception(sError);
                }
                return(v.Get_string());
            }
Beispiel #6
0
            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");
                }
            }
Beispiel #7
0
            public void UpdateList()
            {
                m_listText = new string[m_jxE.size()];
                int i = 0;

                foreach (jxE e in m_jxE)
                {
                    jxV v = e.AttrVar("Enable");
                    if (v != null && v.Get_bool() == false)
                    {
                        continue;
                    }
                    m_listText[i++] = e.Get_string();
                }
            }
Beispiel #8
0
            //#--------------------------------------------------------------------------
            // member function
            //#--------------------------------------------------------------------------
            public jxV AttrVarOverride(string attribute_name)
            {
                jxA v = m_jxE.AttrVar(attribute_name);

                if (v != null || m_OverrideAttribute == null)
                {
                    return(v);
                }

                jxE e = m_OverrideAttribute.Find(m_jxE.GetTagID(), 1);

                if (e == null)
                {
                    return(null);
                }
                //Debug.Log(e.GetTagName() + " : OverrideAttribute : " + attribute_name);
                return(e.AttrVar(attribute_name));
            }
Beispiel #9
0
            //#--------------------------------------------------------------------------
            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);
            }
Beispiel #10
0
    // "dummy_client"라는 jGuiStage xml파일을 로딩했을때 호출됨.
    protected void OnLoadStageXML_dummy_client(nNWM.nXML.jxDocument stageXml)
    {
        jxE xml         = stageXml.m_Root;
        jxV v           = null;
        jxE ePlayerList = xml.FindByAttr("Name", "PlayerList", out v);
        int iTot        = m_CMD.m_PlayerCmdFile.Length - 1;

        Debug.Log("m_CMD.m_PlayerCmdFile.Length  = " + m_CMD.m_PlayerCmdFile.Length);
        for (int i = 0; i < iTot; ++i)
        {
            jxE eClone = ePlayerList.begin().MakeClone();
            ePlayerList.InsertChild(eClone);
        }

        int idx = 0;

        foreach (jxE e in ePlayerList)
        {
            e.Set_string(m_CMD.m_PlayerCmdFile[idx++].USER_ID);
        }
    }
Beispiel #11
0
            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();
            }
Beispiel #12
0
            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();
                }
            }