2 #include "propertygrid.h"
35 , myAppWindow( AppWindow )
39 move( {100,100,width,300} );
40 myGrid.move( { 50,50, width-100, 60});
41 myGrid.labelWidth( width / 4 );
45 myOKButton.text(
"OK");
61 const std::string& name,
62 const std::string& def )
64 ExpandForAdditionalProperty();
65 return myGrid.
string( name, def );
68 const std::string& name,
69 const std::vector<std::string>& choice )
71 ExpandForAdditionalProperty();
72 return myGrid.
choice( name, choice );
75 const std::string& name,
78 ExpandForAdditionalProperty();
79 return myGrid.
check( name, def );
90 auto wh = myGrid.
size();
91 move( {100,100,wh[0]+100,wh[1]+200} );
92 myOKButton.
move( { 100,wh[1]+80, 50, 40 } );
110 std::string
value (
const std::string& name )
112 auto p = myGrid.
find( name );
114 return "property not found";
115 return p->savedValue();
117 bool isChecked(
const std::string& name )
119 return myGrid.isChecked( name );
121 void gridWidth(
int w )
123 myGrid.move( { 50,50, w, 60});
125 void labelWidth(
int w )
127 myGrid.labelWidth( w );
134 void ExpandForAdditionalProperty()
136 myGrid.move( { 50, 50,
138 ( myGrid.propCount() + 1 ) * myGrid.propHeight()
void click(std::function< void(void)> f, bool propogate=false)
register click event handler
Definition: wex.h:280
The base class for all windex gui elements.
Definition: wex.h:900
void showModal(gui &appWindow)
Show this window and suspend all other windows interactions until this is closed.
Definition: wex.h:1599
void endModal()
Stop modal interaction and close window.
Definition: wex.h:1651
eventhandler & events()
Get event handler.
Definition: wex.h:1742
void move(const std::vector< int > &r)
Move the window.
Definition: wex.h:1680
void size(int w, int h)
Change size without moving top left corner.
Definition: wex.h:1691
void bgcolor(int color)
Change background color.
Definition: wex.h:1025
gui()
Construct top level window with no parent.
Definition: wex.h:907
A class for making windex objects.
Definition: wex.h:3338
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:3071
static windex & get()
get reference to windex gui framework ( singleton )
Definition: wex.h:3043