1370b324cSopenharmony_ci// Windows/Control/ToolBar.h 2370b324cSopenharmony_ci 3370b324cSopenharmony_ci#ifndef ZIP7_INC_WINDOWS_CONTROL_TOOLBAR_H 4370b324cSopenharmony_ci#define ZIP7_INC_WINDOWS_CONTROL_TOOLBAR_H 5370b324cSopenharmony_ci 6370b324cSopenharmony_ci#include "../Window.h" 7370b324cSopenharmony_ci 8370b324cSopenharmony_cinamespace NWindows { 9370b324cSopenharmony_cinamespace NControl { 10370b324cSopenharmony_ci 11370b324cSopenharmony_ciclass CToolBar: public NWindows::CWindow 12370b324cSopenharmony_ci{ 13370b324cSopenharmony_cipublic: 14370b324cSopenharmony_ci void AutoSize() { SendMsg(TB_AUTOSIZE, 0, 0); } 15370b324cSopenharmony_ci DWORD GetButtonSize() { return (DWORD)SendMsg(TB_GETBUTTONSIZE, 0, 0); } 16370b324cSopenharmony_ci 17370b324cSopenharmony_ci bool GetMaxSize(LPSIZE size) 18370b324cSopenharmony_ci #ifdef UNDER_CE 19370b324cSopenharmony_ci { 20370b324cSopenharmony_ci // maybe it must be fixed for more than 1 buttons 21370b324cSopenharmony_ci const DWORD val = GetButtonSize(); 22370b324cSopenharmony_ci size->cx = LOWORD(val); 23370b324cSopenharmony_ci size->cy = HIWORD(val); 24370b324cSopenharmony_ci return true; 25370b324cSopenharmony_ci } 26370b324cSopenharmony_ci #else 27370b324cSopenharmony_ci { 28370b324cSopenharmony_ci return LRESULTToBool(SendMsg(TB_GETMAXSIZE, 0, (LPARAM)size)); 29370b324cSopenharmony_ci } 30370b324cSopenharmony_ci #endif 31370b324cSopenharmony_ci 32370b324cSopenharmony_ci bool EnableButton(UINT buttonID, bool enable) { return LRESULTToBool(SendMsg(TB_ENABLEBUTTON, buttonID, MAKELONG(BoolToBOOL(enable), 0))); } 33370b324cSopenharmony_ci void ButtonStructSize() { SendMsg(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON)); } 34370b324cSopenharmony_ci HIMAGELIST SetImageList(UINT listIndex, HIMAGELIST imageList) { return HIMAGELIST(SendMsg(TB_SETIMAGELIST, listIndex, (LPARAM)imageList)); } 35370b324cSopenharmony_ci bool AddButton(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONS, numButtons, (LPARAM)buttons)); } 36370b324cSopenharmony_ci #ifndef _UNICODE 37370b324cSopenharmony_ci bool AddButtonW(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONSW, numButtons, (LPARAM)buttons)); } 38370b324cSopenharmony_ci #endif 39370b324cSopenharmony_ci}; 40370b324cSopenharmony_ci 41370b324cSopenharmony_ci}} 42370b324cSopenharmony_ci 43370b324cSopenharmony_ci#endif 44