#include <gcu/dialog.h>
Public Member Functions | |
Dialog (Application *App, const char *filename, const char *windowname, DialogOwner *owner=NULL, void(*extra_destroy)(gpointer)=NULL, gpointer data=NULL) | |
virtual void | Destroy () |
virtual bool | Apply () |
void | Help () |
GtkWindow * | GetWindow () |
void | Present () |
Protected Member Functions | |
bool | GetNumber (GtkEntry *Entry, double *x, CheckType c=NoCheck, double min=0, double max=0) |
Protected Attributes | |
GladeXML * | xml |
GtkWindow * | dialog |
Application * | m_App |
Definition at line 69 of file dialog.h.
gcu::Dialog::Dialog | ( | Application * | App, | |
const char * | filename, | |||
const char * | windowname, | |||
DialogOwner * | owner = NULL , |
|||
void(*)(gpointer) | extra_destroy = NULL , |
|||
gpointer | data = NULL | |||
) |
App,: | the Application which owns the dialog. | |
filename,: | the glade file name which contains the description of the dialog. | |
windowname,: | the name of the top level GtkWidget of the dialog box in the glade file. This name should be unique for the application. It is used to access the contextual help and to ensure the uniqueness of the dialog (in some cases). | |
owner,: | the address of an owner object, might be App or a document or NULL (the default). when owner is not NULL, the dialog will be unique for it. | |
extra_destroy,: | a callback to be called when the dialog is detroyed by calling Dialog::Destroy. Useful to perform non standard cleaning operations before calling gtk_widget_destroy. The destructor being called afterwards, it cannot access the widget. | |
data,: | the data to be passed to extra_destroy. |
virtual void gcu::Dialog::Destroy | ( | ) | [virtual] |
Called when closing the dialog box after a click on the OK or Cancel buttons. If a child class implements this method, it should call Dialog::Destroy after performing its task or it must destroy the window. The defaut implementation calls extra_destroy and gtk_widget_destroy.
virtual bool gcu::Dialog::Apply | ( | ) | [virtual] |
Called after a click on the OK or Apply buttons. After clicking the OK button and if the method returns true, Destroy will be called to close the dialog box. A derived class should implement this method, as the default just returns true.
void gcu::Dialog::Help | ( | ) |
Displays the help corresponding to the dialog. This function is called when a click occurs on the Help button. It calls Application::OnHelp (windowname);
GtkWindow* gcu::Dialog::GetWindow | ( | ) | [inline] |
void gcu::Dialog::Present | ( | ) | [inline] |
bool gcu::Dialog::GetNumber | ( | GtkEntry * | Entry, | |
double * | x, | |||
CheckType | c = NoCheck , |
|||
double | min = 0 , |
|||
double | max = 0 | |||
) | [protected] |
Entry,: | the GtkEntry from which the number should be retrieved. | |
x,: | a pointer to the value which will be replaced by the result. | |
c,: | the type of check to perform on the value. | |
min,: | the minimum accepted value, if needed. | |
max,: | the maximum accepted value, if needed. |
GladeXML* gcu::Dialog::xml [protected] |
GtkWindow* gcu::Dialog::dialog [protected] |
The associated GtkWindow instance.
Definition at line 152 of file dialog.h.
Referenced by GetWindow(), and Present().
Application* gcu::Dialog::m_App [protected] |
The Application instance owning the dialog.