vdkxdb 2.4.0
vdkxclist.h
1 /*
2  * ===========================
3  * VDK Visual Development Kit
4  * xdb subsystem
5  * Version 0.1
6  * Revision 0.0
7  * April 2000
8  * ===========================
9  *
10  * Copyright (C) 1998, Mario Motta
11  * Developed by Mario Motta <mmotta@guest.net>
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26  * 02111-1307, USA.
27  */
28 
29 #ifndef _vdkxclist_h
30 #define _vdkxclist_h
31 #include <vdkxdb2/vdkxctrl.h>
32 #include <vdk/vdkclist.h>
33 #include <vdk/value_sem_list.h>
34 #include <vdk/vdkarray.h>
35 
36 class VDKXCustomList;
37 
38 class ClistField
39 {
40  public:
41  VDKString name;
42  xbShort id,type,len;
43  ClistField():name(""),id(-1),type(-1),len(0) {}
44  ClistField(char* name, xbShort id, xbShort type, xbShort len):
45  name(name),id(id),type(type),len(len) {}
46  ~ClistField() {}
47  bool operator==(ClistField& f)
48  { return id == f.id; }
49  bool operator<(ClistField& f)
50  { return id < f.id; }
51 };
52 
53 //typedef VDKValueList<ClistField> FieldList;
54 //typedef VDKValueListIterator<ClistField> FieldListIterator;
55 
56 typedef VDKArray<ClistField> FieldArray;
57 
58 
67 public VDKCustomList, public VDKXControl
68 {
69  protected:
70  //FieldList fList;
71  FieldArray fieldArray;
72  void PrepareTupleTh(char** tuple, int z);
73  public:
74 
86  VDKXCustomList(VDKForm* owner,
87  int columns = 1,
88  char** titles = NULL,
89  GtkSelectionMode mode = GTK_SELECTION_SINGLE);
91  virtual ~VDKXCustomList() {}
95  virtual xbShort Read();
105  virtual bool AssignTableFieldToColumn(
106  int column,
107  VDKXTable* table,
108  char* fname);
109  bool AssignTableFieldToColumn(int column,
110  VDKXDatabase* xdb,
111  char* tablename,
112  char* fieldname);
117  bool AssignTable(VDKXTable* t);
118  VDKReadWriteValueProp<VDKXCustomList,int> DateMode;
119 };
120 #endif