Public Member Functions | Protected Attributes
vgui_dialog_extensions Class Reference

Abstract dialog class. More...

#include <vgui_dialog_extensions.h>

Inheritance diagram for vgui_dialog_extensions:
Inheritance graph
[legend]

List of all members.

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 &regexp, vcl_string &dirpath)
 directory browsers.
bool ask ()
 Display the dialog box and wait for the users response.
void line_break ()
void pushbutton (vgui_command_sptr cmnd, const char *label, const void *icon)
void pushbutton (vgui_dialog_callback_no_client_data f, const char *label, const void *icon)
void pushbutton (vgui_dialog_callback f, void const *client_data, const char *label, const void *icon)
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 &regexp, vcl_string &filepath)
 File browsers.
void inline_file (const char *label, vcl_string &regexp, 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_implimpl

Detailed Description

Abstract dialog class.

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 on 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.

Example
   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.


Constructor & Destructor Documentation

vgui_dialog_extensions::vgui_dialog_extensions ( const char *  name)

Constructor - takes the title of the dialog box.

Definition at line 20 of file vgui_dialog_extensions.cxx.

vgui_dialog_extensions::~vgui_dialog_extensions ( ) [virtual]

Definition at line 27 of file vgui_dialog_extensions.cxx.


Member Function Documentation

bool vgui_dialog_extensions::ask ( void  )

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 33 of file vgui_dialog_extensions.cxx.

void vgui_dialog::checkbox ( const char *  txt,
bool &  v 
) [inherited]

Definition at line 60 of file vgui_dialog.cxx.

void vgui_dialog::choice ( const char *  label,
const char *  option1,
const char *  option2,
int &  chosen 
) [inherited]

Multiple choice - with two options.

Definition at line 97 of file vgui_dialog.cxx.

void vgui_dialog::choice ( const char *  label,
const char *  option1,
const char *  option2,
const char *  option3,
int &  chosen 
) [inherited]

Multiple choice - with three options.

Definition at line 105 of file vgui_dialog.cxx.

void vgui_dialog::choice ( const char *  txt,
const vcl_vector< vcl_string > &  labels,
int &  v 
) [inherited]

Multiple choice - with the list of options given.

Definition at line 92 of file vgui_dialog.cxx.

void vgui_dialog::choice ( const char *  s,
const vcl_vector< vcl_string > &  v,
unsigned &  r 
) [inline, inherited]

Definition at line 91 of file vgui_dialog.h.

void vgui_dialog::color ( const char *  label,
vcl_string &  v 
) [inherited]

Color chooser.

Definition at line 125 of file vgui_dialog.cxx.

void vgui_dialog_extensions::dir ( const char *  label,
vcl_string &  regexp,
vcl_string &  dirpath 
)

directory browsers.

Definition at line 42 of file vgui_dialog_extensions.cxx.

void vgui_dialog::field ( const char *  txt,
int &  v 
) [inherited]

Definition at line 66 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  c,
unsigned int &  v 
) [inline, inherited]

Definition at line 74 of file vgui_dialog.h.

void vgui_dialog::field ( const char *  txt,
long &  v 
) [inherited]

Definition at line 72 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  txt,
float &  v 
) [inherited]

Definition at line 77 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  txt,
double &  v 
) [inherited]

Definition at line 82 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  txt,
vcl_string &  v 
) [inherited]

Definition at line 87 of file vgui_dialog.cxx.

void vgui_dialog::file ( const char *  label,
vcl_string &  regexp,
vcl_string &  filepath 
) [inherited]

File browsers.

Definition at line 114 of file vgui_dialog.cxx.

void vgui_dialog::inline_color ( const char *  label,
vcl_string &  v 
) [inherited]

Inline color chooser.

Definition at line 130 of file vgui_dialog.cxx.

void vgui_dialog::inline_file ( const char *  label,
vcl_string &  regexp,
vcl_string &  filepath 
) [inherited]

inline file browser.

Definition at line 119 of file vgui_dialog.cxx.

void vgui_dialog::inline_tableau ( const vgui_tableau_sptr  tab,
unsigned  width,
unsigned  height 
) [inherited]

Display a tableau in the dialog.

Definition at line 140 of file vgui_dialog.cxx.

void vgui_dialog_extensions::line_break ( )

Reimplemented from vgui_dialog.

Definition at line 50 of file vgui_dialog_extensions.cxx.

void vgui_dialog::message ( const char *  txt) [inherited]

Text message.

Definition at line 135 of file vgui_dialog.cxx.

void vgui_dialog::pushbutton ( vgui_command_sptr  cmnd,
const char *  label,
const void *  icon 
) [inherited]

Definition at line 43 of file vgui_dialog.cxx.

void vgui_dialog::pushbutton ( vgui_dialog_callback_no_client_data  f,
const char *  label,
const void *  icon 
) [inherited]

Definition at line 48 of file vgui_dialog.cxx.

void vgui_dialog::pushbutton ( vgui_dialog_callback  f,
void const *  client_data,
const char *  label,
const void *  icon 
) [inherited]

Definition at line 54 of file vgui_dialog.cxx.

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 146 of file vgui_dialog.cxx.

void vgui_dialog::set_modal ( const bool  is_modal) [inherited]

A "modal" dialog captures all events sent to the application.

Definition at line 156 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 151 of file vgui_dialog.cxx.


Member Data Documentation

vgui_dialog_impl* vgui_dialog::impl [protected, inherited]

Definition at line 131 of file vgui_dialog.h.


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