/// <summary>Create <see cref="ViewHostTabs"/>.</summary> internal ViewHostTabs(ViewHost viewHost, AnchorStyles side) { Verify.Argument.IsNotNull(viewHost, "viewHost"); _viewHost = viewHost; _viewHost.ActiveViewChanged += OnActiveViewChanged; SetStyle( ControlStyles.ContainerControl | ControlStyles.Selectable | ControlStyles.SupportsTransparentBackColor, false); SetStyle( ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); _side = side; _tabs = new List <ViewHostTab>(); foreach (var view in viewHost.Views) { _tabs.Add(new ViewHostTab(this, view)); } if (_tabs.Count != 0) { int length = 0; foreach (var tab in _tabs) { tab.ResetLength(GraphicsUtility.MeasurementGraphics); length += tab.Length; } _length = length; } _tabHover = new TrackingService <ViewHostTab>(OnTabHoverChanged); _areaHover = new TrackingService <object>(OnAreaHoverChanged); _areaMouseDown = -1; if (viewHost.IsDocumentWell) { var tabHeight = Renderer.TabHeight; var tabFooterHeight = Renderer.TabFooterHeight; _leftButtons = new ViewButtons(this) { Height = tabHeight + tabFooterHeight, }; _leftButtons.ButtonClick += OnViewButtonClick; _rightButtons = new ViewButtons(this) { Height = tabHeight + tabFooterHeight, }; _rightButtons.SetAvailableButtons(ViewButtonType.TabsMenu); _rightButtons.ButtonClick += OnViewButtonClick; } _floatId = -1; }
public ViewHostTab(ViewHostTabs tabs, ViewBase view) : base(view, tabs.Side) { Verify.Argument.IsNotNull(tabs, nameof(tabs)); Tabs = tabs; _viewHost = tabs.ViewHost; Buttons = new ViewButtons(tabs); if (_viewHost.IsDocumentWell) { Buttons.SetAvailableButtons(ViewButtonType.Close); } Buttons.Height = Renderer.TabHeight + Renderer.TabFooterHeight; Buttons.ButtonClick += OnButtonClick; }
/// <summary>Create <see cref="PopupNotificationHeader"/>.</summary> internal PopupNotificationHeader() { SetStyle( ControlStyles.ContainerControl | ControlStyles.Selectable | ControlStyles.SupportsTransparentBackColor, false); SetStyle( ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); _buttons = new ViewButtons(this); _buttons.SetAvailableButtons(ViewButtonType.Close); _buttons.ButtonClick += OnButtonClick; }
/// <summary>Create <see cref="ViewHostHeader"/>.</summary> internal ViewHostHeader(ViewHost viewHost) { Verify.Argument.IsNotNull(viewHost, "viewHost"); _viewHost = viewHost; SetStyle( ControlStyles.ContainerControl | ControlStyles.Selectable | ControlStyles.SupportsTransparentBackColor, false); SetStyle( ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); _buttons = new ViewButtons(this); }