Generate click events whilst mouse pressed.
Inheritance: ComponentFactory.Krypton.Toolkit.GlobalId, IMouseController
Ejemplo n.º 1
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutRibbonScroller class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="orientation">Scroller orientation.</param>
        /// <param name="insetForTabs">Should scoller be inset for use in tabs area.</param>
        /// <param name="needPaintDelegate">Delegate for notifying paint/layout requests.</param>
        public ViewLayoutRibbonScroller(KryptonRibbon ribbon,
                                        VisualOrientation orientation,
                                        bool insetForTabs,
                                        NeedPaintHandler needPaintDelegate)
        {
            // Cache provided values
            _orientation = orientation;
            _insetForTabs = insetForTabs;

            // Create the button and the separator
            _button = new ViewDrawRibbonScrollButton(ribbon, orientation);
            _separator = new ViewLayoutRibbonSeparator(GAP_LENGTH, true);

            // Create button controller for clicking the button
            RepeatButtonController rbc = new RepeatButtonController(ribbon, _button, needPaintDelegate);
            rbc.Click += new MouseEventHandler(OnButtonClick);
            _button.MouseController = rbc;

            // Add as child elements
            Add(_button);
            Add(_separator);
        }
        /// <summary>
        /// Initialize a new instance of the ViewLayoutRibbonScroller class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="orientation">Scroller orientation.</param>
        /// <param name="insetForTabs">Should scoller be inset for use in tabs area.</param>
        /// <param name="needPaintDelegate">Delegate for notifying paint/layout requests.</param>
        public ViewLayoutRibbonScroller(KryptonRibbon ribbon,
                                        VisualOrientation orientation,
                                        bool insetForTabs,
                                        NeedPaintHandler needPaintDelegate)
        {
            // Cache provided values
            _orientation  = orientation;
            _insetForTabs = insetForTabs;

            // Create the button and the separator
            _button    = new ViewDrawRibbonScrollButton(ribbon, orientation);
            _separator = new ViewLayoutRibbonSeparator(GAP_LENGTH, true);

            // Create button controller for clicking the button
            RepeatButtonController rbc = new RepeatButtonController(ribbon, _button, needPaintDelegate);

            rbc.Click += OnButtonClick;
            _button.MouseController = rbc;

            // Add as child elements
            Add(_button);
            Add(_separator);
        }