Exemple #1
0
 private bool IsVisible(IOurFormButtonBase buttonBase)
 {
     switch (buttonBase.State)
     {
         case OurFormButtonStates.Disabled:
         case OurFormButtonStates.Shown:
             return true;
         case OurFormButtonStates.Hidden:
             return false;
         default:
             throw new ArgumentOutOfRangeException(nameof(buttonBase.State),
                                                   buttonBase.State,
                                                   "Something F****d Up..");
     }
 }
Exemple #2
0
        private void PaintButton(IOurFormButtonBase buttonBase, Graphics g, ref Pen p, ref SolidBrush sB, Rectangle r)
        {
            if (buttonBase.State == OurFormButtonStates.Hidden) { return; }

            this.PaintButton(
                             buttonBase.State != OurFormButtonStates.Disabled ? buttonBase.Normal : buttonBase.Disabled,
                             g,
                             ref p,
                             ref sB,
                             r);
        }
Exemple #3
0
        private bool ControlBoxContains(IOurFormButtonBase buttonBase, Point p, Rectangle r)
        {
            // Might have an issue with this...
            if (!this.IsVisible(buttonBase)
                || !r.Contains(p)) {
                    return false;
                }

            this._mouseIsOver = buttonBase.ButtonBounds;
            this._mouseAction = buttonBase.State != OurFormButtonStates.Disabled
                                    /* 
                                     * The extra Trenary is required otherwise when the mouse is clicked
                                     * is the _mouseAction would always of been set to MouseAction.Hover
                                     */
                                    ? this._mouseAction == MouseAction.Click ? this._mouseAction : MouseAction.Hover
                                    : MouseAction.None;
            return true;
        }