2 #include "propertygrid.h"
34 , myAppWindow( AppWindow )
38 move( {100,100,300,300} );
39 myGrid.move( { 50,50, 200, 60});
40 myGrid.labelWidth( 50 );
44 myOKButton.text(
"OK");
60 const std::string& name,
61 const std::string& def )
63 ExpandForAdditionalProperty();
64 return myGrid.
string( name, def );
67 const std::string& name,
68 const std::vector<std::string>& choice )
70 ExpandForAdditionalProperty();
71 return myGrid.
choice( name, choice );
74 const std::string& name,
77 ExpandForAdditionalProperty();
78 return myGrid.
check( name, def );
89 auto wh = myGrid.
size();
90 move( {100,100,wh[0]+100,wh[1]+200} );
91 myOKButton.
move( { 100,wh[1]+80, 50, 40 } );
109 std::string
value (
const std::string& name )
111 auto p = myGrid.
find( name );
113 return "property not found";
114 return p->savedValue();
116 bool isChecked(
const std::string& name )
118 return myGrid.isChecked( name );
120 void gridWidth(
int w )
122 myGrid.move( { 50,50, w, 60});
124 void labelWidth(
int w )
126 myGrid.labelWidth( w );
133 void ExpandForAdditionalProperty()
135 myGrid.move( { 50, 50,
137 ( myGrid.propCount() + 1 ) * myGrid.propHeight()
void click(std::function< void(void)> f, bool propogate=false)
register click event handler
Definition: wex.h:276
The base class for all windex gui elements.
Definition: wex.h:824
void showModal(gui &appWindow)
Show this window and suspend all other windows interactions until this is closed.
Definition: wex.h:1505
void endModal()
Stop modal interaction and close window.
Definition: wex.h:1558
eventhandler & events()
Get event handler.
Definition: wex.h:1649
void move(const std::vector< int > &r)
Move the window.
Definition: wex.h:1587
void size(int w, int h)
Change size without moving top left corner.
Definition: wex.h:1598
void bgcolor(int color)
Change background color.
Definition: wex.h:949
gui()
Construct top level window with no parent.
Definition: wex.h:831
A class for making windex objects.
Definition: wex.h:3237
A grid of properties.
Definition: propertygrid.h:396
property & check(const std::string &name, bool f)
Add boolean property.
Definition: propertygrid.h:452
property & string(const std::string &name, const std::string &value)
Add string property.
Definition: propertygrid.h:426
void saveValues()
save values in all property textboxes in the property's myValue attribute
Definition: propertygrid.h:682
property & choice(const std::string &name, const std::vector< std::string > &choice)
Add choice property.
Definition: propertygrid.h:439
void tabList(bool f=true)
Enable tab stepping through the properties.
Definition: propertygrid.h:733
property * find(const std::string &name)
get pointer to first property with name, ignoring categories
Definition: propertygrid.h:620
A name value pair.
Definition: propertygrid.h:14
gui * Add(gui *g)
Add new gui element.
Definition: wex.h:2978
static windex & get()
get reference to windex gui framework ( singleton )
Definition: wex.h:2950