diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2021-12-27 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-03-18 15:35:13 +0500 |
commit | f19f813537c7aea1c20749c914e756b54a9c3cf5 (patch) | |
tree | 816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/Control/ToolBar.h | |
parent | 98e06a519b63b81986abe76d28887f6984a7732b (diff) | |
download | 7zip-21.07.tar.gz 7zip-21.07.tar.bz2 7zip-21.07.zip |
'21.07'21.07
Diffstat (limited to 'CPP/Windows/Control/ToolBar.h')
-rw-r--r-- | CPP/Windows/Control/ToolBar.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/CPP/Windows/Control/ToolBar.h b/CPP/Windows/Control/ToolBar.h new file mode 100644 index 0000000..7bc93a2 --- /dev/null +++ b/CPP/Windows/Control/ToolBar.h | |||
@@ -0,0 +1,43 @@ | |||
1 | // Windows/Control/ToolBar.h | ||
2 | |||
3 | #ifndef __WINDOWS_CONTROL_TOOLBAR_H | ||
4 | #define __WINDOWS_CONTROL_TOOLBAR_H | ||
5 | |||
6 | #include "../Window.h" | ||
7 | |||
8 | namespace NWindows { | ||
9 | namespace NControl { | ||
10 | |||
11 | class CToolBar: public NWindows::CWindow | ||
12 | { | ||
13 | public: | ||
14 | void AutoSize() { SendMsg(TB_AUTOSIZE, 0, 0); } | ||
15 | DWORD GetButtonSize() { return (DWORD)SendMsg(TB_GETBUTTONSIZE, 0, 0); } | ||
16 | |||
17 | bool GetMaxSize(LPSIZE size) | ||
18 | #ifdef UNDER_CE | ||
19 | { | ||
20 | // maybe it must be fixed for more than 1 buttons | ||
21 | DWORD val = GetButtonSize(); | ||
22 | size->cx = LOWORD(val); | ||
23 | size->cy = HIWORD(val); | ||
24 | return true; | ||
25 | } | ||
26 | #else | ||
27 | { | ||
28 | return LRESULTToBool(SendMsg(TB_GETMAXSIZE, 0, (LPARAM)size)); | ||
29 | } | ||
30 | #endif | ||
31 | |||
32 | bool EnableButton(UINT buttonID, bool enable) { return LRESULTToBool(SendMsg(TB_ENABLEBUTTON, buttonID, MAKELONG(BoolToBOOL(enable), 0))); } | ||
33 | void ButtonStructSize() { SendMsg(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON)); } | ||
34 | HIMAGELIST SetImageList(UINT listIndex, HIMAGELIST imageList) { return HIMAGELIST(SendMsg(TB_SETIMAGELIST, listIndex, (LPARAM)imageList)); } | ||
35 | bool AddButton(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONS, numButtons, (LPARAM)buttons)); } | ||
36 | #ifndef _UNICODE | ||
37 | bool AddButtonW(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONSW, numButtons, (LPARAM)buttons)); } | ||
38 | #endif | ||
39 | }; | ||
40 | |||
41 | }} | ||
42 | |||
43 | #endif | ||