#include <vgui_dialog_extensions.h>
Inheritance diagram for vgui_dialog_extensions:

vgui_dialog_extension allows the user to build a dialog from a collection of fields. It differs from vgui_dialog by two elements, directory browser to be able to choose folders in addition to the files, and line breaks. The tableau will be designed so that elements are placed on the same line until a line break element is inserted. This allows to create more versatile dialogs, by grouping elements one one line.
A field in this context consists of a vcl_string label and a variable. The dialog is then posted using the ask() method. If ask returns true then any changes to the fields in the dialog are used to update the variables. Each vgui_dialog contains an instance of a concrete subclass of vgui_dialog_impl. The type of the subclass will be determined by the GUI being used.
vgui_dialog_extensions params("My params"); params.field("Table number", the_table); params.line_break(); params.choice("Dressing", "French", "Thousand Island", the_dressing); params.checkbox("Mayo?", has_mayo); params.line_break(); params.message("No smoking is allowed in the restaurant!"); if (!params.ask()) return; // cancelled send_order(the_table, the_dressing, has_mayo);
Definition at line 54 of file vgui_dialog_extensions.h.
Public Member Functions | |
| vgui_dialog_extensions (const char *name) | |
| Constructor - takes the title of the dialog box. | |
| virtual | ~vgui_dialog_extensions () |
| void | dir (const char *label, vcl_string ®exp, vcl_string &dirpath) |
| directory browsers. | |
| bool | ask () |
| Display the dialog box and wait for the users response. | |
| void | line_break () |
| void | checkbox (const char *, bool &) |
| void | field (const char *, int &) |
| void | field (const char *c, unsigned int &v) |
| void | field (const char *, long &) |
| void | field (const char *, float &) |
| void | field (const char *, double &) |
| void | field (const char *, vcl_string &) |
| void | choice (const char *label, const char *option1, const char *option2, int &chosen) |
| Multiple choice - with two options. | |
| void | choice (const char *label, const char *option1, const char *option2, const char *option3, int &chosen) |
| Multiple choice - with three options. | |
| void | choice (const char *, const vcl_vector< vcl_string > &, int &) |
| Multiple choice - with the list of options given. | |
| void | choice (const char *s, const vcl_vector< vcl_string > &v, unsigned &r) |
| void | file (const char *label, vcl_string ®exp, vcl_string &filepath) |
| File browsers. | |
| void | inline_file (const char *label, vcl_string ®exp, vcl_string &filepath) |
| inline file browser. | |
| void | color (const char *label, vcl_string &) |
| Color chooser. | |
| void | inline_color (const char *label, vcl_string &) |
| Inline color chooser. | |
| void | message (const char *) |
| Text message. | |
| void | inline_tableau (const vgui_tableau_sptr tab, unsigned width, unsigned height) |
| Display a tableau in the dialog. | |
| void | set_cancel_button (const char *label) |
| Set the labels on each button, if 0 that button does not appear. | |
| void | set_ok_button (const char *label) |
| Set the labels on each button, if 0 that button does not appear. | |
| void | set_modal (const bool) |
| A "modal" dialog captures all events sent to the application. | |
Protected Attributes | |
| vgui_dialog_impl * | impl |
| vgui_dialog_extensions::vgui_dialog_extensions | ( | const char * | name | ) |
Constructor - takes the title of the dialog box.
Definition at line 21 of file vgui_dialog_extensions.cxx.
| vgui_dialog_extensions::~vgui_dialog_extensions | ( | ) | [virtual] |
Definition at line 29 of file vgui_dialog_extensions.cxx.
| void vgui_dialog_extensions::dir | ( | const char * | label, | |
| vcl_string & | regexp, | |||
| vcl_string & | dirpath | |||
| ) |
| bool vgui_dialog_extensions::ask | ( | ) |
Display the dialog box and wait for the users response.
Returns true if the user clicks on the 'OK' button and false if the user clicks on the 'Cancel' button.
Reimplemented from vgui_dialog.
Definition at line 35 of file vgui_dialog_extensions.cxx.
| void vgui_dialog_extensions::line_break | ( | ) |
Definition at line 52 of file vgui_dialog_extensions.cxx.
| void vgui_dialog::checkbox | ( | const char * | , | |
| bool & | ||||
| ) | [inherited] |
Definition at line 42 of file vgui_dialog.cxx.
| void vgui_dialog::field | ( | const char * | , | |
| int & | ||||
| ) | [inherited] |
Definition at line 48 of file vgui_dialog.cxx.
| void vgui_dialog::field | ( | const char * | c, | |
| unsigned int & | v | |||
| ) | [inline, inherited] |
Definition at line 62 of file vgui_dialog.h.
| void vgui_dialog::field | ( | const char * | , | |
| long & | ||||
| ) | [inherited] |
Definition at line 54 of file vgui_dialog.cxx.
| void vgui_dialog::field | ( | const char * | , | |
| float & | ||||
| ) | [inherited] |
Definition at line 59 of file vgui_dialog.cxx.
| void vgui_dialog::field | ( | const char * | , | |
| double & | ||||
| ) | [inherited] |
Definition at line 64 of file vgui_dialog.cxx.
| void vgui_dialog::field | ( | const char * | , | |
| vcl_string & | ||||
| ) | [inherited] |
Definition at line 69 of file vgui_dialog.cxx.
| void vgui_dialog::choice | ( | const char * | label, | |
| const char * | option1, | |||
| const char * | option2, | |||
| int & | chosen | |||
| ) | [inherited] |
| void vgui_dialog::choice | ( | const char * | label, | |
| const char * | option1, | |||
| const char * | option2, | |||
| const char * | option3, | |||
| int & | chosen | |||
| ) | [inherited] |
| void vgui_dialog::choice | ( | const char * | , | |
| const vcl_vector< vcl_string > & | , | |||
| int & | ||||
| ) | [inherited] |
| void vgui_dialog::choice | ( | const char * | s, | |
| const vcl_vector< vcl_string > & | v, | |||
| unsigned & | r | |||
| ) | [inline, inherited] |
Definition at line 79 of file vgui_dialog.h.
| void vgui_dialog::file | ( | const char * | label, | |
| vcl_string & | regexp, | |||
| vcl_string & | filepath | |||
| ) | [inherited] |
| void vgui_dialog::inline_file | ( | const char * | label, | |
| vcl_string & | regexp, | |||
| vcl_string & | filepath | |||
| ) | [inherited] |
| void vgui_dialog::color | ( | const char * | label, | |
| vcl_string & | ||||
| ) | [inherited] |
| void vgui_dialog::inline_color | ( | const char * | label, | |
| vcl_string & | ||||
| ) | [inherited] |
| void vgui_dialog::message | ( | const char * | ) | [inherited] |
| void vgui_dialog::inline_tableau | ( | const vgui_tableau_sptr | tab, | |
| unsigned | width, | |||
| unsigned | height | |||
| ) | [inherited] |
| void vgui_dialog::set_cancel_button | ( | const char * | label | ) | [inherited] |
Set the labels on each button, if 0 that button does not appear.
Definition at line 128 of file vgui_dialog.cxx.
| void vgui_dialog::set_ok_button | ( | const char * | label | ) | [inherited] |
Set the labels on each button, if 0 that button does not appear.
Definition at line 133 of file vgui_dialog.cxx.
| void vgui_dialog::set_modal | ( | const | bool | ) | [inherited] |
A "modal" dialog captures all events sent to the application.
Definition at line 138 of file vgui_dialog.cxx.
vgui_dialog_impl* vgui_dialog::impl [protected, inherited] |
Definition at line 117 of file vgui_dialog.h.
1.5.1