/// <summary> /// Initialize a new instance of the NavigatorBar class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public NavigatorBar(KryptonNavigator navigator, NeedPaintHandler needPaint) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Default values _barAnimation = true; _barFirstItemInset = 0; _barLastItemInset = 0; _barOrientation = VisualOrientation.Top; _barMinimumHeight = _defaultBarMinimumHeight; _barMultiline = BarMultiline.Singleline; _checkButtonStyle = ButtonStyle.Standalone; _tabStyle = TabStyle.HighProfile; _tabBorderStyle = TabBorderStyle.RoundedOutsizeMedium; _itemAlignment = RelativePositionAlign.Near; _itemMinimumSize = _defaultItemMinimumSize; _itemMaximumSize = _defaultItemMaximumSize; _itemOrientation = ButtonOrientation.Auto; _itemSizing = BarItemSizing.SameHeight; _barMapImage = MapKryptonPageImage.Small; _barMapText = MapKryptonPageText.TextTitle; _barMapExtraText = MapKryptonPageText.None; }
/// <summary> /// Construct the view appropriate for this builder. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="manager">Reference to current manager.</param> /// <param name="redirector">Palette redirector.</param> public override void Construct(KryptonNavigator navigator, ViewManager manager, PaletteRedirect redirector) { // Let base class perform common operations base.Construct(navigator, manager, redirector); // Get the current root element _oldRoot = ViewManager.Root; // Create a canvas for the border and background using current enabled state _drawCanvas = new ViewDrawCanvas(Navigator.StateNormal.HeaderGroup.Back, Navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top); // Put the exising root into the canvas _drawCanvas.Add(_oldRoot); // Set the correct palettes based on enabled state and selected page UpdateStatePalettes(); // Canvas becomes the new root ViewManager.Root = _drawCanvas; // Need to monitor changes in the enabled state Navigator.EnabledChanged += new EventHandler(OnEnabledChanged); }
/// <summary> /// Initialize a new instance of the ViewLayoutPageHide class. /// </summary> public ViewLayoutPageHide(KryptonNavigator navigator) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; }
/// <summary> /// Initialize a new instance of the NavigatorOutlook class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public NavigatorOutlook(KryptonNavigator navigator, NeedPaintHandler needPaint) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Create compound objects _full = new NavigatorOutlookFull(navigator, needPaint); _mini = new NavigatorOutlookMini(navigator, needPaint); // Default values _checkButtonStyle = ButtonStyle.NavigatorStack; _overflowButtonStyle = ButtonStyle.NavigatorOverflow; _borderEdgeStyle = PaletteBorderStyle.ControlClient; _orientation = Orientation.Vertical; _itemOrientation = ButtonOrientation.Auto; _headerSecondaryVisible = InheritBool.False; _textMoreButtons = _defaultMoreButtons; _textFewerButtons = _defaultFewerButtons; _textAddRemoveButtons = _defaultAddRemoveButtons; _showDropDownButton = true; }
/// <summary> /// Construct the view appropriate for this builder. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="manager">Reference to current manager.</param> /// <param name="redirector">Palette redirector.</param> public override void Construct(KryptonNavigator navigator, ViewManager manager, PaletteRedirect redirector) { // Let base class perform common operations base.Construct(navigator, manager, redirector); }
/// <summary> /// Construct the view appropriate for this builder. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="manager">Reference to current manager.</param> /// <param name="redirector">Palette redirector.</param> public override void Construct(KryptonNavigator navigator, ViewManager manager, PaletteRedirect redirector) { // Let base class perform common operations base.Construct(navigator, manager, redirector); // Get the current root element _oldRoot = ViewManager.Root; // Create a canvas for the background _drawPanel = new ViewDrawPanel(Navigator.StateNormal.Back); // Put the exisint root into the canvas _drawPanel.Add(_oldRoot); // Update the child panel to have panel appearance Navigator.ChildPanel.PanelBackStyle = Navigator.Panel.PanelBackStyle; // Set the correct palettes based on enabled state and selected page UpdateStatePalettes(); // Canvas becomes the new root ViewManager.Root = _drawPanel; // Need to monitor changes in the enabled state Navigator.EnabledChanged += new EventHandler(OnEnabledChanged); }
/// <summary> /// Initialize a new instance of the ViewDrawNavOutlookStack class. /// </summary> /// <param name="navigator">Owning navigator instance.</param> /// <param name="page">Page this check button represents.</param> /// <param name="orientation">Orientation for the check button.</param> public ViewDrawNavOutlookStack(KryptonNavigator navigator, KryptonPage page, VisualOrientation orientation) : base(navigator, page, orientation) { // Are we mapping for the full or the mini mode? _full = (navigator.NavigatorMode == NavigatorMode.OutlookFull); }
/// <summary> /// Initialize a new instance of the PageDragEndData class. /// </summary> /// <param name="source">Source object for the drag data..</param> /// <param name="navigator">Navigator associated with pages.</param> /// <param name="pages">Collection of pages.</param> public PageDragEndData(object source, KryptonNavigator navigator, KryptonPageCollection pages) { _source = source; _navigator = navigator; _pages = pages; }
/// <summary> /// Initialize a new instance of the DragTargetNavigatorTransfer class. /// </summary> /// <param name="rect">Rectangle for hot and draw areas.</param> /// <param name="navigator">Control instance for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetNavigatorTransfer(Rectangle rect, KryptonNavigator navigator, KryptonPageFlags allowFlags) : base(rect, rect, rect, DragTargetHint.Transfer, allowFlags) { _navigator = navigator; _notDraggedPagesFromNavigator = -1; }
/// <summary> /// Initialize a new instance of the KryptonNavigatorControlCollection class. /// </summary> /// <param name="owner">Control containing this collection.</param> public KryptonNavigatorControlCollection(KryptonNavigator owner) : base(owner) { Debug.Assert(owner != null); // Remember the collection owner _owner = owner; }
/// <summary> /// Initialize a new instance of the ViewLayoutPageShow class. /// </summary> public ViewLayoutPageShow(KryptonNavigator navigator) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; _minimumAsPreferred = false; }
/// <summary> /// Initialize a new instance of the ViewletHeaderGroupOutlook class. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="redirector">Palette redirector.</param> /// <param name="needPaintDelegate">Delegate for notifying paint requests.</param> public ViewletHeaderGroupOutlook(KryptonNavigator navigator, PaletteRedirect redirector, NeedPaintHandler needPaintDelegate) : base(navigator, redirector, needPaintDelegate) { // Are we using the full or mini outlook mode. _full = (navigator.NavigatorMode == NavigatorMode.OutlookFull); }
/// <summary> /// Initialize a new instance of the ButtonSpecNavContext class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> public ButtonSpecNavContext(KryptonNavigator navigator) : base(navigator, PaletteButtonSpecStyle.Context) { // Provide a context menu so that the button looks fixed when pressed // and the menu is shown. We add an items child so it has some content KryptonContextMenu = new KryptonContextMenu(); KryptonContextMenu.Items.Add(new KryptonContextMenuItems()); }
/// <summary> /// Initialize a new instance of the ViewLayoutPopupPage class. /// </summary> /// <param name="navigator">Reference to owning navigator control.</param> /// <param name="page">Page to the positioned.</param> public ViewLayoutPopupPage(KryptonNavigator navigator, KryptonPage page) { Debug.Assert(navigator != null); Debug.Assert(page != null); _navigator = navigator; _page = page; }
/// <summary> /// Construct the view appropriate for this builder. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="manager">Reference to current manager.</param> /// <param name="redirector">Palette redirector.</param> public override void Construct(KryptonNavigator navigator, ViewManager manager, PaletteRedirect redirector) { // Let base class perform common operations base.Construct(navigator, manager, redirector); // Setup the drag and drop handler CreateDragDrop(); }
/// <summary> /// Construct the view appropriate for this builder. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="manager">Reference to current manager.</param> /// <param name="redirector">Palette redirector.</param> public override void Construct(KryptonNavigator navigator, ViewManager manager, PaletteRedirect redirector) { // Let base class perform common operations base.Construct(navigator, manager, redirector); // Need to monitor changes in the enabled state Navigator.EnabledChanged += new EventHandler(OnEnabledChanged); }
/// <summary> /// Initialize a new instance of the PaletteNavigatorNormabled class. /// </summary> /// <param name="navigator">Reference to owning navigator.</param> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteNavigatorRedirect(KryptonNavigator navigator, PaletteRedirect redirect, NeedPaintHandler needPaint) : this(navigator, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, needPaint) { }
/// <summary> /// Initialize a new instance of the KryptonNavigatorActionList class. /// </summary> /// <param name="owner">Designer that owns this action list instance.</param> public KryptonNavigatorActionList(KryptonNavigatorDesigner owner) : base(owner.Component) { // Remember designer and actual component instance being designed _designer = owner; _navigator = (KryptonNavigator)owner.Component; // Cache service used to notify when a property has changed _serviceComponentChange = (IComponentChangeService)GetService(typeof(IComponentChangeService)); _serviceDesignerAction = (DesignerActionUIService)GetService(typeof(DesignerActionUIService)); }
/// <summary> /// Initialize a new instance of the VisualPopupPage class. /// </summary> /// <param name="navigator">Reference to owning navigator control.</param> /// <param name="page">Reference to page for display.</param> /// <param name="renderer">Drawing renderer.</param> public VisualPopupPage(KryptonNavigator navigator, KryptonPage page, IRenderer renderer) : base(renderer, true) { Debug.Assert(navigator != null); Debug.Assert(page != null); // Remember references needed later _navigator = navigator; _page = page; // Always create the layout that positions the actual page ViewLayoutPopupPage layoutPage = new ViewLayoutPopupPage(navigator, page); // Create the internal panel used for containing content ViewDrawCanvas drawGroup = new ViewDrawCanvas(navigator.StateNormal.HeaderGroup.Back, navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top); // Add the layout inside the draw group drawGroup.Add(layoutPage); // Do we need to add a border area around the page group if (_navigator.PopupPages.Border > 0) { // Grab the actual border values int border = _navigator.PopupPages.Border; // Put the page group inside a layout that has separators // to pad out the sizing to the border size we need ViewLayoutDocker layoutDocker = new ViewLayoutDocker(); layoutDocker.Add(drawGroup, ViewDockStyle.Fill); layoutDocker.Add(new ViewLayoutSeparator(border), ViewDockStyle.Top); layoutDocker.Add(new ViewLayoutSeparator(border), ViewDockStyle.Bottom); layoutDocker.Add(new ViewLayoutSeparator(border), ViewDockStyle.Left); layoutDocker.Add(new ViewLayoutSeparator(border), ViewDockStyle.Right); // Create a new top level group that contains the layout drawGroup = new ViewDrawCanvas(navigator.StateNormal.Back, navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top); drawGroup.Add(layoutDocker); } ViewManager = new ViewManager(this, drawGroup); // Borrow the child panel that contains all the pages from // the navigator and add it inside as a child of ourself navigator.BorrowChildPanel(); Controls.Add(navigator.ChildPanel); }
/// <summary> /// Initialize a new instance of the PaletteMetrics class. /// </summary> /// <param name="navigator">Reference to owning navigator.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteMetrics(KryptonNavigator navigator, NeedPaintHandler needPaint) { _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Default values _pageButtonSpecInset = -1; _pageButtonSpecPadding = CommonHelper.InheritPadding; }
/// <summary> /// Initialize a new instance of the ViewDrawNavCheckButtonTab class. /// </summary> /// <param name="navigator">Owning navigator instance.</param> /// <param name="page">Page this check button represents.</param> /// <param name="orientation">Orientation for the check button.</param> public ViewDrawNavCheckButtonTab(KryptonNavigator navigator, KryptonPage page, VisualOrientation orientation) : base(navigator, page, orientation, page.StateDisabled.Tab, page.StateNormal.Tab, page.StateTracking.Tab, page.StatePressed.Tab, page.StateSelected.Tab, page.OverrideFocus.Tab) { }
/// <summary> /// Initialize a new instance of the ViewletHeaderGroup class. /// </summary> /// <param name="navigator">Reference to navigator instance.</param> /// <param name="redirector">Palette redirector.</param> /// <param name="needPaintDelegate">Delegate for notifying paint requests.</param> public ViewletHeaderGroup(KryptonNavigator navigator, PaletteRedirect redirector, NeedPaintHandler needPaintDelegate) { Debug.Assert(navigator != null); Debug.Assert(redirector != null); Debug.Assert(needPaintDelegate != null); // Remember references _navigator = navigator; _redirector = redirector; _needPaintDelegate = needPaintDelegate; }
/// <summary> /// Initialize a new instance of the ViewDrawNavCheckButtonBase class. /// </summary> /// <param name="navigator">Owning navigator instance.</param> /// <param name="page">Page this check button represents.</param> /// <param name="orientation">Orientation for the check button.</param> /// <param name="overflow">Button is used on the overflow bar.</param> public ViewDrawNavCheckButtonBase(KryptonNavigator navigator, KryptonPage page, VisualOrientation orientation, bool overflow) : this(navigator, page, orientation, page.StateDisabled.OverflowButton, page.StateNormal.OverflowButton, page.StateTracking.OverflowButton, page.StatePressed.OverflowButton, page.StateSelected.OverflowButton, page.OverrideFocus.OverflowButton) { }
/// <summary> /// Initialize a new instance of the ViewDrawNavOutlookSelected class. /// </summary> /// <param name="navigator">Owning navigator instance.</param> /// <param name="page">Page this check button represents.</param> /// <param name="orientation">Orientation for the check button.</param> public ViewDrawNavOutlookMini(KryptonNavigator navigator, KryptonPage page, VisualOrientation orientation) : base(navigator, page, orientation, navigator.StateDisabled.MiniButton, navigator.StateNormal.MiniButton, navigator.StateTracking.MiniButton, navigator.StatePressed.MiniButton, navigator.StateSelected.MiniButton, navigator.OverrideFocus.MiniButton) { // Create the finish handler for when popup is removed _finishDelegate = new EventHandler(OnPopupFinished); }
/// <summary> /// Initialize a new instance of the HeaderGroupMappingBase class. /// </summary> /// <param name="navigator">Reference to owning navogator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public HeaderGroupMappingBase(KryptonNavigator navigator, NeedPaintHandler needPaint) : base(needPaint) { Debug.Assert(navigator != null); // Remember back reference to owning control _navigator = navigator; // Set initial values to the default _mapImage = GetMapImageDefault(); _mapHeading = GetMapHeadingDefault(); _mapDescription = GetMapDescriptionDefault(); }
/// <summary> /// Initialize a new instance of the ButtonSpecNavFixed class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="fixedStyle">Fixed style to use.</param> public ButtonSpecNavFixed(KryptonNavigator navigator, PaletteButtonSpecStyle fixedStyle) { Debug.Assert(navigator != null); // Remember back reference to owning navigator. _navigator = navigator; // Fix the type ProtectedType = fixedStyle; // Default other properties _location = HeaderLocation.PrimaryHeader; }
/// <summary> /// Initialize a new instance of the ViewDrawNavCheckButtonBar class. /// </summary> /// <param name="navigator">Owning navigator instance.</param> /// <param name="page">Page this check button represents.</param> /// <param name="orientation">Orientation for the check button.</param> /// <param name="stateDisabled">Source for disabled state values.</param> /// <param name="stateNormal">Source for normal state values.</param> /// <param name="stateTracking">Source for tracking state values.</param> /// <param name="statePressed">Source for pressed state values.</param> /// <param name="stateSelected">Source for selected state values.</param> /// <param name="stateFocused">Source for focused state values.</param> public ViewDrawNavCheckButtonBar(KryptonNavigator navigator, KryptonPage page, VisualOrientation orientation, IPaletteTriple stateDisabled, IPaletteTriple stateNormal, IPaletteTriple stateTracking, IPaletteTriple statePressed, IPaletteTriple stateSelected, IPaletteTriple stateFocused) : base(navigator, page, orientation, stateDisabled, stateNormal, stateTracking, statePressed, stateSelected, stateFocused) { }
private void AddEmbeddedNavigator(KryptonPage page) { // Create a navigator to embed inside the page KryptonNavigator nav = new KryptonNavigator(); // We want the navigator to fill the entire page area nav.Dock = DockStyle.Fill; // Remove the close and context buttons nav.Button.CloseButtonDisplay = ButtonDisplay.Hide; nav.Button.ButtonDisplayLogic = ButtonDisplayLogic.None; // Set the required tab and bar settings nav.Bar.BarOrientation = VisualOrientation.Right; nav.Bar.ItemOrientation = ButtonOrientation.FixedTop; nav.Bar.ItemSizing = BarItemSizing.SameWidthAndHeight; nav.Bar.TabBorderStyle = TabBorderStyle.RoundedEqualSmall; nav.Bar.TabStyle = TabStyle.StandardProfile; // Do not draw the bar area background, let parent page show through nav.StateCommon.Panel.Draw = InheritBool.False; // Use same font for all tab states and we want text aligned to near nav.StateCommon.Tab.Content.ShortText.Font = SystemFonts.IconTitleFont; nav.StateCommon.Tab.Content.ShortText.TextH = PaletteRelativeAlign.Near; // Set the page colors nav.StateCommon.Tab.Content.Padding = new Padding(4); nav.StateNormal.Tab.Back.ColorStyle = PaletteColorStyle.Linear; nav.StateNormal.Tab.Back.Color1 = _select[_count % _select.Length]; nav.StateNormal.Tab.Back.Color2 = Color.White; nav.StateNormal.Tab.Back.ColorAngle = 270; nav.StateSelected.Tab.Back.ColorStyle = PaletteColorStyle.Linear; nav.StateSelected.Tab.Back.Color2 = _hotEmbedSelected; nav.StateSelected.Tab.Back.ColorAngle = 270; nav.StateTracking.Tab.Back.ColorStyle = PaletteColorStyle.Solid; nav.StateTracking.Tab.Back.Color1 = _hotEmbedTracking; nav.StatePressed.Tab.Back.ColorStyle = PaletteColorStyle.Solid; nav.StatePressed.Tab.Back.Color1 = _hotEmbedTracking; // Add a random number of pages Random rand = new Random(); int numPages = 3 + rand.Next(5); for(int i=0; i<numPages; i++) nav.Pages.Add(NewEmbeddedPage(_titleEmbedded[rand.Next(_titleEmbedded.Length - 1)])); page.Controls.Add(nav); }
/// <summary> /// Initialize a new instance of the NavigatorGroup class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public NavigatorGroup(KryptonNavigator navigator, NeedPaintHandler needPaint) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Default values _groupBackStyle = PaletteBackStyle.ControlClient; _groupBorderStyle = PaletteBorderStyle.ControlClient; }
/// <summary> /// Initialize a new instance of the NavigatorOutlookFull class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public NavigatorOutlookFull(KryptonNavigator navigator, NeedPaintHandler needPaint) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Default values _overflowMapImage = MapKryptonPageImage.Small; _overflowMapText = MapKryptonPageText.None; _overflowMapExtraText = MapKryptonPageText.None; _stackMapImage = MapKryptonPageImage.MediumSmall; _stackMapText = MapKryptonPageText.TextTitle; _stackMapExtraText = MapKryptonPageText.None; }