Example #1
0
        ////////////////

        public UITextPanelButton(OldUITheme theme, string label, float scale = 1f, bool large = false) : base(label, scale, large)
        {
            this.Theme     = theme;
            this.IsEnabled = true;

            this.SetPadding(5f);

            var self = this;

            theme.ApplyButton(this);
            this.OnMouseOver += delegate(UIMouseEvent evt, UIElement from_elem) {
                if (!self.IsEnabled)
                {
                    return;
                }
                theme.ApplyButtonLit(self);
            };
            this.OnMouseOut += delegate(UIMouseEvent evt, UIElement from_elem) {
                if (!self.IsEnabled)
                {
                    return;
                }
                theme.ApplyButton(self);
            };

            this.RefreshTheme();
        }