Add() публичный Метод

Append a view to the collection.
public Add ( ViewBase item, ViewDockStyle dock ) : void
item ViewBase ViewBase reference.
dock ViewDockStyle DockStyle setting.
Результат void
Пример #1
0
        /// <summary>
        /// Add the spacing views into the indexed docker.
        /// </summary>
        /// <param name="i">Index of docker.</param>
        /// <param name="spacerL">Spacer for the left side.</param>
        /// <param name="spacerR">Spacer for the right side.</param>
        protected override void AddSpacersToDocker(int i,
                                                   ViewLayoutMetricSpacer spacerL,
                                                   ViewLayoutMetricSpacer spacerR)
        {
            // Get the indexed instance
            ViewDrawDocker viewDocker = _viewDockers[i];

            // Add them into the view docker instance
            viewDocker.Add(spacerL, ViewDockStyle.Left);
            viewDocker.Add(spacerR, ViewDockStyle.Right);
        }
Пример #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonGroup class.
        /// </summary>
        public KryptonGroup()
        {
            // Create the palette storage
            _stateCommon   = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
            _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate);
            _stateNormal   = new PaletteDouble(_stateCommon, NeedPaintDelegate);

            // Create the internal panel used for containing content
            _panel = new KryptonGroupPanel(this, _stateCommon, _stateDisabled, _stateNormal, new NeedPaintHandler(OnGroupPanelPaint));

            // Make sure the panel back style always mimics our back style
            _panel.PanelBackStyle = PaletteBackStyle.ControlClient;

            // Create the element that fills the remainder space and remembers fill rectange
            _layoutFill = new ViewLayoutFill(_panel);

            // Create view for the control border and background
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDocker.Add(_layoutFill, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // We want to default to shrinking and growing (base class defaults to GrowOnly)
            AutoSizeMode = AutoSizeMode.GrowAndShrink;

            // Add panel to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel);
        }
Пример #3
0
        private void Construct(KryptonContextMenuCollection items,
            bool keyboardActivated)
        {
            // Ask the top level collection to generate the child view elements
            items.GenerateView(_provider, this, _viewColumns, true, true);

            // Create the control panel canvas
            ViewDrawCanvas mainBackground = new ViewDrawCanvas(_provider.ProviderStateCommon.ControlInner.Back, _provider.ProviderStateCommon.ControlInner.Border, VisualOrientation.Top);
            mainBackground.Add(_viewColumns);

            ViewLayoutDocker layoutDocker = new ViewLayoutDocker();
            Padding outerPadding = _provider.ProviderRedirector.GetMetricPadding(PaletteState.Normal, PaletteMetricPadding.ContextMenuItemOuter);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Top), ViewDockStyle.Top);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Bottom), ViewDockStyle.Bottom);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Left), ViewDockStyle.Left);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Right), ViewDockStyle.Right);
            layoutDocker.Add(mainBackground, ViewDockStyle.Fill);

            // Create the docking element that gives us a border and background
            _drawDocker = new ViewDrawDocker(_provider.ProviderStateCommon.ControlOuter.Back, _provider.ProviderStateCommon.ControlOuter.Border, null);
            _drawDocker.Add(layoutDocker, ViewDockStyle.Fill);
            _drawDocker.KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager);
            ViewManager.Root = _drawDocker;

            // With keyboard activate we select the first valid item
            if (keyboardActivated)
                ((ViewContextMenuManager)ViewManager).KeyDown();
        }
Пример #4
0
        /// <summary>
        /// Initialize a new instance of the KryptonGroup class.
        /// </summary>
        public KryptonGroup()
        {
            // Create the palette storage
            _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
            _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteDouble(_stateCommon, NeedPaintDelegate);

            // Create the internal panel used for containing content
            _panel = new KryptonGroupPanel(this, _stateCommon, _stateDisabled, _stateNormal, new NeedPaintHandler(OnGroupPanelPaint));

            // Make sure the panel back style always mimics our back style
            _panel.PanelBackStyle = PaletteBackStyle.ControlClient;

            // Create the element that fills the remainder space and remembers fill rectange
            _layoutFill = new ViewLayoutFill(_panel);

            // Create view for the control border and background
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDocker.Add(_layoutFill, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // We want to default to shrinking and growing (base class defaults to GrowOnly)
            AutoSizeMode = AutoSizeMode.GrowAndShrink;

            // Add panel to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonSeparator class.
        /// </summary>
        public KryptonSeparator()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Create the palette storage
            StateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                            PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorHighProfile,
                                                            PaletteBorderStyle.SeparatorHighProfile, NeedPaintDelegate)
            {
                BorderRedirect = { OverrideBorderToFalse = true }
            };

            // Never draw the border around the background

            StateDisabled = new PaletteSplitContainer(StateCommon, StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StateNormal   = new PaletteSplitContainer(StateCommon, StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StateTracking = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
            StatePressed  = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
                                                   StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
                                                   PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            // Get the separator to fill the entire client area
            _drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border)
            {
                IgnoreAllBorderAndPadding = true
            };
            _drawDocker.Add(_drawSeparator, ViewDockStyle.Fill);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController  = _separatorController;
            _drawSeparator.KeyController    = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Use timer to redraw after windows messages are processed
            _redrawTimer = new Timer
            {
                Interval = 1
            };
            _redrawTimer.Tick += OnRedrawTick;

            // Set other internal starting values
            _style             = SeparatorStyle.HighProfile;
            _orientation       = Orientation.Vertical;
            AllowMove          = true;
            SplitterIncrements = 1;
            _splitterWidth     = 5;
        }
        /// <summary>
        /// Create the view hierarchy for this view mode.
        /// </summary>
        protected override void CreateCheckItemView()
        {
            // Create the view element that lays out the check buttons
            _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
                                           PaletteMetricInt.CheckButtonGap,
                                           Navigator.Bar.ItemSizing,
                                           Navigator.Bar.ItemAlignment,
                                           Navigator.Bar.BarMultiline,
                                           Navigator.Bar.ItemMinimumSize,
                                           Navigator.Bar.ItemMaximumSize,
                                           Navigator.Bar.BarMinimumHeight,
                                           false);

            // Create the scroll spacer that restricts display
            _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
                                                        PaletteMetricPadding.BarPaddingInside,
                                                        PaletteMetricInt.CheckButtonGap,
                                                        Navigator.Header.HeaderPositionBar,
                                                        Navigator.Bar.ItemAlignment,
                                                        Navigator.Bar.BarAnimation);
            _layoutBarViewport.Add(_layoutBar);

            // Create the button bar area docker
            _layoutBarDocker = new ViewLayoutDocker();
            _layoutBarDocker.Add(_layoutBarViewport, ViewDockStyle.Fill);

            // Place the bar inside a header style area
            _viewHeadingBar = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderBar.Back,
                                                 Navigator.StateNormal.HeaderGroup.HeaderBar.Border,
                                                 Navigator.StateNormal.HeaderGroup.HeaderBar,
                                                 PaletteMetricBool.None,
                                                 PaletteMetricPadding.HeaderGroupPaddingSecondary,
                                                 VisualOrientation.Top);

            _viewHeadingBar.Add(_layoutBarDocker, ViewDockStyle.Fill);

            // Create the docker used to layout contents of main panel and fill with group
            _drawPanelDocker = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.Back,
                                                  Navigator.StateNormal.HeaderGroup.Border,
                                                  Navigator.StateNormal.HeaderGroup,
                                                  PaletteMetricBool.HeaderGroupOverlay);

            _drawPanelDocker.Add(_oldRoot, ViewDockStyle.Fill);
            _drawPanelDocker.Add(_viewHeadingBar, ViewDockStyle.Top);
            _newRoot = _drawPanelDocker;

            // Must call the base class to perform common actions
            base.CreateCheckItemView();
        }
Пример #7
0
        /// <summary>
        /// Initialize a new instance of the KryptonHeader class.
        /// </summary>
        public KryptonHeader()
        {
            // The header cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default values
            _style                         = HeaderStyle.Primary;
            _orientation                   = VisualOrientation.Top;
            AllowButtonSpecToolTips        = false;
            AllowButtonSpecToolTipPriority = false;

            // Create storage objects
            Values              = new HeaderValues(NeedPaintDelegate);
            Values.TextChanged += OnHeaderTextChanged;
            ButtonSpecs         = new HeaderButtonSpecCollection(this);

            // Create the palette storage
            StateCommon   = new PaletteHeaderRedirect(Redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, NeedPaintDelegate);
            StateDisabled = new PaletteTripleMetric(StateCommon, NeedPaintDelegate);
            StateNormal   = new PaletteTripleMetric(StateCommon, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker  = new ViewDrawDocker(StateNormal.Back, StateNormal.Border, null);
            _drawContent = new ViewDrawContent(StateNormal.Content, Values, Orientation);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Create button specification collection manager
            _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
                                                       new ViewDrawDocker[] { _drawDocker },
                                                       new IPaletteMetric[] { StateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.HeaderButtonPaddingPrimary },
                                                       CreateToolStripRenderer,
                                                       NeedPaintDelegate);

            // Create the manager for handling tooltips
            ToolTipManager                = new ToolTipManager();
            ToolTipManager.ShowToolTip   += OnShowToolTip;
            ToolTipManager.CancelToolTip += OnCancelToolTip;
            _buttonManager.ToolTipManager = ToolTipManager;

            // We want to be auto sized by default, but not the property default!
            AutoSize     = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
Пример #8
0
        /// <summary>
        /// Initialize a new instance of the KryptonBreadCrumb class.
        /// </summary>
        public KryptonBreadCrumb()
        {
            // The bread crumb cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default values
            _selectedItem              = null;
            _dropDownNavigaton         = true;
            _buttonStyle               = ButtonStyle.BreadCrumb;
            _rootItem                  = new KryptonBreadCrumbItem("Root");
            _rootItem.PropertyChanged += new PropertyChangedEventHandler(OnCrumbItemChanged);
            _allowButtonSpecToolTips   = false;

            // Create storage objects
            _buttonSpecs = new BreadCrumbButtonSpecCollection(this);

            // Create the palette storage
            _stateCommon   = new PaletteBreadCrumbRedirect(Redirector, NeedPaintDelegate);
            _stateDisabled = new PaletteBreadCrumbDoubleState(_stateCommon, NeedPaintDelegate);
            _stateNormal   = new PaletteBreadCrumbDoubleState(_stateCommon, NeedPaintDelegate);
            _stateTracking = new PaletteBreadCrumbState(_stateCommon, NeedPaintDelegate);
            _statePressed  = new PaletteBreadCrumbState(_stateCommon, NeedPaintDelegate);

            // Our view contains background and border with crumbs inside
            _layoutCrumbs = new ViewLayoutCrumbs(this, NeedPaintDelegate);
            _drawDocker   = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border, null);
            _drawDocker.Add(_layoutCrumbs, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Create button specification collection manager
            _buttonManager = new ButtonSpecManagerDraw(this, Redirector, _buttonSpecs, null,
                                                       new ViewDrawDocker[] { _drawDocker },
                                                       new IPaletteMetric[] { _stateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                       new GetToolStripRenderer(CreateToolStripRenderer),
                                                       NeedPaintDelegate);

            // Create the manager for handling tooltips
            _toolTipManager                = new ToolTipManager();
            _toolTipManager.ShowToolTip   += new EventHandler <ToolTipEventArgs>(OnShowToolTip);
            _toolTipManager.CancelToolTip += new EventHandler(OnCancelToolTip);
            _buttonManager.ToolTipManager  = _toolTipManager;
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawMenuHeading class.
        /// </summary>
        /// <param name="heading">Reference to owning heading entry.</param>
        /// <param name="palette">Reference to palette source.</param>
        public ViewDrawMenuHeading(KryptonContextMenuHeading heading,
                                   PaletteTripleRedirect palette)
        {
            // Create fixed storage of the content values
            _contentValues = new FixedContentValue(heading.Text,
                                                   heading.ExtraText,
                                                   heading.Image,
                                                   heading.ImageTransparentColor);

            // Give the heading object the redirector to use when inheriting values
            heading.SetPaletteRedirect(palette);

            // Create the content for the actual heading text/image
            _drawContent = new ViewDrawContent(heading.StateNormal.Content, _contentValues, VisualOrientation.Top);

            // Use the docker to provide the background and border
            _drawDocker = new ViewDrawDocker(heading.StateNormal.Back, heading.StateNormal.Border);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Add docker as the composite content
            Add(_drawDocker);
        }
Пример #10
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawMenuHeading class.
        /// </summary>
        /// <param name="heading">Reference to owning heading entry.</param>
        /// <param name="palette">Reference to palette source.</param>
        public ViewDrawMenuHeading(KryptonContextMenuHeading heading,
                                   PaletteTripleRedirect palette)
        {
            // Create fixed storage of the content values
            _contentValues = new FixedContentValue(heading.Text,
                                                   heading.ExtraText,
                                                   heading.Image,
                                                   heading.ImageTransparentColor);

            // Give the heading object the redirector to use when inheriting values
            heading.SetPaletteRedirect(palette);

            // Create the content for the actual heading text/image
            _drawContent = new ViewDrawContent(heading.StateNormal.Content, _contentValues, VisualOrientation.Top);

            // Use the docker to provide the background and border
            _drawDocker = new ViewDrawDocker(heading.StateNormal.Back, heading.StateNormal.Border);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Add docker as the composite content
            Add(_drawDocker);
        }
Пример #11
0
        /// <summary>
        /// Initialize a new instance of the VisualPopupTooltip class.
        /// </summary>
        /// <param name="redirector">Redirector for recovering palette values.</param>
        /// <param name="contentValues">Source of content values.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="backStyle">Style for the tooltip background.</param>
        /// <param name="borderStyle">Style for the tooltip border.</param>
        /// <param name="contentStyle">Style for the tooltip content.</param>
        public VisualPopupToolTip(PaletteRedirect redirector,
                                  IContentValues contentValues,
                                  IRenderer renderer,
                                  PaletteBackStyle backStyle,
                                  PaletteBorderStyle borderStyle,
                                  PaletteContentStyle contentStyle)
            : base(renderer, true)
        {
            Debug.Assert(contentValues != null);

            // Remember references needed later
            _contentValues = contentValues;

            // Create the triple redirector needed by view elements
            _palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker  = new ViewDrawDocker(_palette.Back, _palette.Border, null);
            _drawContent = new ViewDrawContent(_palette.Content, _contentValues, VisualOrientation.Top);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);
        }
Пример #12
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawMonth class.
        /// </summary>
        /// <param name="calendar">Reference to calendar provider.</param>
        /// <param name="months">Reference to months instance.</param>
        /// <param name="redirector">Redirector for getting values.</param>
        /// <param name="needPaintDelegate">Delegate for requesting paint changes.</param>
        public ViewDrawMonth(IKryptonMonthCalendar calendar,
                             ViewLayoutMonths months,
                             PaletteRedirect redirector,
                             NeedPaintHandler needPaintDelegate)
            : base(false)
        {
            _calendar = calendar;
            _months   = months;

            // Add a header for showing the month/year value
            _drawContent  = new ViewDrawContent(_calendar.StateNormal.Header.Content, this, VisualOrientation.Top);
            _borderForced = new PaletteBorderInheritForced(_calendar.StateNormal.Header.Border);
            _borderForced.ForceBorderEdges(PaletteDrawBorders.None);
            _drawHeader = new ViewDrawDocker(_calendar.StateNormal.Header.Back, _borderForced, null);
            _drawHeader.Add(_drawContent, ViewDockStyle.Fill);
            Add(_drawHeader);

            // Create the left/right arrows for moving the months
            _arrowPrev        = new ButtonSpecCalendar(this, PaletteButtonSpecStyle.Previous, RelativeEdgeAlign.Near);
            _arrowNext        = new ButtonSpecCalendar(this, PaletteButtonSpecStyle.Next, RelativeEdgeAlign.Far);
            _arrowPrev.Click += new EventHandler(OnPrevMonth);
            _arrowNext.Click += new EventHandler(OnNextMonth);
            _buttonSpecs      = new CalendarButtonSpecCollection(this);
            _buttonSpecs.Add(_arrowPrev);
            _buttonSpecs.Add(_arrowNext);

            // Using a button spec manager to add the buttons to the header
            _buttonManager = new ButtonSpecManagerDraw(_calendar.CalendarControl, redirector, null, _buttonSpecs,
                                                       new ViewDrawDocker[] { _drawHeader },
                                                       new IPaletteMetric[] { _calendar.StateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetCalendar },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                       _calendar.GetToolStripDelegate, needPaintDelegate);

            // Create stacks for holding display items
            ViewLayoutStack namesStack = new ViewLayoutStack(true);
            ViewLayoutStack weeksStack = new ViewLayoutStack(true);
            ViewLayoutStack daysStack  = new ViewLayoutStack(false);

            _numberStack = new ViewLayoutStack(false);
            weeksStack.Add(_numberStack);
            weeksStack.Add(daysStack);

            // Add day names
            _drawMonthDayNames = new ViewDrawMonthDayNames(_calendar, _months);
            _drawWeekCorner    = new ViewLayoutWeekCorner(_calendar, _months, _calendar.StateNormal.Header.Border);
            namesStack.Add(_drawWeekCorner);
            namesStack.Add(_drawMonthDayNames);
            Add(namesStack);
            Add(weeksStack);

            // Add border between week numbers and days area
            _borderEdgeRedirect = new PaletteBorderEdgeRedirect(_calendar.StateNormal.Header.Border, null);
            _borderEdge         = new PaletteBorderEdge(_borderEdgeRedirect, null);
            _drawBorderEdge     = new ViewDrawBorderEdge(_borderEdge, Orientation.Vertical);
            _drawWeekNumbers    = new ViewDrawWeekNumbers(_calendar, _months);
            ViewLayoutDocker borderLeftDock = new ViewLayoutDocker();

            borderLeftDock.Add(_drawWeekNumbers, ViewDockStyle.Left);
            borderLeftDock.Add(new ViewLayoutSeparator(0, 4), ViewDockStyle.Top);
            borderLeftDock.Add(_drawBorderEdge, ViewDockStyle.Fill);
            borderLeftDock.Add(new ViewLayoutSeparator(0, 4), ViewDockStyle.Bottom);
            _numberStack.Add(borderLeftDock);

            // Add border between day names and individual days
            PaletteBorderEdgeRedirect borderEdgeRedirect = new PaletteBorderEdgeRedirect(_calendar.StateNormal.Header.Border, null);
            PaletteBorderEdge         borderEdge         = new PaletteBorderEdge(borderEdgeRedirect, null);
            ViewDrawBorderEdge        drawBorderEdge     = new ViewDrawBorderEdge(borderEdge, Orientation.Horizontal);
            ViewLayoutDocker          borderTopDock      = new ViewLayoutDocker();

            borderTopDock.Add(new ViewLayoutSeparator(4, 1), ViewDockStyle.Left);
            borderTopDock.Add(drawBorderEdge, ViewDockStyle.Fill);
            borderTopDock.Add(new ViewLayoutSeparator(4, 1), ViewDockStyle.Right);
            borderTopDock.Add(new ViewLayoutSeparator(1, 3), ViewDockStyle.Bottom);
            daysStack.Add(borderTopDock);

            // Add the actual individual days
            _drawMonthDays = new ViewDrawMonthDays(_calendar, _months);
            daysStack.Add(_drawMonthDays);

            // Adding buttons manually means we have to ask for buttons to be created
            _buttonManager.RecreateButtons();
        }
Пример #13
0
        private void CreateHeaderGroupView(ViewBase filler)
        {
            // Create the top level group view
            _viewGroup = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.Back,
                                            Navigator.StateNormal.HeaderGroup.Border,
                                            Navigator.StateNormal.HeaderGroup,
                                            PaletteMetricBool.HeaderGroupOverlay);

            // Create the two headers and header content
            _viewContentPrimary = new ViewDrawContent(Navigator.StateNormal.HeaderGroup.HeaderPrimary.Content,
                                                      GetPrimaryValues(),
                                                      VisualOrientation.Top);

            _viewHeadingPrimary = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderPrimary.Back,
                                                     Navigator.StateNormal.HeaderGroup.HeaderPrimary.Border,
                                                     Navigator.StateNormal.HeaderGroup.HeaderPrimary,
                                                     PaletteMetricBool.None,
                                                     PaletteMetricPadding.HeaderGroupPaddingPrimary,
                                                     VisualOrientation.Top);

            _viewContentSecondary = new ViewDrawContent(Navigator.StateNormal.HeaderGroup.HeaderSecondary.Content,
                                                        GetSecondaryValues(),
                                                        VisualOrientation.Top);

            _viewHeadingSecondary = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderSecondary.Back,
                                                       Navigator.StateNormal.HeaderGroup.HeaderSecondary.Border,
                                                       Navigator.StateNormal.HeaderGroup.HeaderSecondary,
                                                       PaletteMetricBool.None,
                                                       PaletteMetricPadding.HeaderGroupPaddingSecondary,
                                                       VisualOrientation.Top);

            // Place the the content as fillers in the headers
            _viewHeadingPrimary.Add(_viewContentPrimary, ViewDockStyle.Fill);
            _viewHeadingSecondary.Add(_viewContentSecondary, ViewDockStyle.Fill);

            // Place the headers and page holding area into the group
            _viewGroup.Add(_viewHeadingSecondary, ViewDockStyle.Bottom);
            _viewGroup.Add(_viewHeadingPrimary, ViewDockStyle.Top);
            _viewGroup.Add(filler, ViewDockStyle.Fill);

            // Prevent adjacent headers from having two borders
            _viewGroup.RemoveChildBorders = true;

            // Set initial visible state of headers
            _viewHeadingPrimary.Visible = Navigator.Header.HeaderVisiblePrimary;
            _viewHeadingSecondary.Visible = GetHeaderSecondaryVisible();
        }
Пример #14
0
        /// <summary>
        /// Initialize a new instance of the KryptonMonthCalendar class.
        /// </summary>
        public KryptonMonthCalendar()
        {
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            // Create the palette storage
            _stateCommon = new PaletteMonthCalendarRedirect(Redirector, NeedPaintDelegate);
            _stateFocus = new PaletteMonthCalendarStateRedirect(Redirector, NeedPaintDelegate);
            _stateBolded = new PaletteMonthCalendarStateRedirect(Redirector, NeedPaintDelegate);
            _stateToday = new PaletteMonthCalendarStateRedirect(Redirector, NeedPaintDelegate);

            // Basic state storage
            _stateDisabled = new PaletteMonthCalendarDoubleState(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteMonthCalendarDoubleState(_stateCommon, NeedPaintDelegate);
            _stateTracking = new PaletteMonthCalendarState(_stateCommon, NeedPaintDelegate);
            _statePressed = new PaletteMonthCalendarState(_stateCommon, NeedPaintDelegate);
            _stateCheckedNormal = new PaletteMonthCalendarState(_stateCommon, NeedPaintDelegate);
            _stateCheckedTracking = new PaletteMonthCalendarState(_stateCommon, NeedPaintDelegate);
            _stateCheckedPressed = new PaletteMonthCalendarState(_stateCommon, NeedPaintDelegate);

            // Bold overrides
            _boldedDisabled = new PaletteTripleOverride(_stateBolded.Day, _stateDisabled.Day, PaletteState.BoldedOverride);
            _boldedNormal = new PaletteTripleOverride(_stateBolded.Day, _stateNormal.Day, PaletteState.BoldedOverride);
            _boldedTracking = new PaletteTripleOverride(_stateBolded.Day, _stateTracking.Day, PaletteState.BoldedOverride);
            _boldedPressed = new PaletteTripleOverride(_stateBolded.Day, _statePressed.Day, PaletteState.BoldedOverride);
            _boldedCheckedNormal = new PaletteTripleOverride(_stateBolded.Day, _stateCheckedNormal.Day, PaletteState.BoldedOverride);
            _boldedCheckedTracking = new PaletteTripleOverride(_stateBolded.Day, _stateCheckedTracking.Day, PaletteState.BoldedOverride);
            _boldedCheckedPressed = new PaletteTripleOverride(_stateBolded.Day, _stateCheckedPressed.Day, PaletteState.BoldedOverride);

            // Today overrides
            _todayDisabled = new PaletteTripleOverride(_stateToday.Day, _boldedDisabled, PaletteState.TodayOverride);
            _todayNormal = new PaletteTripleOverride(_stateToday.Day, _boldedNormal, PaletteState.TodayOverride);
            _todayTracking = new PaletteTripleOverride(_stateToday.Day, _boldedTracking, PaletteState.TodayOverride);
            _todayPressed = new PaletteTripleOverride(_stateToday.Day, _boldedPressed, PaletteState.TodayOverride);
            _todayCheckedNormal = new PaletteTripleOverride(_stateToday.Day, _boldedCheckedNormal, PaletteState.TodayOverride);
            _todayCheckedTracking = new PaletteTripleOverride(_stateToday.Day, _boldedCheckedTracking, PaletteState.TodayOverride);
            _todayCheckedPressed = new PaletteTripleOverride(_stateToday.Day, _boldedCheckedPressed, PaletteState.TodayOverride);

            // Focus overrides added to bold overrides
            _overrideDisabled = new PaletteTripleOverride(_stateFocus.Day, _todayDisabled, PaletteState.FocusOverride);
            _overrideNormal = new PaletteTripleOverride(_stateFocus.Day, _todayNormal, PaletteState.FocusOverride);
            _overrideTracking = new PaletteTripleOverride(_stateFocus.Day, _todayTracking, PaletteState.FocusOverride);
            _overridePressed = new PaletteTripleOverride(_stateFocus.Day, _todayPressed, PaletteState.FocusOverride);
            _overrideCheckedNormal = new PaletteTripleOverride(_stateFocus.Day, _todayCheckedNormal, PaletteState.FocusOverride);
            _overrideCheckedTracking = new PaletteTripleOverride(_stateFocus.Day, _todayCheckedTracking, PaletteState.FocusOverride);
            _overrideCheckedPressed = new PaletteTripleOverride(_stateFocus.Day, _todayCheckedPressed, PaletteState.FocusOverride);

            // Create view that is used by standalone control as well as this context menu element
            _drawMonths = new ViewLayoutMonths(null, null, null, this, Redirector, NeedPaintDelegate);

            // Place the months layout view inside a standard docker which provides the control border
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border, null);
            _drawDocker.Add(_drawMonths, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Set default property values
            _dimensions = new Size(1, 1);
            _firstDayOfWeek = Day.Default;
            _headerStyle = HeaderStyle.Calendar;
            _dayStyle = ButtonStyle.CalendarDay;
            _dayOfWeekStyle = ButtonStyle.CalendarDay;
            _selectionStart = DateTime.Now.Date;
            _selectionEnd = _selectionStart;
            _todayDate = _selectionStart;
            _minDate = DateTimePicker.MinimumDateTime;
            _maxDate = DateTimePicker.MaximumDateTime;
            _maxSelectionCount = 7;
            _annualDays = new int[12];
            _annualDates = new DateTimeList();
            _monthlyDates = new DateTimeList();
            _dates = new DateTimeList();
            _scrollChange = 0;
            _todayFormat = "d";
        }
Пример #15
0
        /// <summary>
        /// Initialize a new instance of the VisualPopupTooltip class.
        /// </summary>
        /// <param name="redirector">Redirector for recovering palette values.</param>
        /// <param name="contentValues">Source of content values.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="backStyle">Style for the tooltip background.</param>
        /// <param name="borderStyle">Style for the tooltip border.</param>
        /// <param name="contentStyle">Style for the tooltip content.</param>
        public VisualPopupToolTip(PaletteRedirect redirector,
                                  IContentValues contentValues,
                                  IRenderer renderer,
                                  PaletteBackStyle backStyle,
                                  PaletteBorderStyle borderStyle,
                                  PaletteContentStyle contentStyle)
            : base(renderer, true)
        {
            Debug.Assert(contentValues != null);

            // Remember references needed later
            _contentValues = contentValues;

            // Create the triple redirector needed by view elements
            _palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker = new ViewDrawDocker(_palette.Back, _palette.Border, null);
            _drawContent = new ViewDrawContent(_palette.Content, _contentValues, VisualOrientation.Top);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);
        }
Пример #16
0
        public KryptonListBox()
        {
            // Contains another control and needs marking as such for validation to work
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select this control, only the child ListBox and does not generate a click event
            SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);

            // Default fields
            _alwaysActive = true;
            _lastSelectedIndex = -1;
            _style = ButtonStyle.ListItem;
            base.Padding = new Padding(1);

            // Create the palette storage
            _stateCommon = new PaletteListStateRedirect(Redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, NeedPaintDelegate);
            _stateFocus = new PaletteListItemTripleRedirect(Redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaintDelegate);
            _stateDisabled = new PaletteListState(_stateCommon, NeedPaintDelegate);
            _stateActive = new PaletteDouble(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteListState(_stateCommon, NeedPaintDelegate);
            _stateTracking = new PaletteListItemTriple(_stateCommon.Item, NeedPaintDelegate);
            _statePressed = new PaletteListItemTriple(_stateCommon.Item, NeedPaintDelegate);
            _stateCheckedNormal = new PaletteListItemTriple(_stateCommon.Item, NeedPaintDelegate);
            _stateCheckedTracking = new PaletteListItemTriple(_stateCommon.Item, NeedPaintDelegate);
            _stateCheckedPressed = new PaletteListItemTriple(_stateCommon.Item, NeedPaintDelegate);

            // Create the override handling classes
            _overrideNormal = new PaletteTripleOverride(_stateFocus.Item, _stateNormal.Item, PaletteState.FocusOverride);
            _overrideTracking = new PaletteTripleOverride(_stateFocus.Item, _stateTracking.Item, PaletteState.FocusOverride);
            _overridePressed = new PaletteTripleOverride(_stateFocus.Item, _statePressed.Item, PaletteState.FocusOverride);
            _overrideCheckedNormal = new PaletteTripleOverride(_stateFocus.Item, _stateCheckedNormal.Item, PaletteState.FocusOverride);
            _overrideCheckedTracking = new PaletteTripleOverride(_stateFocus.Item, _stateCheckedTracking.Item, PaletteState.FocusOverride);
            _overrideCheckedPressed = new PaletteTripleOverride(_stateFocus.Item, _stateCheckedPressed.Item, PaletteState.FocusOverride);

            // Create the draw element for owner drawing individual items
            _contentValues = new FixedContentValue();
            _drawButton = new ViewDrawButton(StateDisabled.Item, _overrideNormal,
                                             _overrideTracking, _overridePressed,
                                             _overrideCheckedNormal, _overrideCheckedTracking,
                                             _overrideCheckedPressed,
                                             new PaletteMetricRedirect(Redirector),
                                             _contentValues, VisualOrientation.Top, false);

            // Create the internal list box used for containing content
            _listBox = new InternalListBox(this);
            _listBox.DrawItem += new DrawItemEventHandler(OnListBoxDrawItem);
            _listBox.MeasureItem += new MeasureItemEventHandler(OnListBoxMeasureItem);
            _listBox.TrackMouseEnter += new EventHandler(OnListBoxMouseChange);
            _listBox.TrackMouseLeave += new EventHandler(OnListBoxMouseChange);
            _listBox.DataSourceChanged += new EventHandler(OnListBoxDataSourceChanged);
            _listBox.DisplayMemberChanged += new EventHandler(OnListBoxDisplayMemberChanged);
            _listBox.ValueMemberChanged += new EventHandler(OnListBoxValueMemberChanged);
            _listBox.SelectedIndexChanged += new EventHandler(OnListBoxSelectedIndexChanged);
            _listBox.SelectedValueChanged += new EventHandler(OnListBoxSelectedValueChanged);
            _listBox.DisplayMemberChanged += new EventHandler(OnListBoxDisplayMemberChanged);
            _listBox.Format += new ListControlConvertEventHandler(OnListBoxFormat);
            _listBox.FormatInfoChanged += new EventHandler(OnListBoxFormatInfoChanged);
            _listBox.FormatStringChanged += new EventHandler(OnListBoxFormatStringChanged);
            _listBox.FormattingEnabledChanged += new EventHandler(OnListBoxFormattingEnabledChanged);
            _listBox.GotFocus += new EventHandler(OnListBoxGotFocus);
            _listBox.LostFocus += new EventHandler(OnListBoxLostFocus);
            _listBox.KeyDown += new KeyEventHandler(OnListBoxKeyDown);
            _listBox.KeyUp += new KeyEventHandler(OnListBoxKeyUp);
            _listBox.KeyPress += new KeyPressEventHandler(OnListBoxKeyPress);
            _listBox.PreviewKeyDown += new PreviewKeyDownEventHandler(OnListBoxPreviewKeyDown);
            _listBox.Validating += new CancelEventHandler(OnListBoxValidating);
            _listBox.Validated += new EventHandler(OnListBoxValidated);

            // Create the element that fills the remainder space and remembers fill rectange
            _layoutFill = new ViewLayoutFill(_listBox);
            _layoutFill.DisplayPadding = new Padding(1);

            // Create inner view for placing inside the drawing docker
            _drawDockerInner = new ViewLayoutDocker();
            _drawDockerInner.Add(_layoutFill, ViewDockStyle.Fill);

            // Create view for the control border and background
            _drawDockerOuter = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDockerOuter.Add(_drawDockerInner, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDockerOuter);

            // We need to create and cache a device context compatible with the display
            _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);

            // Add list box to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_listBox);
        }
Пример #17
0
        public KryptonTreeView()
        {
            // Contains another control and needs marking as such for validation to work
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select this control, only the child tree view and does not generate a click event
            SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);

            // Default fields
            _alwaysActive = true;
            _style = ButtonStyle.ListItem;
            _itemHeightDefault = true;
            _plusMinusImages = new TreeViewImages();
            _checkBoxImages = new CheckBoxImages();
            base.Padding = new Padding(1);

            // Create the palette storage
            _redirectImages = new PaletteRedirectTreeView(Redirector, _plusMinusImages, _checkBoxImages);
            PaletteBackInheritRedirect backInherit = new PaletteBackInheritRedirect(Redirector, PaletteBackStyle.InputControlStandalone);
            PaletteBorderInheritRedirect borderInherit = new PaletteBorderInheritRedirect(Redirector, PaletteBorderStyle.InputControlStandalone);
            PaletteBackColor1 commonBack = new PaletteBackColor1(backInherit, NeedPaintDelegate);
            PaletteBorder commonBorder = new PaletteBorder(borderInherit, NeedPaintDelegate);
            _stateCommon = new PaletteTreeStateRedirect(Redirector, commonBack, backInherit, commonBorder, borderInherit, NeedPaintDelegate);

            PaletteBackColor1 disabledBack = new PaletteBackColor1(_stateCommon.PaletteBack, NeedPaintDelegate);
            PaletteBorder disabledBorder = new PaletteBorder(_stateCommon.PaletteBorder, NeedPaintDelegate);
            _stateDisabled = new PaletteTreeState(_stateCommon, disabledBack, disabledBorder, NeedPaintDelegate);

            PaletteBackColor1 normalBack = new PaletteBackColor1(_stateCommon.PaletteBack, NeedPaintDelegate);
            PaletteBorder normalBorder = new PaletteBorder(_stateCommon.PaletteBorder, NeedPaintDelegate);
            _stateNormal = new PaletteTreeState(_stateCommon, normalBack, normalBorder, NeedPaintDelegate);

            PaletteBackColor1 activeBack = new PaletteBackColor1(_stateCommon.PaletteBack, NeedPaintDelegate);
            PaletteBorder activeBorder = new PaletteBorder(_stateCommon.PaletteBorder, NeedPaintDelegate);
            _stateActive = new PaletteDouble(_stateCommon, activeBack, activeBorder, NeedPaintDelegate);

            _stateFocus = new PaletteTreeNodeTripleRedirect(Redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaintDelegate);
            _stateTracking = new PaletteTreeNodeTriple(_stateCommon.Node, NeedPaintDelegate);
            _statePressed = new PaletteTreeNodeTriple(_stateCommon.Node, NeedPaintDelegate);
            _stateCheckedNormal = new PaletteTreeNodeTriple(_stateCommon.Node, NeedPaintDelegate);
            _stateCheckedTracking = new PaletteTreeNodeTriple(_stateCommon.Node, NeedPaintDelegate);
            _stateCheckedPressed = new PaletteTreeNodeTriple(_stateCommon.Node, NeedPaintDelegate);

            // Create the override handling classes
            _overrideNormal = new PaletteTripleOverride(_stateFocus.Node, _stateNormal.Node, PaletteState.FocusOverride);
            _overrideTracking = new PaletteTripleOverride(_stateFocus.Node, _stateTracking.Node, PaletteState.FocusOverride);
            _overridePressed = new PaletteTripleOverride(_stateFocus.Node, _statePressed.Node, PaletteState.FocusOverride);
            _overrideCheckedNormal = new PaletteTripleOverride(_stateFocus.Node, _stateCheckedNormal.Node, PaletteState.FocusOverride);
            _overrideCheckedTracking = new PaletteTripleOverride(_stateFocus.Node, _stateCheckedTracking.Node, PaletteState.FocusOverride);
            _overrideCheckedPressed = new PaletteTripleOverride(_stateFocus.Node, _stateCheckedPressed.Node, PaletteState.FocusOverride);
            _overrideNormalNode = new PaletteNodeOverride(_overrideNormal);

            // Create the check box image drawer and place inside element so it is always centered
            _drawCheckBox = new ViewDrawCheckBox(_redirectImages);
            _layoutCheckBox = new ViewLayoutCenter();
            _layoutCheckBox.Add(_drawCheckBox);

            // Stack used to layout the location of the node image
            _layoutImage = new ViewLayoutSeparator(0, 0);
            _layoutImageAfter = new ViewLayoutSeparator(3, 0);
            _layoutImageCenter = new ViewLayoutCenter(_layoutImage);
            _layoutImageStack = new ViewLayoutStack(true);
            _layoutImageStack.Add(_layoutImageCenter);
            _layoutImageStack.Add(_layoutImageAfter);
            _layoutImageState = new ViewLayoutSeparator(16, 16);
            _layoutImageCenterState = new ViewLayoutCenter(_layoutImageState);

            // Create the draw element for owner drawing individual items
            _contentValues = new FixedContentValue();
            _drawButton = new ViewDrawButton(StateDisabled.Node, _overrideNormalNode,
                                             _overrideTracking, _overridePressed,
                                             _overrideCheckedNormal, _overrideCheckedTracking,
                                             _overrideCheckedPressed,
                                             new PaletteMetricRedirect(Redirector),
                                             _contentValues, VisualOrientation.Top, false);

            // Place check box on the left and the label in the remainder
            _layoutDocker = new ViewLayoutDocker();
            _layoutDocker.Add(_layoutImageStack, ViewDockStyle.Left);
            _layoutDocker.Add(_layoutImageCenterState, ViewDockStyle.Left);
            _layoutDocker.Add(_layoutCheckBox, ViewDockStyle.Left);
            _layoutDocker.Add(_drawButton, ViewDockStyle.Fill);

            // Create the internal tree view used for containing content
            _treeView = new InternalTreeView(this);
            _treeView.TrackMouseEnter += new EventHandler(OnTreeViewMouseChange);
            _treeView.TrackMouseLeave += new EventHandler(OnTreeViewMouseChange);
            _treeView.GotFocus += new EventHandler(OnTreeViewGotFocus);
            _treeView.LostFocus += new EventHandler(OnTreeViewLostFocus);
            _treeView.KeyDown += new KeyEventHandler(OnTreeViewKeyDown);
            _treeView.KeyUp += new KeyEventHandler(OnTreeViewKeyUp);
            _treeView.KeyPress += new KeyPressEventHandler(OnTreeViewKeyPress);
            _treeView.PreviewKeyDown += new PreviewKeyDownEventHandler(OnTreeViewPreviewKeyDown);
            _treeView.Validating += new CancelEventHandler(OnTreeViewValidating);
            _treeView.Validated += new EventHandler(OnTreeViewValidated);
            _treeView.AfterCheck += new TreeViewEventHandler(OnTreeViewAfterCheck);
            _treeView.AfterCollapse += new TreeViewEventHandler(OnTreeViewAfterCollapse);
            _treeView.AfterExpand += new TreeViewEventHandler(OnTreeViewAfterExpand);
            _treeView.AfterLabelEdit += new NodeLabelEditEventHandler(OnTreeViewAfterLabelEdit);
            _treeView.AfterSelect += new TreeViewEventHandler(OnTreeViewAfterSelect);
            _treeView.BeforeCheck += new TreeViewCancelEventHandler(OnTreeViewBeforeCheck);
            _treeView.BeforeCollapse += new TreeViewCancelEventHandler(OnTreeViewBeforeCollapse);
            _treeView.BeforeExpand += new TreeViewCancelEventHandler(OnTreeViewBeforeExpand);
            _treeView.BeforeLabelEdit += new NodeLabelEditEventHandler(OnTreeViewBeforeLabelEdit);
            _treeView.BeforeSelect += new TreeViewCancelEventHandler(OnTreeViewBeforeSelect);
            _treeView.ItemDrag += new ItemDragEventHandler(OnTreeViewItemDrag);
            _treeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(OnTreeViewNodeMouseClick);
            _treeView.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(OnTreeViewNodeMouseDoubleClick);
            _treeView.NodeMouseHover += new TreeNodeMouseHoverEventHandler(OnTreeViewNodeMouseHover);
            _treeView.DrawNode += new DrawTreeNodeEventHandler(OnTreeViewDrawNode);
            _treeView.DrawMode = TreeViewDrawMode.OwnerDrawAll;

            // Create the element that fills the remainder space and remembers fill rectange
            _layoutFill = new ViewLayoutFill(_treeView);
            _layoutFill.DisplayPadding = new Padding(1);

            // Create inner view for placing inside the drawing docker
            _drawDockerInner = new ViewLayoutDocker();
            _drawDockerInner.Add(_layoutFill, ViewDockStyle.Fill);

            // Create view for the control border and background
            _drawDockerOuter = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDockerOuter.Add(_drawDockerInner, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDockerOuter);

            // We need to create and cache a device context compatible with the display
            _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);

            // Add tree view to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_treeView);
        }
Пример #18
0
        private void Construct(KryptonContextMenuCollection items,
                               bool keyboardActivated)
        {
            // Ask the top level collection to generate the child view elements
            items.GenerateView(_provider, this, _viewColumns, true, true);

            // Create the control panel canvas
            ViewDrawCanvas mainBackground = new ViewDrawCanvas(_provider.ProviderStateCommon.ControlInner.Back, _provider.ProviderStateCommon.ControlInner.Border, VisualOrientation.Top);
            mainBackground.Add(_viewColumns);

            ViewLayoutDocker layoutDocker = new ViewLayoutDocker();
            Padding outerPadding = _provider.ProviderRedirector.GetMetricPadding(PaletteState.Normal, PaletteMetricPadding.ContextMenuItemOuter);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Top), ViewDockStyle.Top);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Bottom), ViewDockStyle.Bottom);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Left), ViewDockStyle.Left);
            layoutDocker.Add(new ViewLayoutSeparator(outerPadding.Right), ViewDockStyle.Right);
            layoutDocker.Add(mainBackground, ViewDockStyle.Fill);

            // Create the docking element that gives us a border and background
            _drawDocker = new ViewDrawDocker(_provider.ProviderStateCommon.ControlOuter.Back, _provider.ProviderStateCommon.ControlOuter.Border, null);
            _drawDocker.Add(layoutDocker, ViewDockStyle.Fill);
            _drawDocker.KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager);
            ViewManager.Root = _drawDocker;

            // With keyboard activate we select the first valid item
            if (keyboardActivated)
                ((ViewContextMenuManager)ViewManager).KeyDown();
        }
        /// <summary>
        /// Create the mode specific view hierarchy.
        /// </summary>
        /// <returns>View element to use as base of hierarchy.</returns>
        protected override ViewBase CreateStackCheckButtonView()
        {
            // Let base class do common stuff first
            base.CreateStackCheckButtonView();

            // Add the layout docker inside the border of the group
            _viewLayout = new ViewLayoutDocker();

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

            // Create the scrolling viewport and pass in the _viewLayout as the content to scroll
            _viewScrollViewport = new ViewLayoutScrollViewport(Navigator, _viewLayout, buttonEdgePalette, null,
                                                               PaletteMetricPadding.None, PaletteMetricInt.None,
                                                               VisualOrientation.Top, RelativePositionAlign.Near,
                                                               Navigator.Stack.StackAnimation,
                                                               (Navigator.Stack.StackOrientation == Orientation.Vertical),
                                                               NeedPaintDelegate);

            // Reparent the child panel that contains the actual pages, into the child control
            _viewScrollViewport.MakeParent(Navigator.ChildPanel);

            // Create the top level group view
            _viewGroup = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.Back,
                                            Navigator.StateNormal.HeaderGroup.Border);

            // Fill the group with the scrolling viewport
            _viewGroup.Add(_viewScrollViewport, ViewDockStyle.Fill);

            // Put the old root as the filler inside the group
            _viewLayout.Add(_oldRoot, ViewDockStyle.Fill);

            // Define the top level view to become the new root
            return _viewGroup;
        }
Пример #20
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMonths class.
        /// </summary>
        /// <param name="provider">Provider of context menu information.</param>
        /// <param name="monthCalendar">Reference to owning month calendar entry.</param>
        /// <param name="viewManager">Owning view manager instance.</param>
        /// <param name="calendar">Reference to calendar provider.</param>
        /// <param name="redirector">Redirector for getting values.</param>
        /// <param name="needPaintDelegate">Delegate for requesting paint changes.</param>
        public ViewLayoutMonths(IContextMenuProvider provider,
                                KryptonContextMenuMonthCalendar monthCalendar,
                                ViewContextMenuManager viewManager,
                                IKryptonMonthCalendar calendar,
                                PaletteRedirect redirector,
                                NeedPaintHandler needPaintDelegate)
        {
            _provider = provider;
            _calendar = calendar;
            _oldSelectionStart = _calendar.SelectionStart;
            _oldSelectionEnd = _calendar.SelectionEnd;
            _displayMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            _redirector = redirector;
            _needPaintDelegate = needPaintDelegate;
            _showToday = true;
            _showTodayCircle = true;
            _closeOnTodayClick = false;
            _firstTimeSync = true;
            _allowButtonSpecToolTips = false;

            // Use a controller that can work against all the displayed months
            MonthCalendarController controller = new MonthCalendarController(monthCalendar, viewManager, this, _needPaintDelegate);
            MouseController = controller;
            SourceController = controller;
            KeyController = controller;

            _borderForced = new PaletteBorderInheritForced(_calendar.StateNormal.Header.Border);
            _borderForced.ForceBorderEdges(PaletteDrawBorders.None);
            _drawHeader = new ViewDrawDocker(_calendar.StateNormal.Header.Back, _borderForced, null);
            _emptyContent = new ViewDrawEmptyContent(_calendar.StateDisabled.Header.Content, _calendar.StateNormal.Header.Content);
            _drawHeader.Add(_emptyContent, ViewDockStyle.Fill);
            Add(_drawHeader);

            // Using a button spec manager to add the buttons to the header
            _buttonSpecs = new MonthCalendarButtonSpecCollection(this);
            _buttonManager = new ButtonSpecManagerDraw(_calendar.CalendarControl, redirector, _buttonSpecs, null,
                                                       new ViewDrawDocker[] { _drawHeader },
                                                       new IPaletteMetric[] { _calendar.StateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetCalendar },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                       _calendar.GetToolStripDelegate, _needPaintDelegate);

            // Create the manager for handling tooltips
            _toolTipManager = new ToolTipManager();
            _toolTipManager.ShowToolTip += new EventHandler<ToolTipEventArgs>(OnShowToolTip);
            _toolTipManager.CancelToolTip += new EventHandler(OnCancelToolTip);
            _buttonManager.ToolTipManager = _toolTipManager;

            // Create the bottom header used for showing 'today' and defined button specs
            _remapPalette = (ButtonSpecRemapByContentView)_buttonManager.CreateButtonSpecRemap(redirector, new ButtonSpecAny());
            _remapPalette.Foreground = _emptyContent;

            // Use a redirector to get button values directly from palette
            _palette = new PaletteTripleRedirect(_remapPalette,
                                                 PaletteBackStyle.ButtonButtonSpec,
                                                 PaletteBorderStyle.ButtonButtonSpec,
                                                 PaletteContentStyle.ButtonButtonSpec,
                                                 _needPaintDelegate);

            _drawToday = new ViewDrawToday(_calendar, _palette, _palette, _palette, _palette, _needPaintDelegate);
            _drawToday.Click += new EventHandler(OnTodayClick);
            _drawHeader.Add(_drawToday, ViewDockStyle.Left);
        }
Пример #21
0
        /// <summary>
        /// Initialize a new instance of the KryptonSeparator class.
        /// </summary>
        public KryptonSeparator()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Create the palette storage
            _stateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                             PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorHighProfile,
                                                             PaletteBorderStyle.SeparatorHighProfile, NeedPaintDelegate);

            // Never draw the border around the background
            _stateCommon.BorderRedirect.OverrideBorderToFalse = true;

            _stateDisabled = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateNormal = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateTracking = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _statePressed = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(_stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                   _stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                    PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            // Get the separator to fill the entire client area
            _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border);
            _drawDocker.IgnoreAllBorderAndPadding = true;
            _drawDocker.Add(_drawSeparator, ViewDockStyle.Fill);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController = _separatorController;
            _drawSeparator.KeyController = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Use timer to redraw after windows messages are processed
            _redrawTimer = new Timer();
            _redrawTimer.Interval = 1;
            _redrawTimer.Tick += new EventHandler(OnRedrawTick);

            // Set other internal starting values
            _style = SeparatorStyle.HighProfile;
            _orientation = Orientation.Vertical;
            _allowMove = true;
            _splitterIncrements = 1;
            _splitterWidth = 5;
        }
        /// <summary>
        /// Create the view hierarchy for this view mode.
        /// </summary>
        protected override void CreateCheckItemView()
        {
            // Create the two headers and header content
            _viewContentPrimary = new ViewDrawContent(Navigator.StateNormal.HeaderGroup.HeaderPrimary.Content,
                                                      Navigator.Header.HeaderValuesPrimary,
                                                      VisualOrientation.Top);

            _viewHeadingPrimary = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderPrimary.Back,
                                                     Navigator.StateNormal.HeaderGroup.HeaderPrimary.Border,
                                                     Navigator.StateNormal.HeaderGroup.HeaderPrimary,
                                                     PaletteMetricBool.None,
                                                     PaletteMetricPadding.HeaderGroupPaddingPrimary,
                                                     VisualOrientation.Top);

            _viewContentSecondary = new ViewDrawContent(Navigator.StateNormal.HeaderGroup.HeaderSecondary.Content,
                                                        Navigator.Header.HeaderValuesSecondary,
                                                        VisualOrientation.Top);

            _viewHeadingSecondary = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderSecondary.Back,
                                                       Navigator.StateNormal.HeaderGroup.HeaderSecondary.Border,
                                                       Navigator.StateNormal.HeaderGroup.HeaderSecondary,
                                                       PaletteMetricBool.None,
                                                       PaletteMetricPadding.HeaderGroupPaddingSecondary,
                                                       VisualOrientation.Top);

            // Place the the content as fillers in the headers
            _viewHeadingPrimary.Add(_viewContentPrimary, ViewDockStyle.Fill);
            _viewHeadingSecondary.Add(_viewContentSecondary, ViewDockStyle.Fill);

            // Create a canvas for containing the selected page and put old root inside it
            _drawGroup = new ViewDrawCanvas(Navigator.StateNormal.HeaderGroup.Back,
                                            Navigator.StateNormal.HeaderGroup.Border,
                                            VisualOrientation.Top);

            _drawGroup.ApplyIncludeBorderEdge = true;
            _drawGroup.Add(_oldRoot);

            // Create the view element that lays out the check/tab buttons
            ViewLayoutBarForTabs layoutBar = new ViewLayoutBarForTabs(Navigator.Bar.ItemSizing,
                                                                      Navigator.Bar.ItemAlignment,
                                                                      Navigator.Bar.BarMultiline,
                                                                      Navigator.Bar.ItemMinimumSize,
                                                                      Navigator.Bar.ItemMaximumSize,
                                                                      Navigator.Bar.BarMinimumHeight,
                                                                      Navigator.Bar.TabBorderStyle,
                                                                      true);
            _layoutBar = layoutBar;

            // Create the scroll spacer that restricts display
            _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
                                                        PaletteMetricPadding.BarPaddingTabs,
                                                        PaletteMetricInt.CheckButtonGap,
                                                        Navigator.Bar.BarOrientation,
                                                        Navigator.Bar.ItemAlignment,
                                                        Navigator.Bar.BarAnimation);
            _layoutBarViewport.Add(_layoutBar);

            // Create the button bar area docker
            _layoutBarDocker = new ViewLayoutDocker();
            _layoutBarDocker.Add(_layoutBarViewport, ViewDockStyle.Fill);

            // Add a separators for insetting items
            _layoutBarSeparatorFirst = new ViewLayoutSeparator(0);
            _layoutBarSeparatorLast = new ViewLayoutSeparator(0);
            _layoutBarDocker.Add(_layoutBarSeparatorFirst, ViewDockStyle.Left);
            _layoutBarDocker.Add(_layoutBarSeparatorLast, ViewDockStyle.Right);

            // Create the layout that insets the contents to allow for rounding of the group border
            _layoutOverlap = new ViewLayoutInsetOverlap(_drawGroup);
            _layoutOverlap.Add(_layoutBarDocker);

            // Create the docker used to layout contents of main panel and fill with group
            _layoutPanelDocker = new ViewLayoutDockerOverlap(_drawGroup, _layoutOverlap, layoutBar);
            _layoutPanelDocker.Add(_layoutOverlap, ViewDockStyle.Top);
            _layoutPanelDocker.Add(_drawGroup, ViewDockStyle.Fill);

            // Place the headers and page holding area into the group
            _topGroup = new ViewLayoutDocker();
            _topGroup.Add(_viewHeadingSecondary, ViewDockStyle.Bottom);
            _topGroup.Add(_viewHeadingPrimary, ViewDockStyle.Top);
            _topGroup.Add(_layoutPanelDocker, ViewDockStyle.Fill);

            // Prevent adjacent headers from having two borders
            _topGroup.RemoveChildBorders = true;

            // Create the top level panel and put a layout docker inside it
            _drawPanel = new ViewDrawPanel(Navigator.StateNormal.Back);
            _drawPanel.Add(_topGroup);
            _newRoot = _drawPanel;

            // Set initial visible state of headers
            _viewHeadingPrimary.Visible = Navigator.Header.HeaderVisiblePrimary;
            _viewHeadingSecondary.Visible = Navigator.Header.HeaderVisibleSecondary;

            // Set the correct tab style
            UpdateTabStyle();

            // Must call the base class to perform common actions
            base.CreateCheckItemView();
        }
        /// <summary>
        /// Create the view hierarchy for this view mode.
        /// </summary>
        protected override void CreateCheckItemView()
        {
            // Create the view element that lays out the check buttons
            _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
                                           PaletteMetricInt.CheckButtonGap,
                                           Navigator.Bar.ItemSizing,
                                           Navigator.Bar.ItemAlignment,
                                           Navigator.Bar.BarMultiline,
                                           Navigator.Bar.ItemMinimumSize,
                                           Navigator.Bar.ItemMaximumSize,
                                           Navigator.Bar.BarMinimumHeight,
                                           false);

            // Create the scroll spacer that restricts display
            _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
                                                        PaletteMetricPadding.BarPaddingInside,
                                                        PaletteMetricInt.CheckButtonGap,
                                                        Navigator.Header.HeaderPositionBar,
                                                        Navigator.Bar.ItemAlignment,
                                                        Navigator.Bar.BarAnimation);
            _layoutBarViewport.Add(_layoutBar);

            // Create the button bar area docker
            _layoutBarDocker = new ViewLayoutDocker();
            _layoutBarDocker.Add(_layoutBarViewport, ViewDockStyle.Fill);

            // Place the bar inside a header style area
            _viewHeadingBar = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.HeaderBar.Back,
                                                 Navigator.StateNormal.HeaderGroup.HeaderBar.Border,
                                                 Navigator.StateNormal.HeaderGroup.HeaderBar,
                                                 PaletteMetricBool.None,
                                                 PaletteMetricPadding.HeaderGroupPaddingSecondary,
                                                 VisualOrientation.Top);

            _viewHeadingBar.Add(_layoutBarDocker, ViewDockStyle.Fill);

            // Construct the viewlet instance
            _headerGroup = new ViewletHeaderGroup(Navigator, Redirector, NeedPaintDelegate);

            // Create and initialize the standard header group view elements
            _viewGroup = _headerGroup.Construct(_oldRoot);

            // Add the extra bar header alongside the standard primary and secondary headers
            _viewGroup.Insert(0, _viewHeadingBar);
            _viewGroup.SetDock(_viewHeadingBar, ViewDockStyle.Top);

            // Define the new root for the view hieararchy
            _newRoot = _viewGroup;

            // Must call the base class to perform common actions
            base.CreateCheckItemView();
        }
Пример #24
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMonths class.
        /// </summary>
        /// <param name="provider">Provider of context menu information.</param>
        /// <param name="monthCalendar">Reference to owning month calendar entry.</param>
        /// <param name="viewManager">Owning view manager instance.</param>
        /// <param name="calendar">Reference to calendar provider.</param>
        /// <param name="redirector">Redirector for getting values.</param>
        /// <param name="needPaintDelegate">Delegate for requesting paint changes.</param>
        public ViewLayoutMonths(IContextMenuProvider provider,
                                KryptonContextMenuMonthCalendar monthCalendar,
                                ViewContextMenuManager viewManager,
                                IKryptonMonthCalendar calendar,
                                PaletteRedirect redirector,
                                NeedPaintHandler needPaintDelegate)
        {
            Provider                = provider;
            Calendar                = calendar;
            _oldSelectionStart      = Calendar.SelectionStart;
            _oldSelectionEnd        = Calendar.SelectionEnd;
            _displayMonth           = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            _redirector             = redirector;
            _needPaintDelegate      = needPaintDelegate;
            _showToday              = true;
            _showTodayCircle        = true;
            CloseOnTodayClick       = false;
            _firstTimeSync          = true;
            AllowButtonSpecToolTips = false;

            // Use a controller that can work against all the displayed months
            MonthCalendarController controller = new MonthCalendarController(monthCalendar, viewManager, this, _needPaintDelegate);

            MouseController  = controller;
            SourceController = controller;
            KeyController    = controller;

            _borderForced = new PaletteBorderInheritForced(Calendar.StateNormal.Header.Border);
            _borderForced.ForceBorderEdges(PaletteDrawBorders.None);
            _drawHeader   = new ViewDrawDocker(Calendar.StateNormal.Header.Back, _borderForced, null);
            _emptyContent = new ViewDrawEmptyContent(Calendar.StateDisabled.Header.Content, Calendar.StateNormal.Header.Content);
            _drawHeader.Add(_emptyContent, ViewDockStyle.Fill);
            Add(_drawHeader);

            // Using a button spec manager to add the buttons to the header
            ButtonSpecs   = new MonthCalendarButtonSpecCollection(this);
            ButtonManager = new ButtonSpecManagerDraw(Calendar.CalendarControl, redirector, ButtonSpecs, null,
                                                      new ViewDrawDocker[] { _drawHeader },
                                                      new IPaletteMetric[] { Calendar.StateCommon },
                                                      new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetCalendar },
                                                      new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                      Calendar.GetToolStripDelegate, _needPaintDelegate);

            // Create the manager for handling tooltips
            _toolTipManager                = new ToolTipManager();
            _toolTipManager.ShowToolTip   += OnShowToolTip;
            _toolTipManager.CancelToolTip += OnCancelToolTip;
            ButtonManager.ToolTipManager   = _toolTipManager;

            // Create the bottom header used for showing 'today' and defined button specs
            _remapPalette            = (ButtonSpecRemapByContentView)ButtonManager.CreateButtonSpecRemap(redirector, new ButtonSpecAny());
            _remapPalette.Foreground = _emptyContent;

            // Use a redirector to get button values directly from palette
            _palette = new PaletteTripleRedirect(_remapPalette,
                                                 PaletteBackStyle.ButtonButtonSpec,
                                                 PaletteBorderStyle.ButtonButtonSpec,
                                                 PaletteContentStyle.ButtonButtonSpec,
                                                 _needPaintDelegate);

            _drawToday        = new ViewDrawToday(Calendar, _palette, _palette, _palette, _palette, _needPaintDelegate);
            _drawToday.Click += OnTodayClick;
            _drawHeader.Add(_drawToday, ViewDockStyle.Left);
        }
Пример #25
0
        /// <summary>
        /// Initialize a new instance of the KryptonGallery class.
        /// </summary>
        public KryptonGallery()
        {
            // Defaults
            _mouseOver = false;
            _alwaysActive = true;
            _selectedIndex = -1;
            _trackingIndex = -1;
            _eventTrackingIndex = -1;
            _preferredItemSize = new Size(5, 1);
            _dropMaxItemWidth = 128;
            _dropMinItemWidth = 3;

            // Timer used to generate tracking change event
            _trackingEventTimer = new Timer();
            _trackingEventTimer.Interval = 120;
            _trackingEventTimer.Tick += new EventHandler(OnTrackingTick);

            // Create content storage
            _images = new GalleryImages(NeedPaintDelegate);
            _dropButtonRanges = new KryptonGalleryRangeCollection();

            // Create the palette storage
            _stateCommon = new PaletteGalleryRedirect(Redirector, NeedPaintDelegate);
            _stateNormal = new PaletteGalleryState(_stateCommon, NeedPaintDelegate);
            _stateDisabled = new PaletteGalleryState(_stateCommon, NeedPaintDelegate);
            _stateActive = new PaletteGalleryState(_stateCommon, NeedPaintDelegate);

            // Create and organize the buttons
            _buttonUp = new ViewDrawRibbonGalleryButton(Redirector, PaletteRelativeAlign.Near, PaletteRibbonGalleryButton.Up, _images, NeedPaintDelegate);
            _buttonDown = new ViewDrawRibbonGalleryButton(Redirector, PaletteRelativeAlign.Center, PaletteRibbonGalleryButton.Down, _images, NeedPaintDelegate);
            _buttonContext = new ViewDrawRibbonGalleryButton(Redirector, PaletteRelativeAlign.Far, PaletteRibbonGalleryButton.DropDown, _images, NeedPaintDelegate);
            _buttonsLayout = new ViewLayoutRibbonGalleryButtons();
            _buttonsLayout.Add(_buttonUp);
            _buttonsLayout.Add(_buttonDown);
            _buttonsLayout.Add(_buttonContext);

            // The draw layout that contains the actual selection images
            _backBorder = new PaletteGalleryBackBorder(_stateNormal);
            _drawDocker = new ViewDrawDocker(_backBorder, _backBorder);
            _drawItems = new ViewLayoutRibbonGalleryItems(Redirector, this, NeedPaintDelegate, _buttonUp, _buttonDown, _buttonContext);
            _drawDocker.Add(_drawItems, ViewDockStyle.Fill);

            // Top level layout view
            _layoutDocker = new ViewLayoutDocker();
            _layoutDocker.Add(_drawDocker, ViewDockStyle.Fill);
            _layoutDocker.Add(_buttonsLayout, ViewDockStyle.Right);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _layoutDocker);

            // Check the control is licenced
            KryptonGalleryLicence.PerformLicenceChecking(this);

            // Set the default padding value
            base.Padding = new Padding(3);
        }