/// <summary>
        /// Initialize a new instance of the KryptonPaletteImagesGalleryButton class.
        /// </summary>
        /// <param name="button">Which button this instance represents.</param>
        /// <param name="redirect">Redirector to inherit values from.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public KryptonPaletteImagesGalleryButton(PaletteRibbonGalleryButton button,
                                                 PaletteRedirect redirect,
                                                 NeedPaintHandler needPaint)
        {
            _button = button;
            _redirect = redirect;
            NeedPaint = needPaint;

            // Create the storage
            _common = null;
            _disabled = null;
            _normal = null;
            _tracking = null;
            _pressed = null;
        }
Exemple #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteImagesGalleryButton class.
        /// </summary>
        /// <param name="button">Which button this instance represents.</param>
        /// <param name="redirect">Redirector to inherit values from.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public KryptonPaletteImagesGalleryButton(PaletteRibbonGalleryButton button,
                                                 PaletteRedirect redirect,
                                                 NeedPaintHandler needPaint)
        {
            _button   = button;
            _redirect = redirect;
            NeedPaint = needPaint;

            // Create the storage
            _common   = null;
            _disabled = null;
            _normal   = null;
            _tracking = null;
            _pressed  = null;
        }
Exemple #3
0
 /// <summary>
 /// Initialize a new instance of the ViewDrawRibbonGalleryButton class.
 /// </summary>
 /// <param name="palette">Reference to inherited palette.</param>
 /// <param name="alignment">Button alignment within gallery.</param>
 /// <param name="button">Button content to display.</param>
 /// <param name="images">Button images.</param>
 /// <param name="needPaint">Paint event delegate.</param>
 public ViewDrawRibbonGalleryButton(IPalette palette,
                                    PaletteRelativeAlign alignment,
                                    PaletteRibbonGalleryButton button,
                                    GalleryImages images,
                                    NeedPaintHandler needPaint)
 {
     _palette           = palette;
     _alignment         = alignment;
     _button            = button;
     _images            = images;
     _needPaint         = needPaint;
     _paletteBack       = new PaletteBackToPalette(palette, PaletteBackStyle.ButtonGallery);
     _paletteBorder     = new PaletteBorderToPalette(palette, PaletteBorderStyle.ButtonGallery);
     _paletteContent    = new PaletteContentToPalette(palette, PaletteContentStyle.ButtonGallery);
     _controller        = new GalleryButtonController(this, needPaint, (alignment != PaletteRelativeAlign.Far));
     _controller.Click += OnButtonClick;
     MouseController    = _controller;
 }
 /// <summary>
 /// Initialize a new instance of the ViewDrawRibbonGalleryButton class.
 /// </summary>
 /// <param name="palette">Reference to inherited palette.</param>
 /// <param name="alignment">Button alignment within gallery.</param>
 /// <param name="button">Button content to display.</param>
 /// <param name="images">Button images.</param>
 /// <param name="needPaint">Paint event delegate.</param>
 public ViewDrawRibbonGalleryButton(IPalette palette,
                                    PaletteRelativeAlign alignment,
                                    PaletteRibbonGalleryButton button,
                                    GalleryImages images,
                                    NeedPaintHandler needPaint)
 {
     _palette = palette;
     _alignment = alignment;
     _button = button;
     _images = images;
     _needPaint = needPaint;
     _paletteBack = new PaletteBackToPalette(palette, PaletteBackStyle.ButtonGallery);
     _paletteBorder = new PaletteBorderToPalette(palette, PaletteBorderStyle.ButtonGallery);
     _paletteContent = new PaletteContentToPalette(palette, PaletteContentStyle.ButtonGallery);
     _controller = new GalleryButtonController(this, needPaint, (alignment != PaletteRelativeAlign.Far));
     _controller.Click += new MouseEventHandler(OnButtonClick);
     MouseController = _controller;
 }
 /// <summary>
 /// Gets a check box image appropriate for the provided state.
 /// </summary>
 /// <param name="button">Enum of the button to fetch.</param>
 /// <param name="state">State of the button to fetch.</param>
 /// <returns>Appropriate image for drawing; otherwise null.</returns>
 public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
 {
     switch(button)
     {
         default:
         case PaletteRibbonGalleryButton.Down:
             return _galleryButtonList.Images[0];
         case PaletteRibbonGalleryButton.Up:
             return _galleryButtonList.Images[1];
         case PaletteRibbonGalleryButton.DropDown:
             return _galleryButtonList.Images[2];
     }
 }
 /// <summary>
 /// Gets a check box image appropriate for the provided state.
 /// </summary>
 /// <param name="button">Enum of the button to fetch.</param>
 /// <param name="state">State of the button to fetch.</param>
 /// <returns>Appropriate image for drawing; otherwise null.</returns>
 public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
 {
     switch(button)
     {
         default:
         case PaletteRibbonGalleryButton.Down:
             if (state == PaletteState.Disabled)
                 return _disabledDropDown;
             else
                 return _sparkleDropDownButton;
         case PaletteRibbonGalleryButton.Up:
             if (state == PaletteState.Disabled)
                 return _disabledDropUp;
             else
                 return _sparkleDropUpButton;
         case PaletteRibbonGalleryButton.DropDown:
             if (state == PaletteState.Disabled)
                 return _disabledGalleryDrop;
             else
                 return _sparkleGalleryDropButton;
     }
 }
Exemple #7
0
 public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
 {
     return(GetScaledImage(base.GetGalleryButtonImage(button, state)));
 }
 /// <summary>
 /// Gets a check box image appropriate for the provided state.
 /// </summary>
 /// <param name="button">Enum of the button to fetch.</param>
 /// <param name="state">State of the button to fetch.</param>
 /// <returns>Appropriate image for drawing; otherwise null.</returns>
 public virtual Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
 {
     return _target.GetGalleryButtonImage(button, state);
 }
 /// <summary>
 /// Gets a check box image appropriate for the provided state.
 /// </summary>
 /// <param name="button">Enum of the button to fetch.</param>
 /// <param name="state">State of the button to fetch.</param>
 /// <returns>Appropriate image for drawing; otherwise null.</returns>
 public abstract Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state);
 /// <summary>
 /// Gets a check box image appropriate for the provided state.
 /// </summary>
 /// <param name="button">Enum of the button to fetch.</param>
 /// <param name="state">State of the button to fetch.</param>
 /// <returns>Appropriate image for drawing; otherwise null.</returns>
 public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
 {
     switch (button)
     {
         default:
         case PaletteRibbonGalleryButton.Up:
                 if (_galleryImageUp == null)
                     _galleryImageUp = CreateGalleryUpImage(SystemColors.ControlText);
                 return _galleryImageUp;
         case PaletteRibbonGalleryButton.Down:
             if (_galleryImageDown == null)
                 _galleryImageDown = CreateGalleryDownImage(SystemColors.ControlText);
             return _galleryImageDown;
         case PaletteRibbonGalleryButton.DropDown:
             if (_galleryImageDropDown == null)
                 _galleryImageDropDown = CreateGalleryDropDownImage(SystemColors.ControlText);
             return _galleryImageDropDown;
     }
 }