Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

dialog.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * gcu/dialog.h 
00006  *
00007  * Copyright (C) 2001-2006
00008  *
00009  * Developed by Jean Bréfort <jean.brefort@normalesup.org>
00010  *
00011  * This program is free software; you can redistribute it and/or 
00012  * modify it under the terms of the GNU General Public License as 
00013  * published by the Free Software Foundation; either version 2 of the
00014  * License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00024  * USA
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 }       // namespace gcu
00146 
00147 #endif // GCU_DIALOG_H

Generated on Sun Jan 29 08:25:29 2006 for The Gnome Chemistry Utils by  doxygen 1.4.1