/// <summary>
            /// Raises the Removed event.
            /// </summary>
            /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param>
            protected override void OnRemoved(TypedCollectionEventArgs <KryptonBreadCrumbItem> e)
            {
                base.OnRemoved(e);

                // Clear down parent relationship
                e.Item.Parent = null;

                // Notify a change in the owners items property
                _owner.OnPropertyChanged(new PropertyChangedEventArgs("Items"));
            }
        private void OnRibbonGroupsRemoved(object sender, TypedCollectionEventArgs <KryptonRibbonGroup> e)
        {
            // Remove the back references
            e.Item.Ribbon    = null;
            e.Item.RibbonTab = null;

            // Only need to update display if this tab is selected and the group was visible
            if ((_ribbon != null) && (_ribbon.SelectedTab == this) && Visible)
            {
                _ribbon.PerformNeedPaint(true);
            }
        }
Beispiel #3
0
        private void OnRibbonGroupClusterRemoved(object sender, TypedCollectionEventArgs <KryptonRibbonGroupItem> e)
        {
            // Remove the back references
            e.Item.Ribbon          = null;
            e.Item.RibbonTab       = null;
            e.Item.RibbonContainer = null;

            // Only need to update display if this tab is selected and the group was visible
            if ((Ribbon != null) && (RibbonTab != null) && (Ribbon.SelectedTab == RibbonTab))
            {
                Ribbon.PerformNeedPaint(true);
            }
        }
        private void OnRibbonGroupItemsInserted(object sender, TypedCollectionEventArgs <KryptonRibbonGroupContainer> e)
        {
            // Setup the back references
            e.Item.Ribbon      = _ribbon;
            e.Item.RibbonTab   = _ribbonTab;
            e.Item.RibbonGroup = this;

            // Only need to update display if this tab is selected and the group is visible
            if ((_ribbon != null) && (_ribbonTab != null) && (_ribbon.SelectedTab == _ribbonTab))
            {
                _ribbon.PerformNeedPaint(true);
            }
        }
Beispiel #5
0
        private void OnRibbonGroupLineInserted(object sender, TypedCollectionEventArgs <KryptonRibbonGroupItem> e)
        {
            // Setup the back references
            e.Item.Ribbon          = Ribbon;
            e.Item.RibbonTab       = RibbonTab;
            e.Item.RibbonContainer = this;

            // Force the child item to the fixed lines sizing
            e.Item.ItemSizeMaximum = LinesToItemSize(ItemSizeMaximum);
            e.Item.ItemSizeMinimum = LinesToItemSize(ItemSizeMinimum);
            e.Item.ItemSizeCurrent = LinesToItemSize(ItemSizeCurrent);

            // Only need to update display if this tab is selected and the group is visible
            if ((Ribbon != null) && (RibbonTab != null) && (Ribbon.SelectedTab == RibbonTab))
            {
                Ribbon.PerformNeedPaint(true);
            }
        }
Beispiel #6
0
        private void OnPageInserted(object sender, TypedCollectionEventArgs <KryptonPage> e)
        {
            if (!Navigator.IsDisposed && _events)
            {
                // Create the draw view element for the check button and provide page it represents
                ViewDrawNavCheckButtonStack checkButton = new ViewDrawNavCheckButtonStack(Navigator, e.Item, ResolveButtonOrientation());

                // Provide the drag rectangle when requested for this button
                checkButton.ButtonDragRectangle += OnCheckButtonDragRect;
                checkButton.ButtonDragOffset    += OnCheckButtonDragOffset;

                // Need to know when check button needs repainting
                checkButton.NeedPaint = NeedPaintDelegate;

                // Set the initial state
                checkButton.Visible = e.Item.LastVisibleSet;
                checkButton.Enabled = e.Item.Enabled;
                checkButton.Checked = (Navigator.SelectedPage == e.Item);

                // Find the border edge palette to use
                PaletteBorderEdge buttonEdgePalette = (Navigator.Enabled ? Navigator.StateNormal.BorderEdge :
                                                       Navigator.StateDisabled.BorderEdge);

                // Create the border edge for use next to the check button
                ViewDrawBorderEdge buttonEdge = new ViewDrawBorderEdge(buttonEdgePalette, Navigator.Stack.StackOrientation)
                {
                    Visible = e.Item.LastVisibleSet
                };

                // Add to lookup dictionary
                _pageLookup.Add(e.Item, checkButton);
                _buttonEdgeLookup.Add(e.Item, buttonEdge);

                // Set correct ordering and dock setting
                ReorderCheckButtons();

                // Need to repaint to show the change
                Navigator.PerformNeedPaint(true);
            }
        }
        /// <summary>
        /// Raises the Removed event.
        /// </summary>
        /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param>
        protected override void OnRemoved(TypedCollectionEventArgs <Component> e)
        {
            base.OnRemoved(e);

            if (e.Item is IWorkspaceItem)
            {
                IWorkspaceItem workspaceItem = e.Item as IWorkspaceItem;
                workspaceItem.PropertyChanged        -= new PropertyChangedEventHandler(OnChildPropertyChanged);
                workspaceItem.MaximizeRestoreClicked -= new EventHandler(OnChildMaximizeRestoreClicked);
            }

            if (e.Item is KryptonWorkspaceCell)
            {
                ((KryptonWorkspaceCell)e.Item).WorkspaceParent = null;
            }

            if (e.Item is KryptonWorkspaceSequence)
            {
                ((KryptonWorkspaceSequence)e.Item).WorkspaceParent = null;
            }

            OnPropertyChanged("Children");
        }
        private void OnRibbonGroupItemsRemoved(object sender, TypedCollectionEventArgs<KryptonRibbonGroupContainer> e)
        {
            // Remove the back references
            e.Item.Ribbon = null;
            e.Item.RibbonTab = null;
            e.Item.RibbonGroup = null;

            // Only need to update display if this tab is selected and the group was visible
            if ((_ribbon != null) && (_ribbonTab != null) && (_ribbon.SelectedTab == _ribbonTab))
                _ribbon.PerformNeedPaint(true);
        }
Beispiel #9
0
 private void OnCellPagesInserting(object sender, TypedCollectionEventArgs <KryptonPage> e)
 {
     // Generate event so the docking element can decide on extra actions to be taken
     OnCellPageInserting(new KryptonPageEventArgs(e.Item, e.Index));
 }
 private void OnPagesInserting(object sender, TypedCollectionEventArgs<KryptonPage> e)
 {
     // Generate event so the docking element can decide on extra actions to be taken
     OnCellPageInserting(new KryptonPageEventArgs(e.Item, e.Index));
 }
Beispiel #11
0
        private void OnPageRemoved(object sender, TypedCollectionEventArgs<KryptonPage> e)
        {
            // Ignore call as view builder is already destructed
            if (!IsDisposed && (_viewBuilder != null))
            {
                // Stop the page inheriting palette values from the navigator
                e.Item.ResetInherit(this);

                // Unhook from page events
                e.Item.FlagsChanged -= new KryptonPageFlagsEventHandler(OnPageFlagsChanged);
                e.Item.AppearancePropertyChanged -= new PropertyChangedEventHandler(OnPageAppearanceChanged);
                e.Item.VisibleChanged -= new EventHandler(OnPageVisibleChanged);
                e.Item.EnabledChanged -= new EventHandler(OnPageEnabledChanged);

                // Remove page from the child panel
                if (ChildPanel.Controls.Contains(e.Item))
                    ChildPanel.Controls.Remove(e.Item);

                PageCollectionChanged();
            }
        }
Beispiel #12
0
 void OnPageInsertRemove(object sender, TypedCollectionEventArgs<KryptonPage> e)
 {
     UpdateButtonState();
 }
Beispiel #13
0
 private void OnPageRemoved(object sender, TypedCollectionEventArgs <KryptonPage> e)
 {
     UpdateVerbStatus();
 }
 private void OnPageRemoved(object sender, TypedCollectionEventArgs<KryptonPage> e)
 {
     UpdateVerbStatus();
 }
 private void OnPageInserted(object sender, TypedCollectionEventArgs<KryptonPage> e)
 {
     // Let the user design the new page surface
     EnableDesignMode(e.Item, e.Item.Name);
     UpdateVerbStatus();
 }
        private void OnRibbonGroupLineInserted(object sender, TypedCollectionEventArgs<KryptonRibbonGroupItem> e)
        {
            // Setup the back references
            e.Item.Ribbon = Ribbon;
            e.Item.RibbonTab = RibbonTab;
            e.Item.RibbonContainer = this;

            // Force the child item to the fixed lines sizing
            e.Item.ItemSizeMaximum = LinesToItemSize(ItemSizeMaximum);
            e.Item.ItemSizeMinimum = LinesToItemSize(ItemSizeMinimum);
            e.Item.ItemSizeCurrent = LinesToItemSize(ItemSizeCurrent);

            // Only need to update display if this tab is selected and the group is visible
            if ((Ribbon != null) && (RibbonTab != null) && (Ribbon.SelectedTab == RibbonTab))
                Ribbon.PerformNeedPaint(true);
        }
        private void OnRibbonGroupsInserted(object sender, TypedCollectionEventArgs<KryptonRibbonGroup> e)
        {
            // Setup the back references
            e.Item.Ribbon = _ribbon;
            e.Item.RibbonTab = this;

            // Only need to update display if this tab is selected and the group is visible
            if ((_ribbon != null) && (_ribbon.SelectedTab == this) && Visible)
                _ribbon.PerformNeedPaint(true);
        }
Beispiel #18
0
        private void OnPageRemoving(object sender, TypedCollectionEventArgs<KryptonPage> e)
        {
            // Ignore call as view builder is already destructed
            if (!IsDisposed && (_viewBuilder != null))
            {
                // Change to page collection means we remove the popup page
                DismissPopups();

                // Is the selected page being removed?
                if (SelectedPage == e.Item)
                    SelectNextAvailablePage(e.Item);
            }
        }
        private void OnItemPageRemoved(object sender, TypedCollectionEventArgs<KryptonPage> e)
        {
            if (!Navigator.IsDisposed && (_events > 0))
            {
                // Get the associated check button view element
                INavCheckItem checkItem = _pageLookup[e.Item];

                // Must unhook from events
                checkItem.ButtonDragRectangle -= new EventHandler<ButtonDragRectangleEventArgs>(OnCheckButtonDragRect);
                checkItem.ButtonDragOffset -= new EventHandler<ButtonDragOffsetEventArgs>(OnCheckButtonDragOffset);
                checkItem.NeedPaint = null;

                // Tell the checkbutton it is not longer required
                checkItem.View.Dispose();

                // Remove the check button from the layout bar
                _layoutBar.Remove(checkItem.View);

                // Remove association from the lookup dictionary
                _pageLookup.Remove(e.Item);

                // Need to repaint to show the change
                Navigator.PerformNeedPaint(true);
            }
        }
Beispiel #20
0
 private void OnPageInserted(object sender, TypedCollectionEventArgs <KryptonPage> e)
 {
     // Let the user design the new page surface
     EnableDesignMode(e.Item, e.Item.Name);
     UpdateVerbStatus();
 }
Beispiel #21
0
        private void OnPageInserted(object sender, TypedCollectionEventArgs<KryptonPage> e)
        {
            // Ignore call as view builder is already destructed
            if (!IsDisposed && (_viewBuilder != null))
            {
                // Change to page collection means we remove the popup page
                DismissPopups();

                // Hook into page events
                e.Item.VisibleChanged += new EventHandler(OnPageVisibleChanged);
                e.Item.EnabledChanged += new EventHandler(OnPageEnabledChanged);
                e.Item.AppearancePropertyChanged += new PropertyChangedEventHandler(OnPageAppearanceChanged);
                e.Item.FlagsChanged += new KryptonPageFlagsEventHandler(OnPageFlagsChanged);

                // Make the page inherit palette values from the navigator
                e.Item.SetInherit(this, StateCommon, StateDisabled, StateNormal,
                                        StateTracking, StatePressed, StateSelected,
                                        OverrideFocus);

                // Remove the page from any existing parent control
                if (e.Item.Parent != null)
                    e.Item.Parent.Controls.Remove(e.Item);

                // Add the page into the child panel
                ChildPanel.Controls.Add(e.Item);

                // If there is no current selection and the new page is visible and we are
                // allowed to have a selected page then it should become the selection
                if ((SelectedPage == null) && e.Item.LastVisibleSet && AllowTabSelect)
                    SelectedPage = e.Item;

                PageCollectionChanged();
            }
        }
Beispiel #22
0
 void OnPageInsertRemove(object sender, TypedCollectionEventArgs <KryptonPage> e)
 {
     UpdateButtonState();
 }
        private void OnItemPageInserted(object sender, TypedCollectionEventArgs<KryptonPage> e)
        {
            if (!Navigator.IsDisposed && (_events > 0))
            {
                // Create the draw view element for the check button and provide page it represents
                INavCheckItem checkItem = CreateCheckItem(e.Item, ConvertButtonBorderBackOrientation());

                // Provide the drag rectangle when requested for this button
                checkItem.ButtonDragRectangle += new EventHandler<ButtonDragRectangleEventArgs>(OnCheckButtonDragRect);
                checkItem.ButtonDragOffset += new EventHandler<ButtonDragOffsetEventArgs>(OnCheckButtonDragOffset);

                // Need to know when check button needs repainting
                checkItem.NeedPaint = NeedPaintDelegate;

                // Set the initial state
                checkItem.View.Visible = e.Item.LastVisibleSet;
                checkItem.View.Enabled = e.Item.Enabled;
                checkItem.Checked = (Navigator.SelectedPage == e.Item);

                // Add to lookup dictionary
                _pageLookup.Add(e.Item, checkItem);

                // Add to the bar layout element for positioning
                _layoutBar.Insert(e.Index, checkItem.View);

                // Need to repaint to show the change
                Navigator.PerformNeedPaint(true);
            }
        }