hk_dscombobox.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_classes library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file COPYING included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00010 // ****************************************************************************
00011 #ifndef HK_DSCOMBOBOX
00012 #define HK_DSCOMBOBOX
00013 #include "hk_dsdatavisible.h"
00014 using namespace std;
00015 class hk_listvisible;
00016 class hk_dsgridcolumn;
00017 class hk_dscomboboxprivate;
00018 class hk_dscomboboxmodeprivate;
00032 class hk_dscombobox:public hk_dsdatavisible
00033 {
00034     public:
00035         hk_dscombobox(hk_form* form=NULL);
00036 virtual        ~hk_dscombobox();
00043         void    set_listdatasource(hk_datasource* list);
00044         hk_datasource* listdatasource(void);
00045         virtual void set_datasource(hk_datasource* d);
00046 
00050         void    set_viewcolumnname(const hk_string& viewcolumn,bool registerchange=true);
00051         hk_string  viewcolumnname(void);
00055         void    set_listcolumnname(const hk_string& listcolumn,bool registerchange=true);
00056         hk_string listcolumnname(void);
00057         virtual void savedata(ostream& s );
00058         virtual void loaddata(xmlNodePtr definition);
00062         virtual bool        set_listpresentationdatasource(long n, bool registerchange=true);
00063         long        listpresentationdatasource(void);
00064         virtual void  load_listitems(void){}
00069         enum enum_mode{combo,combo_noedit,selector};
00070         void set_mode(enum_mode);
00071         enum_mode mode(void);
00072 
00073         hk_string     value_at(unsigned long);
00074 
00075         hk_column* viewcolumn(void);
00076         hk_column* listcolumn(void);
00077 
00078         void set_gridcolumn(hk_dsgridcolumn* );
00079         hk_dsgridcolumn*gridcolumn (void) const;
00080 
00081         void set_use_textlist(bool,bool registerchange=true);
00082         bool use_textlist(void) const;
00083         void set_textlist(list<hk_string>&,bool registerchange=true);
00084         void add_text(const hk_string& , bool registerchange=true);
00085 list<hk_string>* textlist(void) const;
00086 
00087 
00088 virtual bool action_on_select(void);
00089 hk_string on_select_action(void);
00090 void set_on_select_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00091 
00092     protected:
00093         bool    datasource_enable(void);
00094         bool    datasource_disable(void);
00095         virtual bool    widget_specific_row_change(void);
00096         virtual void    widget_specific_mode_change(void){}
00097         virtual void    after_store_changed_data(void);
00098         virtual void columndata_has_changed(void);
00099         virtual bool presentationmode_changed(void);
00100 
00101     //needed for gridcolumn actions where a line editor takes the input (eg. action_on_key)
00102     hk_dsgridcolumn* p_gridcolumn;
00103     private:
00104         hk_listvisible* p_listvisible;
00105         long p_listdatasource;
00106         enum_mode p_mode;
00107         hk_dscomboboxprivate* p_private;
00108         hk_dscomboboxmodeprivate* p_designdata;
00109         hk_dscomboboxmodeprivate* p_viewdata;
00110 
00111 };
00112 #endif

Generated on Tue Nov 28 02:48:08 2006 for Databaseconnectionclasses by  doxygen 1.5.0