vgui_dialog Class Reference

#include <vgui_dialog.h>

Inheritance diagram for vgui_dialog:

vgui_dialog_extensions List of all members.

Detailed Description

Abstract dialog class.

vgui_dialog allows the user to build a dialog from a collection of fields. 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 params("My params");
   params.field("Table number", the_table);
   params.choice("Dressing", "French", "Thousand Island", the_dressing);
   params.checkbox("Mayo?", has_mayo);
   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 51 of file vgui_dialog.h.


Public Member Functions

 vgui_dialog (const char *name)
 Constructor - takes the title of the dialog box.
virtual ~vgui_dialog ()
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.
bool ask ()
 Display the dialog box and wait for the users response.

Protected Member Functions

 vgui_dialog ()

Protected Attributes

vgui_dialog_implimpl

Constructor & Destructor Documentation

vgui_dialog::vgui_dialog ( const char *  name  ) 

Constructor - takes the title of the dialog box.

Definition at line 21 of file vgui_dialog.cxx.

vgui_dialog::~vgui_dialog (  )  [virtual]

Definition at line 28 of file vgui_dialog.cxx.

vgui_dialog::vgui_dialog (  )  [inline, protected]

Definition at line 116 of file vgui_dialog.h.


Member Function Documentation

void vgui_dialog::checkbox ( const char *  ,
bool &   
)

Definition at line 42 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  ,
int &   
)

Definition at line 48 of file vgui_dialog.cxx.

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

Definition at line 62 of file vgui_dialog.h.

void vgui_dialog::field ( const char *  ,
long &   
)

Definition at line 54 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  ,
float &   
)

Definition at line 59 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  ,
double &   
)

Definition at line 64 of file vgui_dialog.cxx.

void vgui_dialog::field ( const char *  ,
vcl_string &   
)

Definition at line 69 of file vgui_dialog.cxx.

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

Multiple choice - with two options.

Definition at line 79 of file vgui_dialog.cxx.

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

Multiple choice - with three options.

Definition at line 87 of file vgui_dialog.cxx.

void vgui_dialog::choice ( const char *  ,
const vcl_vector< vcl_string > &  ,
int &   
)

Multiple choice - with the list of options given.

Definition at line 74 of file vgui_dialog.cxx.

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

Definition at line 79 of file vgui_dialog.h.

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

File browsers.

Definition at line 96 of file vgui_dialog.cxx.

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

inline file browser.

Definition at line 101 of file vgui_dialog.cxx.

void vgui_dialog::color ( const char *  label,
vcl_string &   
)

Color chooser.

Definition at line 107 of file vgui_dialog.cxx.

void vgui_dialog::inline_color ( const char *  label,
vcl_string &   
)

Inline color chooser.

Definition at line 112 of file vgui_dialog.cxx.

void vgui_dialog::message ( const char *   ) 

Text message.

Definition at line 117 of file vgui_dialog.cxx.

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

Display a tableau in the dialog.

Definition at line 122 of file vgui_dialog.cxx.

void vgui_dialog::set_cancel_button ( const char *  label  ) 

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  ) 

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  ) 

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

Definition at line 138 of file vgui_dialog.cxx.

bool vgui_dialog::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 in vgui_dialog_extensions.

Definition at line 34 of file vgui_dialog.cxx.


Member Data Documentation

vgui_dialog_impl* vgui_dialog::impl [protected]

Definition at line 117 of file vgui_dialog.h.


The documentation for this class was generated from the following files:
Generated on Sun Nov 22 05:12:05 2009 for core/vgui by  doxygen 1.5.1