private static void Initialize()
        {
            //Debug.Log("FormHeadingStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(10, 10, 10, 10),
                Font      = FontMapper.GetDefault().Font,
                Border    = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                //FontSize = 30,
                FontStyle       = FontStyle.Italic,
                NormalTextColor = new Color(1f, 0.7f, 0f, 1)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;

            //const int w = (Weight + 1)*2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;

            //_style.NormalGraphics = new Rect(w, w,
            //                                 new Fill(new Color(0.3f, 0.3f, 0.3f, 0.2f))
            //    );

            _style.Commit();
        }
Exemple #2
0
        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("LabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(7, 7, 7, 7),
                Font      = FontMapper.GetDefault().Font,
                Border    = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                //FontSize = 8,
                NormalTextColor = Color.white             // new Color(0.3f, 0.3f, 0.3f, 1f)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;
            //_style.Font = FontMapper.GetDefault();

            //const int w = (Weight + 1)*2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;

            //_style.NormalGraphics = new Rect(w, w, new Fill(new Color(0.3f, 0.4f, 0.9f, 1f)));

            _style.Commit();
        }
Exemple #3
0
        private static void Initialize()
        {
            _instance.name = "CheckBoxStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font          = FontMapper.GetDefault().Font,
                Style         = _instance,
                Alignment     = TextAnchor.MiddleCenter,
                ContentOffset = new Vector2(-1, -1) // fix bad Unity offset
                                                    //Padding = new RectOffset(6, 6, 3, 3) // no GUIStyle padding
            };

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.white), // RgbColor.FromHex(0xC0C0C0).ToColor()
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            }
                                              );
            _style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(1f, 1f, 1f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                              );

            //_style.OnNormalTextColor = Color.white;
            //_style.OnNormalGraphics = new Rect(w, w,
            //                                   new Fill(RgbColor.FromHex(0x808080).ToColor()),
            //                                   new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
            //     );

            _style.Commit();

            //_style.FixedHeight = 20;
            //_style.FixedWidth = 100;
        }
Exemple #4
0
        private static void Initialize()
        {
            _instance.name = "PagerButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 6, 6)
            };

            const int w = (Weight + 1) * 2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0xC0C0C0).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            }
                                              );
            _style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(1f, 1f, 1f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                              );

            _style.OnNormalTextColor = Color.white;
            _style.OnNormalGraphics  = new Rect(w, w,
                                                new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                                new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                                );

            _style.FixedHeight = 25;
            _style.FixedWidth  = 25;

            _style.Commit();
        }
        private static void Initialize()
        {
            _instance.name = "TabButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 3, 3)
            };

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black; // Color.white;
            _style.NormalGraphics  = new Rect(w, w,
                                                  //new Fill(RgbColor.FromHex(0x965FFF).ToColor()),
                                              new Fill(ColorMixer.FromHex(0xc0c0c0).ToColor()),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            //_style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            //_style.HoverGraphics = new Rect(w, w,
            //                                new Fill(new Color(1f, 1f, 1f, 1f)),
            //                                new Stroke(Color.grey, Weight)
            //    );
            _style.ActiveTextColor = Color.white;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0xA97FFF).ToColor()),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );

            //_style.OnNormalTextColor = Color.white;
            //_style.OnNormalGraphics = new Rect(w, w,
            //                                   new Fill(RgbColor.FromHex(0x808080).ToColor()),
            //                                   new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
            //     );

            //_style.ImagePosition = ImagePosition.ImageAbove;

            _style.ContentOffset = new Vector2(-3, 0);

            _style.Commit();
        }
Exemple #6
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style        = _instance,
                Alignment    = TextAnchor.UpperLeft,
                Padding      = new RectOffset(6, 6, 6, 6),
                WordWrap     = true,
                TextClipping = TextClipping.Clip,
                Font         = FontMapper.GetDefault().Font
            };

            int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.Font = FontMapper.Get("pixel");
            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black; //Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              //new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            _style.WordWrap  = true;
            _style.Alignment = TextAnchor.UpperLeft;

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(10, 10, 4, 4),
                Font      = FontMapper.GetDefault().Font
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            _style.FixedWidth  = 320;
            _style.FixedHeight = 25;

            _style.Commit();
        }
Exemple #8
0
        ///<summary>
        /// Note: sanity check done outside (in DefaultValuesFactory class)
        ///</summary>
        ///<returns></returns>
        public object GetDefault()
        {
            /* XOR! */
            //if (null == ProxyType ^ !string.IsNullOrEmpty(ProxyMemberName))
            //    throw new Exception("When using proxy, both ProxyType and ProxyMemberName have to be defined: " + GetType());

            try
            {
                /**
                 * 1. Proxy takes precedence
                 * */
                if (null != ProxyType)
                {
                    return(string.IsNullOrEmpty(ProxyMemberName) ?
                           StyleProxyReader.GetProxySingleton(ProxyType) :
                           StyleProxyReader.GetProxyMemberValue(ProxyType, ProxyMemberName));
                }

                /**
                 * 2. Color
                 * */
                if (IsValidColor())
                {
                    return(ColorMixer.FromHexAndAlpha((int)Default, 1f).ToColor());
                }

                /**
                 * 3. Font
                 * */
                if (IsValidFont())
                {
                    var fontMapperId = Default as string;
                    /* Use the font mapper */
                    return(string.IsNullOrEmpty(fontMapperId) ?
                           FontMapper.GetDefault().Font :                  // get default font
                           FontMapper.GetWithFallback(fontMapperId).Font); // get named font
                }

                /**
                 * 3. Default value
                 * */
                return(Default);
            }
            catch (Exception ex)
            {
                throw new Exception("Problem processing style attribute " + Name + ": ", ex);
            }
        }
        public void PlayModeStartedSlot(object[] parameters)
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log("PlayModeChangeProcessorHandlingDesignerOverlay->PlayModeStartedSlot");
            }
#endif
            //_changesCached = false;

            if (EditorSettings.InspectorEnabled && Application.isEditor && Application.isPlaying /* && null == DesignerOverlay.Instance*/)
            {
                //if (FontMapper.IsMapping(DipSwitches.DefaultFontMapperId))
                if (null != FontMapper.GetDefault())
                {
                    // ReSharper disable once UnusedVariable
                    DesignerOverlay.Attach();
                    //overlay.Font = FontMapper.GetWithFallback(DipSwitches.DefaultFontMapperId).Font; // set font
                }
            }
        }
        private static void Initialize()
        {
            _instance.name = "GreenButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 3, 3)
            };

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Green),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );

            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(ColorMixer.FromHex(0x14FF99).ToColor()),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );

            _style.Commit();
        }
        private static void Initialize()
        {
            _instance.name = "GroupBackgroundStyle";

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Font      = FontMapper.GetDefault().Font
            };

            const int w = (Weight + 1) * 2;

            _style.Border  = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.Padding = new RectOffset(2, 2, 2, 2);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.85f, 0.85f, 0.85f, 1);
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(1, 1, 1, 1)) /*, new Stroke(Color.grey, Weight)*/);

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Font      = FontMapper.GetDefault().Font
            };

            const int w = (Weight + 1) * 2;

            _style.Border  = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.Padding = new RectOffset(2, 2, 2, 2);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.white;
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(0.2f, 0.2f, 0.2f, 0.75f)));

            //_style.TextClipping = TextClipping.Overflow;
            _style.WordWrap = true;

            _style.Commit();
        }
Exemple #13
0
        private static void Initialize()
        {
            _instance.name = "ButtonSingleStateStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font          = FontMapper.GetDefault().Font,
                Style         = _instance,
                Alignment     = TextAnchor.MiddleCenter,
                ContentOffset = new Vector2(-1, -1)              // fix bad Unity offset
            };

            const int w = (Weight + 1) * 2;

            _style.Border         = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.NormalGraphics = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            });
            _style.Commit();
        }
        private static void Initialize()
        {
            //Debug.Log("FormItemLabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(4, 4, 7, 4),
                Font      = FontMapper.GetDefault().Font,
                //FontSize = 8,
                NormalTextColor = new Color(0.2f, 0.2f, 0.2f, 1)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;

            //const int w = (Weight + 1)*2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            //_style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            _style.Commit();
        }
Exemple #15
0
        private static void Initialize()
        {
            _instance.name = "ButtonsStyle2";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Font      = FontMapper.GetDefault().Font,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(10, 10, 14, 10)
            };

            const int w = (Weight + 1) * 2;

            _style.Border          = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.Font            = FontMapper.Get("arial").Font;
            _style.FontSize        = 30;
            _style.NormalTextColor = Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            });

            _style.HoverTextColor = Color.white;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.green),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );

            _style.ActiveTextColor = Color.white;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.2f, 0.9f, 0.2f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.white
            }
                                              );
            _style.FocusedTextColor = Color.white;
            _style.FocusedGraphics  = new Rect(w, w,
                                               new Fill(Color.blue),
                                               new Stroke(Weight)
            {
                Color = Color.yellow
            }
                                               );

            _style.OnNormalTextColor = Color.white;
            _style.OnNormalGraphics  = new Rect(w, w,
                                                new Fill(new Color(0.3f, 0.4f, 0.9f, 1f)),
                                                new Stroke(Weight)
                                                );
            _style.OnHoverTextColor = Color.white;
            _style.OnHoverGraphics  = new Rect(w, w,
                                               new Fill(new Color(0.4f, 0.5f, 0.9f, 1f)),
                                               new Stroke(Weight)
                                               );
            _style.OnActiveTextColor = Color.white;
            _style.OnActiveGraphics  = new Rect(w, w,
                                                new Fill(new Color(0.4f, 0.6f, 0.9f, 1f)),
                                                new Stroke(Weight)
                                                );
            _style.OnFocusedTextColor = Color.white;
            _style.OnFocusedGraphics  = new Rect(w, w,
                                                 new Fill(Color.blue),
                                                 new Stroke(Weight)
                                                 );

            _style.Commit();
        }
Exemple #16
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 3, 3)
            };

            const int w  = (Weight + 1) * 2;
            int       w2 = 18;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0xC0C0C0).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            }
                                              );
            _style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(1f, 1f, 1f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                              );

            _style.OnNormalTextColor = Color.white;
            _style.OnNormalGraphics  = new Rect(w, w,
                                                new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                                new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                                );

            ScrollbarHelper.ApplyButtonStyle(_style, w2, Weight, TriangleDirection.Up);

            _style.FixedWidth  = w2;
            _style.FixedHeight = w2;

            _style.Commit();

            //_style.FixedHeight = 20;
            //_style.FixedWidth = 100;
        }
        private static void Initialize()
        {
            //Debug.Log("ToggleStyle initializer");

            _instance.name = "ButtonBarButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Font      = FontMapper.GetDefault().Font,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(10, 10, 0, 0)
            };

            const int w = (Weight + 1) * 2; // calculating the minimum width to stretch

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 30;
            _style.NormalTextColor = Color.white;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.grey),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );

            _style.HoverTextColor = Color.white;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );

            _style.ActiveTextColor = Color.white;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            _style.FocusedTextColor = Color.white;
            _style.FocusedGraphics  = new Rect(w, w,
                                               new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                               new Stroke(Weight)
            {
                Color = Color.grey
            }
                                               );

            _style.OnNormalTextColor = Color.gray;
            _style.OnNormalGraphics  = new Rect(w, w,
                                                new Fill(new Color(1f, 1f, 1f, 1f)),
                                                new Stroke(Weight)
            {
                Color = Color.grey
            }
                                                );
            _style.OnHoverTextColor = Color.gray;
            _style.OnHoverGraphics  = new Rect(w, w,
                                               new Fill(new Color(1f, 1f, 1f, 1f)),
                                               new Stroke(Weight)
            {
                Color = Color.grey
            }
                                               );
            _style.OnActiveTextColor = Color.gray;
            _style.OnActiveGraphics  = new Rect(w, w,
                                                new Fill(new Color(1f, 1f, 1f, 1f)),
                                                new Stroke(Weight)
            {
                Color = Color.grey
            }
                                                );
            _style.OnFocusedTextColor = Color.gray;
            _style.OnFocusedGraphics  = new Rect(w, w,
                                                 new Fill(new Color(1f, 1f, 1f, 1f)),
                                                 new Stroke(Weight)
            {
                Color = Color.grey
            }
                                                 );

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style         = _instance,
                ImagePosition = ImagePosition.ImageOnly,
                Font          = FontMapper.GetDefault().Font
            };

            const int w = 25; //(Weight + 1)*2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            _style.NormalTextColor = Color.grey;
            _style.NormalGraphics  = new GraphicGroup(w, w,
                                                      new Rect(
                                                          new Fill(Color.white),
                                                          new Stroke(Weight)
            {
                Color = Color.grey
            }
                                                          ),
                                                      new Triangle(new Fill(Color.grey))
            {
                Direction = TriangleDirection.Down,
                Pixels    = 5
            }
                                                      );

            _style.HoverTextColor = Color.white;
            _style.HoverGraphics  = new GraphicGroup(w, w,
                                                     new Rect(
                                                         //new Fill(Color.red),
                                                         new Fill(Color.white), // 20121212
                                                         new Stroke(Weight)
            {
                Color = Color.blue
            }
                                                         ),
                                                     new Triangle(new Fill(Color.blue))
            {
                Direction = TriangleDirection.Down,
                Pixels    = 5
            }
                                                     );
            _style.ActiveTextColor = Color.white;
            _style.ActiveGraphics  = new GraphicGroup(w, w,
                                                      new Rect(
                                                          //new Fill(Color.red),
                                                          new Fill(Color.white), // 20121212
                                                          new Stroke(Weight)
            {
                Color = Color.black
            }
                                                          ),
                                                      new Triangle(new Fill(Color.black))
            {
                Direction = TriangleDirection.Down,
                Pixels    = 5
            }
                                                      );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            _style.FixedWidth  = w;
            _style.FixedHeight = w;

            _style.Commit();
        }
        private static void Initialize()
        {
            //Skin = (GUISkin) ScriptableObject.CreateInstance(typeof (GUISkin));
            //_instance.font = CoreSkinMapper.Instance.System.font;
            //_instance.button.alignment = TextAnchor.MiddleCenter;
            //Skin.font.fontNames = new string[]{"arial"};

            //StyleName = "button";

            //Debug.Log("PopupButtonStyle initializer");

            _instance.name = "PopupButtonStyle";

            _style = new ProgramaticStyle
            {
                Style   = _instance,
                Padding = new RectOffset(10, 10, 4, 4),
                Font    = FontMapper.GetDefault().Font
            };
            //_style.Alignment = TextAnchor.MiddleLeft;

            //_style.Font = CoreSkinMapper.Instance.System.font;

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.95f, 0.95f, 0.95f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            _style.HoverTextColor = Color.blue;
            _style.HoverGraphics  = new Rect(w, w,
                                             //new Fill(Color.green)/*,
                                             new Fill(new Color(0.95f, 0.95f, 0.95f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.95f, 0.95f, 0.95f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            //_style.FixedWidth = 320;
            _style.FixedHeight = 25;

            _style.Commit();
        }