Databaseconnectionclasses  0.5.3
hk_dscombobox.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_DSCOMBOBOX
12 #define HK_DSCOMBOBOX
13 #include "hk_dsdatavisible.h"
14 using namespace std;
15 class hk_listvisible;
16 class hk_dsgridcolumn;
33 {
34  public:
35  hk_dscombobox(hk_form* form=NULL);
36 virtual ~hk_dscombobox();
43  void set_listdatasource(hk_datasource* list);
44  hk_datasource* listdatasource(void);
45  virtual void set_datasource(hk_datasource* d);
46 
50  void set_viewcolumnname(const hk_string& viewcolumn,bool registerchange=true);
51  hk_string viewcolumnname(void);
55  void set_listcolumnname(const hk_string& listcolumn,bool registerchange=true);
56  hk_string listcolumnname(void);
57  virtual void savedata(ostream& s );
58  virtual void loaddata(xmlNodePtr definition);
62  virtual bool set_listpresentationdatasource(long n, bool registerchange=true);
63  long listpresentationdatasource(void);
64  virtual void load_listitems(void){}
69  enum enum_mode{combo,combo_noedit,selector};
70  void set_mode(enum_mode);
71  enum_mode mode(void);
72 
73  hk_string value_at(unsigned long);
74 
75  hk_column* viewcolumn(void);
76  hk_column* listcolumn(void);
77 
78  void set_gridcolumn(hk_dsgridcolumn* );
79  hk_dsgridcolumn*gridcolumn (void) const;
80 
81  void set_use_textlist(bool,bool registerchange=true);
82  bool use_textlist(void) const;
83  void set_textlist(list<hk_string>&,bool registerchange=true);
84  void add_text(const hk_string& , bool registerchange=true);
85 list<hk_string>* textlist(void) const;
86 
87 
88 virtual bool action_on_select(void);
89 hk_string on_select_action(void);
90 void set_on_select_action(const hk_string&,bool registerchange=true,bool force_setting=true);
91 
92  protected:
93  bool datasource_enable(void);
94  bool datasource_disable(void);
95  virtual bool widget_specific_row_change(void);
96  virtual void widget_specific_mode_change(void){}
97  virtual void after_store_changed_data(void);
98  virtual void columndata_has_changed(void);
99  virtual bool presentationmode_changed(void);
100 
101  //needed for gridcolumn actions where a line editor takes the input (eg. action_on_key)
102  hk_dsgridcolumn* p_gridcolumn;
103  private:
104  void create_filternames();
105  hk_listvisible* p_listvisible;
106  long p_listdatasource;
107  enum_mode p_mode;
108  hk_dscomboboxprivate* p_private;
109  hk_dscomboboxmodeprivate* p_designdata;
110  hk_dscomboboxmodeprivate* p_viewdata;
111 
112 };
113 #endif
Definition: hk_dscombobox.cpp:52
structure of a column in a grid
Definition: hk_dsgridcolumn.h:29
base class for forms
Definition: hk_form.h:43
Definition: hk_dscombobox.cpp:25
represents a resultquery or a table of a database.
Definition: hk_datasource.h:45
enum_mode
Definition: hk_dscombobox.h:69
base class for visible widgets with data connection
Definition: hk_dsdatavisible.h:32
Definition: hk_dscombobox.cpp:19
base class for combobox fields
Definition: hk_dscombobox.h:32
represents one column of a datasource.
Definition: hk_column.h:34