public LightwaveTabRenderer(TitleBarTabs parentWindow)
            : base(parentWindow)
        {
            // Initialize the various images to use during rendering
            _activeLeftSideImage    = Properties.Resources.Lightwave_Tab_Left;
            _activeRightSideImage   = Properties.Resources.Lightwave_Tab_Right;
            _activeCenterImage      = Properties.Resources.Lightwave_TabCenter;
            _inactiveLeftSideImage  = Properties.Resources.Lightwave_TabCenter_Inactive_Left;
            _inactiveRightSideImage = Properties.Resources.Lightwave_TabCenter_Inactive_Right;
            _inactiveCenterImage    = Properties.Resources.Lightwave_TabCenter_Inactive;
            _closeButtonImage       = Properties.Resources.ChromeClose;
            _closeButtonHoverImage  = Properties.Resources.ChromeCloseHover;
            _background             = Properties.Resources.Lightwave_Tab_Background;
            _addButtonImage         = new Bitmap(Properties.Resources.ChromeAdd, new Size(34, 18));
            _addButtonHoverImage    = new Bitmap(Properties.Resources.ChromeAddHover, new Size(34, 25));

            // Set the various positioning properties
            CloseButtonMarginTop  = 6;
            CloseButtonMarginLeft = 0;
            AddButtonMarginTop    = 5;
            AddButtonMarginLeft   = -10;
            CaptionMarginTop      = 6;
            CaptionMarginLeft     = 2;
            IconMarginTop         = 7;
            IconMarginRight       = 5;
            AddButtonMarginRight  = 2;
        }
Exemplo n.º 2
0
        public ChromeTabRenderer(TitleBarTabs parentWindow) : base(parentWindow)
        {
            // Initialize the various images to use during rendering
            ActiveLeftSideImage    = Resources.ChromeLeft;
            ActiveRightSideImage   = Resources.ChromeRight;
            ActiveCenterImage      = Resources.ChromeCenter;
            InactiveLeftSideImage  = Resources.ChromeInactiveLeft;
            InactiveRightSideImage = Resources.ChromeInactiveRight;
            InactiveCenterImage    = Resources.ChromeInactiveCenter;
            CloseButtonImage       = Resources.ChromeClose;
            CloseButtonHoverImage  = Resources.ChromeCloseHover;
            Background             = Resources.ChromeBackground;
            AddButtonImage         = new Bitmap(Resources.ChromeAdd);
            AddButtonHoverImage    = new Bitmap(Resources.ChromeAddHover);

            // Set the various positioning properties
            CloseButtonMarginTop  = 6;
            CloseButtonMarginLeft = 2;
            AddButtonMarginTop    = 7;
            AddButtonMarginLeft   = -1;
            CaptionMarginTop      = 6;
            IconMarginTop         = 7;
            IconMarginRight       = 5;
            AddButtonMarginRight  = 5;
        }
Exemplo n.º 3
0
        /// <summary>Constructor that initializes the various resources that we use in rendering.</summary>
        /// <param name="parentWindow">Parent window that this renderer belongs to.</param>
        public ChromeTabRenderer(TitleBarTabs parentWindow)
            : base(parentWindow)
        {
            // Initialize the various images to use during rendering
            _activeLeftSideImage = Resources.ChromeLeft;
            _activeRightSideImage = Resources.ChromeRight;
            _activeCenterImage = Resources.ChromeCenter;
            _inactiveLeftSideImage = Resources.ChromeInactiveLeft;
            _inactiveRightSideImage = Resources.ChromeInactiveRight;
            _inactiveCenterImage = Resources.ChromeInactiveCenter;
            _closeButtonImage = Resources.ChromeClose;
            _closeButtonHoverImage = Resources.ChromeCloseHover;
            _background = Resources.ChromeBackground;
            _addButtonImage = new Bitmap(Resources.ChromeAdd);
            _addButtonHoverImage = new Bitmap(Resources.ChromeAddHover);

            // Set the various positioning properties
            CloseButtonMarginTop = 6;
            CloseButtonMarginLeft = 2;
            AddButtonMarginTop = 5;
            AddButtonMarginLeft = -3;
            CaptionMarginTop = 5;
            IconMarginTop = 6;
            IconMarginRight = 5;
            AddButtonMarginRight = 5;
        }
Exemplo n.º 4
0
 protected BaseTabRenderer(TitleBarTabs parentWindow)
 {
     ParentWindow                          = parentWindow;
     ShowAddButton                         = true;
     TabRepositionDragDistance             = 10;
     TabTearDragDistance                   = 10;
     parentWindow.Tabs.CollectionModified += TabsOnCollectionModified;
     if (parentWindow.Overlay != null)
     {
         parentWindow.Overlay.MouseMove += OverlayOnMouseMove;
         parentWindow.Overlay.MouseUp   += OverlayOnMouseUp;
         parentWindow.Overlay.MouseDown += OverlayOnMouseDown;
     }
 }
Exemplo n.º 5
0
        /// <summary>Default constructor that initializes the <see cref="_parentWindow" /> and <see cref="ShowAddButton" /> properties.</summary>
        /// <param name="parentWindow">The parent window that this renderer instance belongs to.</param>
        protected BaseTabRenderer(TitleBarTabs parentWindow)
        {
            _parentWindow = parentWindow;
            ShowAddButton = true;
            TabRepositionDragDistance = 10;
            TabTearDragDistance = 10;

            parentWindow.Tabs.CollectionModified += Tabs_CollectionModified;

            if (parentWindow._overlay != null)
            {
                parentWindow._overlay.MouseMove += Overlay_MouseMove;
                parentWindow._overlay.MouseUp += Overlay_MouseUp;
                parentWindow._overlay.MouseDown += Overlay_MouseDown;
            }
        }
Exemplo n.º 6
0
 public NewTabLifespanHandler(TitleBarTabs parentForm)
 {
     _parentForm = parentForm;
 }
Exemplo n.º 7
0
 /// <summary>Default constructor that initializes the various properties.</summary>
 /// <param name="parent">Parent window that contains this tab.</param>
 public TitleBarTab(TitleBarTabs parent)
 {
     ShowCloseButton = true;
     Parent = parent;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Retrieves or creates the overlay for <paramref name="parentForm" />.
        /// </summary>
        /// <param name="parentForm">Parent form that we are to create the overlay for.</param>
        /// <returns>
        /// Newly-created or previously existing overlay for <paramref name="parentForm" />.
        /// </returns>
        public static TitleBarTabsOverlay GetInstance(TitleBarTabs parentForm)
        {
            if (!_parents.ContainsKey(parentForm))
                _parents.Add(parentForm, new TitleBarTabsOverlay(parentForm));

            return _parents[parentForm];
        }
Exemplo n.º 9
0
        /// <summary>
        /// Creates the overlay window and attaches it to <paramref name="parentForm" />.
        /// </summary>
        /// <param name="parentForm">Parent form that the overlay should be rendered on top of.</param>
        protected TitleBarTabsOverlay(TitleBarTabs parentForm)
        {
            _parentForm = parentForm;

            // We don't want this window visible in the taskbar
            ShowInTaskbar = false;
            FormBorderStyle = FormBorderStyle.Sizable;
            MinimizeBox = false;
            MaximizeBox = false;
            _aeroEnabled = _parentForm.IsCompositionEnabled;

            Show(_parentForm);
            AttachHandlers();
        }