Application object.
More...
#include <application.h>
Application object.
This class initializes GTK+ library and starts event loop. Normally user overrides this class using his own application object. Application objects are responsible to manage also terminating and clean-up procedures.
◆ VDKApplication()
VDKApplication::VDKApplication |
( |
int * |
argc, |
|
|
char ** |
argv, |
|
|
char * |
rcf = (char*) NULL , |
|
|
bool |
have_locale = false |
|
) |
| |
Constructor, receives main() arguments and pass them to GTK* library.
- Parameters
-
rc | if isn't NULL <rc> resource file will be loaded and parsed. |
have_locale | if true let's VDK to invoke gtk_set_locale() and support any languages that GTK supports. |
◆ ~VDKApplication()
VDKApplication::~VDKApplication |
( |
| ) |
|
|
virtual |
◆ HasResources()
bool VDKApplication::HasResources |
( |
| ) |
|
|
inline |
Indicates if the resource file was loaded and parsed
◆ MainWindow()
GtkWidget * VDKApplication::MainWindow |
( |
| ) |
|
Returns underlying gtk+ window of the application main form
◆ RemoveGarbageCollection()
void VDKApplication::RemoveGarbageCollection |
( |
| ) |
|
Remove timed garbage collection.
◆ Run()
void VDKApplication::Run |
( |
void |
| ) |
|
◆ SetGarbageCollection()
void VDKApplication::SetGarbageCollection |
( |
unsigned int |
tick = 1000 | ) |
|
Set a timed garbage collection that will be invoked each <timing> msecs.
◆ SetIdleCallback()
void VDKApplication::SetIdleCallback |
( |
GtkFunction |
idlecb = NULL , |
|
|
gpointer |
data = (gpointer) NULL |
|
) |
| |
Sets idle callback function, if a previous idle callback was installed, uninstall it. /param /c idlecb idle callback function must be declared as: void idlecb(gpointer data); /param /c data will be passed to user defined function and must be a non NULL pointer otherwise SetIdleCallback won't work.
◆ SetResourceFile()
void VDKApplication::SetResourceFile |
( |
char * |
rcf | ) |
|
Set a resource file. Tip: this should be done before Run()ning app.
◆ Setup()
virtual void VDKApplication::Setup |
( |
| ) |
|
|
pure virtual |
Initializes Main form, user must override this one in his own application object.
◆ Terminate()
void VDKApplication::Terminate |
( |
void |
| ) |
|
Terminates event loop and quits GTK* library. This method is called after a destroy event on MainForm, user normally doesn't care of it.
◆ VDKMessageBox()
gint VDKApplication::VDKMessageBox |
( |
char * |
caption, |
|
|
char * |
text, |
|
|
int |
mode = VDK_OK , |
|
|
char * |
oktext = (char*) NULL , |
|
|
char * |
canceltext = (char*) NULL , |
|
|
unsigned int |
wait = 0 |
|
) |
| |
Provide a modal dialog window for messages to user.
- Parameters
-
mode |
MB_OK provide only one button with a "Ok" default caption
MB_YESNO provides two button with "Yes" and "No" default captions.
MB_OKCANCEL provides two button with "Ok" and "Cancel" default captions. Mode can be ored with:
MB_ICONSTOP provides a warning icon
MB_ICONINFORMATION provides a "information icon"
MB_ICONQUESTION provides a question mark icon
MB_ICONERROR provides an error icon MessageBox returns an integer that depends on modes and user response:
IDOK , user pressed OK button in MB_OK or MB_OKCANCEL mode
IDYES , user pressed YES button in MB_YESNO mode
IDNO , user pressed NO button in MB_YESNO mode
IDCANCEL , user pressed NO button in MB_OKCANCEL mode
|
oktex | |
canceltext | Args not more used, mantained for compat with vdk series 1.x.y Both OK,YES and NO buttons captions can be customized using <oktext> and <canceltext> arguments. |
wait | if set other than 0 makes MessageBox automatically closed after <wait> msecs with IDCANCEL or IDNO result. Tip: MessageBox accepts CR as "yes/ok" and ESC as "no/cancel" default answers. |
◆ MainForm
Must be initialized by the user otherwise an useless default main form will be created
The documentation for this class was generated from the following files: