|
| slider (gui *parent) |
|
void | range (int min, int max) |
| Specify the range of values used. More...
|
|
void | stopTracking () |
|
void | draw (PAINTSTRUCT &ps) |
|
void | vertical (bool f=true) |
|
double | position () const |
|
void | position (double v) |
|
void | maximum (double max) |
|
void | steps (bool f=true) |
| Specify slider moves in steps to integer positions.
|
|
| 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) |
|
|
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.
|
|
int | NewID () |
| Create new, unique ID for gui element. More...
|
|
int | scrollMove (SCROLLINFO &si, int code) |
|
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 |
|
A widget which user can drag to change a value.
// construct top level window
gui& form = wex::windex::topWindow();
form.move({ 50,50,500,400});
form.text("Slider demo");
// construct labels to display values when sliders are moved
wex::label& label = wex::make<wex::label>(form);
label.move( 200, 200, 100,30 );
label.text("");
wex::label& vlabel = wex::make<wex::label>(form);
vlabel.move( 200, 240, 100,30 );
vlabel.text("");
// construct horizontal slider
wex::slider& S = wex::make<wex::slider>( form );
S.move({ 50,50,400,50});
S.range( 0, 100 );
S.text("horiz slider");
S.events().slid([&](int pos)
{
label.text("horiz value: " + std::to_string( pos ));
label.update();
});
// construct vertical slider
wex::slider& V = wex::make<wex::slider>( form );
V.move({ 50,100,50,400});
V.range( 0, 10 );
V.vertical();
V.events().slid([&](int pos)
{
vlabel.text("vert value: " + std::to_string( pos ));
vlabel.update();
});
form.show();