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

A grid of properties. More...

#include <propertygrid.h>

Inheritance diagram for wex::propertyGrid:
wex::gui

Public Types

typedef std::shared_ptr< propertyprop_t
 

Public Member Functions

 propertyGrid (gui *parent)
 
void clear ()
 
propertystring (const std::string &name, const std::string &value)
 Add string property. More...
 
propertychoice (const std::string &name, const std::vector< std::string > &choice)
 Add choice property. More...
 
propertycheck (const std::string &name, bool f)
 Add boolean property. More...
 
void category (const std::string &name)
 Add categoty.
 
void scroll ()
 Add vertical scrollbar.
 
void expand (const std::string name, bool fexpand=true)
 Expand, or contract, category of properties.
 
void expandAll (bool fexpand=true)
 
void move (const std::vector< int > &r)
 
void labelWidth (int w)
 
void update ()
 force every property to redraw its label
 
propertyfind (const std::string &name)
 get pointer to first property with name, ignoring categories
 
propertyfind (const std::string &category, const std::string &name)
 get pointer to first property with name in a category
 
const std::string value (const std::string &name)
 get value in editbox of property with name
 
bool isChecked (const std::string &name)
 
void saveValues ()
 save values in all property textboxes in the property's myValue attribute
 
int propHeight () const
 
void propHeight (int h)
 set property display height in pixels. Default 25
 
void categoryHeightLow (bool f=true)
 set category height low i.e. just one property height, rather than 2x prop height
 
int width () const
 
int propCount () const
 
void change (std::function< void()> f)
 Register function to call when property value has changed.
 
void nameClick (std::function< void(const std::string &)> f)
 Register function to call when property name is clicked.
 
void tabList (bool f=true)
 Enable tab stepping through the properties. More...
 
- 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.
 
virtual void draw (PAINTSTRUCT &ps)
 
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

A grid of properties.

Add boost to the compiler include search list

Member Function Documentation

◆ check()

property& wex::propertyGrid::check ( const std::string &  name,
bool  f 
)
inline

Add boolean property.

Parameters
[in]nameof property
[in]fdefault
Returns
reference to property

◆ choice()

property& wex::propertyGrid::choice ( const std::string &  name,
const std::vector< std::string > &  choice 
)
inline

Add choice property.

Parameters
[in]nameof property
[in]choicevector of choices to be selected from
Returns
reference to property

◆ string()

property& wex::propertyGrid::string ( const std::string &  name,
const std::string &  value 
)
inline

Add string property.

Parameters
[in]nameof property
[in]valueinitial value
Returns
reference to property

◆ tabList()

void wex::propertyGrid::tabList ( bool  f = true)
inline

Enable tab stepping through the properties.

Note: all windows need to have WS_EX_CONTROLPARENT style otherwise the message pump hangs https://stackoverflow.com/a/11090609/16582


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