1717
1818#pragma once
1919
20- #ifndef _WIN32_IE
21- #define _WIN32_IE 0x0600
22- #endif // _WIN32_IE
23-
2420#include < windows.h>
21+
2522#include < commctrl.h>
23+
2624#include " Window.h"
2725#include " dpiManagerV2.h"
2826
3735
3836#define WM_TABSETSTYLE (WM_APP + 0x024 )
3937
40- const int nbCtrlMax = 10 ;
41-
42- const wchar_t TABBAR_ACTIVEFOCUSEDINDCATOR[64 ] = L" Active tab focused indicator" ;
43- const wchar_t TABBAR_ACTIVEUNFOCUSEDINDCATOR[64 ] = L" Active tab unfocused indicator" ;
44- const wchar_t TABBAR_ACTIVETEXT[64 ] = L" Active tab text" ;
45- const wchar_t TABBAR_INACTIVETEXT[64 ] = L" Inactive tabs" ;
46-
47- const wchar_t TABBAR_INDIVIDUALCOLOR_1[64 ] = L" Tab color 1" ;
48- const wchar_t TABBAR_INDIVIDUALCOLOR_2[64 ] = L" Tab color 2" ;
49- const wchar_t TABBAR_INDIVIDUALCOLOR_3[64 ] = L" Tab color 3" ;
50- const wchar_t TABBAR_INDIVIDUALCOLOR_4[64 ] = L" Tab color 4" ;
51- const wchar_t TABBAR_INDIVIDUALCOLOR_5[64 ] = L" Tab color 5" ;
52-
53- const wchar_t TABBAR_INDIVIDUALCOLOR_DM_1[64 ] = L" Tab color dark mode 1" ;
54- const wchar_t TABBAR_INDIVIDUALCOLOR_DM_2[64 ] = L" Tab color dark mode 2" ;
55- const wchar_t TABBAR_INDIVIDUALCOLOR_DM_3[64 ] = L" Tab color dark mode 3" ;
56- const wchar_t TABBAR_INDIVIDUALCOLOR_DM_4[64 ] = L" Tab color dark mode 4" ;
57- const wchar_t TABBAR_INDIVIDUALCOLOR_DM_5[64 ] = L" Tab color dark mode 5" ;
58-
59- constexpr int g_TabIconSize = 16 ;
60- constexpr int g_TabHeight = 22 ;
61- constexpr int g_TabHeightLarge = 25 ;
62- constexpr int g_TabWidth = 45 ;
63- constexpr int g_TabWidthButton = 60 ;
64- constexpr int g_TabCloseBtnSize = 11 ;
65- constexpr int g_TabPinBtnSize = 11 ;
66- constexpr int g_TabCloseBtnSize_DM = 16 ;
67- constexpr int g_TabPinBtnSize_DM = 16 ;
38+ inline constexpr int nbCtrlMax = 10 ;
6839
6940struct TBHDR
7041{
@@ -80,7 +51,7 @@ class TabBar : public Window
8051 TabBar () = default ;
8152 ~TabBar () override = default ;
8253 void destroy () override ;
83- virtual void init (HINSTANCE hInst, HWND parent, bool isVertical = false , bool isMultiLine = false );
54+ virtual void init (HINSTANCE hInst, HWND parent, bool isVertical, bool isMultiLine);
8455 void reSizeTo (RECT& rc2Adjust) override ;
8556 int insertAtEnd (const wchar_t *subTabName);
8657 void activateAt (int index) const ;
@@ -132,8 +103,10 @@ class TabBar : public Window
132103 DPIManagerV2 _dpiManager;
133104
134105 long getRowCount () const {
135- return long (::SendMessage (_hSelf, TCM_GETROWCOUNT, 0 , 0 ));
106+ return static_cast < long > (::SendMessage (_hSelf, TCM_GETROWCOUNT, 0 , 0 ));
136107 }
108+
109+ using Window::init;
137110};
138111
139112
@@ -288,4 +261,7 @@ public :
288261
289262 void notify (int notifyCode, int tabIndex);
290263 void trackMouseEvent (DWORD event2check);
264+
265+ using Window::init;
266+ using TabBar::init;
291267};
0 commit comments