Skip to content

Class: TrackBar

Properties | Events | Methods | Index of Classes

Enables applications to provide users with a visual control to 'slide' through a range of values

Hierarchy

cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseControl > DfBaseList > DfBaseForm > Form > FormExternalControl > TrackBar

Show full hierarchy and direct subclasses

Library: Windows Application Class Library

Package: Trckbr.pkg

Mixins: Trackbar_Mixin

Description

TrackBar is used to enable applications to provide users with a 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.

The colors used by TrackBar match those defined by the Windows Setup.

The dbTrackBar class is a data-aware class similar to the TrackBar class.

Sample

Use Windows.pkg
Use Dfclient.pkg
Use Data_set.pkg
Use cApplication.pkg
Use TrckBr.pkg // TrackBar control
Use cProgressBar.pkg // ProgressBar control

Object oPanel is a Panel
    Set Size To 80 200
    Set Location To 25 25
    Set Label To 'TrackBar Test'

    Object oProgress is a cProgressBar
        Set Size     To 20 180
        Set Location To 10 10
    End_Object

    Object oTrackBar is a TrackBar
        Set Size     To 20 180
        Set Location To 40 10

        Procedure OnSetPosition Integer iPosition
            Set piPosition Of oProgress To iPosition
        End_Procedure
    End_Object
End_Object

Start_UI

Syntax

Use TrckBr

Object oObjectName is a TrackBar
    Set Minimum_Position To lowest track value
    Set Maximum_Position To hight track value

    Procedure OnSetPosition
        :
    End_Procedure

End_Object

Of Special Note

All of the methods of this class are events. This means that you are receiving a notification of something that has happened. On most occasions, you will only need to augment OnSetPosition to know that the slider position has changed. If you need greater resolution, OnSliding is sent whenever a user drags the slider, and OnFinishedSliding is sent after an event that caused the slider to move.