• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "../Window.h"
9 
10 namespace NWindows {
11 namespace NControl {
12 
13 class CCommandBar: public NWindows::CWindow
14 {
15 public:
Create(HINSTANCE hInst,HWND hwndParent,int idCmdBar)16   bool Create(HINSTANCE hInst, HWND hwndParent, int idCmdBar)
17   {
18     _window = ::CommandBar_Create(hInst, hwndParent, idCmdBar);
19     return (_window != NULL);
20   }
21 
22   // Macros
23   // void Destroy() { CommandBar_Destroy(_window); }
24   // bool AddButtons(UINT numButtons, LPTBBUTTON buttons) { return BOOLToBool(SendMessage(TB_ADDBUTTONS, (WPARAM)numButtons, (LPARAM)buttons)); }
InsertButton(int iButton,LPTBBUTTON button)25   bool InsertButton(int iButton, LPTBBUTTON button) { return BOOLToBool(SendMessage(TB_INSERTBUTTON, (WPARAM)iButton, (LPARAM)button)); }
AddToolTips(UINT numToolTips,LPTSTR toolTips)26   BOOL AddToolTips(UINT numToolTips, LPTSTR toolTips) { return BOOLToBool(SendMessage(TB_SETTOOLTIPS, (WPARAM)numToolTips, (LPARAM)toolTips)); }
AutoSize()27   void AutoSize() { SendMessage(TB_AUTOSIZE, 0, 0); }
28 
AddAdornments(DWORD dwFlags)29   bool AddAdornments(DWORD dwFlags) { return BOOLToBool(::CommandBar_AddAdornments(_window, dwFlags, 0)); }
AddBitmap(HINSTANCE hInst,int idBitmap,int iNumImages,int iImageWidth,int iImageHeight)30   int AddBitmap(HINSTANCE hInst, int idBitmap, int iNumImages, int iImageWidth, int iImageHeight) { return ::CommandBar_AddBitmap(_window, hInst, idBitmap, iNumImages, iImageWidth, iImageHeight); }
DrawMenuBar(WORD iButton)31   bool DrawMenuBar(WORD iButton) { return BOOLToBool(::CommandBar_DrawMenuBar(_window, iButton)); }
GetMenu(WORD iButton)32   HMENU GetMenu(WORD iButton) { return ::CommandBar_GetMenu(_window, iButton); }
Height()33   int Height() { return CommandBar_Height(_window); }
InsertComboBox(HINSTANCE hInst,int iWidth,UINT dwStyle,WORD idComboBox,WORD iButton)34   HWND InsertComboBox(HINSTANCE hInst, int iWidth, UINT dwStyle, WORD idComboBox, WORD iButton) { return ::CommandBar_InsertComboBox(_window, hInst, iWidth, dwStyle, idComboBox, iButton); }
InsertMenubar(HINSTANCE hInst,WORD idMenu,WORD iButton)35   bool InsertMenubar(HINSTANCE hInst, WORD idMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubar(_window, hInst, idMenu, iButton)); }
InsertMenubarEx(HINSTANCE hInst,LPTSTR pszMenu,WORD iButton)36   bool InsertMenubarEx(HINSTANCE hInst, LPTSTR pszMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubarEx(_window, hInst, pszMenu, iButton)); }
Show(bool cmdShow)37   bool Show(bool cmdShow) { return BOOLToBool(::CommandBar_Show(_window, BoolToBOOL(cmdShow))); }
38 
39 
40   // CE 4.0
AlignAdornments()41   void AlignAdornments() { CommandBar_AlignAdornments(_window); }
42 };
43 
44 }}
45 
46 #endif
47 
48 #endif
49