setCtlOrder
Syntax
- setCtlOrder(int n, int order)
Arguments
- n
- The index of the user control whose order you wish to change.
- order
- The z-order you wish to set the control to.
Description
- Sets the z-order of control n, ordered with 1 on top. Controls with higher orders are moved down accordingly. (This is unlike the usual definition of z-order, ordered with 1 on the bottom.)
Example
%ffp
Dialog: Size=(590,300)
ctl(1): Rect(Modalframe, White), pos=(380,50), size=(100, 100)
ctl(2): Rect(Modalframe, Gray), pos=(430,70), size=(100, 100)
ctl(3): Rect(Modalframe, Black), pos=(405,100), size=(100, 100)
ctl(4): Pushbutton, text="White", Pos=(386,283), Anchor=ANCHOR_RIGHT|ANCHOR_BOTTOM
ctl(5): Pushbutton, text="Gray", Pos=(423,283), Anchor=ANCHOR_RIGHT|ANCHOR_BOTTOM
ctl(6): Pushbutton, text="Black", Pos=(460,283), Anchor=ANCHOR_RIGHT|ANCHOR_BOTTOM
OnCtl(n):
{
if (n==4)
{
setCtlOrder(1, 1); // white on top
}
else if (n==5)
{
setCtlOrder(2, 1); // gray on top
}
else if (n==6)
{
setCtlOrder(3, 1); // black on top
}
return false;
}
ForEveryTile:
{
return true;
}
Comments
- Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.