WidgetWindow Class Template Reference
[Widgets]

"Window" class More...

Inherits WidgetWindowBase< EventHandlerClass, MessageMapPolicy >.

Inherited by WidgetChildWindow.

List of all members.

Public Types

typedef bool(*) boolFunctionTakingInt (EventHandlerClass *, int)
 Typedef of a static/global function taking a pointer to the original class and one int returning bool.
typedef bool(*) boolFunctionTakingTstring (EventHandlerClass *, const SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class and a const SmartUtil::tstring & returning bool.
typedef bool(*) boolFunctionTakingVoid (EventHandlerClass *)
 Typedef of a static/global function taking a pointer to the original class returning bool.
typedef HRESULT(*) hresultFunctionTakingLparamWparam (EventHandlerClass *, LPARAM, WPARAM)
 Typedef of a static/global function taking a pointer to the original class, LPARAM and WPARAM returning HRESULT.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingInt (int)
 Typedef of a member function to the original class taking one int returning bool.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingTstring (const SmartUtil::tstring &)
 Typedef of a member function to the original class taking const SmartUtil::tstring & returning bool.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingVoid ()
 Typedef of a member function to the original class taking void returning bool.
typedef HRESULT(EventHandlerClass::*) itsHresultFunctionTakingLparamWparam (LPARAM, WPARAM)
 Typedef of a member function to the original class taking LPARAM and WPARAM returning HRESULT.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingBool (bool)
 Typedef of a member function to the original class taking one bool returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingCanvas (Canvas &)
 Typedef of a member function to the original class taking Canvas & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingCommand (const CommandPtr &)
 Typedef of a member function to the original class taking const CommandPtr & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingConstString (const SmartUtil::tstring &)
 Typedef of a member function to the original class taking one SmartUtil::tstring & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingInt (int)
 Typedef of a member function to the original class taking one int returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingMouseEventResult (const MouseEventResult &)
 Typedef of a member function to the original class taking const MouseEventResult & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingPoint (const Point &)
 Typedef of a member function to the original class taking const Point & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingSeedPointer (const SmartWin::Seed &)
 Typedef of a member function to the original class taking const CreationalStruct & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingString (SmartUtil::tstring &)
 Typedef of a member function to the original class taking one SmartUtil::tstring & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingVoid ()
 Typedef of a member function to the original class taking void returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingWindowSizedEventResult (const WidgetSizedEventResult &)
 Typedef of a member function to the original class taking const WidgetSizedEventResult & returning void.
typedef WidgetWindow< EventHandlerClass,
MessageMapPolicy > * 
ObjectType
 Object type.
typedef WidgetWindow< EventHandlerClass,
MessageMapPolicy > 
ThisType
 Class type.
typedef void(*) voidFunctionTaking2Bool (EventHandlerClass *, bool, bool)
 Typedef of a static/global function taking a pointer to the original class and two bool returning void.
typedef void(*) voidFunctionTakingBool (EventHandlerClass *, bool)
 Typedef of a static/global function taking a pointer to the original class and one bool returning void.
typedef void(*) voidFunctionTakingCanvas (EventHandlerClass *, Canvas &)
 Typedef of a static/global function taking a pointer to the original class and a Canvas & returning void.
typedef void(*) voidFunctionTakingCommand (EventHandlerClass *, const CommandPtr &)
 Typedef of a static/global function taking a pointer to the original class and a const CommandPtr & returning void.
typedef void(*) voidFunctionTakingConstString (EventHandlerClass *, const SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class and one SmartUtil::tstring & returning void.
typedef void(*) voidFunctionTakingInt (EventHandlerClass *, int)
 Typedef of a static/global function taking a pointer to the original class and one int returning void.
typedef void(*) voidFunctionTakingMouseEventResult (EventHandlerClass *, const MouseEventResult &)
 Typedef of a static/global function taking a pointer to the original class and a const MouseEventResult & returning void.
typedef void(*) voidFunctionTakingPoint (EventHandlerClass *, const Point &)
 Typedef of a static/global function taking a pointer to the original class and a const Point & returning void.
typedef void(*) voidFunctionTakingSeedPointer (EventHandlerClass *, const SmartWin::Seed &)
 Typedef of a static/global function taking a pointer to the original class and a const CreationalStruct & returning void.
typedef void(*) voidFunctionTakingString (EventHandlerClass *, SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class and one SmartUtil::tstring & returning void.
typedef void(*) voidFunctionTakingVoid (EventHandlerClass *)
 Typedef of a static/global function taking a pointer to the original class returning void.
typedef void(*) voidFunctionTakingWindowSizedEventResult (EventHandlerClass *, const WidgetSizedEventResult &)
 Typedef of a static/global function taking a pointer to the original class and a const WidgetSizedEventResult & returning void.

Public Member Functions

void activatePreviousInstance ()
 Activates already running instance of an application.
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 animateBlend (bool show, int msTime)
 Animates a window.
void animateCollapse (bool show, int msTime)
 Animates a window.
void animateSlide (bool show, bool left, unsigned int msTime)
 Animates a window.
void bringToBottom ()
 Brings the widget to the bottom.
void bringToFront ()
 Brings the widget to the front.
void close (bool asyncron=false)
 Closes the window.
void createTimer (typename ThisMessageMap::itsVoidFunctionTakingCommand eventHandler, unsigned int milliSecond, const SmartWin::Command &command)
 Creates a timer object.
virtual void createWindow (Seed=getDefaultSeed())
 Actually creates the window.
Utilities::Thread fork (unsigned long(EventHandlerClass::*threadProc)())
 Creates a new thread on the given function.
template<class Param>
Utilities::Thread fork (const Param &par, unsigned long(EventHandlerClass::*threadProc)(Param &))
 Creates a new thread and passes the given parameter.
bool getActive () const
 Retrieves the activated property of the Widget.
Rectangle getBounds () const
 Returns the position and size of the window.
bool getCapsLockOn ()
 Checks if Caps Lock is on.
Point getClientAreaSize () const
 Returns the size of the client area of the window.
bool getControlPressed ()
 Checks if control is pressed.
Utilities::CriticalSectiongetCriticalSection ()
 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.
WidgetgetParent () const
 Returns the parent Widget of the Widget.
Point getPosition () const
 Returns the position of the window.
bool getShiftPressed ()
 Checks if shift is pressed.
Point getSize () const
 Returns the size of the window.
SmartUtil::tstring getText () const
 Gets the text of the AspectText realizing class.
Point getTextSize (const SmartUtil::tstring &text)
 Fills a Point with the size of text to be drawn in the Widget's font.
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 maximize ()
 Maximize your window.
void minimize ()
 Minimize your window.
void onActivate (typename MessageMapType::itsVoidFunctionTakingBool eventHandler)
 Setting the member event handler for the "activated" event.
void onChar (typename MessageMapType::itsBoolFunctionTakingInt eventHandler)
 Setting the event handler for the "char" event.
void onClosing (typename ThisMessageMap::itsBoolFunctionTakingVoid eventHandler)
 Event Handler setter for the Closing Event.
void onCreate (typename ThisMessageMap::itsVoidFunctionTakingSeedPointer eventHandler)
 Setting the event handler for the "create" event.
void onEnabled (typename MessageMapType::itsVoidFunctionTakingBool eventHandler)
 Setting the event handler for the "enabled" event.
void onEraseBackground (typename MessageMapType::itsVoidFunctionTakingCanvas eventHandler)
 Setting the event handler for the "erase background" event.
void onFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Sets the event handler for what function to be called when control loses focus.
void onKeyPressed (typename MessageMapType::itsBoolFunctionTakingInt eventHandler)
 Setting the event handler for the "key pressed" event.
void onKillFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Sets the event handler for what function to be called when control loses focus.
void onLeftMouseDown (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Left mouse button pressed event handler setter.
void onLeftMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Left mouse button pressed and released event handler setter.
void onMiddleMouseDown (typename MessageMapType::voidFunctionTakingMouseEventResult eventHandler)
 Middle mouse button pressed event handler setter.
void onMiddleMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Middle mouse button pressed and released event handler setter.
void onMouseMove (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Mouse moved event handler setter.
void onMoved (typename MessageMapType::itsVoidFunctionTakingPoint eventHandler)
void onPainting (typename MessageMapType::itsVoidFunctionTakingCanvas eventHandler)
 Painting event handler setter.
void onRaw (typename MessageMapType::itsHresultFunctionTakingLparamWparam eventHandler, const Message &msg)
 Setting the member event handler for a "raw" event.
void onRightMouseDown (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Right mouse button pressed event handler setter.
void onRightMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Right mouse button pressed and released event handler setter.
void onSized (typename MessageMapType::itsVoidFunctionTakingWindowSizedEventResult eventHandler)
void onTextChanging (typename MessageMapType::itsVoidFunctionTakingConstString eventHandler)
 Setting the event handler for the "setText" event.
void onVisibilityChanged (typename MessageMapType::itsVoidFunctionTakingBool eventHandler)
 Setting the event handler for the "visible" event.
void restore ()
 Restores your window.
virtual LRESULT sendWidgetMessage (HWND hWnd, UINT msg, WPARAM &wPar, LPARAM &lPar)
 Send a message to the Widget.
void setActive ()
 Activates the Widget.
void setBorder (bool value=true)
 Set or remove the simple border (solid line).
void setBounds (int x, int y, int width, int height, bool updateWindow=true)
 Sets the new size and position of the window.
void setBounds (const Point &newPos, const Point &newSize, bool updateWindow=true)
 Sets the new size and position of the window.
void setBounds (const Rectangle &rect, bool updateWindow=true)
 Sets the new size and position of the window.
void setCursor (const SmartUtil::tstring &filePathName)
 Sets the cursor for the Widget.
void setCursor (int resourceId)
 Sets the cursor for the Widget.
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 setIconLarge (const SmartUtil::tstring &filePathName)
 Sets the large icon for the Widget (the large icon appears e.g. when you press ALT+Tab).
void setIconLarge (int resourceId)
 Sets the large icon for the Widget (the large icon appears e.g. when you press ALT+Tab).
void setIconSmall (const SmartUtil::tstring &filePathName)
 Sets the small icon for the Widget (the small icon appears typically in the top left corner of the Widget).
void setIconSmall (int resourceId)
 Sets the small icon for the Widget (the small icon appears typically in the top left corner of the Widget).
void setMaximizeBox (bool value=true)
 Adds or removes the maximize box from the Widget.
void setMinimizeBox (bool value=true)
 Adds or removes the minimize box from the Widget.
void setPositionPerPlace (SmartWin::Place &bound)
 Given a bounding Place class, place this Widget and adjust to the next position.
void setRaisedBorder (bool value=true)
 Set or remove the raised border (like in buttons).
void setSizeAsCol (const Rectangle &rect, int rows, int rownum, int border=0, bool updateWindow=true)
 Given a bounding rectangle with rows, put this Widget in the rownum position.
void setSizeAsGridPerPlace (SmartWin::Place &bound, int rows, int cols)
 this Widget in the next cell.
void setSizeAsRow (const Rectangle &rect, int cols, int colnum, int border=0, bool updateWindow=true)
 Given a bounding rectangle with cols, put this Widget in the colnum position.
void setSizePerTextPerPlace (SmartWin::Place &bound, const SmartUtil::tstring &text, int extraX=0, int extraY=0)
 Place after sizing for the Widget's text, and adjust to the next position.
void setSmoothSunkenBorder (bool value=true)
 Set or remove the smooth sunken border (generally used in read only text boxes).
void setSunkenBorder (bool value=true)
 Set or remove the sunken border (like in text box widgets).
void setText (const SmartUtil::tstring &txt)
 Sets the text of the AspectText realizing class.
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 SeedgetDefaultSeed ()
 Default values for creation.
static Point getDesktopSize ()
 Returns the screen size.
static char virtualKeyToChar (int vkey)
 Get ascii character from a Virtual Key.

Classes

class  Seed
 Seed class. More...


Detailed Description

template<class EventHandlerClass, class MessageMapPolicy = MessageMapPolicyNormalWidget>
class SmartWin::WidgetWindow< EventHandlerClass, MessageMapPolicy >

"Window" class

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.

window.PNG
Class for creating a "normal" window.
A normal window is what most applications would use as the basic main structure, in it you can add other Widgets like for instance buttons, comboboxes etc.
A WidgetWindow is basically a container Widget for other Widgets to reside in.
Class is a public superclass of WidgetWindowBase and therefore can use all features of WidgetWindowBase.


Member Function Documentation

void activatePreviousInstance (  ) 

Activates already running instance of an application.

Note that this only works if you have only one SmartWin application running!

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 animateBlend ( bool  show,
int  msTime 
) [inherited]

Animates a window.

Blends the window INTO view or OUT of view.
Show defines if the window shall come INTO view or go OUT of view.
The "time" parameter is the total duration of the function in milliseconds.

void animateCollapse ( bool  show,
int  msTime 
) [inherited]

Animates a window.

Collapses the window INTO view or OUT of view. The collapse can be thought of as either an "explosion" or an "implosion".
Show defines if the window shall come INTO view or go OUT of view.
The "time" parameter is the total duration of the function in milliseconds.

void animateSlide ( bool  show,
bool  left,
unsigned int  msTime 
) [inherited]

Animates a window.

Slides the window into view from either right or left depending on the parameter "left". If "left" is true, then from the left, otherwise from the right.
Show defines if the window shall come INTO view or go OUT of view.
The "time" parameter is the total duration of the function in milliseconds.

void bringToBottom (  )  [inherited]

Brings the widget to the bottom.

Makes the widget become the bottom most widget meaning it will be obscured by all other widgets which are contained in the same container widget.
For instance if you have two widgets which partially hides eachother and you call bringToBottom on one of them it will make sure that the widget you call bringToBottom on will be the one which will be invisible and the other one will be all visible by the parts which are obscured by the this widget.

void bringToFront (  )  [inherited]

Brings the widget to the front.

Makes the widget become the front most widget meaning it will not be obscured by other widgets which are contained in the same container widget.
For instance if you have two widgets which partially hides eachother and you call bringToFront on one of them it will make sure that the widget you call bringToFront on will be the one which will be all visible and the other one will be partially hidden by the parts which are obscured by the this widget.

void close ( bool  asyncron = false  )  [inherited]

Closes the window.

Call this function to raise the "Closing" event.
This will normally try to close the window.
Note!
If this event is trapped and we in that event handler state that we DON'T want to close the window (by returning false) the window will not be close.
Note!
If the asyncron argument is true the message will be posted to the message que meaning that the close event will be done asyncronously and therefore the function will return immediately and the close event will be handled when the close event pops up in the event handler que.

void createTimer ( typename ThisMessageMap::itsVoidFunctionTakingCommand  eventHandler,
unsigned int  milliSecond,
const SmartWin::Command command 
) [inherited]

Creates a timer object.

The supplied function must have the signature void foo( const CommandPtr & command )
The command parameter is a custom command object associated with your timer event.
The supplied Command will then be passed (as a shared_ptr) to your supplied event handler function after the specified (in milliSeconds parameter) time has elapsed.

void createWindow ( Seed  = getDefaultSeed()  )  [virtual]

Actually creates the window.

This one creates the window. The seed is not taken a constant because the class name will be generated at the registration.

Utilities::Thread fork ( unsigned long(EventHandlerClass::*)()  threadProc  )  [inherited]

Creates a new thread on the given function.

Forks execution into a member function. If you wish to later manipulate the thread in some way use the Utilities::Thread class to store the return value of this function.

Utilities::Thread fork ( const Param &  par,
unsigned long(EventHandlerClass::*)(Param &)  threadProc 
) [inherited]

Creates a new thread and passes the given parameter.

Forks execution into a member function with the given parameter of the given type. If you wish to later manipulate the thread in some way use the Utilities::Thread class to store the return value of this function.

bool getActive (  )  const [inherited]

Retrieves the activated property of the Widget.

Use this function to check if the Widget is active or not.
If the Widget is active this function will return true.

Rectangle getBounds (  )  const [inherited]

Returns the position and size of the window.

Note that this is in screen coordinates meaning the position returned is relative to the upper left corner of the desktop screen, the function also returns in the size member of the Rectangle the size of the window and not the position of the lower right point. Values includes borders, frames and toolbar etc of the window.

bool getCapsLockOn (  )  [inherited]

Checks if Caps Lock is on.

Use this function if you need to determine if Caps Lock is ON

Point getClientAreaSize (  )  const [inherited]

Returns the size of the client area of the window.

This differs from getSize because it disregards the border and headers, this function only returns the client area of the Widget meaning the area which it is possible to draw on.

bool getControlPressed (  )  [inherited]

Checks if control is pressed.

Use this function if you need to determine if any of the CTRL keys are pressed.

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

Point getDesktopSize (  )  [static, inherited]

Returns the screen size.

This is the screen size, and useful for making applications that must adapt to different screen sizes.

bool getEnabled (  )  const [inherited]

Retrieves the enabled property of the Widget.

Use this function to check if the Widget is Enabled or not. If the Widget is enabled this function will return true.

bool getFocus (  )  const [inherited]

Retrieves the focus property of the Widget.

Use this function to check if the Widget has focus or not. If the Widget has focus this function will return true.

FontPtr getFont (  )  [inherited]

Returns the font used by the Widget.

Returns the Font object currently being used by the Widget

Widget* getParent (  )  const [inherited]

Returns the parent Widget of the Widget.

Most Widgets have got a parent, this function will retrieve a pointer to the Widgets parent, if the Widget doesn't have a parent it will return a null pointer.

Point getPosition (  )  const [inherited]

Returns the position of the window.

Note that this is in screen coordinates meaning the position returned is relative to the upper left corner of the desktop screen.

Reimplemented in WidgetProgressBar, and WidgetSlider.

bool getShiftPressed (  )  [inherited]

Checks if shift is pressed.

Use this function if you need to determine if any of the SHIFT keys are pressed.

Point getSize (  )  const [inherited]

Returns the size of the window.

Includes the border, frame and toolbar etc of the window.

SmartUtil::tstring getText (  )  const [inherited]

Gets the text of the AspectText realizing class.

The Return value is the text of the realizing class.

Point getTextSize ( const SmartUtil::tstring &  text  )  [inherited]

Fills a Point with the size of text to be drawn in the Widget's font.

getTextSize determines the height and width that text will take.
This is useful if you want to allocate enough space to fit known text.
It accounts for the set font too.

bool getVisible (  )  const [inherited]

Retrieves the visible property of the Widget.

Use this function to check if the Widget is visible or not.
If the Widget is visible this function will return true.

HWND handle (  )  const [inherited]

Returns the HWND to the Widget.

Returns the HWND to the inner window of the Widget.
If you need to do directly manipulation of the window use this function to retrieve the HWND of the Widget.

void invalidateWidget (  )  [inherited]

Add this widget to the update area.

Same as updateWidget except that this does not force an immediate redraw.

void maximize (  )  [inherited]

Maximize your window.

This will make the window fill the whole area that the window has available.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

void minimize (  )  [inherited]

Minimize your window.

This will make the window become minimized.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

void onChar ( typename MessageMapType::itsBoolFunctionTakingInt  eventHandler  )  [inherited]

Setting the event handler for the "char" event.

If supplied event handler is called when control has the focus and character event occurs
parameter passed is int which is the character of the nonsystem key being pressed. Return value must be of type bool, if event handler returns true event is defined as "handled" meaning the system will not try itself to handle the event.
Certain widgets, such as WidgetTextBox, will not report VK_RETURN unless you include ES_WANTRETURN in the style field of of the creational structure passed when you createTextBox( cs ).

void onClosing ( typename ThisMessageMap::itsBoolFunctionTakingVoid  eventHandler  )  [inherited]

Event Handler setter for the Closing Event.

If supplied event handler is called before the window is closed.
Signature of event handler must be "bool foo()"
If you return true from your event handler the window is closed, otherwise the window is NOT allowed to actually close!!

void onCreate ( typename ThisMessageMap::itsVoidFunctionTakingSeedPointer  eventHandler  ) 

Setting the event handler for the "create" event.

The event handler must have the signature "void foo( CREATESTRUCT * )" where the WidgetType is the type of Widget that realizes the Aspect.
If you supply an event handler for this event your handler will be called when Widget is initially created.
The argument CREATESTRUCT sent into your handler is modifiable so that you can add/remove styles and add remove EX styles etc.

void onMiddleMouseDown ( typename MessageMapType::voidFunctionTakingMouseEventResult  eventHandler  )  [inherited]

Middle mouse button pressed event handler setter.

If supplied, function will be called when user press the Middle Mouse button in the client area of the widget.
The parameter passed is const MouseEventResult & which contains the state of the mouse.

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 restore (  )  [inherited]

Restores your window.

This will make the window become restored.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

LRESULT sendWidgetMessage ( HWND  hWnd,
UINT  msg,
WPARAM &  wPar,
LPARAM &  lPar 
) [virtual, inherited]

Send a message to the Widget.

If you need to be able to send a message to a Widget then use this function as it will unroll into
a SendMessage from the Windows API

Reimplemented from MessageMap.

Reimplemented in WidgetMDIChild.

void setActive (  )  [inherited]

Activates the Widget.

Changes the activated property of the Widget.
Use this function to change the activated property of the Widget to true or with other words make this Widget the currently active Widget.

void setBounds ( int  x,
int  y,
int  width,
int  height,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

x is the new horizontal position of your window.
y is the new vertical position of your window.
width is the new width and height is the new height of your window.
Zenith is as in all other bounds function top/left.
A call to this function will (probably) also MOVE your Widget too.

void setBounds ( const Point newPos,
const Point newSize,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

The input parameter newPos of type Point defines the new position of the window.
The newSize member of type Point is the new size of the window.
A call to this function will (probably) also MOVE your Widget too.

void setBounds ( const Rectangle rect,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

The input parameter Rectangle defines the new size (and position) of the window.
The pos member of the Rectangle is the position and the size member is the size.
So a call to this function will (probably) also MOVE your Widget too.

void setEnabled ( bool  enabled  )  [inherited]

Sets the enabled property of the Widget.

Changes the enabled property of the Widget. Use this function to change the enabled property of the Widget

void setFocus (  )  [inherited]

Gives the Widget the keyboard focus.

Use this function if you wish to give the Focus to a specific Widget

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]

Sets the font used by the Widget.

Changes the font of the Widget to the given font. Use the class Font to construct a font in which to set by this function.

void setPositionPerPlace ( SmartWin::Place bound  )  [inherited]

Given a bounding Place class, place this Widget and adjust to the next position.

This function places the Widget into the bounding rectangle specified by bound.
The size of the Widget is preserved.
The Widgets are sized and placed from left to right until a row is full, and then continues with the next row.
The internal position of bound is updated.

void setSizeAsCol ( const Rectangle rect,
int  rows,
int  rownum,
int  border = 0,
bool  updateWindow = true 
) [inherited]

Given a bounding rectangle with rows, put this Widget in the rownum position.

The rect defines a column made up of a number of rows. The rownum specifies a zero based index of the row to place the Widget. [ row0 ]
[ row1 ]
...
[ rownum ]
[ ]

Of course you could just generate a new bounding rectangle, but this is easier.

void setSizeAsGridPerPlace ( SmartWin::Place bound,
int  rows,
int  cols 
) [inherited]

this Widget in the next cell.

Bound determines the bounding rectangle, and borders.
rows and cols determine the size and position of each cell.
The internal position of bound is updated.
The Widgets are sized and placed according to the current cell, from left to right until a row is full, and then continues with the next row.

void setSizeAsRow ( const Rectangle rect,
int  cols,
int  colnum,
int  border = 0,
bool  updateWindow = true 
) [inherited]

Given a bounding rectangle with cols, put this Widget in the colnum position.

The rect defines a row made up of a number of columns. The colnum specifies a zero based index of the column to place the Widget.
[ col0 ] [ col1 ] ... [ colnum ] [ ] [ ]

void setSizePerTextPerPlace ( SmartWin::Place bound,
const SmartUtil::tstring &  text,
int  extraX = 0,
int  extraY = 0 
) [inherited]

Place after sizing for the Widget's text, and adjust to the next position.

This function places the Widget into the bounding rectangle specified by bound.
The idea is that the size of certain Widgets should really be large enough to show their text. Buttons and text areas are examples.
The size of the Widget is calculated from the size of getText().
It is optionally adjusted by the extraX and extraY.
The Widgets are sized and placed from left to right until a row is full, and then continues with the next row.
The internal position of bound is updated.

void setText ( const SmartUtil::tstring &  txt  )  [inherited]

Sets the text of the AspectText realizing class.

The txt parameter is the new text to put into the realizing object.

void setVisible ( bool  visible  )  [inherited]

Sets the visibility property of the Widget.

Changes the visibility property of the Widget.
Use this function to change the visibility property of the Widget

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.

char virtualKeyToChar ( int  vkey  )  [static, inherited]

Get ascii character from a Virtual Key.

Use this to convert from the input to the response to onKeyPressed to a character.
Virtual Keys do not take into account the shift status of the keyboard, and always report UPPERCASE letters.

Back to SmartWin website
SourceForge.net Logo