#include <AbstractButton.h>
Inheritance diagram for wkgl::AbstractButton:

Public Methods | |
| AbstractButton (const char *label, int x=AUTOPOS, int y=AUTOPOS, int width=AUTOSIZE, int height=AUTOSIZE) | |
| Constructor that creates a new button. | |
| virtual void | setText (const char *label) |
| Sets the buttons label. | |
| virtual BOOL | create (Control *parent) |
| Specifies the manner in which a particular control is to be created. | |
| virtual void | setStyle (LFLAG style, bool extended=false) |
| Alters a control's style. | |
| virtual LFLAG | getStyle (bool extended=false) |
| Gets a control's style. | |
| virtual LRESULT | sendEventToParent (UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the parent. | |
| virtual LRESULT | sendEventToChild (HWND child, UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the child. | |
| virtual LRESULT | sendEventToChild (Component *child, UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the child. | |
| LRESULT | sendMessage (UINT msg, WPARAM wParam, LPARAM lParam) |
| Sends a message to the underlying control. | |
| virtual BOOL | show () |
| Shows the component. | |
| virtual BOOL | hide () |
| Hides the component. | |
| virtual void | setSize (int width, int height) |
| Sets the size of the component. | |
| virtual void | setWidth (int width) |
| Sets the width of the component. | |
| virtual void | setHeight (int height) |
| Sets the height of the component. | |
| virtual int | getWidth () |
| Gets the width of the component. | |
| virtual int | getHeight () |
| Gets the height of the component. | |
| virtual void | setText (String label) |
| Set the components text. | |
| virtual void | getText (char *buf, int buf_len=30) |
| Returns the component's text. | |
| virtual void | getText (String &buf, int buf_len=30) |
| Returns the component's text. | |
| virtual int | getX () |
| Returns the component's horizontal position. | |
| virtual int | getY () |
| Returns the component's vertical position. | |
| virtual void | setX (int x) |
| Sets the component's horizontal position. | |
| virtual void | setY (int y) |
| Sets the component's vertical position. | |
| virtual BOOL | autoPositionX () |
| Tells whether x coordinate should be auto positioned by layout manager. | |
| virtual BOOL | autoPositionY () |
| Tells whether y coordinate should be auto positioned by layout manager. | |
| virtual void | setautoPositionX (BOOL a) |
| Sets whether x coordinate should be auto positioned by layout manager. | |
| virtual void | setautoPositionY (BOOL a) |
| Sets whether y coordinate should be auto positioned by layout manager. | |
| virtual void | setPosition (int x, int y) |
| Sets the component's position. | |
| virtual void | setCursor (Cursor *cur) |
| Set the cursor that will be used by this window. | |
| virtual Cursor * | getCursor () |
| Get the cursor that is be used by this window. | |
| virtual WNDCLASSEX | getWndClass () |
| Returns the window class structure that represents this window. | |
| virtual String * | getClassName () |
| Returns the window class name of this control. | |
| virtual void | paint () |
| Paints the control to the display. | |
| virtual void | registerComponent (HWND *hwnd, Component *com) |
| Allows this component to recieve top level events. | |
| virtual void | registerChild (HWND *hwnd, Component *com) |
| Allows this component to propagate an event to the given child. | |
| virtual LRESULT | fireChildEvents (UINT message, WPARAM wParam, LPARAM lParam) |
| Propagates the events to the appropriate child/children. | |
| virtual Component * | getParent () |
| Returns a pointer to the parent component. | |
| virtual void | setParent (Component *p) |
| Sets the components parent. | |
| virtual HINSTANCE | getInstance () |
| Returns the instance of the application. | |
| virtual HWND | getHwnd () |
| Returns the window handle. | |
| virtual void | setHwnd (HWND h) |
| Sets the window handle. | |
| virtual void | addCallBack (COMCALLBACK callback) |
| Adds a callback function. | |
| virtual void | addCallBack (CallBack *callback) |
| Adds a callback method. | |
| virtual LRESULT | fireEvents (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| Propagates events to all the callback functions. | |
Static Public Methods | |
| UINT | getWndProc () |
| Returns the the address of GlobalProc(). | |
Protected Methods | |
| AbstractButton () | |
| Used by subclasses that want to create the button manually. | |
| int | calculateWidth (String &label) |
| Calculates the size of the button based on the given label. | |
| void | createControl (Component *parent, String *classname, String *label, int width, int height, int x, int y, int style, int exstyle) |
| Method that does the actual control creation. | |
| void | getCharSize () |
| Gets the average width of a character and the height of a character. | |
Protected Attributes | |
| bool | awidth |
| Flag saying whether the button's width is AUTOSIZE. | |
| bool | aheight |
| Flag saying whether the button's height is AUTOSIZE. | |
| Control * | parent |
| The parent of the component. | |
| int | showstate |
| The state of the window when hidden. | |
| int | width |
| The width of the component in pixels. | |
| int | height |
| The height of the component in pixels. | |
| int | x |
| The horizontal position of the panel. | |
| int | y |
| The vertical position of the panel. | |
| BOOL | ax |
| Flag saying whether the x is auto positioned. | |
| BOOL | ay |
| Flag saying whether the y is auto positioned. | |
| Cursor * | cursor |
| The cursor. | |
| String | className |
| The name of this class. | |
| String * | label |
| The controls label. | |
| WNDCLASSEX | wndclass |
| The window class. | |
| DWORD | style |
| The style of the control. | |
| DWORD | exstyle |
| The extended style of the control. | |
| HINSTANCE | hInstance |
| The instance of this application. | |
| HWND | hwnd |
| The handle to the component. | |
| std::vector< CHILDCOMPONENT > | clisteners |
| A list of the child components that events are to be passed to. | |
| std::vector< COMCALLBACK > | comlisteners |
| Stores the callbacks for this component that use functions. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks. | |
| std::vector< CallBack * > | classlisteners |
| Stores the callbacks for this component that come from classes. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks. | |
Static Protected Attributes | |
| TEXTMETRIC | finfo |
| Information about the font used by the system. | |
Friends | |
| LRESULT CALLBACK | globalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| Is used to process all the callback functions. | |
|
||||||||||||||||||||||||
|
Constructor that creates a new button.
|
|
|
Used by subclasses that want to create the button manually.
|
|
|
Adds a callback method. The callback must be a method from a class that inheirits from CallBack.
|
|
|
Adds a callback function.
|
|
|
Tells whether x coordinate should be auto positioned by layout manager.
|
|
|
Tells whether y coordinate should be auto positioned by layout manager.
|
|
|
Calculates the size of the button based on the given label.
|
|
|
Specifies the manner in which a particular control is to be created.
Implements wkgl::Control. |
|
||||||||||||||||||||||||||||||||||||||||
|
Method that does the actual control creation.
|
|
||||||||||||||||
|
Propagates the events to the appropriate child/children.
Reimplemented in wkgl::Dialog. |
|
||||||||||||||||||||
|
Propagates events to all the callback functions.
Reimplemented in wkgl::Dialog. |
|
|
Gets the average width of a character and the height of a character.
|
|
|
Returns the window class name of this control.
|
|
|
Get the cursor that is be used by this window.
|
|
|
Gets the height of the component.
Reimplemented in wkgl::LayoutManager. |
|
|
Returns the window handle.
|
|
|
Returns the instance of the application.
|
|
|
Returns a pointer to the parent component.
|
|
|
Gets a control's style.
|
|
||||||||||||
|
Returns the component's text.
|
|
||||||||||||
|
Returns the component's text.
|
|
|
Gets the width of the component.
Reimplemented in wkgl::LayoutManager. |
|
|
Returns the window class structure that represents this window.
|
|
|
Returns the the address of GlobalProc().
|
|
|
Returns the component's horizontal position.
|
|
|
Returns the component's vertical position.
|
|
|
Hides the component. It still may not be hidden if Window::BeginMessageLoop() has not been called yet, or some callback negates this methods effect.
Reimplemented in wkgl::Dialog, and wkgl::Window. |
|
|
Paints the control to the display.
|
|
||||||||||||
|
Allows this component to propagate an event to the given child.
|
|
||||||||||||
|
Allows this component to recieve top level events.
|
|
||||||||||||||||||||
|
Transmits the given event to the child.
|
|
||||||||||||||||||||
|
Transmits the given event to the child.
|
|
||||||||||||||||
|
Transmits the given event to the parent.
|
|
||||||||||||||||
|
Sends a message to the underlying control. See the components docs. |
|
|
Sets whether x coordinate should be auto positioned by layout manager.
|
|
|
Sets whether y coordinate should be auto positioned by layout manager.
|
|
|
Set the cursor that will be used by this window.
|
|
|
Sets the height of the component.
|
|
|
Sets the window handle.
|
|
|
Sets the components parent.
|
|
||||||||||||
|
Sets the component's position. This method is most often used by layout managers to set a control's position without affecting wether x or y's value is AUTOPOS.
Reimplemented in wkgl::LayoutManager. |
|
||||||||||||
|
Sets the size of the component.
|
|
||||||||||||
|
Alters a control's style.
|
|
|
Set the components text.
|
|
|
Sets the buttons label.
Reimplemented from wkgl::Control. |
|
|
Sets the width of the component.
|
|
|
Sets the component's horizontal position.
|
|
|
Sets the component's vertical position.
|
|
|
Shows the component. It still may not be shown if Window::BeginMessageLoop() has not been called yet, or some callback negates this methods effect.
Reimplemented in wkgl::Dialog, and wkgl::Window. |
|
||||||||||||||||||||
|
Is used to process all the callback functions.
|
|
|
Flag saying whether the button's height is AUTOSIZE.
|
|
|
Flag saying whether the button's width is AUTOSIZE.
|
|
|
Flag saying whether the x is auto positioned.
|
|
|
Flag saying whether the y is auto positioned.
|
|
|
Stores the callbacks for this component that come from classes. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks.
|
|
|
The name of this class.
|
|
|
A list of the child components that events are to be passed to. Stores the children who wish to recieve events.
|
|
|
Stores the callbacks for this component that use functions. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks.
|
|
|
The cursor.
|
|
|
The extended style of the control.
Reimplemented in wkgl::Window. |
|
|
Information about the font used by the system.
|
|
|
The height of the component in pixels.
|
|
|
The instance of this application.
|
|
|
The handle to the component.
|
|
|
The controls label.
|
|
|
The parent of the component.
Reimplemented from wkgl::Component. |
|
|
The state of the window when hidden.
|
|
|
The style of the control.
Reimplemented in wkgl::Window. |
|
|
The width of the component in pixels.
|
|
|
The window class.
|
|
|
The horizontal position of the panel.
|
|
|
The vertical position of the panel.
|
1.2.18