hk_dsdatavisible

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

columnname()

returns the column name string

column()

returns the used hk_column object

set_defaultvalue(def[,registerchange])

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.

defaultvalue()

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

raw_defaultvalue()

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

reset_default([registerchange])

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.

use_numberseparator()

returns True if the number separator is used

precision()

returns the number of digits

value_at(row)

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

value()

returns the displayed string (the current value)

set_value(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

find(from_rownumber,to_rownumber,searchtext[,wholephrase[,casesensitive[,backwards]]])

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

find(searchtext[,wholephrase[,casesensitive[,backwards]]])

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.