Klarisoft™ | http://www.klariosoft.com |
|
KSSlider™ Template gives Clarion user an easy access to the standard MS Windows trackbar control.
KSSlider™ can be used in Clarion4, Clarion5 or Clarion5.5 32-bit application. With the help of the templates you will be able to handle standard Windows 32-bit trackbar control in a "Clarion Way". Templates support placing of the trackbar control on a winodow/sheet/tab, autoresizing, tooltips and many other features.
KSSlider™ Template is a pure Clarion source (no dll or lib black boxes) based on the ABC/Legacy compliant SliderClass! Start using the templates and give you Clarion applications native MS Windows 32-bit look.
The common controls are a set of windows that are implemented by the
common control library, which is a dynamic-link library (DLL) included with the
Microsoft® Windows® operating system. Like other control windows, a common
control is a child window that an application uses in conjunction with another
window to perform I/O tasks.
A trackbar is a window that contains a slider and optional tick marks.
When the user moves the slider, using either the mouse or the direction keys,
the trackbar sends notification messages to indicate the change.
Trackbars are useful when you want the user to select a discrete value or a set of consecutive values in a range. For example, you might use a trackbar to allow the user to set the repeat rate of the keyboard by moving the slider to a given tick mark. The following illustration shows a typical trackbar.
The slider in a trackbar moves in increments that you specify when you create
it. This range of values is referred to as logical units. For example, if
you specify that the trackbar should have logical units that range from zero to
five, the slider can occupy only six positions: a position at the left side of
the trackbar and one position for each increment in the range. Typically, each
of these positions is identified by a tick mark.
The KSSlider™ Setup Program can automatically register the templates. If
you don't wish to register the templates automatically you'll have to register it manually.
Start Clarion, select "Template registry" from the "Setup"
menu. When the "Template registry" window opens, select the
"Register" button on the right. Then you are prompted for a filename.
Select KStrbar.tpl (for both ABC and Legacy template). These files are located in
your TEMPLATE folder.
After registering your Template Registry window will look like:
The images below show the template prompts for the KSSlider™ control template. You can find the detailed description in tables below.
KSLider (General) Tab:
Prompt | Description |
Min. Value | Sets the minimum position for the slider in a trackbar. This can be any valid Clarion expression. |
Max. Value | Sets the maximum position for the slider in a trackbar. This can be any valid Clarion expression. |
Initial Value | Sets the initial position for the slider in a trackbar. This can be any valid Clarion expression. |
Orientation | Select the orientation of the trackbar. You can choose between horizontal and vertical. |
Enable range selection | To enable range selection activate this checkbox. |
Tick Orientation | You can display tick marks on either or both sides of the trackbar. For horizontal trackbars, you can specify bottom or top. For vertical trackbars, you can specify right or left. For tick marks on both sides of the trackbar in any orientation, specify both. |
Tick Frequency | Sets the interval frequency for tick marks in a trackbar. |
Enable tooltips | When enabled, there will be a tooltip visible whenever the
thumb is dragged by the mouse, displaying the current value. |
Sheet and Tabs:
Usually it is not possible to place a Trackbar control onto a tab / sheet control, since Trackbar is not a Clarion control and therefore can't be handled by the Clarion runtime library. KSSlider™ Template solves this problem.
Prompt | Description |
Attached to the Tab | Enable this check box if you put your KSSlider™ Control on a Tab. |
Sheet | Select Sheet Control. |
Tab number | Indicate Tab Number. |
Object Name:
Prompt | Description |
KSSlider Object Name | Name of KSSlider Control Object in the source code. |
KSSlider Value | The variable containing current trackbar's value. You can use this variable in the source code. |
KSSlider Control | Name of the KSSlider Control in a source code. |
Slider Value Variable | Variable to receive trackbar's value (optional). You can select this variable from the file schematic. |
The following embeds are provided for botth legacy and ABC template versions:
Embed points established
in the source code: - after call Init method - after call Kill method - after call Set SubClass method - On Accepted After and Before Parent call Among these points On Accepted is very important. KSSlider™ passes the control to this embed point while changing slider position. After Parent: After setting trakckbar's value to KSSlider Value (KSSlider:Class.SliderValue) Before Parent: Before setting trakckbar's value to KSSlider Value (KSSlider:Class.SliderValue)
|
This table lists the KSSlider™ Properties and Methods.
Name | Type | Description | ||||||
Properties: SliderValue |
LONG | Slider Value. | ||||||
|
|
|
||||||
Init | PROCEDURE | Initializes the KSSlider™ control. | ||||||
Kill | PROCEDURE | Kills and deinitializes the KSSlider™ control. | ||||||
SetSubClass | PROCEDURE | Sets SubClass procedure. | ||||||
CreateSlider | PROCEDURE(<LONG Left>,<LONG Top>, <LONG Width>, <LONG Height>,<SHORT Vertical>, <SHORT EnableSelRange>), SHORT,PROC |
Creates trackbar control. Parameters: Left: left position of trackbar Top: top position of trackbar Width: width of trackbar Height: height of trackbar Vertical: if true then trackbar is vertical else horizontal EnableSelRange: if true then enable range selection. Returns: Returns TRUE if sucessful. |
||||||
ResizeSlider | PROCEDURE(LONG left,LONG Top,LONG Width,LONG Height) | Resizes the KSSLider™ Control in the window. Parameters: Left: left position of trackbar Top: top position of trackbar Width: width of trackbar Height: height of trackbar |
||||||
ClearTics | PROCEDURE | Removes all the current tick marks from a trackbar. | ||||||
ClearSel | PROCEDURE | Clears current range selection. | ||||||
Enable | PROCEDURE(BYTE Enable) | Enables or Disables KSSLider™ Control Parameters: Enable: if True then Enable Control if False then Disable Control |
||||||
GetNumTics | PROCEDURE(),LONG | Retrieves the number of tick marks in a trackbar.
Returns: |
||||||
GetSliderPos | PROCEDURE(),LONG | Retrieves the current position of the slider in a trackbar.
Returns: |
||||||
SetFocus | PROCEDURE() | Sets focus to the trackbar. | ||||||
SetPos | PROCEDURE(LONG SliderValue) | Sets the current position of the slider in a trackbar.
Parameters: |
||||||
SetPosHwnd | PROCEDURE(LONG hWnd, LONG SliderValue), LONG |
Sets the current position of any KSSlider
in the application.
Parameters: |
||||||
SetRangeMin | PROCEDURE(LONG MinRange) | Sets the minimum position for the slider in a trackbar.
Parameters: |
||||||
SetRangeMax | PROCEDURE(LONG MaxRange) | Sets the maximum position for the slider in a trackbar.
Parameters: |
||||||
SetSelStart | PROCEDURE(LONG SelStart) | Sets the starting position of the current selection in a
trackbar.
Parameters: |
||||||
SetSelEnd | PROCEDURE(LONG SelEnd) | Sets the end position of the current selection in a
trackbar.
Parameters: |
||||||
SetTic | PROCEDURE(LONG Tick),SHORT,PROC | Sets the position of a tick mark in a trackbar.
Parameters: |
||||||
SetTicFreq | PROCEDURE(LONG TicFreq) | Sets the interval frequency for tick marks in a trackbar.
For example, if the frequency is set to two, a tick mark is displayed for
every other increment in the trackbar's range. The default setting for the
frequency is one; that is, every increment in the range is associated with
a tick mark. This is for use the the "auto" tick style only.
Parameters: |
||||||
OnAccepted | PROCEDURE(),VIRTUAL | Virtual procedure for receiving program control when slider is moving. | ||||||
Hide | PROCEDURE() | Hides the KSSlider™ Control. | ||||||
unHide | PROCEDURE() | Unhides the KSSlider™ Control. |
The following files will be copied to your hard disk during installation. All pathnames are relative to your Clarion root directory (e.g. C:\CLARION5, C:\C55), depending on your choice during installation.
Directory | File Name | Definition |
Example\KS\KSSlider | Clarion.ico KSLogo.bmp regpro.gif KSslapp.app KSslapp.exe KSslappL.app |
KSSlider™ Demo Applications KSslapp.app - Clarion5.5 ABC example KSslappL.app - Clarion5.5 Legacy example KSslapp5.app - Clarion5 ABC example KSslap5L.app - Clarion5 Legacy example KSslapp4.app - Clarion4 ABC example KSslap4L.app - Clarion4 Legacy example If you install templates for Clarion4 then Clarion4 examples are
installed. |
KS\KSSlider | KSSlider.htm *.gif |
This documentation and images. |
Lib | KScomct.lib |
Library (to link Clarion with Windows API) |
Libsrc | KStrbar.inc KStrbar.clw |
KSSlider™ Class Defenition |
Template | KSLogo.bmp KStrbar.tpl KStrbar.tpw |
Template and templates image files. |
It is possible to use KSSlider™ without
templates, but there are some things to consider:
You will need to include KStrbar.inc (located in your LIBSRC folder)
manually.
You will also have to add a .lib file to your project:
Open the "Project editor" window, locate the "Library, object and
resource files" entry and press "Add file". Select KScomct.lib
file.
KSSlider™ copyright © 2001 by KlariSoft. All rights reserved.
For support, please write to Support@klarisoft.com
For updates of this product please visit http://www.klarisoft.com
regularly.