Files
Work/toolbar/TOOLBAR.HPP
2024-08-07 09:16:27 -04:00

80 lines
3.0 KiB
C++

#ifndef _TOOLBAR_TOOLBAR_HPP_
#define _TOOLBAR_TOOLBAR_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
#ifndef _COMMON_CONTROL_HPP_
#include <common/control.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _TOOLBAR_ADDBITMAP_HPP_
#include <toolbar/addbmp.hpp>
#endif
#ifndef _TOOLBAR_TOOLBARBUTTON_HPP_
#include <toolbar/tbbtn.hpp>
#endif
class Rect;
class ToolBar : public Control
{
public:
enum Styles{StyleToolTips=TBSTYLE_TOOLTIPS,StyleWrapable=TBSTYLE_WRAPABLE,StyleAltDrag=TBSTYLE_ALTDRAG,
StyleFlat=TBSTYLE_FLAT,StyleList=TBSTYLE_LIST,StyleCustomErase=TBSTYLE_CUSTOMERASE};
enum States{Checked=TBSTATE_CHECKED,Enabled=TBSTATE_ENABLED,Hidden=TBSTATE_HIDDEN,
Indeterminate=TBSTATE_INDETERMINATE,Pressed=TBSTATE_PRESSED,Wrap=TBSTATE_WRAP};
ToolBar(void);
virtual ~ToolBar();
BOOL create(GUIWindow &parentWindow,UINT controlID,const Rect &initRect=Rect(0,0,100,30),UINT styles=StyleList);
BOOL addBitmap(const AddBitmap &addBitmap,UINT imageCount=1)const;
BOOL addBitmaps(Block<AddBitmap> &addBitmaps)const;
BOOL addButton(const ToolBarButton &toolBarButton)const;
BOOL addButtons(Block<ToolBarButton> &toolBarButtons)const;
BOOL deleteButton(WORD indexButton)const;
BOOL changeBitmap(WORD indexBitmapFrom,WORD indexBitmapTo)const;
BOOL checkButton(UINT buttonID,BOOL checkState)const;
BOOL enableButton(UINT buttonID,BOOL enable)const;
BOOL setState(UINT buttonID,int state);
BOOL canHandleLargeBitmaps(void)const;
BOOL getButtonInfo(WORD indexButton,ToolBarButton &toolBarButton)const;
BOOL getButtonText(WORD buttonID,String &strButtonText)const;
BOOL getItemRect(WORD indexButton,Rect &itemRect)const;
BOOL hideButton(UINT buttonID,BOOL hide)const;
BOOL indeterminate(UINT buttonID,BOOL isIndeterminate)const;
BOOL insertButton(WORD indexButton,const ToolBarButton &toolBarButton)const;
BOOL isButtonChecked(UINT buttonID)const;
BOOL isButtonEnabled(UINT buttonID)const;
BOOL isButtonHidden(UINT buttonID)const;
BOOL isButtonIndeterminate(UINT buttonID)const;
BOOL isButtonPressed(UINT buttonID)const;
BOOL pressButton(UINT buttonID,BOOL pressed)const;
BOOL setBitmapSize(WORD xBitmap,WORD yBitmap)const;
BOOL setButtonSize(WORD xButton,WORD yButton)const;
BOOL setCommandID(WORD indexButton,UINT commandID)const;
WORD countButtons(void)const;
WORD getButtonIndex(UINT buttonID)const;
WORD getBitmapIndex(UINT buttonID)const;
WORD getRows(void)const;
DWORD getButtonState(UINT buttonID)const;
HANDLE getToolTipControl(void)const;
void resize(void)const;
void customize(void)const;
void setParent(GUIWindow &parentWindow)const;
void setToolTips(HANDLE hToolTips)const;
private:
void buttonStructSize(void)const;
ToolBar(const ToolBar &someToolBar);
ToolBar &operator=(const ToolBar &someToolBar);
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
Callback<ToolBar> mSizeHandler;
SmartPointer<GUIWindow> mParentWindow;
};
#endif