WINDEX
Public Member Functions | List of all members
wex::radiobuttonLayout Class Reference

Widget to layout a group of radio buttons. More...

#include <wex.h>

Inheritance diagram for wex::radiobuttonLayout:
wex::layout wex::panel wex::gui

Public Member Functions

 radiobuttonLayout (gui *parent)
 
radiobuttonadd ()
 add a radio button More...
 
int checked ()
 0-based index of checked radio button
 
void check (int i, bool f=true)
 set status of radio button More...
 
void enable (bool f=true)
 Enable/disable all radio buttons. More...
 
- Public Member Functions inherited from wex::layout
 layout (gui *parent)
 
void grid (int cols)
 Specify number of cols to use for layout. More...
 
void colWidths (const std::vector< int > &vw)
 Specify column widths. More...
 
void colfirst (bool f=true)
 Specify that widgets should be added to fill columns first. More...
 
void draw (PAINTSTRUCT &ps)
 
- Public Member Functions inherited from wex::panel
 panel (gui *parent)
 
- Public Member Functions inherited from wex::gui
 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
 
guiparent ()
 
guifind (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 ()
 
eventhandlerevents ()
 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)
 

Additional Inherited Members

- Protected Member Functions inherited from wex::gui
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)
 
- Protected Attributes inherited from wex::gui
HWND myHandle
 
guimyParent
 
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
 

Detailed Description

Widget to layout a group of radio buttons.

Usage:

    wex::radiobuttonLayout & myGroup = wex::maker::make<wex::radiobuttonLayout>( form );
    myGroup.move( {50,50,200,400} );
    myGroup.grid(1);        // layout in one column
    wex::radiobutton& rb1 = myGroup.add();
    rb1.text("Heart");
    rb1.size(60,20);
    rb1.events().click([this]
    {
        Change( 1 );
    });
    wex::radiobutton& rb2 = myGroup.add();
    rb2.text("EMI 1");
    rb2.size(60,20);
    rb2.events().click([this]
    {
        Change(2 );
    });
    wex::radiobutton& rb3 = myGroup.add();
    rb3.text("EMI 2");
    rb3.size(60,20);
    rb3.events().click([this]
    {
        Change( 3 );
    });

Member Function Documentation

◆ add()

radiobutton& wex::radiobuttonLayout::add ( )
inline

add a radio button

Returns
reference to radiobutton

◆ check()

void wex::radiobuttonLayout::check ( int  i,
bool  f = true 
)
inline

set status of radio button

Parameters
[in]izero-based index of radio button
[in]ftrue or false, default true

◆ enable()

void wex::radiobuttonLayout::enable ( bool  f = true)
inline

Enable/disable all radio buttons.

Parameters
[in]fstatus required, true for enabled, default enabled

The documentation for this class was generated from the following file: