Beispiel #1
0
        public UIButton(UIComponent parent, UIConfirmType confirmType, string title) : base(parent)
        {
            // Type Theme
            UITheme       theme  = UIHandler.theme;
            UIThemeButton bTheme = theme.button;

            if (confirmType == UIConfirmType.Normal)
            {
                this.bg    = bTheme.NormalBG;
                this.hover = bTheme.NormalHover;
            }

            else if (confirmType == UIConfirmType.Approve)
            {
                this.bg    = bTheme.AcceptBG;
                this.hover = bTheme.AcceptHover;
            }

            else if (confirmType == UIConfirmType.Reject)
            {
                this.bg    = bTheme.RejectBG;
                this.hover = bTheme.RejectHover;
            }

            // Essentials
            this.confirmType = confirmType;
            this.title       = title;
            this.titleWidth  = (short)UIHandler.theme.bigFont.font.MeasureString(title).X;

            // Size Setup
            this.SetHeight(bTheme.Height);
            this.SetWidth(bTheme.Width);
        }
Beispiel #2
0
        public void OnSubmit(UIConfirmType confirmType)
        {
            // Prepare Event Type
            EventType evType = EventType.Confirm_Ok;

            if (confirmType == UIConfirmType.Approve)
            {
                evType = EventType.Confirm_Yes;
            }
            else if (confirmType == UIConfirmType.Reject)
            {
                evType = EventType.Confirm_No;
            }

            // Run the Action assigned to this Confirmation Box.
            EventSys.TriggerEvent(EventCategory.Confirm, evType, this.eventTag, new EventComponentData(this));
        }