示例#1
0
        private void LoadSkin(string Filename)
        {
            Scanner s = new Scanner(Filename);

            Skin.Instance.TextureDirectory = s.GetToken();
            Skin.Instance.Version = s.GetNumber();
            Skin.Instance.WindowCaptionCentered = s.GetNumber();
            Skin.Instance.Offi = s.GetNumber();
            Skin.Instance.DefaultColors.RootWindow.Text = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.RootWindow.Caption = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.RootWindow.CaptionOutline = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.StaticControl.Caption = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.StaticControl.CaptionText = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.Caption = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionOutline = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionDisabled = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionDisabledOutline = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionPushed = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionPushedOutline = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionHighlighted = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.ButtonControl.CaptionHighlightedOutline = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.RadioControl.Caption = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.RadioControl.CaptionHighlighted = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.CheckboxControl.Caption = Color.FromArgb(s.GetNumber());
            Skin.Instance.DefaultColors.CheckboxControl.CaptionHighlighted = Color.FromArgb(s.GetNumber());
        }
示例#2
0
        private void LoadProperties(string Filename)
        {
            Scanner s = new Scanner(Filename);

            string id = s.GetToken();
            while (id != null)
            {
                WindowProperty res = new WindowProperty();

                // id
                res.m_szID = id;

                // tex
                res.m_szTexture = s.GetToken();
                if (Skin.Instance.Offi != 0)
                    s.GetToken();

                res.m_bTile = Convert.ToInt32(Convert.ToBoolean(s.GetNumber()));
                res.m_size = new Size(s.GetNumber(), s.GetNumber());
                res.m_style = (WindowStyle)s.GetNumber();
                //s.GetToken();

                s.GetToken(); // d3dFormat

                s.GetToken(); // {
                // title
                res.m_szTitle = s.GetToken();
                if (Data.Strings.Keys.Contains(res.m_szTitle))
                    res.m_szTitle = Data.Strings[res.m_szTitle];
                s.GetToken(); // }

                s.GetToken(); // {
                // help key
                res.m_szHelp = s.GetToken();
                if (Data.Strings.Keys.Contains(res.m_szHelp))
                    res.m_szHelp = Data.Strings[res.m_szHelp];
                s.GetToken(); // }

                s.GetToken(); // {
                string type = s.GetToken();
                while (!type.Equals("}"))
                {
                    ControlProperty con = new ControlProperty();

                    // type
                    con.m_szType = type;

                    // id
                    con.m_szID = s.GetToken();

                    // tex
                    con.m_szTexture = s.GetToken();

                    // tile
                    con.m_bTile = Convert.ToInt32(Convert.ToBoolean(s.GetNumber()));

                    // rect.left
                    int left = s.GetNumber();
                    int top = s.GetNumber();
                    int right = s.GetNumber();
                    int bottom = s.GetNumber();

                    con.m_rectBounds = new Rectangle(left, top, right - left, bottom - top);

                    con.m_style = (WindowStyle)s.GetNumber();

                    con.m_bVisible = s.GetNumber();
                    con.m_bGroup = s.GetNumber();
                    con.m_bDisabled = s.GetNumber();
                    con.m_bTabstop = s.GetNumber();

                    if (Skin.Instance.Offi != 0)
                    {
                        s.GetToken();
                        s.GetToken();
                        s.GetToken();
                    }
                    else
                    {
                        //con.m_nfontcolor = s.GetNumber();
                    }

                    s.GetToken(); // {
                    // title
                    con.m_szTitle = s.GetToken();
                    if (Data.Strings.Keys.Contains(con.m_szTitle))
                        con.m_szTitle = Data.Strings[con.m_szTitle];
                    s.GetToken(); // }

                    s.GetToken(); // {
                    // tooltip
                    con.m_szTooltip = s.GetToken();
                    if (Data.Strings.Keys.Contains(con.m_szTooltip))
                        con.m_szTooltip = Data.Strings[con.m_szTooltip];
                    s.GetToken(); // }

                    // Store control.
                    res.m_aControls.Add(con.m_szID, con);

                    type = s.GetToken();
                } // }

                // Store resource.
                Data.Properties.Add(id, res);
                //m_szLastWindowResource = id;

                id = s.GetToken();
            }
            Data.SortProperties();
        }