/// <summary> /// Initialize a new instance of the ViewLayoutRibbonGalleryItems class. /// </summary> /// <param name="palette">Reference to palette for display values.</param> /// <param name="gallery">Reference to owning gallery.</param> /// <param name="needPaint">Delegate for requesting paints.</param> /// <param name="buttonUp">Reference to the up button.</param> /// <param name="buttonDown">Reference to the down button.</param> /// <param name="buttonContext">Reference to the context button.</param> public ViewLayoutRibbonGalleryItems(IPalette palette, KryptonGallery gallery, NeedPaintHandler needPaint, ViewDrawRibbonGalleryButton buttonUp, ViewDrawRibbonGalleryButton buttonDown, ViewDrawRibbonGalleryButton buttonContext) { Debug.Assert(palette != null); Debug.Assert(gallery != null); Debug.Assert(needPaint != null); Debug.Assert(buttonUp != null); Debug.Assert(buttonDown != null); Debug.Assert(buttonContext != null); _gallery = gallery; _needPaint = needPaint; _buttonUp = buttonUp; _buttonDown = buttonDown; _buttonContext = buttonContext; _bringIntoView = -1; ScrollIntoView = true; // Need to know when any button is clicked _buttonUp.Click += OnButtonUp; _buttonDown.Click += OnButtonDown; _buttonContext.Click += OnButtonContext; // Create triple that can be used by the draw button _style = ButtonStyle.LowProfile; _triple = new PaletteTripleToPalette(palette, PaletteBackStyle.ButtonLowProfile, PaletteBorderStyle.ButtonLowProfile, PaletteContentStyle.ButtonLowProfile); // Setup timer to use for scrolling lines _scrollTimer = new Timer { Interval = 40 }; _scrollTimer.Tick += OnScrollTick; }
/// <summary> /// Initialise a new instance of the KryptonRibbonGroupGallery class. /// </summary> public KryptonRibbonGroupGallery() { // Default fields _visible = true; _enabled = true; _keyTip = "X"; _itemSizeMax = GroupItemSize.Large; _itemSizeMin = GroupItemSize.Small; _itemSizeCurrent = GroupItemSize.Large; _largeItemCount = 9; _mediumItemCount = 3; _dropButtonItemWidth = 9; _imageLarge = _defaultButtonImageLarge; _textLine1 = "Gallery"; _textLine2 = string.Empty; ToolTipImageTransparentColor = Color.Empty; ToolTipTitle = string.Empty; ToolTipBody = string.Empty; ToolTipStyle = LabelStyle.SuperTip; // Create the actual text box control and set initial settings Gallery = new KryptonGallery { AlwaysActive = false, TabStop = false, InternalPreferredItemSize = new Size(_largeItemCount, 1) }; // Hook into events to expose via this container Gallery.SelectedIndexChanged += OnGallerySelectedIndexChanged; Gallery.ImageListChanged += OnGalleryImageListChanged; Gallery.TrackingImage += OnGalleryTrackingImage; Gallery.GalleryDropMenu += OnGalleryGalleryDropMenu; Gallery.GotFocus += OnGalleryGotFocus; Gallery.LostFocus += OnGalleryLostFocus; // Ensure we can track mouse events on the gallery MonitorControl(Gallery); }
/// <summary> /// Perform licence checking actions. /// </summary> /// <param name="gallery">Gallery control reference.</param> internal static void PerformLicenceChecking(KryptonGallery gallery) { }