#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>

#include <WSCform.h>
#include <WSCtextField.h>

//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
void resizeep(WSCbase* object){
  //do something...
extern WSCform* newform_000;
extern WSCform* newform_002;
extern WSCtextField* newtext_001;

  long width = object->getProperty(WSNwidth);
  long height = object->getProperty(WSNheight);
  width -= 2;
  if (width > 0){
    newform_000->setProperty(WSNwidth,width);
    newform_002->setProperty(WSNwidth,width);
  }else{
    newform_000->setProperty(WSNwidth,1);
    newform_002->setProperty(WSNwidth,1);
  }

  width -= 10;
  if (width > 0){
    newtext_001->setProperty(WSNwidth,width);
  }else{
    newtext_001->setProperty(WSNwidth,1);
  }

  height -= 65;
  if (height > 0){
    newform_000->setProperty(WSNheight,height);
  }else{
    newform_000->setProperty(WSNheight,1);
  }

  height -= 40;
  if (height > 0){
    newtext_001->setProperty(WSNheight,height);
  }else{
    newtext_001->setProperty(WSNheight,1);
  }
}
static WSCfunctionRegister  op("resizeep",(void*)resizeep);
