/// <summary>
        /// Initialize an instance of the TooltipController class.
        /// </summary>
        /// <param name="manager">Reference to manager of all tooltip functionality.</param>
        /// <param name="targetElement">Target element that controller is for.</param>
        /// <param name="targetController">Target controller that we are snooping.</param>
        public ToolTipController(ToolTipManager manager,
                                 ViewBase targetElement,
                                 IMouseController targetController)
        {
            Debug.Assert(manager != null);
            Debug.Assert(targetElement != null);

            // Remember incoming references
            _manager          = manager;
            _targetElement    = targetElement;
            _targetController = targetController;
        }
        /// <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;

            // Create storage objects
            _headerValues              = new HeaderValues(NeedPaintDelegate);
            _headerValues.TextChanged += new EventHandler(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, _headerValues, 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 },
                                                       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;

            // We want to be auto sized by default, but not the property default!
            AutoSize     = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
        /// <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 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);
        }