Class: dbTrackBar
Properties | Events | Methods | Index of Classes
Enables applications to provide users with a data aware visual control to 'slide' through a range of values
Hierarchy
cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseControl > DfBaseList > DfBaseForm > DfBaseEntry > Entry > dbForm_ > dbFormDS > dbForm > dbFormExternalControl > dbTrackBar
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: dbTrckBr.pkg
Mixins: Trackbar_Mixin
Description
dbTrackbar is used to enable applications to provide users with a data aware visual control to 'slide' through a range of values. The objects have the visual appearance of the type of slider control commonly found on stereo/graphic equalizers. The control can be either horizontal or vertical and can have "tick" marks along either or both sides.
Sample
Object Reportby_Reliability is a dbTrackBar
Entry_Item Reportby.Reliability
Set Label to "Reliability: Low"
Set Maximum_Position to 10
Set Visible_Tick_State to FALSE
Set Tick_Orientation to tkBOTTOM
Set Tick_Frequency to 1
Set Page_Size to 1
Set Size to 15 186
Set Location to 53 70
End_Object // Reportby_Reliability
Syntax
Use dbTrckBr.pkg
Object object_name is a dbTrackBar
Set Minimum_Position To lowest track value
Set maximum_Position To hight track value
Set Visible_Tick_State to True|False
Set Tick_Orientation to orientation
Set Tick_Frequency to number
Set Page_Size to size
Set Size to height width
Set location to Row Column
entry_item file.field
Set Label to text
Set Label_Justification_Mode to mode
Set Label_row_Offset to Num
Set Label_Col_Offset to Num
Set enabled_state to true|false
Procedure Set ControlValue string sVal
:
End_Procedure
Function ControlValue Returns String
:
End_Function
Procedure onChange
:
End_Procedure
Procedure onSetFocus
:
End_Procedure
Procedure onKillFocus
:
End_Procedure
Procedure OnSetPosition
:
End_Procedure
End_Object
Of Special Note
This class is usually used to represent integer field values as a trackbar. In such a case you need to simply set the minimum_position and maximum_position properties. In such a case, your data base value and the slider have a one to one correspondence.
You can translate other database values to a trackbar integer value (and back) by augmenting the methods Set and Get ControlValue. For example, the string database field Customer.Status could map the values "A", "B", "C" and "D" slider values 0, 1, 2 and 3 as follows:
Object Customer_status is a dbTrackBar
Entry_Item Customer_Status
Set Maximum_Position to 4
Set Minimum_Position to 0
Set Size to 15 186
Set Location to 53 70
Procedure Set ControlValue string sVal // s/b A B C or D
Integer iPos
Move (ascii(sVal)-ascii("A")) to iPos
Set current_Position to iPos
End_Procedure
Function ControlValue Returns String
Integer iPos
Get current_position to iPos
Function_return ( character(iPos+ascii("A" ) )
End_Function
End_Object