Ejemplo n.º 1
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());
            }
Ejemplo n.º 2
0
            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=...");
                }
            }
Ejemplo n.º 3
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();
                }
            }
Ejemplo n.º 4
0
            public jGuiControl CreateRTTI(jxE e)
            {
                string rtti = e.GetTagName();

                if (!rtti.Contains("jGui"))
                {
                    return(null);
                }
                if (rtti == "jGuiWindow")
                {
                    return(get_rtti_control("window", new jGuiWindow(), e));
                }
                if (rtti == "jGuiGroup")
                {
                    return(get_rtti_control(null, new jGuiGroup(), e));
                }
                if (rtti == "jGuiBox")
                {
                    return(get_rtti_control("box", new jGuiBox(), e));
                }
                if (rtti == "jGuiVertical")
                {
                    return(get_rtti_control(null, new jGuiVertical(), e));
                }
                if (rtti == "jGuiHorizontal")
                {
                    return(get_rtti_control(null, new jGuiHorizontal(), e));
                }
                if (rtti == "jGuiScrollView")
                {
                    return(get_rtti_control("scrollview", new jGuiScrollView(), e));
                }

                if (rtti == "jGuiButton")
                {
                    return(get_rtti_control("button", new jGuiButton(), e));
                }
                if (rtti == "jGuiRepeatButton")
                {
                    return(get_rtti_control("button", new jGuiRepeatButton(), e));
                }

                if (rtti == "jGuiToolbar")
                {
                    return(get_rtti_control("button", new jGuiToolbar(), e));
                }
                if (rtti == "jGuiGrid")
                {
                    return(get_rtti_control("button", new jGuiGrid(), e));                                   //SelectionGrid  다수의 행의Toolbar
                }
                if (rtti == "jGuiToggle")
                {
                    return(get_rtti_control("toggle", new jGuiToggle(), e));
                }

                //Slider과 비슷하나 브라우저나 워드를 위한 스크롤링. ScrollView 컨트롤을 조종
                if (rtti == "jGuiScrollbarH")
                {
                    return(get_rtti_control("horizontalscrollbar", new jGuiScrollbarH(), e));
                }
                if (rtti == "jGuiScrollbarV")
                {
                    return(get_rtti_control("verticalscrollbar", new jGuiScrollbarV(), e));
                }

                //HorizontalSlider  미리 결정된 최소와 최대 값 사이의 값을 변화
                if (rtti == "jGuiSliderH")
                {
                    return(get_rtti_control("horizontalscrollbar", new jGuiSliderH(), e));
                }
                if (rtti == "jGuiSliderV")
                {
                    return(get_rtti_control("verticalscrollbar", new jGuiSliderV(), e));
                }

                if (rtti == "jGuiLabel")
                {
                    return(get_rtti_control("label", new jGuiLabel(), e));
                }
                if (rtti == "jGuiPassword")
                {
                    return(get_rtti_control("textfield", new jGuiPassword(), e));
                }
                if (rtti == "jGuiTextField")
                {
                    return(get_rtti_control("textfield", new jGuiTextField(), e));
                }
                if (rtti == "jGuiTextArea")
                {
                    return(get_rtti_control("textarea", new jGuiTextArea(), e));
                }
                if (rtti == "jGuiLayout")
                {
                    return(get_rtti_control(null, new jGuiLayout(), e));
                }
                if (rtti == "jGuiArea")
                {
                    return(get_rtti_control("textarea", new jGuiArea(), e));
                }

                throw new System.Exception("Gui==null : " + e.GetTagName() + " : Not found in jGuiStage.CreateRTTI()");
            }
Ejemplo n.º 5
0
            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)