int ContainerSetx(int cn, int x);
Sets the x coordinate of a container within its owning container or the screen.
Return value not used.
Handle to a container where the container was added. Container zero is defined as the screen.
The ContainerSetx() function moves a container on the screen or within another container. Pass zero to the first parameter to specify the preexisting screen container.
Available in DragonFireSDK 2.0 and later.
The sample code below puts a deck of cards on the screen and when the user touches a card, it is brought to the foreground and can be dragged around in front of the other cards until the user picks another card.
int OnTouch(int id, int event, int x, int y)
// Bring the selected card to the fore.
// Take half off the card's width and height from the x and y
// to "grab" the card in the center while we drag it around.
// Start each card 17 pixels right of the last one.
// When we hit the 13th card (King), start a new row
if (i>0 && i % 13==0)
// Create a container and put a view with the next card into it.
Containers[i]=ContainerAdd(0, x, y);