TAB

Syntax

ctl[n]: TAB(Class Specific Properties), Other Properties

Description

Tabs are useful for grouping related controls that don't all need to be onscreen at the same time. In graphics programs, this is often used to group separate features such as brightness/contrast, gamma, and hue/saturation/luminance into separate sets of controls the user can manipulate one at a time.

Class Specific Properties

BOTTOM
Orients the tabs on the bottom instead of the top (or right if VERTICAL is enabled)
BUTTONS
Uses pushbuttons instead of tabs to switch between sheets.
FLATBUTTONS
When used with BUTTONS, makes the buttons look sunken into the dialog instead of raised.
HOTTRACK
Enables hover/mouseover events (ie illuminates the tab labels when hovered over)
RIGHT
Orients the tabs on the right side if VERTICAL is enabled, bottom otherwise
TABS
Uses tabs to switch between sheets. (default)
VERTICAL
Orients the tabs vertically / side on

Other Properties

Pos
The position of the tab control on the screen, in DBUs
Size
The size of the tab control
Text
Sets the initial labels for all tab sheets & therefore how many sheets it has (default = no Text)
Tooltip
Sets a tooltip displayed when the mouse hovers over the tab labels.
Val
Selects which tab sheet is visible and activates all controls within it (default = 0)

Example

%ffp

ctl[10]: TAB, Text="RGB\nHSL", Pos=(320,5), Size=(160,100), Val=0

// Add to tab sheet 0, RGB
ctl[2]: "R", Tab=(10,0), Range=(-100, 100), Pos=(*,25)
ctl[3]: "G", Tab=(10,0), Range=(-100, 100), Pos=(*,35)
ctl[4]: "B", Tab=(10,0), Range=(-100, 100), Pos=(*,45)

// Add to tab sheet 1, HSL
ctl[5]: "H", Tab=(10,1), Range=(-100, 100), Pos=(*,25)
ctl[6]: "S", Tab=(10,1), Range=(-100, 100), Pos=(*,35)
ctl[7]: "L", Tab=(10,1), Range=(-100, 100), Pos=(*,45)


ForEveryPixel: {

   int hue = rgb2hsl(R, G, B, 0) + ctl(5);
   int sat = rgb2hsl(R, G, B, 1) + ctl(6);
   int lum = rgb2hsl(R, G, B, 2) + ctl(7);

   int red = hsl2rgb(hue, sat, lum, 0);
   int grn = hsl2rgb(hue, sat, lum, 1);
   int blu = hsl2rgb(hue, sat, lum, 2);

   R = red + ctl(2);
   G = grn + ctl(3);
   B = blu + ctl(4);
}

See Also

COMBOBOX