/// <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 PreviousButton = new ButtonSpecNavPrevious(_navigator); NextButton = new ButtonSpecNavNext(_navigator); ContextButton = new ButtonSpecNavContext(_navigator); CloseButton = new ButtonSpecNavClose(_navigator); // Hook into the click events for the buttons PreviousButton.Click += OnPreviousClick; NextButton.Click += OnNextClick; ContextButton.Click += OnContextClick; CloseButton.Click += OnCloseClick; // Add fixed buttons into the display collection FixedSpecs.AddRange(new ButtonSpecNavFixed[] { PreviousButton, NextButton, ContextButton, CloseButton }); // Default fields _displayLogic = ButtonDisplayLogic.Context; ContextMenuMapText = MapKryptonPageText.TextTitle; ContextMenuMapImage = MapKryptonPageImage.Small; _actionClosed = CloseButtonAction.RemovePageAndDispose; _actionContext = ContextButtonAction.SelectPage; _actionPrevious = _actionNext = DirectionButtonAction.ModeAppropriateAction; _displayPrevious = _displayNext = _displayContext = _displayClosed = ButtonDisplay.Logic; CloseButtonShortcut = DEFAULT_SHORTCUT_CLOSE; ContextButtonShortcut = DEFAULT_SHORTCUT_CONTEXT; NextButtonShortcut = DEFAULT_SHORTCUT_NEXT; PreviousButtonShortcut = DEFAULT_SHORTCUT_PREVIOUS; }
/// <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; }