dialog.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCU_DIALOG_H
00026 #define GCU_DIALOG_H
00027 #include "ui-builder.h"
00028 #include <gtk/gtk.h>
00029 #include <string>
00030
00032 namespace gcu {
00033
00049 enum CheckType
00050 {
00051 NoCheck,
00052 Min,
00053 Max,
00054 MinMax,
00055 MinEq,
00056 MaxEq,
00057 MinEqMax,
00058 MinMaxEq,
00059 MinEqMaxEq
00060 };
00061
00062 class Application;
00063 class DialogOwner;
00064
00068 class Dialog: public UIBuilder
00069 {
00070 public:
00091 Dialog (Application* App, char const *filename, const char* windowname, char const *domainname, DialogOwner *owner = NULL, void (*extra_destroy)(gpointer) = NULL, gpointer data = NULL) throw (std::runtime_error);
00092 virtual ~Dialog ();
00093
00100 virtual void Destroy ();
00101
00110 virtual bool Apply ();
00111
00116 void Help ();
00117
00121 GtkWindow* GetWindow () {return dialog;}
00122
00126 void Present () {gtk_window_present (dialog);}
00127
00133 void SetTransientFor (GtkWindow *window);
00145 void SetRealName (char const *name, DialogOwner *owner) throw (std::runtime_error);
00146
00147 protected:
00160 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00161
00162 protected:
00166 GtkWindow *dialog;
00170 Application *m_App;
00171
00172 private:
00173 void (*m_extra_destroy) (gpointer);
00174 gpointer m_data;
00175 char m_buf[64];
00176 std::string m_windowname;
00177 DialogOwner *m_Owner;
00178 };
00179
00180 }
00181
00182 #endif // GCU_DIALOG_H