This is the base class for visible widgets that provides access to a specific column and its data. To use visible objects you have to set the datasource with set_datasource() and the column with set_columnname().

Inherits from hk_dsvisible.

set_columnname(columnname [,registerchange])

column name in the datasource(). If there is no column with this name the widget will not be enabled

Parameter 'column': the wished column

Parameter '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".


returns the column name string


returns the used hk_column object


Sets the default value. The default value will be used in insert mode.

Parameter 'def': the new default value

Parameter 'registerchange': if true and this widget is part of a form the new default value will be stored when closing the form. 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.


returns the default value, but variables are replaced by its values


returns the default value as set with set_defaultvalue, without replacing the variables


resets the default value. After that no default value will be used

set_numberformat([use_numberseparator[, precision[,registerchange]]])

Sets the definition how to format number strings.

Parameter 'use_numberseparator': True or False. If true, this will use a thousand separator if your locale set defines one. E.g. in Germany the number 3.000,5 means three thousand and a half. The dot is the thousands separator. Of course the used character is depending on your locale definition.

Parameter 'precision': The number of digits used to represent values smaller than 1.


returns True if the number separator is used


returns the number of digits


returns the formatted string in the column at row position 'row'


returns the displayed string (the current value)


sets the current value,where 'value' is a string. If a column is set, the datasource will be changed, if not it will be only displayed


searches for a specific value in a column, returns the row number if found, hk_datasource.max_rows()+1 if not found


searches for a specific value in a column, returns the row number if found, hk_datasource.max_rows()+1 if not found. This version searches all rows of a datasource.