int ContainerOrderFront(int pcn, int cn);

 

Changes a container's z-order by sending it to the top of the "stack" of containers within the parent container.

 

Return Value

 

Returns one if container was found, zero otherwise.

 

Parameters

 

pcn

Handle to a parent container where the container was added.

 

cn

Handle to the container to be sent to the top of the "stack".

 

Remarks

 

The ContainerOrderFront() function affects the z-order of a specified container within a parent container by sending it "in front of" all of the other containers in the parent container.

 

Availability

 

Available in DragonFireSDK 2.0 and later.

 

Example

 

The sample code below adds some containers to the screen as well as adding containers to those containers.  Additionally, it adds some buttons for changing the z-order of the containers with respect to each other as well as for the containers within containers.

 

#include "DragonFireSDK.h"

 

int cn1;

int cn2;

int cn1a;

int cn2a;

int cn1b;

int cn2b;

int ft;

 

int OnButton(int id)

{

  if (id==1)

      // Bring Red / Green container to the front

       ContainerOrderFront(0,cn1);

  else

  if (id==2)

      // Bring Blue / Yellow container to the front

       ContainerOrderFront(0,cn2);

  else

  if (id==3)

      // Within c1, bring Red to front

       ContainerOrderFront(cn1,cn1a);

  else

  if (id==4)

      // Within c1, bring Green to front

       ContainerOrderFront(cn1,cn1b);

  else

  if (id==5)

      // Within c2, bring Blue to front

       ContainerOrderFront(cn2,cn2a);

  else

  if (id==6)

      // Within c2, bring Yellow to front:

       ContainerOrderFront(cn2,cn2b);

 

  return(id);

}

 

void AppMain()

{

   LandscapeMode();

 

   cn1=ContainerAdd(0,10,50);

   cn1a=ContainerAdd(cn1,0,0);

   cn1b=ContainerAdd(cn1,20,20);

   cn2=ContainerAdd(0,100,140);

   cn2a=ContainerAdd(cn2,0,0);

   cn2b=ContainerAdd(cn2,20,20);

 

  // Add red and green blocks to c1:

   ViewAdd(cn1a,"Images/red.png",0,0);

   ViewAdd(cn1b,"Images/green.png",0,0);

 

  // Add blue and yellow blocks to c2:

   ViewAdd(cn2a,"Images/blue.png",0,0);

   ViewAdd(cn2b,"Images/yellow.png",0,0);

 

   ButtonAdd("Images/Button",0,0,OnButton,1);

   ButtonAdd("Images/Button",60,0,OnButton,2);

   ButtonAdd("Images/Button",120,0,OnButton,3);

   ButtonAdd("Images/Button",180,0,OnButton,4);

   ButtonAdd("Images/Button",240,0,OnButton,5);

   ButtonAdd("Images/Button",300,0,OnButton,6);

 

  int ft=FontAdd("Helvetica","Bold",12,0xffffff);

 

   TextAdd(23,7,"c1",ft);

   TextAdd(83,7,"c2",ft);

   TextAdd(140,7,"c1a",ft);

   TextAdd(200,7,"c1b",ft);

   TextAdd(260,7,"c2a",ft);

   TextAdd(320,7,"c2b",ft);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}