コード例 #1
0
        /// <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      += new MouseEventHandler(OnButtonUp);
            _buttonDown.Click    += new MouseEventHandler(OnButtonDown);
            _buttonContext.Click += new MouseEventHandler(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();
            _scrollTimer.Interval = 40;
            _scrollTimer.Tick    += new EventHandler(OnScrollTick);
        }
コード例 #2
0
        /// <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();
            _gallery.AlwaysActive = false;
            _gallery.TabStop      = false;
            _gallery.InternalPreferredItemSize = new Size(_largeItemCount, 1);

            // Hook into events to expose via this container
            _gallery.SelectedIndexChanged += new EventHandler(OnGallerySelectedIndexChanged);
            _gallery.ImageListChanged     += new EventHandler(OnGalleryImageListChanged);
            _gallery.TrackingImage        += new EventHandler <ImageSelectEventArgs>(OnGalleryTrackingImage);
            _gallery.GalleryDropMenu      += new EventHandler <GalleryDropMenuEventArgs>(OnGalleryGalleryDropMenu);
            _gallery.GotFocus             += new EventHandler(OnGalleryGotFocus);
            _gallery.LostFocus            += new EventHandler(OnGalleryLostFocus);

            // Ensure we can track mouse events on the gallery
            MonitorControl(_gallery);
        }
コード例 #3
0
 /// <summary>
 /// Perform licence checking actions.
 /// </summary>
 /// <param name="gallery">Gallery control reference.</param>
 internal static void PerformLicenceChecking(KryptonGallery gallery)
 {
 }
コード例 #4
0
 private void UnmonitorControl(KryptonGallery c)
 {
     c.MouseEnter -= new EventHandler(OnControlEnter);
     c.MouseLeave -= new EventHandler(OnControlLeave);
 }