Initial
This commit is contained in:
216
toolbar/TBBTN.HPP
Normal file
216
toolbar/TBBTN.HPP
Normal file
@@ -0,0 +1,216 @@
|
||||
#ifndef _TOOLBAR_TOOLBARBUTTON_HPP_
|
||||
#define _TOOLBAR_TOOLBARBUTTON_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_COMMCTRL_HPP_
|
||||
#include <common/commctrl.hpp>
|
||||
#endif
|
||||
|
||||
class ToolBarButton : private TBBUTTON
|
||||
{
|
||||
public:
|
||||
enum StateFlags{StateChecked=TBSTATE_CHECKED,StatePressed=TBSTATE_PRESSED,StateEnabled=TBSTATE_ENABLED,
|
||||
StateHidden=TBSTATE_HIDDEN,StateIndeterminate=TBSTATE_INDETERMINATE,StateWrap=TBSTATE_WRAP,
|
||||
StateEllipses=TBSTATE_ELLIPSES};
|
||||
enum StyleFlags{StyleButton=TBSTYLE_BUTTON,StyleSEP=TBSTYLE_SEP,StyleCheck=TBSTYLE_CHECK,StyleGroup=TBSTYLE_GROUP,
|
||||
StyleCheckGroup=TBSTYLE_CHECKGROUP,StyleDropDown=TBSTYLE_DROPDOWN};
|
||||
ToolBarButton(void);
|
||||
ToolBarButton(int indexBitmap,int commandID,BYTE stateFlags=StateEnabled,BYTE styleFlags=StyleButton,DWORD userData=0,DWORD indexString=0);
|
||||
ToolBarButton(const ToolBarButton &someToolBarButton);
|
||||
ToolBarButton(const TBBUTTON &someTBBUTTON);
|
||||
virtual ~ToolBarButton();
|
||||
ToolBarButton &operator=(const ToolBarButton &someToolBarButton);
|
||||
ToolBarButton &operator=(const TBBUTTON &someTBBUTTON);
|
||||
BOOL operator==(const ToolBarButton &someToolBarButton)const;
|
||||
BOOL operator==(const TBBUTTON &someTBBUTTON)const;
|
||||
int indexBitmap(void)const;
|
||||
void indexBitmap(int indexBitmap);
|
||||
int commandID(void)const;
|
||||
void commandID(int commandID);
|
||||
BYTE stateFlags(void)const;
|
||||
void stateFlags(BYTE stateFlags);
|
||||
BYTE style(void)const;
|
||||
void style(BYTE style);
|
||||
DWORD userData(void)const;
|
||||
void userData(DWORD userData);
|
||||
int indexString(void)const;
|
||||
void indexString(int indexString);
|
||||
TBBUTTON &getTBBUTTON(void);
|
||||
private:
|
||||
void init(void);
|
||||
};
|
||||
|
||||
inline
|
||||
ToolBarButton::ToolBarButton(void)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton::ToolBarButton(int indexBitmap,int commandID,BYTE stateFlags,BYTE styleFlags,DWORD userData,DWORD indexString)
|
||||
{
|
||||
TBBUTTON::iBitmap=indexBitmap;
|
||||
TBBUTTON::idCommand=commandID;
|
||||
TBBUTTON::fsState=stateFlags;
|
||||
TBBUTTON::fsStyle=styleFlags;
|
||||
TBBUTTON::dwData=userData;
|
||||
TBBUTTON::iString=indexString;
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton::ToolBarButton(const ToolBarButton &someToolBarButton)
|
||||
{
|
||||
init();
|
||||
*this=someToolBarButton;
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton::ToolBarButton(const TBBUTTON &someTBBUTTON)
|
||||
{
|
||||
init();
|
||||
*this=someTBBUTTON;
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton::~ToolBarButton()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton &ToolBarButton::operator=(const ToolBarButton &someToolBarButton)
|
||||
{
|
||||
indexBitmap(someToolBarButton.indexBitmap());
|
||||
commandID(someToolBarButton.commandID());
|
||||
stateFlags(someToolBarButton.stateFlags());
|
||||
style(someToolBarButton.style());
|
||||
userData(someToolBarButton.userData());
|
||||
indexString(someToolBarButton.indexString());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
ToolBarButton &ToolBarButton::operator=(const TBBUTTON &someTBBUTTON)
|
||||
{
|
||||
indexBitmap(someTBBUTTON.iBitmap);
|
||||
commandID(someTBBUTTON.idCommand);
|
||||
stateFlags(someTBBUTTON.fsState);
|
||||
style(someTBBUTTON.fsStyle);
|
||||
userData(someTBBUTTON.dwData);
|
||||
indexString(someTBBUTTON.iString);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL ToolBarButton::operator==(const ToolBarButton &someToolBarButton)const
|
||||
{
|
||||
return (indexBitmap()==someToolBarButton.indexBitmap()&&
|
||||
commandID()==someToolBarButton.commandID()&&
|
||||
stateFlags()==someToolBarButton.stateFlags()&&
|
||||
style()==someToolBarButton.style()&&
|
||||
userData()==someToolBarButton.userData()&&
|
||||
indexString()==someToolBarButton.indexString());
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL ToolBarButton::operator==(const TBBUTTON &someTBBUTTON)const
|
||||
{
|
||||
return (indexBitmap()==someTBBUTTON.iBitmap&&
|
||||
commandID()==someTBBUTTON.idCommand&&
|
||||
stateFlags()==someTBBUTTON.fsState&&
|
||||
style()==someTBBUTTON.fsStyle&&
|
||||
userData()==someTBBUTTON.dwData&&
|
||||
indexString()==someTBBUTTON.iString);
|
||||
}
|
||||
|
||||
inline
|
||||
int ToolBarButton::indexBitmap(void)const
|
||||
{
|
||||
return TBBUTTON::iBitmap;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::indexBitmap(int indexBitmap)
|
||||
{
|
||||
TBBUTTON::iBitmap=indexBitmap;
|
||||
}
|
||||
|
||||
inline
|
||||
int ToolBarButton::commandID(void)const
|
||||
{
|
||||
return TBBUTTON::idCommand;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::commandID(int commandID)
|
||||
{
|
||||
TBBUTTON::idCommand=commandID;
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE ToolBarButton::stateFlags(void)const
|
||||
{
|
||||
return TBBUTTON::fsState;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::stateFlags(BYTE stateFlags)
|
||||
{
|
||||
TBBUTTON::fsState=stateFlags;
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE ToolBarButton::style(void)const
|
||||
{
|
||||
return TBBUTTON::fsStyle;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::style(BYTE style)
|
||||
{
|
||||
TBBUTTON::fsStyle=style;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD ToolBarButton::userData(void)const
|
||||
{
|
||||
return TBBUTTON::dwData;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::userData(DWORD userData)
|
||||
{
|
||||
TBBUTTON::dwData=userData;
|
||||
}
|
||||
|
||||
inline
|
||||
int ToolBarButton::indexString(void)const
|
||||
{
|
||||
return TBBUTTON::iString;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::indexString(int indexString)
|
||||
{
|
||||
TBBUTTON::iString=indexString;
|
||||
}
|
||||
|
||||
inline
|
||||
void ToolBarButton::init(void)
|
||||
{
|
||||
TBBUTTON::iBitmap=0;
|
||||
TBBUTTON::idCommand=0;
|
||||
TBBUTTON::fsState=0;
|
||||
TBBUTTON::fsStyle=0;
|
||||
TBBUTTON::bReserved[0]=0;
|
||||
TBBUTTON::bReserved[1]=0;
|
||||
TBBUTTON::dwData=0;
|
||||
TBBUTTON::iString=0;
|
||||
}
|
||||
|
||||
inline
|
||||
TBBUTTON &ToolBarButton::getTBBUTTON(void)
|
||||
{
|
||||
return (TBBUTTON&)*this;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user