00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_DSGRIDCOLUMN_H
00012 #define HK_DSGRIDCOLUMN_H
00013 #include "hk_dsdatavisible.h"
00014 using namespace std;
00015 class hk_column;
00016 class hk_dsgrid;
00017 class hk_dscombobox;
00018 const int default_cellwidth=100;
00019 const int default_cellheight=20;
00020 class hk_dsgridcolumnmodeprivate;
00021 class hk_dsgridcolumnprivate;
00029 class hk_dsgridcolumn :public hk_dsdatavisible
00030 {
00031 friend class hk_dsgrid;
00032 public:
00033 enum enum_columntype{columnedit,columnbool,columncombo};
00034 hk_dsgridcolumn(void);
00035 virtual ~hk_dsgridcolumn(void);
00039 void set_displayname(hk_string,bool registerchange=true);
00040 hk_string displayname(void);
00045 void set_columntype(enum_columntype,bool registerchange=true);
00046 enum_columntype columntype(void);
00050 void set_columnwidth(int ,bool registerchange=true);
00051 int columnwidth(void);
00052 virtual void savedata(ostream& s);
00053 virtual void loaddata(const hk_string& definition);
00054
00061 void set_listdatasource(const hk_string& datasourcename,datasourcetype dt=dt_table, bool registerchange=true);
00062 hk_datasource* listdatasource(void);
00063 hk_string listdatasourcename(void);
00064 datasourcetype listdatasourcetype() const;
00068 void set_viewcolumnname(const hk_string& viewcolumn,bool registerchange=true);
00069 hk_string viewcolumnname(void);
00073 void set_listcolumnname(const hk_string& listcolumn,bool registerchange=true);
00074 hk_string listcolumnname(void);
00075
00079 virtual bool set_listpresentationdatasource(long n, bool registerchange=true);
00080 long listpresentationdatasource(void);
00081 hk_string value_at(unsigned long);
00082
00083 virtual void set_datasource(hk_datasource*);
00084 hk_dscombobox* combobox(void);
00085
00086 unsigned int find(unsigned int from,unsigned int to,const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false,bool backwards=false);
00087 bool is_findstring(unsigned int pos,const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false);
00088
00089
00090 virtual bool action_on_click(void);
00091 virtual bool action_on_doubleclick(void);
00092 virtual bool action_on_close(void);
00093 virtual bool action_on_open(void);
00094 virtual void action_before_store_changed_data(void);
00095 virtual void action_after_store_changed_data(void);
00096 virtual void action_before_row_change(void);
00097 virtual void action_after_row_change(void);
00098 virtual void action_before_delete(void);
00099 virtual void action_after_delete(void);
00100 virtual void action_before_insert(void);
00101 virtual void action_after_insert(void);
00102 virtual bool action_on_getfocus(void);
00103 virtual bool action_on_loosefocus(void);
00104 virtual bool action_on_key(void);
00105 bool action_on_select(hk_dscombobox*);
00106 hk_string on_select_action(void);
00107 void set_on_select_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00108
00109 protected:
00110 virtual bool presentationmode_changed(void);
00111
00112
00113 private:
00114 void set_grid(hk_dsgrid*);
00115 void set_combovalues(void);
00116 hk_string p_displayname;
00117 hk_string p_comboviewcolumnname;
00118 hk_string p_combolistcolumnname;
00119 long p_combopresentationdatasource;
00120 hk_string p_combolistdatasourcename;
00121 datasourcetype p_combolistdatasourcetype;
00122
00123 enum_columntype p_columntype;
00124 int p_columnwidth;
00125 hk_dsgrid* p_grid;
00126 hk_dscombobox* p_combobox;
00127 hk_dsgridcolumnprivate* p_private;
00128 hk_dsgridcolumnmodeprivate* p_designdata;
00129 hk_dsgridcolumnmodeprivate* p_viewdata;
00130
00131 };
00132 #endif