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
00128 void SetTransientFor (GtkWindow *window);
00129
00130 protected:
00143 bool GetNumber (GtkEntry *Entry, double *x, CheckType c = NoCheck, double min = 0, double max = 0);
00144
00145 protected:
00149 GtkWindow *dialog;
00153 Application *m_App;
00154
00155 private:
00156 void (*m_extra_destroy) (gpointer);
00157 gpointer m_data;
00158 char m_buf[64];
00159 std::string m_windowname;
00160 DialogOwner *m_Owner;
00161 };
00162
00163 }
00164
00165 #endif // GCU_DIALOG_H