Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Dialog_DS.h

00001 /*
00002  * $Id: Fl_Dialog_DS.h,v 1.5 2003/07/03 20:36:35 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Alexey Parshin
00016  * Email  : alexey@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef __FL_DIALOG_DS_H__
00023 #define __FL_DIALOG_DS_H__
00024 
00025 #include <efltk/Fl_Config.h>
00026 #include <efltk/Fl_Data_Fields.h>
00027 #include <efltk/Fl_Data_Source.h>
00028 
00030 class FL_API Fl_Dialog_DS : public Fl_Data_Source {
00031 
00032 protected:
00033     Fl_Data_Fields            m_fields;
00034 
00035     virtual bool              load_data() { return true; }
00036     virtual bool              save_data() { return true; }
00037 
00038     bool                      m_widgetsScanned;
00039     void scan_widgets(Fl_Group *group=NULL);
00040 
00041 public:
00043     Fl_Dialog_DS() : Fl_Data_Source(NULL) { m_widgetsScanned = false; }
00044 
00046     virtual const Fl_Variant& operator [] (const char *field_name) const   { return m_fields[field_name]; }
00047     virtual Fl_Variant&       operator [] (const char *field_name);
00048 
00050     virtual const Fl_Data_Field& field (int field_index) const             { return m_fields.field(field_index); }
00051     virtual Fl_Data_Field&    field (int field_index)                      { return m_fields.field(field_index); }
00052 
00054     virtual unsigned          record_count() const { return 1; }
00055 
00057     virtual unsigned          field_count() const;
00058     virtual int               field_index(const char *field_name) const    { return m_fields.field_index(field_name); }
00059 
00061     virtual const Fl_Variant& operator [] (int index) const                { return m_fields[index]; }
00062     virtual Fl_Variant&       operator [] (int index)                      { return m_fields[index]; }
00063     virtual bool              read_field(const char *fname,Fl_Variant& fvalue) { fvalue = (*this)[fname]; return true; }
00064     virtual bool              write_field(const char *fname,const Fl_Variant& fvalue) { (*this)[fname] = fvalue; return true; }
00065 };
00066 
00067 #endif

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15