Implementation for the fixed context button for navigator.
상속: ButtonSpecNavFixed
        /// <summary>
        /// Initialize a new instance of the NavigatorButton class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorButton(KryptonNavigator navigator,
                               NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create collection for use defined and fixed buttons
            _buttonSpecs = new NavigatorButtonSpecCollection(navigator);
            _fixedSpecs  = new NavFixedButtonSpecCollection(navigator);

            // Create the fixed buttons
            _fixedPrevious = new ButtonSpecNavPrevious(_navigator);
            _fixedNext     = new ButtonSpecNavNext(_navigator);
            _fixedContext  = new ButtonSpecNavContext(_navigator);
            _fixedClose    = new ButtonSpecNavClose(_navigator);

            // Hook into the click events for the buttons
            _fixedPrevious.Click += new EventHandler(OnPreviousClick);
            _fixedNext.Click     += new EventHandler(OnNextClick);
            _fixedContext.Click  += new EventHandler(OnContextClick);
            _fixedClose.Click    += new EventHandler(OnCloseClick);

            // Add fixed buttons into the display collection
            _fixedSpecs.AddRange(new ButtonSpecNavFixed[] { _fixedPrevious, _fixedNext, _fixedContext, _fixedClose });

            // Default fields
            _displayLogic     = ButtonDisplayLogic.Context;
            _mapTextContext   = MapKryptonPageText.TextTitle;
            _mapImageContext  = MapKryptonPageImage.Small;
            _actionClosed     = CloseButtonAction.RemovePageAndDispose;
            _actionContext    = ContextButtonAction.SelectPage;
            _actionPrevious   = _actionNext = DirectionButtonAction.ModeAppropriateAction;
            _displayPrevious  = _displayNext = _displayContext = _displayClosed = ButtonDisplay.Logic;
            _shortcutClose    = DEFAULT_SHORTCUT_CLOSE;
            _shortcutContext  = DEFAULT_SHORTCUT_CONTEXT;
            _shortcutNext     = DEFAULT_SHORTCUT_NEXT;
            _shortcutPrevious = DEFAULT_SHORTCUT_PREVIOUS;
        }
예제 #2
0
        /// <summary>
        /// Initialize a new instance of the NavigatorButton class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorButton(KryptonNavigator navigator,
                               NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create collection for use defined and fixed buttons
            _buttonSpecs = new NavigatorButtonSpecCollection(navigator);
            _fixedSpecs = new NavFixedButtonSpecCollection(navigator);

            // Create the fixed buttons
            _fixedPrevious = new ButtonSpecNavPrevious(_navigator);
            _fixedNext = new ButtonSpecNavNext(_navigator);
            _fixedContext = new ButtonSpecNavContext(_navigator);
            _fixedClose = new ButtonSpecNavClose(_navigator);

            // Hook into the click events for the buttons
            _fixedPrevious.Click += new EventHandler(OnPreviousClick);
            _fixedNext.Click += new EventHandler(OnNextClick);
            _fixedContext.Click += new EventHandler(OnContextClick);
            _fixedClose.Click += new EventHandler(OnCloseClick);

            // Add fixed buttons into the display collection
            _fixedSpecs.AddRange(new ButtonSpecNavFixed[] { _fixedPrevious, _fixedNext, _fixedContext, _fixedClose });

            // Default fields
            _displayLogic = ButtonDisplayLogic.Context;
            _mapTextContext = MapKryptonPageText.TextTitle;
            _mapImageContext = MapKryptonPageImage.Small;
            _actionClosed = CloseButtonAction.RemovePageAndDispose;
            _actionContext = ContextButtonAction.SelectPage;
            _actionPrevious = _actionNext = DirectionButtonAction.ModeAppropriateAction;
            _displayPrevious = _displayNext = _displayContext = _displayClosed = ButtonDisplay.Logic;
            _shortcutClose = _defaultShortcutClose;
            _shortcutContext = _defaultShortcutContext;
            _shortcutNext = _defaultShortcutNext;
            _shortcutPrevious = _defaultShortcutPrevious;
        }