Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter NineDialog Functions (continued)

9.26 Trackbar Controls

9.26.1 Introduction

A Trackbar Control (Windows SDK control class name ‘msctls_trackbar32’) is a window that renders a tracking bar with scrollbar like functionality.

The control operates in a manner similar to a scrollbar control except it has only a slider (as opposed to a thumb track) and no end arrows.

An example:

The slider can be moved by the mouse or keyboard with any movement resulting in notification messages.

Control components include the channel, slider, select area, optional buddy windows and optional tooltip. The control can be set up with a vertical or horizontal orientation with horizontal being the default. By default, there are tick marks at the ends of the channel. Marks can be added automatically using the TBS_AUTOTICKS control style or manually via trackbar API functions.

9.26.2 Controls Styles

Control styles should be combined with regular window styles.

  Constant   Description  
  TBS_AUTOTICKS   The trackbar control has a tick mark for each increment in its range of values. The frequency of the ticks can be adjusted via the TrackbarSetTickFrequency function.  
  TBS_BOTH    The trackbar control displays tick marks on both sides of the control. This will be both top and bottom when used with TBS_HORZ or both left and right if used with TBS_VERT  
  TBS_BOTTOM    The trackbar control displays tick marks below the control. This style is valid only with TBS_HORZ  
  TBS_DOWNISLEFT    By default, the trackbar control uses down equal to right and up equal to left. Use the TBS_DOWNISLEFT style to reverse the default, making down equal left and up equal right.   
  TBS_ENABLESELRANGE    The trackbar control displays a selection range only. The tick marks at the starting and ending positions of a selection range are displayed as triangles (instead of vertical dashes), and the selection range is highlighted.  
  TBS_FIXEDLENGTH    The trackbar control allows the size of the slider to be changed with TrackbarSetSliderSize function.   
  TBS_HORZ    The trackbar control is oriented horizontally. This is the default orientation.  
  TBS_LEFT    The trackbar control displays tick marks to the left of the control. This style is valid only with TBS_VERT  
  TBS_NOTHUMB    The trackbar control does not display a slider.  
  TBS_NOTICKS    The trackbar control does not display any tick marks.   
  TBS_NOTIFYBEFOREMOVE    Trackbar should notify parent before repositioning the slider due to user action (enables snapping). When present, the TRBN_THUMBPOSCHANGING is sent via the action procedure.  
  TBS_REVERSED    This style bit is used for "reversed" trackbars, where a smaller number indicates "higher" and a larger number indicates "lower." It has no effect on the control; it is simply a label that can be checked to determine whether a trackbar is normal or reversed.   
  TBS_RIGHT    The trackbar control displays tick marks to the right of the control. This style is valid only with TBS_VERT.  
  TBS_TOP    The trackbar control displays tick marks above the control. This style is valid only with TBS_HORZ.  
  TBS_TOOLTIPS    The trackbar control supports tooltips. When a trackbar control is created using this style, it automatically creates a default tooltip control that displays the slider's current position. You can change where the tooltips are displayed by using the TrackbarSetToolTipPosition function.  
  TBS_TRANSPARENTBKGND    Background is painted by the parent.  
  TBS_VERT    The trackbar control is oriented vertically. The default is horizontal.   

 

User actions result in standard notification via the “action” procedure. Note that for clarity, some of these messages have been renamed from the Windows SDK. These are:

  Define   Value   Description  
  TRBN_THUMBPOSCHANGING   -2   Notifies that the thumb position on a trackbar is changing. this can also be processed by the “notify” procedure.  
  TRBN_LINEUP   0   Scrolled a line increment.  
  TRBN_LINELEFT   0   Scrolled a line increment.  
  TRBN_LINEDOWN   1   Scrolled a line increment.  
  TRBN_LINERIGHT    1   Scrolled a line increment.  
  TRBN_PAGEUP   2   Scrolled a page increment.  
  TRBN_PAGELEFT   2   Scrolled a page increment.  
  TRBN_PAGEDOWN   3   Scrolled a page increment.  
  TRBN_PAGERIGHT   3   Scrolled a page increment.  
  TRBN_THUMBPOSITION   4   Thumb position has changed. This is sent at the end of a drag.  
  TRBN_THUMBTRACK   5   Thumb position is changing. This is sent during a drag.  
  TRBN_TOP   6   Moved to minimum value.  
  TRBN_LEFT   6   Moved to minimum value.  
  TRBN_BOTTOM   7   Moved to maximum value.  
  TRBN_RIGHT   7   Moved to maximum value.  
  TRBN_ENDSCROLL   8   The moving process has ended. If the keyboard is repeating, this is sent after the key is released. When dragging it is sent along with the TRBN_THUMBPOSITION notification.  

 

 

9.26.3 Functions