TMlHLSTrackBar

An HLS track bar: dragging the thumb adjusts hue, saturation or lightness — the control behind a skin-colour picker.

Category
HLS trackbar
Unit
uMlHLSTrackbar.pas
Inherits from
TMlSkinCustomControl

Notes

  • Min and Max bound the range, Value reads and writes the current position, and dragging fires OnChange.
  • Kind selects whether the bar drives hue, saturation or lightness, and the colour strip behind it changes to match.
  • Thumb supplies the image used for the slider handle.

Example

From the demo MlSkin.Demo.360安全卫士.v3.1 (.dfm form file)

object tkB: TMlHLSTrackBar
  Tag = 2
  Left = 16
  Top = 140
  Width = 296
  Height = 28
  Kind = hlsB
  Thumb = 'MlSkinSlider_dragBackground'
  Max = 100
  Min = -100
  OnChange = tkHChange
end

Properties 8

NameTypeDefaultDescription
AboutTMlAboutInfoA design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm.
KindTHLSKindRecWhat this bar controls — hue, saturation or lightness — which also changes the colour strip behind it.
ThumbTMlResIDImage used for the slider thumb, given as a resource ID or file path.
MaxInteger10Upper bound of the range.
MinInteger0Lower bound of the range.
ValueInteger0The current value; dragging the thumb changes it and fires OnChange.
TransparentBooleanTrueWhether the background is transparent.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.

Events 1

NameTypeDefaultDescription
OnChangeTNotifyEventFires when the content changes.
Properties of TMlSkinCustomControl 2
NameTypeDefaultDescription
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
OnDPIChangedTMlDPIChangedEventFires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself.
OnBackgroundChangingTMlBackgroundEventFires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEventFires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEventFires when the control is shown or hidden.

Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.

Offline helpA PDF / CHM version is available for offline reading.