vdkxclist.h

00001 /*
00002  * ===========================
00003  * VDK Visual Development Kit
00004  * xdb subsystem
00005  * Version 0.1
00006  * Revision 0.0
00007  * April 2000
00008  * ===========================
00009  *
00010  * Copyright (C) 1998, Mario Motta
00011  * Developed by Mario Motta <mmotta@guest.net>
00012  *
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Library General Public
00015  * License as published by the Free Software Foundation; either
00016  * version 2 of the License, or (at your option) any later version.
00017  *
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Library General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Library General Public
00024  * License along with this library; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00026  * 02111-1307, USA.
00027  */
00028 
00029 #ifndef _vdkxclist_h
00030 #define _vdkxclist_h
00031 #include <vdkxdb2/vdkxctrl.h>
00032 #include <vdk/vdkclist.h>
00033 #include <vdk/value_sem_list.h>
00034 #include <vdk/vdkarray.h>
00035 
00036 class VDKXCustomList;
00037 
00038 class ClistField
00039 {
00040  public:
00041   VDKString name;
00042   xbShort id,type,len;
00043   ClistField():name(""),id(-1),type(-1),len(0) {}
00044   ClistField(char* name, xbShort id, xbShort type, xbShort len):
00045     name(name),id(id),type(type),len(len) {}
00046   ~ClistField() {}
00047   bool operator==(ClistField& f)
00048   { return id == f.id; }
00049   bool operator<(ClistField& f)
00050   { return id < f.id; }
00051 };
00052 
00053 //typedef VDKValueList<ClistField> FieldList;
00054 //typedef VDKValueListIterator<ClistField> FieldListIterator;
00055 
00056 typedef VDKArray<ClistField> FieldArray;
00057 
00058 
00066 class VDKXCustomList: 
00067 public VDKCustomList, public VDKXControl
00068 {
00069  protected:
00070   //FieldList fList;
00071   FieldArray fieldArray;
00072   void PrepareTupleTh(char** tuple, int z);
00073  public:
00074 
00086   VDKXCustomList(VDKForm* owner, 
00087                  int columns = 1,
00088                  char** titles = NULL,
00089                  GtkSelectionMode mode = GTK_SELECTION_SINGLE);
00091   virtual ~VDKXCustomList() {}
00095   virtual xbShort Read();
00105   virtual bool AssignTableFieldToColumn(
00106                                         int column,
00107                                         VDKXTable* table,
00108                                         char* fname);
00109   bool AssignTableFieldToColumn(int column,
00110                                 VDKXDatabase* xdb,
00111                                 char* tablename,
00112                                 char* fieldname);
00117   bool AssignTable(VDKXTable* t);
00118   VDKReadWriteValueProp<VDKXCustomList,int> DateMode;
00119 };
00120 #endif

Generated on Sun Oct 16 13:35:44 2005 for vdkxdb 2.4.0 by  doxygen 1.4.5