WINDEX
|
The base class for all windex gui elements. More...
#include <wex.h>
Public Member Functions | |
gui () | |
Construct top level window with no parent. More... | |
gui (gui *parent, const char *window_class="windex", unsigned long style=WS_CHILD, unsigned long exstyle=WS_EX_CONTROLPARENT) | |
Construct child of a parent. More... | |
void | child (gui *w) |
register child on this window | |
children_t & | children () |
get vector of children | |
gui * | parent () |
gui * | find (int id) |
find child window with specified id | |
void | focus () |
void | bgcolor (int color) |
Change background color. More... | |
void | nobgerase () |
void | enable (bool f=true) |
Enable/Disable, default enable. | |
bool | isEnabled () const |
void | fontHeight (int h) |
Change font height for this and all child windows. | |
void | fontName (const std::string &name) |
void | icon (const std::string &iconfilename) |
Change icon. More... | |
void | cursor (char *cursorID) |
int | id () |
int | bgcolor () const |
void | textColor (int c) |
Set text color. More... | |
void | text (const std::string &text) |
std::string | text () const |
void | scroll (bool fHoriz=true) |
Add scrollbars. More... | |
void | scrollRange (int width, int height) |
Set the scrolling range. More... | |
sMouse | getMouseStatus () |
Get mouse status. More... | |
void | run () |
Run the windows message loop. More... | |
void | tooltip (const std::string &text, int width=0) |
Add tooltip that pops up helpfully when mouse cursor hovers over widget. More... | |
virtual LRESULT | WindowMessageHandler (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
virtual void | show (bool f=true) |
Show window and all children. | |
void | showModal (gui &appWindow) |
Show this window and suspend all other windows interactions until this is closed. More... | |
void | endModal () |
Stop modal interaction and close window. | |
void | update () |
force widget to redraw completely More... | |
void | move (const std::vector< int > &r) |
Move the window. More... | |
void | size (int w, int h) |
Change size without moving top left corner. More... | |
void | move (int x, int y) |
Change position without changing size. More... | |
void | move (int x, int y, int w, int h) |
std::vector< int > | size () |
Size of window client area. More... | |
std::vector< int > | lefttop () |
eventhandler & | events () |
Get event handler. | |
HWND | handle () |
get window handle | |
void | delete_list (std::vector< HWND > *list) |
set delete list for when gui is detroyed | |
void | setfont (LOGFONT &logfont, HFONT &font) |
change font for this and all child windows | |
void | setAsyncReadCompleteMsgID (int id) |
Protected Member Functions | |
void | Create (HWND parent, const char *window_class, DWORD style, DWORD exstyle=0, int id=0) |
Create the managed window. More... | |
void | font (LOGFONT &logfont, HFONT &font) |
get font details More... | |
void | createNewFont () |
Replace font used by this and child windows from logfont. | |
virtual void | draw (PAINTSTRUCT &ps) |
int | NewID () |
Create new, unique ID for gui element. More... | |
int | scrollMove (SCROLLINFO &si, int code) |
Protected Attributes | |
HWND | myHandle |
gui * | myParent |
eventhandler | myEvents |
int | myBGColor |
int | myTextColor |
HBRUSH | myBGBrush |
LOGFONT | myLogFont |
HFONT | myFont |
std::vector< HWND > * | myDeleteList |
std::string | myText |
int | myID |
std::vector< gui * > | myChild |
gui elements to be displayed in this window | |
bool | myfModal |
true if element is being shown as modal | |
bool | myfEnabled |
true if not disabled | |
bool | myfnobgerase |
HWND | myToolTip |
unsigned int | myAsyncReadCompleteMsgID |
handle to tooltip control for this gui element | |
char * | myCursorID |
bool | myfScrollHoriz |
The base class for all windex gui elements.
|
inline |
Construct top level window with no parent.
Application code should NOT use this constructor directly, nor that of any specilaization classes. Intead use maker::make().
|
inline |
Construct child of a parent.
Application code should NOT use this constructor directly, nor that of any sepecilaization classes. Intead use maker::make().
|
inline |
Change background color.
[in] | color | in BGR format eg 0x0000FF for red |
|
inlineprotected |
Create the managed window.
[in] | parent | handle of parent window |
[in] | window_class | controls which callback function handles window messages |
[in] | style | |
[in] | exstyle | |
[in] | id | identifies which control generated notification |
|
inlineprotected |
get font details
[out] | logfont | logical font |
[out] | font | Used by child window constructor to inherit font from parent. |
|
inline |
Get mouse status.
|
inline |
Change icon.
[in] | iconfilename | Use to set the application icon in the taskbar |
|
inline |
Move the window.
[in] | r | specify location and size r contains 4 values, { x, y, width, height } |
|
inline |
Change position without changing size.
[in] | x | left |
[in] | y | top |
|
inlineprotected |
Create new, unique ID for gui element.
The first ID will be 1, and is assumed to be the application window which causes the application to quit when destroyed
|
inline |
Run the windows message loop.
This waits for events to occur and runs the requested event handler when they do.
It does not return until the application window ( that is the first top level window created ) is closed
|
inline |
Add scrollbars.
[in] | fHoriz | true if horizontal scroll reuired, default true |
|
inline |
Set the scrolling range.
[in] | width | of the underlying window to be scrolled over |
[in] | height | of the underlying window to be scrolled over |
This sets how far scrolling can move horixonatally and vertically. The width and height should be set to the maximum locations to be shown when scrolled to the limits.
This should be called again if the window size changes.
|
inline |
Show this window and suspend all other windows interactions until this is closed.
appWindow | application window to disable while modal runs |
|
inline |
Size of window client area.
|
inline |
Change size without moving top left corner.
[in] | w | width |
[in] | h | height |
|
inline |
Set text color.
c | color 0xBBGGRR e.g. 0x0000FF for red If not called, defaults to black children do not inherit this |
|
inline |
Add tooltip that pops up helpfully when mouse cursor hovers over widget.
[in] | text | of tooltip |
[in] | width | of multiline tooltip, default single line |
|
inline |
force widget to redraw completely
Windex makes no effort to auto update the screen display. If application code alters something and the change should be seen immediatly then update() should be called, either on the widget that has changed or the top level window that contains the changed widgets.