Databaseconnectionclasses  0.5.3
hk_dsgridcolumn.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_DSGRIDCOLUMN_H
12 #define HK_DSGRIDCOLUMN_H
13 #include "hk_dsdatavisible.h"
14 using namespace std;
15 class hk_column;
16 class hk_dsgrid;
17 class hk_dscombobox;
18 const int default_cellwidth=100;
19 const int default_cellheight=20;
30 {
31  friend class hk_dsgrid;
32  public:
33  enum enum_columntype{columnedit,columnbool,columncombo};
34  hk_dsgridcolumn(void);
35  virtual ~hk_dsgridcolumn(void);
39  void set_displayname(hk_string,bool registerchange=true);
40  hk_string displayname(void);
45  void set_columntype(enum_columntype,bool registerchange=true);
46  enum_columntype columntype(void);
50  void set_columnwidth(int ,bool registerchange=true);
51  int columnwidth(void);
52  virtual void savedata(ostream& s);
53  virtual void loaddata(xmlNodePtr definition);
54 
61  void set_listdatasource(const hk_string& datasourcename,datasourcetype dt=dt_table, bool registerchange=true);
62  hk_datasource* listdatasource(void);
63  hk_string listdatasourcename(void);
64  datasourcetype listdatasourcetype() const;
68  void set_viewcolumnname(const hk_string& viewcolumn,bool registerchange=true);
69  hk_string viewcolumnname(void);
73  void set_listcolumnname(const hk_string& listcolumn,bool registerchange=true);
74  hk_string listcolumnname(void);
75 
79  virtual bool set_listpresentationdatasource(long n, bool registerchange=true);
80  long listpresentationdatasource(void);
81  hk_string value_at(unsigned long);
82 
83  virtual void set_datasource(hk_datasource*);
84  hk_dscombobox* combobox(void);
85 
86  unsigned int find(unsigned int from,unsigned int to,const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false,bool backwards=false);
87  bool is_findstring(unsigned int pos,const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false);
88 
89 
90 virtual bool action_on_click(void);
91 virtual bool action_on_doubleclick(void);
92 virtual bool action_on_close(void);
93 virtual bool action_on_open(void);
94 virtual void action_before_store_changed_data(void);
95 virtual void action_after_store_changed_data(void);
96 virtual void action_before_row_change(void);
97 virtual void action_after_row_change(void);
98 virtual void action_before_delete(void);
99 virtual void action_after_delete(void);
100 virtual void action_before_insert(void);
101 virtual void action_after_insert(void);
102 virtual bool action_on_getfocus(void);
103 virtual bool action_on_loosefocus(void);
104 virtual bool action_on_key(void);
105  bool action_on_select(hk_dscombobox*);
106 hk_string on_select_action(void);
107 void set_on_select_action(const hk_string&,bool registerchange=true,bool force_setting=true);
108 
109 protected:
110  virtual bool presentationmode_changed(void);
111 
112 
113  private:
114  void set_grid(hk_dsgrid*);
115  void set_combovalues(void);
116  hk_string p_displayname;
117  hk_string p_comboviewcolumnname;
118  hk_string p_combolistcolumnname;
119  long p_combopresentationdatasource;
120  hk_string p_combolistdatasourcename;
121  datasourcetype p_combolistdatasourcetype;
122 
123  enum_columntype p_columntype;
124  int p_columnwidth;
125  hk_dsgrid* p_grid;
126  hk_dscombobox* p_combobox;
127  hk_dsgridcolumnprivate* p_private;
128  hk_dsgridcolumnmodeprivate* p_designdata;
129  hk_dsgridcolumnmodeprivate* p_viewdata;
130 
131 };
132 #endif
base class for widgets which show multi column data in a grid.
Definition: hk_dsgrid.h:26
structure of a column in a grid
Definition: hk_dsgridcolumn.h:29
virtual void loaddata(xmlNodePtr definition)
Definition: hk_dsgrid.cpp:222
represents a resultquery or a table of a database.
Definition: hk_datasource.h:45
Definition: hk_dsgridcolumn.cpp:19
base class for visible widgets with data connection
Definition: hk_dsdatavisible.h:32
base class for combobox fields
Definition: hk_dscombobox.h:32
represents one column of a datasource.
Definition: hk_column.h:34
Definition: hk_dsgridcolumn.cpp:24