getCtlTab

Syntax

int getCtlTab(int n, int t)

Arguments

n
The number of the user control you want to locate
t
Set to 0 to retrieve the number of the TAB control the user control is assigned to, or to 1 to retrieve the tabsheet item number the control is assigned to.

Return

If t is 0, the function returns the tab sheet the control is on. If t is non-zero, it returns the tabsheet number of the tab the control has been assigned to. Returns -1 if the user control number is out of range.

Description

Returns the tab control or tab sheet that a user control has been assigned to.

Comment

Due to the design of this function, the tab control index number should be 1 or higher. If the tab is control #0, you won't be able to use getCtlTab to retrieve the sheet number the control is on.

Example

%fml
ctl[1]: TAB, Text="page0\npage1", Pos=(250, 5), Size=(200, 100)
ctl[2]: STANDARD, Text="Slider", Pos=(280,*)
ctl[8]: PUSHBUTTON, Text="Move slider to other tab sheet", Pos=(250, 120), Size=(150,*)

OnCtl(n): {
  if (n==8 && e==FME_CLICKED) {
    // If not already on page1,
    // move slider to page1
    if (getCtlTab(2, 1) != 1) {
      setCtlTab(2, 1, 1);
    }
    else {
      // Move back to page0
      setCtlTab(2, 1, 0);
    }
  }
  return false;
}

See Also

setCtlTab, TAB