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
00037 enum CheckType
00038 {
00039 NoCheck,
00040 Min,
00041 Max,
00042 MinMax,
00043 MinEq,
00044 MaxEq,
00045 MinEqMax,
00046 MinMaxEq,
00047 MinEqMaxEq
00048 };
00049
00050 class Application;
00051
00052 class Dialog
00053 {
00054 public:
00055 Dialog (Application* App, const char* filename, const char* windowname, void (*extra_destroy)(gpointer) = NULL, gpointer data = NULL);
00056 virtual ~Dialog ();
00057
00058 virtual void Destroy ();
00059 virtual bool Apply ();
00060 void Help ();
00061 GtkWindow* GetWindow () {return dialog;}
00062
00063 protected:
00064 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00065
00066 void (*m_extra_destroy) (gpointer);
00067 gpointer m_data;
00068 GladeXML* xml;
00069 char m_buf[64];
00070 string m_windowname;
00071 GtkWindow *dialog;
00072 Application *m_App;
00073 };
00074
00075 }
00076
00077 #endif // GCU_DIALOG_H