XGP::XDialog Class Reference

Baseclass for dialogs. More...

Inherited by XGP::BrowserDlg, XGP::ConnectDlg, XGP::HTMLViewer, XGP::LoginDialog, XGP::PrintDialog, XGP::SearchDialog, XGP::TraceDlg, XGP::XAbout, and XGP::XDate.

List of all members.

Public Member Functions

virtual ~XDialog ()

Protected Types

enum  buttons { NONE = 0, OK = 1, CANCEL = 2, OKCANCEL = (OK | CANCEL) }

Protected Member Functions

 XDialog (const Glib::ustring &title, Gtk::Window &parent, unsigned int buttons=OKCANCEL, bool modal=false, bool use_separator=false)
 XDialog (const Glib::ustring &title, unsigned int buttons=OKCANCEL, bool modal=false, bool use_separator=false)
 XDialog (unsigned int buttons=OKCANCEL, bool modal=false, bool use_separator=false)
void init (unsigned int buttons=OKCANCEL)
virtual bool isDataOK ()
virtual void okEvent ()
virtual void cancelEvent ()
virtual void command (int action)
void free (int)
void on_response (int cmd)

Protected Attributes

Gtk::Button * ok
Gtk::Button * cancel


Detailed Description

Baseclass for dialogs.

Installs OK and/or Cancel buttons and registers a command handler for them. Pressing OK is reported with the okEvent() method; cancel with the cancelEvent() method. The baseclase destroys the dialog in both cases.

Pressing ESC is equal to selecting the CANCEL button.


Member Enumeration Documentation

enum XGP::XDialog::buttons [protected]

Possible buttons of the dialog: Any combination of OK and/or Cancel.

Enumerator:
NONE  Don't add any buttons.
OK  Add an OK-button.
CANCEL  Add a Cancel-button.
OKCANCEL  Add OK & Cancel-buttons.


Constructor & Destructor Documentation

XGP::XDialog::~XDialog (  )  [virtual]

Destructor.

XGP::XDialog::XDialog ( const Glib::ustring &  title,
Gtk::Window &  parent,
unsigned int  buttons = OKCANCEL,
bool  modal = false,
bool  use_separator = false 
) [protected]

(Default-)Constructor; creates the dialog with the specified buttons

Parameters:
buttons Bitfield for buttons to display
title Title to display
parent Parent of the dialog
modal Flag, if the dialog is modal
use_separator Flag, if the dialog should display a separator line between its contents and its buttons

XGP::XDialog::XDialog ( const Glib::ustring &  title,
unsigned int  buttons = OKCANCEL,
bool  modal = false,
bool  use_separator = false 
) [protected]

Constructor; creates the dialog with the specified buttons.

Parameters:
buttons Bitfield for buttons to display
title Title to display
modal Flag, if the dialog is modal
use_separator Flag, if the dialog should display a separator line between its contents and its buttons

XGP::XDialog::XDialog ( unsigned int  buttons = OKCANCEL,
bool  modal = false,
bool  use_separator = false 
) [protected]

Constructor; creates the dialog with the specified buttons.

Parameters:
buttons Bitfield for buttons to display
modal Flag, if the dialog is modal
use_separator Flag, if the dialog should display a separator line between its contents and its buttons


Member Function Documentation

void XGP::XDialog::cancelEvent (  )  [protected, virtual]

Callback after pressing the Cancel button.

Reimplemented in XGP::ConnectDlg.

void XGP::XDialog::command ( int  action  )  [protected, virtual]

Command handler of the dialog.

Parameters:
action Selected action
Remarks:
Must not be called

Reimplemented in XGP::ConnectDlg, and XGP::LoginDialog.

void XGP::XDialog::free ( int   )  [protected]

Frees the dialog.

Remarks:
Call only if the dialog was created with new

void XGP::XDialog::init ( unsigned int  buttons = OKCANCEL  )  [protected]

Adds the specified buttons to the dialog.

Parameters:
buttons Bitfield for buttons to display

bool XGP::XDialog::isDataOK (  )  [protected, virtual]

Checks if the data entered in the dialog is OK.

Returns:
bool True, if dialog can be left by selecting OK

void XGP::XDialog::okEvent (  )  [protected, virtual]

Callback after pressing the OK button; the user can override that to implemnt own behaviour.

Reimplemented in XGP::ConnectDlg.

void XGP::XDialog::on_response ( int  cmd  )  [protected]

Callback after button-events.

Parameters:
cmd ID of pressed button


Member Data Documentation

Gtk::Button* XGP::XDialog::cancel [protected]

Cancel button of the dialog.

Gtk::Button* XGP::XDialog::ok [protected]

OK button of the dialog.


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

XGP Version 0.9.31 - Generated on Wed Nov 18 11:25:30 2009 by doxygen 1.5.8