/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupColorButton class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonColorButton">Reference to source color button definition.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupColorButton(KryptonRibbon ribbon, KryptonRibbonGroupColorButton ribbonColorButton, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(ribbonColorButton != null); Debug.Assert(needPaint != null); // Remember incoming references _ribbon = ribbon; _ribbonColorButton = ribbonColorButton; _needPaint = needPaint; _currentSize = _ribbonColorButton.ItemSizeCurrent; // Associate this view with the source component (required for design time selection) Component = _ribbonColorButton; // Create the different views for different sizes of the button CreateLargeButtonView(); CreateMediumSmallButtonView(); // Update all views to reflect current button state UpdateEnabledState(); UpdateCheckedState(); UpdateDropDownState(); UpdateItemSizeState(); // Hook into changes in the ribbon button definition _ribbonColorButton.PropertyChanged += new PropertyChangedEventHandler(OnButtonPropertyChanged); }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupClusterButtonImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonButton">Reference to ribbon group button definition.</param> public ViewDrawRibbonGroupClusterButtonImage(KryptonRibbon ribbon, KryptonRibbonGroupClusterButton ribbonButton) : base(ribbon) { Debug.Assert(ribbonButton != null); _ribbonButton = ribbonButton; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupCheckBox class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonCheckBox">Reference to source check box definition.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupCheckBox(KryptonRibbon ribbon, KryptonRibbonGroupCheckBox ribbonCheckBox, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(ribbonCheckBox != null); Debug.Assert(needPaint != null); // Remember incoming references _ribbon = ribbon; _ribbonCheckBox = ribbonCheckBox; _needPaint = needPaint; _currentSize = _ribbonCheckBox.ItemSizeCurrent; // Create delegate used to process end of click action _finishDelegateLarge = new EventHandler(ActionFinishedLarge); _finishDelegateMediumSmall = new EventHandler(ActionFinishedMediumSmall); // Associate this view with the source component (required for design time selection) Component = _ribbonCheckBox; // Create the different views for different sizes of the check box CreateLargeCheckBoxView(); CreateMediumSmallCheckBoxView(); // Update all views to reflect current check box state UpdateEnabledState(); UpdateCheckState(); UpdateItemSizeState(); // Hook into changes in the ribbon check box definition _ribbonCheckBox.PropertyChanged += new PropertyChangedEventHandler(OnCheckBoxPropertyChanged); }
/// <summary> /// Initialize a new instance of the ViewLayoutRibbonQATMini class. /// </summary> /// <param name="ribbon">Owning control instance.</param> /// <param name="needPaintDelegate">Delegate for notifying paint/layout changes.</param> public ViewLayoutRibbonQATMini(KryptonRibbon ribbon, NeedPaintHandler needPaintDelegate) { Debug.Assert(ribbon != null); _ribbon = ribbon; // Create the minibar border suitable for a caption area _border = new ViewDrawRibbonQATBorder(ribbon, needPaintDelegate, true); // Create minibar content that synchs with ribbon collection _borderContents = new ViewLayoutRibbonQATFromRibbon(ribbon, needPaintDelegate, false); _border.Add(_borderContents); // Separator gap before the extra button _extraSeparator = new ViewLayoutSeparator(SEP_GAP); // Need the extra button to show after the border area _extraButton = new ViewDrawRibbonQATExtraButtonMini(ribbon, needPaintDelegate); _extraButton.ClickAndFinish += new ClickAndFinishHandler(OnExtraButtonClick); // Add layout contents Add(_border, ViewDockStyle.Fill); Add(_extraSeparator, ViewDockStyle.Right); Add(_extraButton, ViewDockStyle.Right); }
/// <summary> /// Initialize a new instance of the VisualPopupGroup class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonGroup">Reference to ribbon group for display.</param> /// <param name="renderer">Drawing renderer.</param> public VisualPopupGroup(KryptonRibbon ribbon, KryptonRibbonGroup ribbonGroup, IRenderer renderer) : base(renderer, true) { Debug.Assert(ribbon != null); Debug.Assert(ribbonGroup != null); // Remember references needed later _ribbon = ribbon; _ribbonGroup = ribbonGroup; // Create a view element for drawing the group _viewGroup = new ViewDrawRibbonGroup(ribbon, ribbonGroup, NeedPaintDelegate); _viewGroup.Collapsed = false; // Create the background that will contain the actual group instance _viewBackground = new ViewDrawRibbonGroupsBorder(ribbon, true, NeedPaintDelegate); _viewBackground.Add(_viewGroup); // Attach the root to the view manager instance ViewManager = new ViewRibbonPopupGroupManager(this, ribbon, _viewBackground, _viewGroup, NeedPaintDelegate); // Create and add a hidden button to act as the focus target _hiddenFocusTarget = new Button(); _hiddenFocusTarget.TabStop = false; _hiddenFocusTarget.Location = new Point(-_hiddenFocusTarget.Width, -_hiddenFocusTarget.Height); CommonHelper.AddControlToParent(this, _hiddenFocusTarget); }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupSeparator class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonSeparator">Reference to group separator definition.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupSeparator(KryptonRibbon ribbon, KryptonRibbonGroupSeparator ribbonSeparator, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(ribbonSeparator != null); Debug.Assert(needPaint != null); _ribbon = ribbon; _ribbonSeparator = ribbonSeparator; _needPaint = needPaint; // Associate this view with the source component (required for design time selection) Component = _ribbonSeparator; if (_ribbon.InDesignMode) { // At design time we need to know when the user right clicks the label ContextClickController controller = new ContextClickController(); controller.ContextClick += new MouseEventHandler(OnContextClick); MouseController = controller; } // Define back reference to view for the separator definition _ribbonSeparator.SeparatorView = this; // Hook into changes in the ribbon separator definition _ribbonSeparator.PropertyChanged += new PropertyChangedEventHandler(OnSeparatorPropertyChanged); // Default the preferred size _lastShape = PaletteRibbonShape.Office2007; _preferredSize = _preferredSize2007; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupLabel class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonLabel">Reference to source label definition.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupLabel(KryptonRibbon ribbon, KryptonRibbonGroupLabel ribbonLabel, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(ribbonLabel != null); Debug.Assert(needPaint != null); // Remember incoming references _ribbon = ribbon; _ribbonLabel = ribbonLabel; _needPaint = needPaint; // Associate this view with the source component (required for design time selection) Component = _ribbonLabel; // Give paint delegate to label so its palette changes are redrawn _ribbonLabel.ViewPaintDelegate = needPaint; // Create the different views for different sizes of the label CreateLargeLabelView(); CreateMediumSmallLabelView(); // Update all views to reflect current label state UpdateEnabledState(); UpdateImageSmallState(); UpdateItemSizeState(); // Hook into changes in the ribbon button definition _ribbonLabel.PropertyChanged += new PropertyChangedEventHandler(OnLabelPropertyChanged); }
/// <summary> /// Initialize a new instance of the CalculatedValues class. /// </summary> /// <param name="ribbon">Source control instance.</param> public CalculatedValues(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; _lastShape = PaletteRibbonShape.Inherit; }
/// <summary> /// Initialize a new instance of the ButtonSpecMinimizeRibbon class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> public ButtonSpecMinimizeRibbon(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; // Fix the type ProtectedType = PaletteButtonSpecStyle.RibbonMinimize; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDesignCluster class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonCluster">Reference to cluster definition.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonDesignCluster(KryptonRibbon ribbon, KryptonRibbonGroupCluster ribbonCluster, NeedPaintHandler needPaint) : base(ribbon, needPaint) { Debug.Assert(ribbonCluster != null); _ribbonCluster = ribbonCluster; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupGalleryImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonGallery">Reference to ribbon group gallery definition.</param> public ViewDrawRibbonGroupGalleryImage(KryptonRibbon ribbon, KryptonRibbonGroupGallery ribbonGallery) : base(ribbon) { Debug.Assert(ribbonGallery != null); _ribbonGallery = ribbonGallery; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDesignGroup class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonGroup">Associated ribbon group.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonDesignGroupContainer(KryptonRibbon ribbon, KryptonRibbonGroup ribbonGroup, NeedPaintHandler needPaint) : base(ribbon, needPaint) { Debug.Assert(ribbonGroup != null); _ribbonGroup = ribbonGroup; }
/// <summary> /// Initialize a new instance of the AppButtonController class. /// </summary> public AppButtonController(KryptonRibbon ribbon) { _ribbon = ribbon; _updateTimer = new Timer(); _updateTimer.Interval = 1; _updateTimer.Tick += new EventHandler(OnUpdateTimer); _keyboard = false; }
/// <summary> /// Initialize a new instance of the KryptonRibbonActionList class. /// </summary> /// <param name="owner">Designer that owns this action list instance.</param> public KryptonRibbonActionList(KryptonRibbonDesigner owner) : base(owner.Component) { // Remember the ribbon instance _ribbon = (KryptonRibbon)owner.Component; // Cache service used to notify when a property has changed _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonRecentDocs class. /// </summary> /// <param name="ribbon">Source ribbon control.</param> public ViewDrawRibbonRecentDocs(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; // Use a class to convert from ribbon recent docs to content interface _contentProvider = new RibbonRecentDocsTitleToContent(ribbon.StateCommon.RibbonGeneral, ribbon.StateCommon.RibbonAppMenuDocsTitle); }
/// <summary> /// Initialize a new instance of the PaletteRibbonStyles class. /// </summary> /// <param name="ribbon">Source ribbon control instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteRibbonStyles(KryptonRibbon ribbon, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); _ribbon = ribbon; // Store the provided paint notification delegate NeedPaint = needPaint; }
/// <summary> /// Initialize a new instance of the ViewDrawRibViewDrawRibbonGroupClusterColorButtonImagebonGroupClusterButtonImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonColorButton">Reference to ribbon group color button definition.</param> public ViewDrawRibbonGroupClusterColorButtonImage(KryptonRibbon ribbon, KryptonRibbonGroupClusterColorButton ribbonColorButton) : base(ribbon) { Debug.Assert(ribbonColorButton != null); _ribbonColorButton = ribbonColorButton; _selectedColor = ribbonColorButton.SelectedColor; _emptyBorderColor = ribbonColorButton.EmptyBorderColor; _selectedRect = ribbonColorButton.SelectedRect; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupLabelImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonLabel">Reference to ribbon group label definition.</param> /// <param name="large">Show the large image.</param> public ViewDrawRibbonGroupLabelImage(KryptonRibbon ribbon, KryptonRibbonGroupLabel ribbonLabel, bool large) : base(ribbon) { Debug.Assert(ribbonLabel != null); _ribbonLabel = ribbonLabel; _large = large; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupButtonImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonButton">Reference to ribbon group button definition.</param> /// <param name="large">Show the large image.</param> public ViewDrawRibbonGroupButtonImage(KryptonRibbon ribbon, KryptonRibbonGroupButton ribbonButton, bool large) : base(ribbon) { Debug.Assert(ribbonButton != null); _ribbonButton = ribbonButton; _large = large; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonAppButton class. /// </summary> /// <param name="ribbon">Owning control instance.</param> /// <param name="bottomHalf">Scroller orientation.</param> public ViewDrawRibbonAppButton(KryptonRibbon ribbon, bool bottomHalf) { Debug.Assert(ribbon != null); _ribbon = ribbon; _bottomHalf = bottomHalf; _size = (_bottomHalf ? SIZE_BOTTOM : SIZE_TOP); _mementos = new IDisposable[3]; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupClusterEdge class. /// </summary> /// <param name="ribbon">Reference to owning ribbon..</param> /// <param name="palette">Palette source for drawing details.</param> public ViewDrawRibbonGroupClusterEdge(KryptonRibbon ribbon, PaletteBorderEdge palette) : base(palette, Orientation.Vertical) { Debug.Assert(ribbon != null); Debug.Assert(palette != null); _ribbon = ribbon; _palette = palette; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonQATOverflow class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="needPaintDelegate">Delegate for notifying paint/layout changes.</param> public ViewDrawRibbonQATOverflow(KryptonRibbon ribbon, NeedPaintHandler needPaintDelegate) { Debug.Assert(ribbon != null); Debug.Assert(needPaintDelegate != null); // Remember incoming references _ribbon = ribbon; _needPaintDelegate = needPaintDelegate; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDesignGroupLines class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonLines">Associated ribbon group lines.</param> /// <param name="currentSize">Size the view should use.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonDesignGroupLines(KryptonRibbon ribbon, KryptonRibbonGroupLines ribbonLines, GroupItemSize currentSize, NeedPaintHandler needPaint) : base(ribbon, needPaint) { Debug.Assert(ribbonLines != null); _ribbonLines = ribbonLines; _currentSize = currentSize; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDesignGroupTriple class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonTriple">Associated ribbon group triple.</param> /// <param name="currentSize">Size the view should use.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonDesignGroupTriple(KryptonRibbon ribbon, KryptonRibbonGroupTriple ribbonTriple, GroupItemSize currentSize, NeedPaintHandler needPaint) : base(ribbon, needPaint) { Debug.Assert(ribbonTriple != null); _ribbonTriple = ribbonTriple; _currentSize = currentSize; }
/// <summary> /// Initialize a new instance of the ViewLayoutRibbonAppTab class. /// </summary> /// <param name="ribbon">Owning control instance.</param> public ViewLayoutRibbonAppTab(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; _appTab = new ViewDrawRibbonAppTab(ribbon); // Dock it against the appropriate edge Add(_appTab, ViewDockStyle.Bottom); Add(new ViewLayoutSeparator(1), ViewDockStyle.Left); }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupClusterButtonImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonButton">Reference to ribbon group button definition.</param> public ViewDrawRibbonGroupClusterButtonImage(KryptonRibbon ribbon, KryptonRibbonGroupClusterButton ribbonButton) : base(ribbon) { Debug.Assert(ribbonButton != null); //Seb dpi aware _smallSize = new Size((int)(16 * FactorDpiX), (int)(16 * FactorDpiY)); _ribbonButton = ribbonButton; }
/// <summary> /// Initialize a new instance of the ViewLayoutRibbonGroupButton class. /// </summary> /// <param name="ribbon">Owning control instance.</param> /// <param name="ribbonGroup">Reference to ribbon group this represents.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewLayoutRibbonGroupButton(KryptonRibbon ribbon, KryptonRibbonGroup ribbonGroup, NeedPaintHandler needPaint) { _groupButton = new ViewDrawRibbonGroupDialogButton(ribbon, ribbonGroup, needPaint); _centerButton = new ViewLayoutRibbonCenter(); // Fill remainder with the actual button, but centered within space _centerButton.Add(_groupButton); Add(_centerButton, ViewDockStyle.Fill); }
/// <summary> /// Initialize a new instance of the DomainUpDownController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> /// <param name="domainUpDown">Source definition.</param> /// <param name="target">Target view element.</param> public DomainUpDownController(KryptonRibbon ribbon, KryptonRibbonGroupDomainUpDown domainUpDown, ViewDrawRibbonGroupDomainUpDown target) { Debug.Assert(ribbon != null); Debug.Assert(domainUpDown != null); Debug.Assert(target != null); _ribbon = ribbon; _domainUpDown = domainUpDown; _target = target; }
/// <summary> /// Initialize a new instance of the MaskedTextBoxController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> /// <param name="maskedTextBox">Source definition.</param> /// <param name="target">Target view element.</param> public MaskedTextBoxController(KryptonRibbon ribbon, KryptonRibbonGroupMaskedTextBox maskedTextBox, ViewDrawRibbonGroupMaskedTextBox target) { Debug.Assert(ribbon != null); Debug.Assert(maskedTextBox != null); Debug.Assert(target != null); _ribbon = ribbon; _maskedTextBox = maskedTextBox; _target = target; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupImage class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonGroup">Reference to ribbon group definition.</param> /// <param name="viewGroup">Reference to top level group element.</param> public ViewDrawRibbonGroupImage(KryptonRibbon ribbon, KryptonRibbonGroup ribbonGroup, ViewDrawRibbonGroup viewGroup) { Debug.Assert(ribbon != null); Debug.Assert(ribbonGroup != null); Debug.Assert(viewGroup != null); _ribbon = ribbon; _ribbonGroup = ribbonGroup; _viewGroup = viewGroup; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonQATExtraButtonMini class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonQATExtraButtonMini(KryptonRibbon ribbon, NeedPaintHandler needPaint) : base(ribbon, needPaint) { }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDropArrow class. /// </summary> /// <param name="ribbon">Reference to owning control instance.</param> public ViewDrawRibbonDropArrow(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
public override ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint) { return(new ViewDrawRibbonGroupRadioButton(ribbon, this, needPaint)); }
public override ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint) { return(new ViewLayoutRibbonGroupLines(ribbon, this, needPaint)); }
/// <summary> /// Key has been pressed down. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="e">A KeyEventArgs that contains the event data.</param> public void KeyDown(Control c, KeyEventArgs e) { ViewBase newView = null; KryptonRibbon ribbon = (KryptonRibbon)c; switch (e.KeyData) { case Keys.Tab: case Keys.Right: // Ask the ribbon to get use the first view for the qat newView = ribbon.GetFirstQATView(); // Get the first near edge button (the last near button is the leftmost one!) if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near); } if (newView == null) { if ((e.KeyData == Keys.Tab) && (ribbon.SelectedTab != null)) { // Get the currently selected tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab); } else { // Get the first visible tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForFirstRibbonTab(); } } // Move across to any far defined buttons if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far); } // Move across to any inherit defined buttons if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit); } break; case Keys.Tab | Keys.Shift: case Keys.Left: // Move across to any far defined buttons newView = ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Far); // Move across to any inherit defined buttons if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Inherit); } if (newView == null) { if (e.KeyData != Keys.Left) { // Get the last control on the selected tab newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem(); // Get the currently selected tab page if (newView == null) { if (ribbon.SelectedTab != null) { newView = ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab); } else { newView = ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab(); } } } else { // Get the last visible tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab(); } } // Get the last near edge button (the first near button is the rightmost one!) if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near); } // Get the last qat button if (newView == null) { newView = ribbon.GetLastQATView(); } break; case Keys.Space: case Keys.Enter: case Keys.Down: // Show the button as pressed, until told otherwise _fixedPressed = true; // Mouse is being pressed UpdateTargetState(); // Generate a click event _keyboard = true; OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); break; } // If we have a new view to focus and it is not ourself... if ((newView != null) && (newView != _target1) && (newView != _target2 && (newView != _target3))) { // If the new view is a tab then select that tab unless in minimized mode if ((newView is ViewDrawRibbonTab) && !ribbon.RealMinimizedMode) { ribbon.SelectedTab = ((ViewDrawRibbonTab)newView).RibbonTab; } // Finally we switch focus to new view ribbon.FocusView = newView; } }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupImageBase class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> public ViewDrawRibbonGroupImageBase(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the PaletteRibbonContextBack class. /// </summary> /// <param name="ribbon">Reference to ribbon control.</param> public PaletteRibbonContextBack(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
/// <summary> /// Key has been pressed down. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="e">A KeyEventArgs that contains the event data.</param> public override void KeyDown(Control c, KeyEventArgs e) { ViewBase newView = null; KryptonRibbon ribbon = (KryptonRibbon)c; // Get the button spec associated with this controller ViewDrawButton viewButton = (ViewDrawButton)Target; ButtonSpec buttonSpec = ribbon.TabsArea.ButtonSpecManager.GetButtonSpecFromView(viewButton); // Note if we are on the near edge bool isNear = (buttonSpec.Edge == PaletteRelativeEdgeAlign.Near); switch (e.KeyData) { case Keys.Tab: case Keys.Right: // Logic depends on the edge this button is on if (isNear) { // Try getting the previous near edge button (previous on near gets the next right hand side!) newView = ribbon.TabsArea.ButtonSpecManager.GetPreviousVisibleViewButton(PaletteRelativeEdgeAlign.Near, viewButton); if (newView == null) { if ((e.KeyData == Keys.Tab) && (ribbon.SelectedTab != null)) { // Get the currently selected tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab); } else { // Get the first visible tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForFirstRibbonTab(); } } // Get the first far edge button if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far); } // Get the first inherit edge button if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit); } // Rotate around to application button if (newView == null) { if (ribbon.TabsArea.LayoutAppButton.Visible) { newView = ribbon.TabsArea.LayoutAppButton.AppButton; } else if (ribbon.TabsArea.LayoutAppTab.Visible) { newView = ribbon.TabsArea.LayoutAppTab.AppTab; } } } else { // Try using the next far edge button newView = ribbon.TabsArea.ButtonSpecManager.GetNextVisibleViewButton(PaletteRelativeEdgeAlign.Far, viewButton); // Try using the next inherit edge button if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetNextVisibleViewButton(PaletteRelativeEdgeAlign.Inherit, viewButton); } // Rotate around to application button if (newView == null) { if (ribbon.TabsArea.LayoutAppButton.Visible) { newView = ribbon.TabsArea.LayoutAppButton.AppButton; } else if (ribbon.TabsArea.LayoutAppTab.Visible) { newView = ribbon.TabsArea.LayoutAppTab.AppTab; } } } break; case Keys.Tab | Keys.Shift: case Keys.Left: // Logic depends on the edge this button is on if (isNear) { // Try using the previous near edge button (next for a near edge is the left hand side!) newView = ribbon.TabsArea.ButtonSpecManager.GetNextVisibleViewButton(PaletteRelativeEdgeAlign.Near, viewButton); // Get the last qat button if (newView == null) { newView = ribbon.GetLastQATView(); } // Rotate around to application button if (newView == null) { if (ribbon.TabsArea.LayoutAppButton.Visible) { newView = ribbon.TabsArea.LayoutAppButton.AppButton; } else if (ribbon.TabsArea.LayoutAppTab.Visible) { newView = ribbon.TabsArea.LayoutAppTab.AppTab; } } } else { // Try getting the previous far edge button newView = ribbon.TabsArea.ButtonSpecManager.GetPreviousVisibleViewButton(PaletteRelativeEdgeAlign.Far, viewButton); // Try getting the previous inherit edge button if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetPreviousVisibleViewButton(PaletteRelativeEdgeAlign.Inherit, viewButton); } if (newView == null) { if (e.KeyData != Keys.Left) { // Get the last control on the selected tab newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem(); // Get the currently selected tab page if (newView == null) { if (ribbon.SelectedTab != null) { newView = ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab); } else { newView = ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab(); } } } else { // Get the last visible tab page newView = ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab(); } } // Get the last near edge button if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near); } // Get the last qat button if (newView == null) { newView = ribbon.GetLastQATView(); } // Rotate around to application button if (newView == null) { if (ribbon.TabsArea.LayoutAppButton.Visible) { newView = ribbon.TabsArea.LayoutAppButton.AppButton; } else if (ribbon.TabsArea.LayoutAppTab.Visible) { newView = ribbon.TabsArea.LayoutAppTab.AppTab; } } } break; case Keys.Space: case Keys.Enter: // Exit keyboard mode when you click the button spec ribbon.KillKeyboardMode(); // Generate a click event OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); break; } // If we have a new view to focus and it is not ourself... if ((newView != null) && (newView != Target)) { // If the new view is a tab then select that tab unless in minimized mode if (!ribbon.RealMinimizedMode && (newView is ViewDrawRibbonTab tab)) { ribbon.SelectedTab = tab.RibbonTab; } // Finally we switch focus to new view ribbon.FocusView = newView; } }
/// <summary> /// Initialize a new instance of the DesignTextToContent class. /// </summary> /// <param name="ribbon">Reference to the owning ribbon control.</param> public DesignTextToContent(KryptonRibbon ribbon) : base(ribbon.StateCommon.RibbonGeneral) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the RibbonTabsController class. /// </summary> /// <param name="ribbon">Reference to owning control.</param> public RibbonTabsController(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the AppTabController class. /// </summary> public AppTabController(KryptonRibbon ribbon) { _ribbon = ribbon; Keyboard = false; }
/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonAeroOverride class. /// </summary> /// <param name="ribbon">Reference to owning Ribbon instance.</param> /// <param name="redirect">Source for inheriting values.</param> public PaletteRedirectRibbonAeroOverride(KryptonRibbon ribbon, PaletteRedirect redirect) : base(redirect) { _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the RibbonButtonSpecFixedCollection class. /// </summary> /// <param name="owner">Reference to owning object.</param> public RibbonButtonSpecFixedCollection(KryptonRibbon owner) : base(owner) { }
/// <summary> /// Initialize a new instance of the QATExtraButtonController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> /// <param name="target">Target for state changes.</param> /// <param name="needPaint">Delegate for notifying changes in display.</param> public QATExtraButtonController(KryptonRibbon ribbon, ViewBase target, NeedPaintHandler needPaint) : base(ribbon, target, needPaint) { }
/// <summary> /// Perform actual selection of the item. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public void KeyTipSelect(KryptonRibbon ribbon) { _target?.KeyTipSelect(ribbon); }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonAppMenuOuter class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public ViewDrawRibbonAppMenuOuter(KryptonRibbon ribbon) { _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the ContextTitleController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public ContextTitleController(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
public override ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint) { return(new ViewDrawRibbonGroupCustomControl(ribbon, this, needPaint)); }
/// <summary> /// Initialize a new instance of the ButtonSpecMdiChildMin class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> public ButtonSpecMdiChildMin(KryptonRibbon ribbon) : base(PaletteButtonSpecStyle.PendantMin) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
public override ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint) { return(new ViewDrawRibbonGroupDateTimePicker(ribbon, this, needPaint)); }
private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e) { ViewBase newView = null; switch (e.KeyData) { case Keys.Tab | Keys.Shift: case Keys.Left: // Get the previous focus item for the currently selected page newView = ribbon.GroupsArea.ViewGroups.GetPreviousFocusItem(_target) ?? ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab); // Got to the actual tab header break; case Keys.Tab: case Keys.Right: // Get the next focus item for the currently selected page newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far); // Move across to any far defined buttons // Move across to any inherit defined buttons if (newView == null) { newView = ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit); } // Rotate around to application button if (newView == null) { if (ribbon.TabsArea.LayoutAppButton.Visible) { newView = ribbon.TabsArea.LayoutAppButton.AppButton; } else if (ribbon.TabsArea.LayoutAppTab.Visible) { newView = ribbon.TabsArea.LayoutAppTab.AppTab; } } break; case Keys.Space: case Keys.Enter: OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); // Get access to the popup for the group if ((VisualPopupManager.Singleton.CurrentPopup != null) && (VisualPopupManager.Singleton.CurrentPopup is VisualPopupGroup)) { // Cast to correct type VisualPopupGroup popupGroup = (VisualPopupGroup)VisualPopupManager.Singleton.CurrentPopup; popupGroup.SetFirstFocusItem(); } break; } // If we have a new view to focus and it is not ourself... if ((newView != null) && (newView != _target)) { // If the new view is a tab then select that tab unless in minimized mode if (!ribbon.RealMinimizedMode && (newView is ViewDrawRibbonTab tab)) { ribbon.SelectedTab = tab.RibbonTab; } // Finally we switch focus to new view ribbon.FocusView = newView; } }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonScrollButton class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="orientation">Scroller orientation.</param> public ViewDrawRibbonScrollButton(KryptonRibbon ribbon, VisualOrientation orientation) { _ribbon = ribbon; Orientation = orientation; }
public override ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint) { return(new ViewDrawRibbonGroupMaskedTextBox(ribbon, this, needPaint)); }
/// <summary> /// Initialize a new instance of the DialogLauncherButtonController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> /// <param name="target">Target for state changes.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public DialogLauncherButtonController(KryptonRibbon ribbon, ViewBase target, NeedPaintHandler needPaint) : base(ribbon, target, needPaint) { }
/// <summary> /// Initialize a new instance of the ApplicationTabToContent class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control..</param> /// <param name="ribbonGeneral">Source for general ribbon settings.</param> public ApplicationTabToContent(KryptonRibbon ribbon, PaletteRibbonGeneral ribbonGeneral) : base(ribbonGeneral) { _ribbon = ribbon; }
public abstract ViewBase CreateView(KryptonRibbon ribbon, NeedPaintHandler needPaint);
/// <summary> /// Initialize a new instance of the AppButtonToolTipToContent class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public AppButtonToolTipToContent(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonDesignTab class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonDesignTab(KryptonRibbon ribbon, NeedPaintHandler needPaint) : base(ribbon, needPaint) { }
/// <summary> /// Initialize a new instance of the PaletteRibbonContextDouble class. /// </summary> /// <param name="ribbon">Reference to ribbon control.</param> public PaletteRibbonContextDouble(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; LightBackground = false; }
/// <summary> /// Initialize a new instance of the ViewDrawRibbonAppMenuDocs class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public ViewDrawRibbonAppMenuDocs(KryptonRibbon ribbon) { _ribbon = ribbon; }