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-2005
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 
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 }       // namespace gcu
00076 
00077 #endif // GCU_DIALOG_H

Generated on Sat Nov 12 15:50:14 2005 for The Gnome Chemistry Utils by  doxygen 1.4.1