Inheritance: ComponentFactory.Krypton.Toolkit.VisualPanel
 /// <summary>
 /// Initialize a new instance of the KryptonContextMenuEventArgs class.
 /// </summary>
 /// <param name="page">Page effected by event.</param>
 /// <param name="index">Index of page in the owning collection.</param>
 /// <param name="contextMenu">Prepopulated context menu ready for display.</param>
 public KryptonContextMenuEventArgs(KryptonPage page, 
                                    int index,
                                    KryptonContextMenu contextMenu)
     : base(page, index)
 {
     _contextMenu = contextMenu;
 }
 /// <summary>
 /// Initialize a new instance of the PageLoadingEventArgs class.
 /// </summary>
 /// <param name="workspace">Reference to owning workspace control.</param>
 /// <param name="page">Reference to owning workspace cell page.</param>
 /// <param name="xmlReader">Xml reader for persisting custom data.</param>
 public PageLoadingEventArgs(KryptonWorkspace workspace,
                             KryptonPage page,
                             XmlReader xmlReader)
     : base(workspace, xmlReader)
 {
     _page = page;
 }
示例#3
0
 /// <summary>
 /// Initialize a new instance of the DirectionActionEventArgs class.
 /// </summary>
 /// <param name="page">Page effected by event.</param>
 /// <param name="index">Index of page in the owning collection.</param>
 /// <param name="action">Previous/Next action to take.</param>
 public DirectionActionEventArgs(KryptonPage page, 
     int index,
     DirectionButtonAction action)
     : base(page, index)
 {
     _action = action;
 }
示例#4
0
        private KryptonPage CreatePage()
        {
            // Give each page a unique number
            string pageNumber = (_count++).ToString();

            // Create a new page and give it a name and image
            KryptonPage page = new KryptonPage();
            page.Text = "P" + pageNumber;
            page.TextTitle = "P" + pageNumber + " Title";
            page.TextDescription = "P" + pageNumber + " Description";
            page.ImageSmall = imageList.Images[_count % imageList.Images.Count];
            page.MinimumSize = new Size(200, 250);

            // Create a rich text box with some sample text inside
            KryptonRichTextBox rtb = new KryptonRichTextBox();
            rtb.Text = "This page (" + page.Text + ") contains a rich text box control as example content. Your application could place anything you like here such as data entry controls, charts, data grids etc.\n\nTry dragging the page headers in order to rearrange the workspace layout.";
            rtb.Dock = DockStyle.Fill;
            rtb.StateCommon.Border.Draw = InheritBool.False;

            // Add rich text box as the contents of the page
            page.Padding = new Padding(5);
            page.Controls.Add(rtb);

            return page;
        }
 /// <summary>
 /// Initialize a new instance of the DockPageLoadingEventArgs class.
 /// </summary>
 /// <param name="manager">Reference to owning docking manager instance.</param>
 /// <param name="xmlReading">Xml reader for persisting custom data.</param>
 /// <param name="page">Reference to page being loaded.</param>
 public DockPageLoadingEventArgs(KryptonDockingManager manager,
                                 XmlReader xmlReading,
                                 KryptonPage page)
     : base(manager, xmlReading)
 {
     _page = page;
 }
示例#6
0
 private void buttonAddPage_Click(object sender, EventArgs e)
 {
     KryptonPage newPage = new KryptonPage();
     newPage.Text = "Page " + _newPage.ToString();
     newPage.ImageSmall = imageList1.Images[_newPage++ % imageList1.Images.Count];
     kryptonNavigator1.Pages.Add(newPage);
 }
 /// <summary>
 /// Initialize a new instance of the CloseActionEventArgs class.
 /// </summary>
 /// <param name="page">Page effected by event.</param>
 /// <param name="index">Index of page in the owning collection.</param>
 /// <param name="action">Close action to take.</param>
 public CloseActionEventArgs(KryptonPage page, 
                             int index, 
                             CloseButtonAction action)
     : base(page, index)
 {
     _action = action;
 }
 /// <summary>
 /// Initialize a new instance of the PageSavingEventArgs class.
 /// </summary>
 /// <param name="workspace">Reference to owning workspace control.</param>
 /// <param name="page">Reference to owning workspace cell page.</param>
 /// <param name="xmlWriter">Xml writer for persisting custom data.</param>
 public PageSavingEventArgs(KryptonWorkspace workspace,
                            KryptonPage page,
                            XmlWriter xmlWriter)
     : base(workspace, xmlWriter)
 {
     _page = page;
 }
 /// <summary>
 /// Initialize a new instance of the DockPageSavingEventArgs class.
 /// </summary>
 /// <param name="manager">Reference to owning docking manager instance.</param>
 /// <param name="xmlWriter">Xml writer for persisting custom data.</param>
 /// <param name="page">Reference to page being saved.</param>
 public DockPageSavingEventArgs(KryptonDockingManager manager,
                                XmlWriter xmlWriter,
                                KryptonPage page)
     : base(manager, xmlWriter)
 {
     _page = page;
 }
 /// <summary>
 /// Initialize a new instance of the PopupPageEventArgs class.
 /// </summary>
 /// <param name="page">Page effected by event.</param>
 /// <param name="index">Index of page in the owning collection.</param>
 /// <param name="screenRect">Screen rectangle for showing the popup.</param>
 public PopupPageEventArgs(KryptonPage page, 
                           int index, 
                           Rectangle screenRect)
     : base(page, index)
 {
     _screenRect = screenRect;
 }
 /// <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 ContextPageEventArgs class.
 /// </summary>
 /// <param name="page">Page associated with the context menu.</param>
 /// <param name="contextMenu">Context menu that can be customized.</param>
 /// <param name="cancel">Initial value for the cancel property.</param>
 public ContextPageEventArgs(KryptonPage page, 
                             KryptonContextMenu contextMenu,
                             bool cancel)
     : base(cancel)
 {
     _page = page;
     _contextMenu = contextMenu;
 }
 /// <summary>
 /// Initialize a new instance of the ContextActionEventArgs class.
 /// </summary>
 /// <param name="page">Page effected by event.</param>
 /// <param name="index">Index of page in the owning collection.</param>
 /// <param name="action">Close action to take.</param>
 /// <param name="contextMenu">Prepopulated context menu ready for display.</param>
 public ContextActionEventArgs(KryptonPage page, 
                               int index, 
                               ContextButtonAction action,
                               KryptonContextMenu contextMenu)
     : base(page, index, contextMenu)
 {
     _action = action;
 }
示例#14
0
 /// <summary>
 /// Initialize a new instance of the PageReorderEventArgs class.
 /// </summary>
 /// <param name="pageMoving">Reference to page being moved.</param>
 /// <param name="pageTarget">Reference to target paged.</param>
 /// <param name="movingBefore">True if moving page is to be positioned before the target; otherwise after the target.</param>
 public PageReorderEventArgs(KryptonPage pageMoving, 
                             KryptonPage pageTarget, 
                             bool movingBefore)
 {
     _pageMoving = pageMoving;
     _pageTarget = pageTarget;
     _movingBefore = movingBefore;
 }
        /// <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>
        /// Initialize a new instance of the PageDragEndEventArgs class.
        /// </summary>
        /// <param name="dropped">True if a drop was performed; otherwise false.</param>
        /// <param name="pages">Array of event associated pages.</param>
        public PageDragEndEventArgs(bool dropped,
                                    KryptonPage[] pages)
        {
            _dropped = dropped;
            _pages = new KryptonPageCollection();

            if (pages != null)
                _pages.AddRange(pages);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPageActionList class.
        /// </summary>
        /// <param name="owner">Designer that owns this action list instance.</param>
        public KryptonPageActionList(KryptonPageDesigner owner)
            : base(owner.Component)
        {
            // Remember designer and actual component instance being designed
            _page = (KryptonPage)owner.Component;

            // Cache service used to notify when a property has changed
            _serviceComponentChange = (IComponentChangeService)GetService(typeof(IComponentChangeService));
        }
示例#18
0
        /// <summary>
        /// Initialize a new instance of the KryptonPageDragEventArgs class.
        /// </summary>
        /// <param name="screenPoint">Screen point of the mouse.</param>
        /// <param name="pages">Array of event associated pages.</param>
        public PageDragEventArgs(Point screenPoint,
            KryptonPage[] pages)
        {
            _screenPoint = screenPoint;
            _pages = new KryptonPageCollection();

            if (pages != null)
                _pages.AddRange(pages);
        }
 /// <summary>
 /// Initialize a new instance of the CellDragCancelEventArgs class.
 /// </summary>
 /// <param name="screenPoint">Screen point of the mouse.</param>
 /// <param name="screenOffset">Screen offset of the mouse to the source element.</param>
 /// <param name="c">Control that started the drag operation.</param>
 /// <param name="pages">Array of event associated pages.</param>
 /// <param name="cell">Workspace cell associated with pages.</param>
 public CellDragCancelEventArgs(Point screenPoint,
                                Point screenOffset,
                                Control c,
                                KryptonPage[] pages,
                                KryptonWorkspaceCell cell)
     : base(screenPoint, screenOffset, c, pages)
 {
     _cell = cell;
 }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenSeparatorResizeEventArgs class.
 /// </summary>
 /// <param name="separator">Reference to separator control instance.</param>
 /// <param name="dockspace">Reference to dockspace control instance.</param>
 /// <param name="page">Reference to page contained in the dockspace.</param>
 /// <param name="resizeRect">Initial resizing rectangle.</param>
 public AutoHiddenSeparatorResizeEventArgs(KryptonSeparator separator,
                                           KryptonDockspace dockspace,
                                           KryptonPage page,
                                           Rectangle resizeRect)
 {
     _separator = separator;
     _dockspace = dockspace;
     _page = page;
     _resizeRect = resizeRect;
 }
 /// <summary>
 /// Initialize a new instance of the ViewDrawAutoHiddenTab class.
 /// </summary>
 /// <param name="page">Reference to the page this tab represents.</param>
 /// <param name="orientation">Visual orientation used for drawing the tab.</param>
 public ViewDrawAutoHiddenTab(KryptonPage page,
                              VisualOrientation orientation)
     : base(page.StateDisabled.CheckButton, 
            page.StateNormal.CheckButton,
            page.StateTracking.CheckButton, 
            page.StatePressed.CheckButton,
            null, null, orientation, false)
 {
     _page = page;
     _orientation = orientation;
 }
        /// <summary>
        /// Initialize a new instance of the KryptonAutoHiddenProxyPage class.
        /// </summary>
        public KryptonAutoHiddenProxyPage(KryptonPage page)
        {
            if (page == null)
                throw new ArgumentNullException("page");

            // We are a proxy for this cached page reference
            _page = page;

            // Text property was updated by the base class constructor, so now we update the actual referenced class
            _page.Text = Text;
        }
 /// <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)
 {
 }
示例#24
0
        /// <summary>
        /// Initialize a new instance of the PageToToolTipMapping class.
        /// </summary>
        /// <param name="page">Page to source values from.</param>
        /// <param name="mapImage">How to map the image from the page to the tooltip.</param>
        /// <param name="mapText">How to map the text from the page to the tooltip.</param>
        /// <param name="mapExtraText">How to map the extra text from the page to the tooltip.</param>
        public PageToToolTipMapping(KryptonPage page,
                                    MapKryptonPageImage mapImage,
                                    MapKryptonPageText mapText,
                                    MapKryptonPageText mapExtraText)
        {
            Debug.Assert(page != null);

            _page = page;
            _mapImage = mapImage;
            _mapText = mapText;
            _mapExtraText = mapExtraText;
        }
示例#25
0
        /// <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 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 PageDragCancelEventArgs class.
        /// </summary>
        /// <param name="elementOffset">Offset from the top left of the element.</param>
        /// <param name="screenPoint">Screen point of the mouse.</param>
        /// <param name="c">Control that started the drag operation.</param>
        /// <param name="pages">Array of event associated pages.</param>
        public PageDragCancelEventArgs(Point screenPoint,
                                       Point elementOffset,
                                       Control c,
                                       KryptonPage[] pages)
        {
            _screenPoint = screenPoint;
            _elementOffset = elementOffset;
            _c = c;
            _pages = new KryptonPageCollection();

            if (pages != null)
                _pages.AddRange(pages);
        }
 /// <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 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)
 {
 }
示例#30
0
        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);
        }