aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/Control/CommandBar.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/Control/CommandBar.h
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to '')
-rw-r--r--CPP/Windows/Control/CommandBar.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/CPP/Windows/Control/CommandBar.h b/CPP/Windows/Control/CommandBar.h
new file mode 100644
index 0000000..a619744
--- /dev/null
+++ b/CPP/Windows/Control/CommandBar.h
@@ -0,0 +1,52 @@
1// Windows/Control/CommandBar.h
2
3#ifndef __WINDOWS_CONTROL_COMMANDBAR_H
4#define __WINDOWS_CONTROL_COMMANDBAR_H
5
6#ifdef UNDER_CE
7
8#include "../../Common/MyWindows.h"
9
10#include <commctrl.h>
11
12#include "../Window.h"
13
14namespace NWindows {
15namespace NControl {
16
17class CCommandBar: public NWindows::CWindow
18{
19public:
20 bool Create(HINSTANCE hInst, HWND hwndParent, int idCmdBar)
21 {
22 _window = ::CommandBar_Create(hInst, hwndParent, idCmdBar);
23 return (_window != NULL);
24 }
25
26 // Macros
27 // void Destroy() { CommandBar_Destroy(_window); }
28 // bool AddButtons(UINT numButtons, LPTBBUTTON buttons) { return BOOLToBool(SendMsg(TB_ADDBUTTONS, (WPARAM)numButtons, (LPARAM)buttons)); }
29 bool InsertButton(int iButton, LPTBBUTTON button) { return BOOLToBool(SendMsg(TB_INSERTBUTTON, (WPARAM)iButton, (LPARAM)button)); }
30 BOOL AddToolTips(UINT numToolTips, LPTSTR toolTips) { return BOOLToBool(SendMsg(TB_SETTOOLTIPS, (WPARAM)numToolTips, (LPARAM)toolTips)); }
31 void AutoSize() { SendMsg(TB_AUTOSIZE, 0, 0); }
32
33 bool AddAdornments(DWORD dwFlags) { return BOOLToBool(::CommandBar_AddAdornments(_window, dwFlags, 0)); }
34 int AddBitmap(HINSTANCE hInst, int idBitmap, int iNumImages, int iImageWidth, int iImageHeight) { return ::CommandBar_AddBitmap(_window, hInst, idBitmap, iNumImages, iImageWidth, iImageHeight); }
35 bool DrawMenuBar(WORD iButton) { return BOOLToBool(::CommandBar_DrawMenuBar(_window, iButton)); }
36 HMENU GetMenu(WORD iButton) { return ::CommandBar_GetMenu(_window, iButton); }
37 int Height() { return CommandBar_Height(_window); }
38 HWND InsertComboBox(HINSTANCE hInst, int iWidth, UINT dwStyle, WORD idComboBox, WORD iButton) { return ::CommandBar_InsertComboBox(_window, hInst, iWidth, dwStyle, idComboBox, iButton); }
39 bool InsertMenubar(HINSTANCE hInst, WORD idMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubar(_window, hInst, idMenu, iButton)); }
40 bool InsertMenubarEx(HINSTANCE hInst, LPTSTR pszMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubarEx(_window, hInst, pszMenu, iButton)); }
41 bool Show(bool cmdShow) { return BOOLToBool(::CommandBar_Show(_window, BoolToBOOL(cmdShow))); }
42
43
44 // CE 4.0
45 void AlignAdornments() { CommandBar_AlignAdornments(_window); }
46};
47
48}}
49
50#endif
51
52#endif