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 <glade/glade.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
00069 {
00070 public:
00090 Dialog (Application* App, const char* filename, const char* windowname, DialogOwner *owner = NULL, void (*extra_destroy)(gpointer) = NULL, gpointer data = NULL);
00091 virtual ~Dialog ();
00092
00099 virtual void Destroy ();
00100
00109 virtual bool Apply ();
00110
00115 void Help ();
00116
00120 GtkWindow* GetWindow () {return dialog;}
00121
00125 void Present () {gtk_window_present (dialog);}
00126
00127 protected:
00140 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00141
00142 protected:
00147 GladeXML* xml;
00151 GtkWindow *dialog;
00155 Application *m_App;
00156
00157 private:
00158 void (*m_extra_destroy) (gpointer);
00159 gpointer m_data;
00160 char m_buf[64];
00161 std::string m_windowname;
00162 DialogOwner *m_Owner;
00163 };
00164
00165 }
00166
00167 #endif // GCU_DIALOG_H