Process mouse events for a gallery button.
Inheritance: ComponentFactory.Krypton.Toolkit.GlobalId, IMouseController
Example #1
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;
 }