<HTML> <HEAD> <TITLE>Source: hk_classes/hk_classes/hk_dsdatavisible.h</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>Source: hk_classes/hk_classes/hk_dsdatavisible.h</h1> </TD> <TD valign="top" align="right" colspan="1"></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <pre> // **************************************************************************** // copyright (c) 2000-2002 Horst Knorr <hk_classes@knoda.org> // This file is part of the hk_classes library. // This file may be distributed and/or modified under the terms of the // GNU Library Public License version 2 as published by the Free Software // Foundation and appearing in the file COPYING included in the // packaging of this file. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // **************************************************************************** #ifndef HK_DSDATAVISIBLE #define HK_DSDATAVISIBLE #include <hk_dsvisible.h> using namespace std; class hk_column; class hk_form; class hk_dsdatavisibleprivate; /** * *@short base class for visible widgets with data connection *@version $Revision: 1.2 $ *@author Horst Knorr (hk_classes@knoda.org) *This is the base class for visible widgets and provides * access to a specific column and its data. To use visible * objects you have to define the datasource and the column. */ class hk_dsdatavisible: public hk_dsvisible { friend class hk_column; public: hk_dsdatavisible(hk_presentation* p=NULL); virtual ~hk_dsdatavisible(); /** *column name in the @ref datasource. If there is no column *with this name the widget will not be enabled *@param column the wished column *@param registerchange: If this object will be displayed on a form you can decide whether changing the column name *should mark the form as changed (then it will be saved when closed). Default is "true". */ void set_columnname(const hk_string& c,bool registerchange=true); void set_columnname(const hk_string& c, bool registerchange, int coloccurance); /** *@return NULL if there is no column with the defined name. *An object of type hk_column if it was found in the datasource */ hk_column* column(void); hk_string columnname(void); /** * the datasource */ virtual void set_datasource(hk_datasource* d); hk_datasource* datasource(void); virtual void savedata(ostream& s ); virtual void loaddata(const hk_string& definition); /** *true if the default value will be used while inserting a new row */ bool use_defaultvalue(void); /** *sets the default value *@param def the new default value *@param registerchange if true and this widget is part of a form the new default value *will be stored when closing the form. *<pre>The following variables are available: * %NOW% the actual date, time or datetime, depending on the fieldtype. Default ist datetime * %NOWDATE% the actual date * %NOWTIME% the actual time * %TRUE% the driver specific true value. * %FALSE% the driver specific false value. *</pre> */ void set_defaultvalue(const hk_string& def,bool registerchange=true); /** * @return the default value as set with @ref set_defaultvalue */ hk_string raw_defaultvalue(void); /** *@return the default value, but variables are replaced by its values */ hk_string defaultvalue(void); /** * resets the default value. After that no default value will be used */ void reset_default(bool registerchange=true); void set_numberformat(bool use_numberseparator=false, int commadigits=-1,bool registerchange=true); void set_numberformat(bool use_numberseparator, int commadigits,bool registerchange,bool force_setting); bool use_numberseparator(void); /** *@deprecated use @ref precision() instead */ int commadigits(void); int precision(void); static void set_defaultnumberformat(bool use_thousandsseparator,int precision); static bool defaultuse_numberseparator(void); static int defaultprecision(void); //returns the formatted value of the row 'row' virtual hk_string value_at(unsigned long row); protected: virtual bool datasource_disable(void); virtual bool datasource_enable(void); virtual void datasource_delete(void); virtual bool before_columns_deleted(void); virtual void widget_specific_set_column(void); virtual void widget_specific_numberformat(void); virtual void columndata_has_changed(void){} virtual void before_insert_row(void); virtual void new_column_pointer_created(void); hk_column* p_column; private: void set_column(void); bool p_usedefault; bool p_virginname;//used to find out whether to automatically set defaultvalues static bool p_defaultthousandsseparator; static int p_defaultprecision; hk_dsdatavisibleprivate* p_designdata; hk_dsdatavisibleprivate* p_viewdata; } ; #endif </pre> <HR> <table> <tr><td><small>Generated by: horst on horstnotebook on Wed Sep 24 10:38:50 2003, using kdoc 2.0a54.</small></td></tr> </table> </BODY> </HTML>