Inherits MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy >, TrueWindow, AspectEnabled< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectFocus< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectFont< SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy > >, AspectRaw< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectSizable< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, and AspectVisible< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetToolbar< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >.
Public Types | |
typedef bool(*) | boolFunctionTakingInt (EventHandlerClass *, WidgetType *, int) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an int returning bool. | |
typedef bool(*) | boolFunctionTakingTstring (EventHandlerClass *, WidgetType *, const SmartUtil::tstring &) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a const SmartUtil::tstring & returning bool. | |
typedef bool(*) | boolFunctionTakingUnsigned (EventHandlerClass *, WidgetType *, unsigned) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class pluss an unsigned int returning void. | |
typedef bool(*) | boolValidationFunc (EventHandlerClass *, WidgetType *, unsigned, unsigned, SmartUtil::tstring &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, two unsigned int and a SmartUtil::tstring & returning bool. | |
typedef BrushPtr(*) | brushFunctionTakingCanvas (EventHandlerClass *, WidgetType *, Canvas &canvas) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a Canvas & returning BrushPtr. | |
typedef HRESULT(*) | hresultFunctionTakingLparamWparam (EventHandlerClass *, WidgetType *, LPARAM, WPARAM) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget, an LPARAM and a WPARAM returning HRESULT. | |
typedef int(*) | intCallbackCompareFunc (EventHandlerClass *, WidgetType *, LPARAM, LPARAM) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and two LPARAM returning int. | |
typedef bool(EventHandlerClass::*) | itsBoolFunctionTakingInt (WidgetType *, int) |
Typedef of a member function to the original class taking pointer to the this Widget and an int returning bool. | |
typedef bool(EventHandlerClass::*) | itsBoolFunctionTakingTstring (WidgetType *, const SmartUtil::tstring &) |
Typedef of a member function to the original class taking pointer to the this Widget and a const SmartUtil::tstring & returning bool. | |
typedef bool(EventHandlerClass::*) | itsBoolFunctionTakingUnsigned (WidgetType *, unsigned) |
Typedef of a member function to the original class taking pointer to the this Widget and unsigned and returning bool. | |
typedef bool(EventHandlerClass::*) | itsBoolValidationFunc (WidgetType *, unsigned, unsigned, SmartUtil::tstring &) |
Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int and SmartUtil::tstring & returning bool. | |
typedef BrushPtr(EventHandlerClass::*) | itsBrushFunctionTakingCanvas (WidgetType *, Canvas &) |
Typedef of a member function to the original class taking pointer to the this Widget and a Canvas & returning BrushPtr. | |
typedef HRESULT(EventHandlerClass::*) | itsHresultFunctionTakingLparamWparam (WidgetType *, LPARAM, WPARAM) |
Typedef of a member function to the original class taking pointer to the this Widget, an LPARAM and a WPARAM returning HRESULT. | |
typedef int(EventHandlerClass::*) | itsIntLparamLparam (WidgetType *, LPARAM, LPARAM) |
Typedef of a member function to the original class taking pointer to the this Widget, two LPARAM returning int. | |
typedef void(EventHandlerClass::*) | itsVoidDrawItemFunction (WidgetType *, const DRAWITEMSTRUCT &) |
Typedef of a member function to the original class taking pointer to the this Widget and a const DRAWITEMSTRUCT & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTaking2Bool (WidgetType *, bool, bool) |
Typedef of a member function to the original class taking pointer to the this Widget and two bool returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingBool (WidgetType *, bool) |
Typedef of a member function to the original class taking pointer to the this Widget and a bool returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingCanvas (WidgetType *, Canvas &) |
Typedef of a member function to the original class taking pointer to the this Widget and a Canvas & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingConstString (WidgetType *, const SmartUtil::tstring &) |
Typedef of a member function to the original class taking pointer to the this Widget and a SmartUtil::tstring & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingInt (WidgetType *, int) |
Typedef of a member function to the original class taking pointer to the this Widget and an int returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingMouseEventResult (WidgetType *, const MouseEventResult &) |
Typedef of a member function to the original class taking pointer to the this Widget and a const MouseEventResult & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingPoint (WidgetType *, const Point &) |
Typedef of a member function to the original class taking pointer to the this Widget and const Point & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingString (WidgetType *, SmartUtil::tstring &) |
Typedef of a member function to the original class taking pointer to the this Widget and a SmartUtil::tstring & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingSystemTime (WidgetType *, const SYSTEMTIME &) |
Typedef of a member function to the original class taking pointer to the this Widget and a const SYSTEMTIME & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingUInt (WidgetType *, unsigned) |
Typedef of a member function to the original class taking pointer to the this Widget and an unsigned int returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingVoid (WidgetType *) |
Typedef of a member function to the original class taking pointer to the this Widget returning void. | |
typedef void(EventHandlerClass::*) | itsVoidFunctionTakingWindowSizedEventResult (WidgetType *, const WidgetSizedEventResult &) |
Typedef of a member function to the original class taking pointer to the this Widget and const WidgetSizedEventResult & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidGetIconFunc (WidgetType *, LPARAM, unsigned, int &) |
Typedef of a member function to the original class taking pointer to the this Widget, an unsigned int and an int & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidGetItemFunc (WidgetType *, LPARAM, unsigned, unsigned, SmartUtil::tstring &) |
Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int and SmartUtil::tstring & returning void. | |
typedef void(EventHandlerClass::*) | itsVoidMeasureItemFunction (WidgetType *, MEASUREITEMSTRUCT *) |
Typedef of a member function to the original class taking pointer to the this Widget and a MEASUREITEMSTRUCT * returning void. | |
typedef void(EventHandlerClass::*) | itsVoidUnsignedUnsignedBoolCanvasRectangle (WidgetType *, unsigned, unsigned, bool, Canvas &, const SmartWin::Rectangle &) |
Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int, a Canvas & and a const Rectangle & returning void. | |
typedef WidgetToolbar< EventHandlerClass, MessageMapPolicy > * | ObjectType |
Object type. | |
typedef WidgetToolbar< EventHandlerClass, MessageMapPolicy > | ThisType |
Class type. | |
typedef void(*) | voidDrawItemFunction (EventHandlerClass *, WidgetType *, const DRAWITEMSTRUCT &) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a const DRAWITEMSTRUCT & returning void. | |
typedef void(*) | voidFunctionTaking2Bool (EventHandlerClass *, WidgetType *, bool, bool) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and two bool returning void. | |
typedef void(*) | voidFunctionTakingBool (EventHandlerClass *, WidgetType *, bool) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a bool returning void. | |
typedef void(*) | voidFunctionTakingCanvas (EventHandlerClass *, WidgetType *, Canvas &) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a Canvas & returning void. | |
typedef void(*) | voidFunctionTakingConstString (EventHandlerClass *, WidgetType *, const SmartUtil::tstring &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a SmartUtil::tstring & returning void. | |
typedef void(*) | voidFunctionTakingInt (EventHandlerClass *, WidgetType *, int) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an int returning void. | |
typedef void(*) | voidFunctionTakingMouseEventResult (EventHandlerClass *, WidgetType *, const MouseEventResult &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const MouseEventResult & returning void. | |
typedef void(*) | voidFunctionTakingPoint (EventHandlerClass *, WidgetType *, const Point &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const Point & returning void. | |
typedef void(*) | voidFunctionTakingString (EventHandlerClass *, WidgetType *, SmartUtil::tstring &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a SmartUtil::tstring & returning void. | |
typedef void(*) | voidFunctionTakingSystemTime (EventHandlerClass *, WidgetType *, const SYSTEMTIME &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const SYSTEMTIME & returning void. | |
typedef void(*) | voidFunctionTakingUInt (EventHandlerClass *, WidgetType *, unsigned) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an unsigned int returning void. | |
typedef void(*) | voidFunctionTakingVoid (EventHandlerClass *, WidgetType *) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class returning void. | |
typedef void(*) | voidFunctionTakingWindowSizedEventResult (EventHandlerClass *, WidgetType *, const WidgetSizedEventResult &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const WidgetSizedEventResult & returning void. | |
typedef void(*) | voidGetIconFunc (EventHandlerClass *, WidgetType *, LPARAM, unsigned, int &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, an LPARAM, an unsigned int and an int & returning void. | |
typedef void(*) | voidGetItemFunc (EventHandlerClass *, WidgetType *, LPARAM, unsigned, unsigned, int &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, an LPARAM, two unsigned int and a SmartUtil::tstring & returning void. | |
typedef void(*) | voidMeasureItemFunction (EventHandlerClass *, WidgetType *, MEASUREITEMSTRUCT *) |
Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a MEASUREITEMSTRUCT * returning void. | |
typedef void(*) | voidUnsignedUnsignedBoolCanvasRectangle (EventHandlerClass *, WidgetType *, unsigned, unsigned, bool, Canvas &, const SmartWin::Rectangle &) |
Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, two unsigned int, a bool, a Canvas & and a const Rectangle & returning void. | |
Public Member Functions | |
void | addButton (unsigned int id, int iconIndex, const SmartUtil::tstring &text, const SmartUtil::tstring &toolTip, bool checkButton, typename ThisMessageMap::itsVoidFunctionTakingUInt eventHandler) |
Adds a button to the toolbar. | |
void | addButton (unsigned int id, int iconIndex, typename ThisMessageMap::itsVoidFunctionTakingUInt eventHandler) |
Adds a button to the toolbar. | |
void | addButton (unsigned int id, int iconIndex, const SmartUtil::tstring &toolTip, typename ThisMessageMap::itsVoidFunctionTakingUInt eventHandler) |
Adds a button to the toolbar. | |
void | addButton (unsigned int id, const SmartUtil::tstring &text, typename ThisMessageMap::itsVoidFunctionTakingUInt eventHandler) |
Adds a button to the toolbar. | |
void | addButton (unsigned int id, const SmartUtil::tstring &text, const SmartUtil::tstring &toolTip, typename ThisMessageMap::itsVoidFunctionTakingUInt eventHandler) |
Adds a button to the Toolbar. | |
void | addRemoveExStyle (DWORD addStyle, bool add) |
Use this function to add or remove windows exStyles. | |
void | addRemoveStyle (DWORD addStyle, bool add) |
Use this function to add or remove windows styles. | |
void | addSeparator () |
Adds a separator to the toolbar. | |
virtual void | create (const Seed &cs=getDefaultSeed()) |
Actually creates the Toolbar. | |
bool | getButtonChecked (unsigned int id) |
Returns a boolean indicating if the button with the current id is checked or not. | |
bool | getButtonEnabled (unsigned int id) |
Returns a boolean indicating if the button with the current id is enabled or not. | |
bool | getButtonVisible (unsigned id) |
Returns a boolean indicating if the button with the current id is visible or not. | |
Utilities::CriticalSection & | getCriticalSection () |
Returns a CriticalSection associated with the current Widget object. | |
HMENU | getCtrlId () const |
Returns the control id of the Widget. | |
bool | getEnabled () const |
Retrieves the enabled property of the Widget. | |
bool | getFocus () const |
Retrieves the focus property of the Widget. | |
FontPtr | getFont () |
Returns the font used by the Widget. | |
Widget * | getParent () const |
Returns the parent Widget of the Widget. | |
bool | getVisible () const |
Retrieves the visible property of the Widget. | |
HWND | handle () const |
Returns the HWND to the Widget. | |
void | invalidateWidget () |
Add this widget to the update area. | |
void | onEnabled (typename MessageMapType::itsVoidFunctionTakingBool eventHandler) |
Setting the event handler for the "enabled" event. | |
void | onFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler) |
Sets the event handler for what function to be called when control loses focus. | |
void | onKillFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler) |
Sets the event handler for what function to be called when control loses focus. | |
void | onRaw (typename MessageMapType::itsHresultFunctionTakingLparamWparam eventHandler, const Message &msg) |
Setting the member event handler for a "raw" event. | |
void | onVisibilityChanged (typename MessageMapType::itsVoidFunctionTakingBool eventHandler) |
Setting the event handler for the "visible" event. | |
void | refresh () |
Refreshes the toolbar, must be called after main window has been resized. | |
void | setButtonEnabled (unsigned id, bool enable) |
Enables (or disables) the button in the toolbar with the given id. | |
void | setButtonSize (unsigned int width, unsigned int height) |
Sets the size of buttons in the toolbar. | |
void | setButtonVisible (unsigned int id, bool show) |
Shows (or hides) the button in the toolbar with the given id. | |
void | setDisabledImageList (ImageListPtr disabledImageList) |
Set the image list with the normal button images. | |
void | setEnabled (bool enabled) |
Sets the enabled property of the Widget. | |
void | setFocus () |
Gives the Widget the keyboard focus. | |
void | setFont (PredefinedFontTypes stockObjectFont, bool forceUpdate=true) |
Function taking a PredefinedFontTypes type. | |
void | setFont (FontPtr font, bool forceUpdate=true) |
Sets the font used by the Widget. | |
void | setHotImageList (ImageListPtr hotImageList) |
Set the image list with the hot button images. | |
void | setNormalImageList (ImageListPtr normalImageList) |
Set the image list with the normal button images. | |
void | setVisible (bool visible) |
Sets the visibility property of the Widget. | |
virtual void | subclass (unsigned id) |
Subclasses the dialog item with the given dialog item id. | |
void | updateWidget () |
Repaints the whole window. | |
Static Public Member Functions | |
static const Seed & | getDefaultSeed () |
Default values for creation. | |
Protected Member Functions | |
void | createMessageMap () |
make the Windows Message Procedure dispatching map right. | |
Classes | |
class | Seed |
Seed class. More... |
You can either inherit from this class or add an instance of this class into your WidgetWindow inherited class.
If you inherit from the class you should explicitly call create e.g. in the CTOR of you class.
If you instantiate it directly (through the class Widget) you should create it by calling WidgetFactory::createxxx where xxx equals the name of the class WITHOUT the Widget part.
void addRemoveExStyle | ( | DWORD | addStyle, | |
bool | add | |||
) | [inherited] |
Use this function to add or remove windows exStyles.
The first parameter is the type of style you wish to add/remove.
The second argument is a boolean indicating if you wish to add or remove the style (if true add style, else remove)
void addRemoveStyle | ( | DWORD | addStyle, | |
bool | add | |||
) | [inherited] |
Use this function to add or remove windows styles.
The first parameter is the type of style you wish to add/remove.
The second argument is a boolean indicating if you wish to add or remove the style (if true add style, else remove)
void addSeparator | ( | ) |
Adds a separator to the toolbar.
A separator is an "empty space" that adds air between buttons
void create | ( | const Seed & | cs = getDefaultSeed() |
) | [virtual] |
Actually creates the Toolbar.
You should call WidgetFactory::createToolbar if you instantiate class directly.
Only if you DERIVE from class you should call this function directly.
bool getButtonChecked | ( | unsigned int | id | ) |
Returns a boolean indicating if the button with the current id is checked or not.
id is the identification you supplied when you called addButton.
bool getButtonEnabled | ( | unsigned int | id | ) |
Returns a boolean indicating if the button with the current id is enabled or not.
id is the identification you supplied when you called addButton.
bool getButtonVisible | ( | unsigned | id | ) |
Returns a boolean indicating if the button with the current id is visible or not.
id is the identification you supplied when you called addButton.
Utilities::CriticalSection & getCriticalSection | ( | ) | [inherited] |
Returns a CriticalSection associated with the current Widget object.
If you need serialized thread safe access to the Widget call this function and either stuff the returned object into a Utilities::ThreadLock or call Utilities::CriticalSection::lock (then you manually have to ensure CriticalSection::unlock is called on it)
HMENU getCtrlId | ( | ) | const [inherited] |
Returns the control id of the Widget.
This one only makes sense for control items, e.g. WidgetButton, WidgetComboBox etc.
Every control in a Widget has got its own control ID, mark that for a WidgetWindow this will always be ZERO
bool getEnabled | ( | ) | const [inherited] |
bool getFocus | ( | ) | const [inherited] |
FontPtr getFont | ( | ) | [inherited] |
Widget* getParent | ( | ) | const [inherited] |
bool getVisible | ( | ) | const [inherited] |
HWND handle | ( | ) | const [inherited] |
void invalidateWidget | ( | ) | [inherited] |
Add this widget to the update area.
Same as updateWidget except that this does not force an immediate redraw.
void onRaw | ( | typename MessageMapType::itsHresultFunctionTakingLparamWparam | eventHandler, | |
const Message & | msg | |||
) | [inherited] |
Setting the member event handler for a "raw" event.
Sets the event handler for the "raw" event handler. Use this if any of the predefined Event Handlers are not powerful enough or if you can't find the specific Event Handler you need.
Note!
This works in a special way. Unless you add the same Message twice, it will add that Event Handler and not remove the previous one. You can have "multiple" raw Event Handlers as long as the Message is not the same!
Note also!
This is an UNTYPED Event!
If there are other events which will handle the message, USE THOSE instead of this one!!!
This is a "last resort" event type.
Two parameters are passed: LPARAM and WPARAM
Return value is HRESULT which will be passed on to the System
void refresh | ( | ) |
Refreshes the toolbar, must be called after main window has been resized.
Refreshes the toolbar, call this one whenever you need to redraw the toolbar, typical example is when you have resized the main window.
void setButtonEnabled | ( | unsigned | id, | |
bool | enable | |||
) |
Enables (or disables) the button in the toolbar with the given id.
id is the identification of which button you want to enable.
void setButtonSize | ( | unsigned int | width, | |
unsigned int | height | |||
) |
Sets the size of buttons in the toolbar.
This should be relative to the size of the bitmap used (if you use a bitmap)
void setButtonVisible | ( | unsigned int | id, | |
bool | show | |||
) |
Shows (or hides) the button in the toolbar with the given id.
id is the identification of which button you want to show.
void setDisabledImageList | ( | ImageListPtr | disabledImageList | ) |
Set the image list with the normal button images.
disabledImageList is the image list that contains the images for the toolbar buttons in "disabled" state.
void setEnabled | ( | bool | enabled | ) | [inherited] |
void setFocus | ( | ) | [inherited] |
void setFont | ( | PredefinedFontTypes | stockObjectFont, | |
bool | forceUpdate = true | |||
) | [inherited] |
Function taking a PredefinedFontTypes type.
Examples are SystemFixedFont, SystemFont or DefaultGuiFont. -- credit to mm.
void setFont | ( | FontPtr | font, | |
bool | forceUpdate = true | |||
) | [inherited] |
void setHotImageList | ( | ImageListPtr | hotImageList | ) |
Set the image list with the hot button images.
hotImageList is the image list that contains the images for the toolbar buttons in "hot" state (being hovered / pressed).
Note, hot button images requires the TBSTYLE_FLAT, TBSTYLE_LIST or TBSTYLE_TRANSPARENT style upon Toolbar creation.
void setNormalImageList | ( | ImageListPtr | normalImageList | ) |
Set the image list with the normal button images.
normalImageList is the image list that contains the images for the toolbar buttons in "normal" state.
void setVisible | ( | bool | visible | ) | [inherited] |
void subclass | ( | unsigned | id | ) | [virtual, inherited] |
Subclasses the dialog item with the given dialog item id.
Subclasses a dialog item, the id is the dialog item id from the resource editor.
Should normally not be called directly but rather called from e.g. one of the creational functions found in the WidgetFactory class.
void updateWidget | ( | ) | [inherited] |
Repaints the whole window.
Invalidate the window and repaints it.