wex  v20.04.0
Public Member Functions | List of all members
wex::item_template_dialog< T > Class Template Reference

Offers a dialog template to set several items. More...

#include <wex/itemtpldlg.h>

Public Member Functions

 item_template_dialog (const std::vector< T > &v, const window_data &data=wex::window_data(), int rows=0, int cols=1)
 Constructor. More...
 
void add (const T &item)
 Adds an item to the temp vector.
 
bool bind_button (const T &item)
 If this item is related to a button, bind to event handler. More...
 
const T find (const std::string &label) const
 Returns the (first) item that has specified label, or empty item if item does not exist.
 
void force_checkbox_checked (const std::string &contains=std::string(), const std::string &page=std::string())
 If you specified some checkboxes, calling this method requires that one of them should be checked for the OK button to be enabled. More...
 
const auto & get_items () const
 Returns all items.
 
const auto get_item_value (const std::string &label) const
 Returns the item actual value for specified label, or empty object if item does not exist.
 
bool set_item_value (const std::string &label, const std::any &value) const
 Sets the item actual value for specified label.
 

Detailed Description

template<class T>
class wex::item_template_dialog< T >

Offers a dialog template to set several items.

If you only specify a wxCANCEL button, the dialog is readonly. When pressing the:

Constructor & Destructor Documentation

◆ item_template_dialog()

template<class T >
wex::item_template_dialog< T >::item_template_dialog ( const std::vector< T > &  v,
const window_data data = wex::window_data(),
int  rows = 0,
int  cols = 1 
)
inline

Constructor.

Parameters
vvector with items
datadata
rowsnumber of rows (if 0 add similar items on next row)
colsnumber of columns

Member Function Documentation

◆ bind_button()

template<class T >
bool wex::item_template_dialog< T >::bind_button ( const T &  item)
inline

If this item is related to a button, bind to event handler.

Returns true if bind was done.

◆ force_checkbox_checked()

template<class T >
void wex::item_template_dialog< T >::force_checkbox_checked ( const std::string &  contains = std::string(),
const std::string &  page = std::string() 
)
inline

If you specified some checkboxes, calling this method requires that one of them should be checked for the OK button to be enabled.

Parameters
containsspecify the (part of) the name of the checkbox
pagespecify on which page