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: 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)); } 25 bool InsertButton(int iButton, LPTBBUTTON button) { return BOOLToBool(SendMessage(TB_INSERTBUTTON, (WPARAM)iButton, (LPARAM)button)); } 26 BOOL AddToolTips(UINT numToolTips, LPTSTR toolTips) { return BOOLToBool(SendMessage(TB_SETTOOLTIPS, (WPARAM)numToolTips, (LPARAM)toolTips)); } 27 void AutoSize() { SendMessage(TB_AUTOSIZE, 0, 0); } 28 29 bool AddAdornments(DWORD dwFlags) { return BOOLToBool(::CommandBar_AddAdornments(_window, dwFlags, 0)); } 30 int AddBitmap(HINSTANCE hInst, int idBitmap, int iNumImages, int iImageWidth, int iImageHeight) { return ::CommandBar_AddBitmap(_window, hInst, idBitmap, iNumImages, iImageWidth, iImageHeight); } 31 bool DrawMenuBar(WORD iButton) { return BOOLToBool(::CommandBar_DrawMenuBar(_window, iButton)); } 32 HMENU GetMenu(WORD iButton) { return ::CommandBar_GetMenu(_window, iButton); } 33 int Height() { return CommandBar_Height(_window); } 34 HWND InsertComboBox(HINSTANCE hInst, int iWidth, UINT dwStyle, WORD idComboBox, WORD iButton) { return ::CommandBar_InsertComboBox(_window, hInst, iWidth, dwStyle, idComboBox, iButton); } 35 bool InsertMenubar(HINSTANCE hInst, WORD idMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubar(_window, hInst, idMenu, iButton)); } 36 bool InsertMenubarEx(HINSTANCE hInst, LPTSTR pszMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubarEx(_window, hInst, pszMenu, iButton)); } 37 bool Show(bool cmdShow) { return BOOLToBool(::CommandBar_Show(_window, BoolToBOOL(cmdShow))); } 38 39 40 // CE 4.0 41 void AlignAdornments() { CommandBar_AlignAdornments(_window); } 42 }; 43 44 }} 45 46 #endif 47 48 #endif 49