getTheme(); if(empty($theme)) { $App->setTheme("default"); } STPHPWindow::STPHPWindow($name); } function dtor() { STPHPWindow::dtor(); unset($checkGroup); } function init() { global $App; $conf = new STPHPXmlDoc('conf'); $conf->readFromFile('./conf/wndsimple.xml'); $components = $conf->root->getChildByName('components'); $this->addCssFile('./themes/STPHPTHEME/css/wndsimple.css'); $this->addCodeFile('./js/wndsimple.js'); $this->form = new STPHPForm('main'); $this->form->setAttribute('ACTION', 'wndsimple.php'); $this->form->setAttribute('METHOD', 'POST'); $this->pnlMain = new STPHPTable('pnlMain'); $this->pnlMain->setNumOfRows(3); $this->pnlMain->setNumOfCols(1); $this->pnlMain->setAttribute('WIDTH', '100%'); $this->pnlMain->prepare(); $this->toolbarHor = new STPHPToolbar('toolbarHor'); $this->toolbarHor->setConfiguration($components->getChildByName('toolbarHor')); $n = $this->toolbarHor->getNumOfButtonByName('STPHPTHEME'); $this->toolbarHor->buttons[$n]->control->selectElementByKey($App->getTheme()); $n = $this->toolbarHor->getNumOfButtonByName('STPHPLANGUAGE'); $this->toolbarHor->buttons[$n]->control->selectElementByKey($App->getLanguage()); $this->pnlMain->addComponentToCell(1, 1, $this->toolbarHor); $this->panel = new STPHPTabPanel('tabPanel'); $this->panel->setConfiguration($components->getChildByName('tabPanel')); switch($this->panel->getTabSelected()) { case 1: $this->constructTab1($components); break; case 2: $this->constructTab2($components); break; case 3: $this->constructTab3($components); break; } $this->pnlMain->addComponentToCell(2, 1, $this->panel); $this->form->addComponent($this->pnlMain); $this->addComponent($this->form); $conf->dtor(); } function constructTab1(&$components) { $this->cont1 = new STPHPTable('cont1'); $this->cont1->setNumOfRows(1); $this->cont1->setNumOfCols(4); $this->cont1->setAttribute('WIDTH', '100%'); $this->cont1->prepare(); $this->cont1->cells[1][1]->setAttribute('VALIGN', 'TOP'); $this->cont1->cells[1][1]->setAttribute('ALIGN', 'CENTER'); $this->cont1->cells[1][1]->setAttribute('WIDTH', '25%'); $this->cont1->cells[1][2]->setAttribute('VALIGN', 'TOP'); $this->cont1->cells[1][2]->setAttribute('ALIGN', 'CENTER'); $this->cont1->cells[1][2]->setAttribute('WIDTH', '25%'); $this->cont1->cells[1][3]->setAttribute('VALIGN', 'TOP'); $this->cont1->cells[1][3]->setAttribute('ALIGN', 'CENTER'); $this->cont1->cells[1][3]->setAttribute('WIDTH', '25%'); $this->cont1->cells[1][4]->setAttribute('VALIGN', 'TOP'); $this->cont1->cells[1][4]->setAttribute('ALIGN', 'RIGHT'); $this->cont1->cells[1][4]->setAttribute('WIDTH', '25%'); $this->checkGroup = new STPHPCheckGroup('checkGroup'); $this->checkGroup->setFormParent('main'); $this->checkGroup->setConfiguration($components->getChildByName('checkGroup')); $this->cont1->addComponentToCell(1, 1, $this->checkGroup); $this->radioGroup = new STPHPRadioGroup('radioGroup'); $this->radioGroup->setFormParent('main'); $this->radioGroup->setConfiguration($components->getChildByName('radioGroup')); $this->cont1->addComponentToCell(1, 2, $this->radioGroup); $this->listBox = new STPHPListBoxWithCaption('listBox'); $this->listBox->setFormParent('main'); $this->listBox->setConfiguration($components->getChildByName('listBox')); $this->cont1->addComponentToCell(1, 3, $this->listBox); $this->toolbarVer = new STPHPToolbar('toolbarVer'); $this->toolbarVer->setConfiguration($components->getChildByName('toolbarVer')); $this->cont1->addComponentToCell(1, 4, $this->toolbarVer); $this->panel->addComponentToTab(1, $this->cont1); } function constructTab2(&$components) { $this->cont2 = new STPHPTable('cont2'); $this->cont2->setNumOfRows(2); $this->cont2->setNumOfCols(1); $this->cont2->setAttribute('WIDTH', '100%'); $this->cont2->prepare(); $this->cont2->cells[1][1]->setAttribute('VALIGN', 'TOP'); $this->cont2->cells[1][1]->setAttribute('ALIGN', 'LEFT'); $this->cont2->cells[2][1]->setAttribute('VALIGN', 'TOP'); $this->cont2->cells[2][1]->setAttribute('ALIGN', 'LEFT'); $this->edit = new STPHPEditWithCaption('edit'); $this->edit->setConfiguration($components->getChildByName('edit')); $this->cont2->addComponentToCell(1, 1, $this->edit); $this->txt = new STPHPTextAreaWithCaption('txt'); $this->txt->setConfiguration($components->getChildByName('txt')); $this->cont2->addComponentToCell(2, 1, $this->txt); $this->panel->addComponentToTab(2, $this->cont2); } function constructTab3(&$components) { global $App; $this->cont3 = new STPHPTable('cont3'); $this->cont3->setNumOfRows(1); $this->cont3->setNumOfCols(3); $this->cont3->setAttribute('WIDTH', '100%'); $this->cont3->prepare(); $this->cont3->cells[1][1]->setAttribute('VALIGN', 'TOP'); $this->cont3->cells[1][1]->setAttribute('ALIGN', 'CENTER'); $this->cont3->cells[1][2]->setAttribute('VALIGN', 'TOP'); $this->cont3->cells[1][2]->setAttribute('ALIGN', 'CENTER'); $this->cont3->cells[1][3]->setAttribute('VALIGN', 'TOP'); $this->cont3->cells[1][3]->setAttribute('ALIGN', 'CENTER'); $this->simpleButton = new STPHPButton('simpleButton'); $this->simpleButton->setConfiguration($components->getChildByName('simpleButton')); $this->cont3->addComponentToCell(1, 1, $this->simpleButton); $this->richButton = new STPHPRichButton('richButton'); $this->richButton->setAttribute('VALUE', 'Rich button'); $this->imgRichButton = new STPHPImage('imgRichButton'); $this->imgRichButton->setAttribute('SRC', './images/dae_up3.gif'); $this->imgRichButton->setAttribute('ALT', $App->getLocaleText('Rich button')); $this->richButton->addComponent($this->imgRichButton); $this->richButton->addVSpace(1); $this->lblRich = new STPHPLabel('lblRich'); $this->lblRich->setAttribute('TEXT', '' . $App->getLocaleText('Rich button') . ''); $this->lblRich->setAttribute('CLASS', 'richButton'); $this->richButton->addComponent($this->lblRich); $this->cont3->addComponentToCell(1, 2, $this->richButton); $this->imageCapt = new STPHPImageWithCaption('imageCapt'); $this->imageCapt->control->setAttribute('SRC', './images/chuck.jpg'); $this->imageCapt->control->setAttribute('ALT', 'An image with a caption'); $this->imageCapt->setAttribute('CAPTION', 'An image with a caption'); $this->imageCapt->setAttribute('CAPTION_ALIGN', 'BOTTOM'); $this->imageCapt->setAttribute('CAPTION_CLASS', 'imagecapt'); $this->cont3->addComponentToCell(1, 3, $this->imageCapt); $this->panel->addComponentToTab(3, $this->cont3); } } $App = new AppSimple("AppSimple"); $App->activateLocalization(); $App->setLocaleBasePath('./locale'); $App->setLocaleDefaultLanguage($App->getLanguage()); $Wnd = new WndSimple("WndSimple"); $App->setWndMain($Wnd); $App->init(); $Wnd->dtor(); $App->dtor(); ?>