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
00031 namespace gcu {
00032
00048 enum CheckType
00049 {
00050 NoCheck,
00051 Min,
00052 Max,
00053 MinMax,
00054 MinEq,
00055 MaxEq,
00056 MinEqMax,
00057 MinMaxEq,
00058 MinEqMaxEq
00059 };
00060
00061 class Application;
00062 class DialogOwner;
00063
00067 class Dialog
00068 {
00069 public:
00089 Dialog (Application* App, const char* filename, const char* windowname, DialogOwner *owner = NULL, void (*extra_destroy)(gpointer) = NULL, gpointer data = NULL);
00090 virtual ~Dialog ();
00091
00098 virtual void Destroy ();
00099
00108 virtual bool Apply ();
00109
00114 void Help ();
00115
00119 GtkWindow* GetWindow () {return dialog;}
00120
00124 void Present () {gtk_window_present (dialog);}
00125
00126 protected:
00139 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00140
00141 protected:
00146 GladeXML* xml;
00150 GtkWindow *dialog;
00154 Application *m_App;
00155
00156 private:
00157 void (*m_extra_destroy) (gpointer);
00158 gpointer m_data;
00159 char m_buf[64];
00160 std::string m_windowname;
00161 DialogOwner *m_Owner;
00162 };
00163
00164 }
00165
00166 #endif // GCU_DIALOG_H