#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
#include <WSCvlabel.h>
#include <WSCvbtn.h>
#include <WSCform.h>

//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------

extern WSCform*  newform_000;
extern WSCvlabel* newvlab_001;
extern WSCvbtn** newvbtn;

void resizeep(WSCbase* object){
  //do something...
  long width = object->getProperty(WSNwidth);
  long height = object->getProperty(WSNheight);

  width -= 10;
  newform_000->setProperty(WSNwidth,width);
  newvlab_001->setProperty(WSNwidth,(width-10));

  long bheight = (height -60 -10)/5;
  long bwidth = width/4;
  long i;
  for(i=0; i<20; i++){
    newvbtn[i]->setProperty(WSNx,(5 + bwidth*(i/5)));
    newvbtn[i]->setProperty(WSNy,(60 + bheight * (i % 5)));
    newvbtn[i]->setProperty(WSNwidth,bwidth);
    newvbtn[i]->setProperty(WSNheight,bheight);
  }
}
static WSCfunctionRegister  op("resizeep",(void*)resizeep);
