public OfficeForm() : base() { // This forces the initialization out of paint loop which speeds up how fast components show up BaseRenderer renderer = Rendering.GlobalManager.Renderer; m_BorderWidth = SystemInformation.Border3DSize.Width + NativeFunctions.BorderMultiplierFactor; this.DockPadding.All = 0; m_Caption = new GenericItemContainer(); m_Caption.GlobalItem = false; m_Caption.ContainerControl = this; m_Caption.WrapItems = false; m_Caption.EventHeight = false; m_Caption.UseMoreItemsButton = false; m_Caption.Stretch = true; m_Caption.Displayed = true; m_Caption.SystemContainer = true; m_Caption.PaddingTop = 0; m_Caption.PaddingBottom = 0; m_Caption.PaddingLeft = 2; m_Caption.ItemSpacing = 1; m_Caption.SetOwner(this); m_Caption.Style = eDotNetBarStyle.StyleManagerControlled; m_Caption.ToolbarItemsAlign = eContainerVerticalAlignment.Top; m_SystemIcon = new SystemCaptionItem(); m_SystemIcon.GlobalItem = false; m_SystemIcon.Enabled = false; m_Caption.SubItems.Add(m_SystemIcon); m_SystemIcon.IsSystemIcon = true; m_SystemIcon.Icon = this.Icon; m_TitleLabel = CreateTitleLabel(); m_Caption.SubItems.Add(m_TitleLabel); CreateAdditionalCaptionItems(m_Caption); m_SystemButtons = new SystemCaptionItem(); m_SystemButtons.GlobalItem = false; //m_SystemButtons.ItemAlignment = eItemAlignment.Far; m_SystemButtons.Click += new EventHandler(SystemButtons_Click); m_SystemButtons.MouseEnter += new EventHandler(SystemButtons_MouseEnter); m_Caption.SubItems.Add(m_SystemButtons); }
protected virtual void CreateAdditionalCaptionItems(GenericItemContainer captionContainer) { }
/// <summary> /// Initializes a new instance of the Bar class. /// </summary> public Bar() { if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_ColorScheme = new ColorScheme(); m_ParentItem = null; m_OldContainer = null; m_ClientRect = Rectangle.Empty; m_SideBarRect = Rectangle.Empty; m_SideBarImage = new SideBarImage(); m_ItemContainer = new GenericItemContainer(); m_ItemContainer.GlobalItem = false; m_ItemContainer.ContainerControl = this; m_ItemContainer.WrapItems = true; m_ItemContainer.Stretch = false; m_ItemContainer.Displayed = true; m_ItemContainer.SystemContainer = true; //m_ItemContainer.SetSystemItem(true); //m_OldParent=null; m_InitialContainerWidth = 164; //m_BarState=eBarState.Popup; m_BarState = eBarState.Docked; m_DockOffset = 0; m_DockLine = 0; m_GrabHandleStyle = eGrabHandleStyle.None; m_GrabHandleRect = Rectangle.Empty; m_Owner = null; m_MouseDownPt = Point.Empty; m_MouseDownSize = new Size(0, 0); m_MoveWindow = false; m_FloatingRect = Rectangle.Empty; m_SizeWindow = 0; m_LastDragRect = Rectangle.Empty; m_WrapItemsDock = false; m_WrapItemsFloat = true; m_DockStretch = false; m_MenuBar = false; this.Text = ""; m_Float = null; m_DockingInProgress = false; this.SetStyle(ControlStyles.Selectable, false); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.TabStop = false; base.Font = SystemFonts.MenuFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font; m_CanDockLeft = true; m_CanDockRight = true; m_CanDockTop = true; m_CanDockBottom = true; m_CanUndock = true; Microsoft.Win32.SystemEvents.UserPreferenceChanged += new Microsoft.Win32.UserPreferenceChangedEventHandler(PreferenceChanged); this.IsAccessible = true; m_SystemButtons.MouseDownAutoHideChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseDownCloseChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseDownCustomizeChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseOverAutoHideChanged += new EventHandler(this.SysButtonMouseOverAutoHide); m_SystemButtons.MouseOverCustomizeChanged += new EventHandler(this.SysButtonMouseOverCustomize); m_SystemButtons.MouseOverCloseChanged += new EventHandler(this.SysButtonMouseOverClose); }
protected override void Dispose(bool disposing) { IsDisposing = true; if (m_ParentMsgHandlerRegistered) { DotNetBarManager.UnRegisterOwnerParentMsgHandler(this, null); m_ParentMsgHandlerRegistered = false; } if (m_Float != null && disposing) { try { if (m_Float.Controls.Contains(this)) m_Float.Controls.Remove(this); m_Float.Close(); m_Float.Dispose(); m_Float = null; } catch (Exception) { } } if (m_Owner is DotNetBarManager && ((DotNetBarManager)m_Owner).IgnoreLoadedControlDispose) this.Controls.Clear(); if (this.Parent != null) { try { this.Parent.Controls.Remove(this); } catch (Exception) { } } Microsoft.Win32.SystemEvents.UserPreferenceChanged -= new Microsoft.Win32.UserPreferenceChangedEventHandler(PreferenceChanged); if (m_TabDockItems != null) { m_TabDockItems.Dispose(); m_TabDockItems = null; } if (m_DropShadow != null) { m_DropShadow.Hide(); m_DropShadow.Dispose(); m_DropShadow = null; } if (m_FilterInstalled) { MessageHandler.UnregisterMessageClient(this); m_FilterInstalled = false; } RestoreContainer(); m_Owner = null; m_ParentItem = null; m_OldContainer = null; //m_OldParent=null; if (m_ItemContainer != null) m_ItemContainer.Dispose(); m_ItemContainer = null; base.Dispose(disposing); IsDisposing = false; }
/// <summary> /// Returns copy of GenericItemContainer item /// </summary> public override BaseItem Copy() { GenericItemContainer objCopy=new GenericItemContainer(); this.CopyToItem(objCopy); return objCopy; }