Custom controls

From TeamDeveloperWiki

Jump to: navigation, search

This page covers CustomControl tips & tricks.

Contents


Image:Pointer.pngTrackbar

(MSCTLS_trackbar32)

A trackbar is a window that contains a slider (sometimes called a thumb) in a channel, 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.

Image:TrackbarSample.jpg

There are several samples which implements a Trackbar.
TrackBar.zip
SALExtension-v204.zip (see Trackbar.apl)

The SalExtension Trackbar implements all features. Info on usage can be found here
-> About Trackbar Controls

Image:Pointer.pngMonthCalendar and DateTimePicker

(SysMonthCal32 and SysDateTimePick32)

A month calendar control implements a calendar-like user interface. This provides the user with a very intuitive and recognizable method of entering or selecting a date. The control also provides the application with the means to obtain and set the date information in the control using existing data types.

A date and time picker (DTP) control provides a simple and intuitive interface through which to exchange date and time information with a user. For example, with a DTP control you can ask the user to enter a date and then easily retrieve the selection.


There is a very nice sample by Christian Astor which shows these controls.
Calendar_Control.zip

Info on usage can be found here
-> About Month Calendar Controls
-> About Date and Time Picker Controls

Image:Pointer.pngTooltips

(tooltips_class32)

Team Developer offers tooltip support using qckttip library. But there are some tooltip features WinAPI offers
which is not part of the TD implementation.

For more tooltip options you can use the WinAPI_Tooltips module.
It supports these features:

  • Rectangle and balloon tooltips
  • Set text color and background color
  • Set font (size, font name and enhancement)
  • Floating tooltips (put them anywhere on screen)
  • Set the size of the tooltip margins
  • Opaque tooltips (transparency)
  • Set tooltip title with or without icons
  • (optional) subclass tooltip messages to trap in TD (using Subclasser)

(for instance with this you can react on tooltip clicks, mouse moves or paint custom stuff on the tooltip).


The module works in all TD versions. For TD5.x a specific version is available.

Build the source WinAPI_Tooltips.apt to WinAPI_Tooltips.apd (dynalib) and include it in your projects.
Just call the available exported functions to get tooltips within your application.
(A sample source is included to show how to call the module)

You can download the module here:
WinAPI_Tooltips.zip

A specific TD5.x version here:
WinAPI_Tooltips_TD5x.zip