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
00026
00027 #ifndef GCU_DIALOG_H
00028 #define GCU_DIALOG_H
00029 #include <glade/glade.h>
00030 #include <gtk/gtk.h>
00031 #include <string>
00032
00033 using namespace std;
00034
00035 namespace gcu {
00036
00052 enum CheckType
00053 {
00054 NoCheck,
00055 Min,
00056 Max,
00057 MinMax,
00058 MinEq,
00059 MaxEq,
00060 MinEqMax,
00061 MinMaxEq,
00062 MinEqMaxEq
00063 };
00064
00065 class Application;
00066
00070 class Dialog
00071 {
00072 public:
00089 Dialog (Application* App, const char* filename, const char* windowname, 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
00121 protected:
00134 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00135
00136 void (*m_extra_destroy) (gpointer);
00137 gpointer m_data;
00138 GladeXML* xml;
00139 char m_buf[64];
00140 string m_windowname;
00141 GtkWindow *dialog;
00142 Application *m_App;
00143 };
00144
00145 }
00146
00147 #endif // GCU_DIALOG_H