Provides basic windowing system classes for the plugin package.
namespace ManiaLivePlugins\eXpansion\Gui\Elements
provides elements: Button, Checkbox, InputBox, Ratiobutton
Public methods:
Usage:
// first create action $this->actionOK = ActionHandler::getInstance()->createAction(array($this, "Ok")); $button = new myButton(); $button->setText("Ok"); $button->setAction($this->actionOk); $this->_mainFrame->addComponent($button);
Checkbox has its own action handler build in, basicly you just say if the checkbox is checked or not, user changes its state and onsave you query the current state from the element.
Public methods:
Usage:
$xsize = 4; $ysize = 4; $textwidth = 40; $checkbox = new checkbox($xsize,$ysize,$textwidth); $checkbox -> setText("is Server online"); $checkbox -> setStatus(true); $this->_mainFrame->addComponent($checkbox );
Ratiobutton has its own action handler build in, basicly you just say if the ratiobutton is checked or not, user changes its state and onsave you query the current state from the element.
Public methods:
Usage:
$xsize = 4; $ysize = 4; $textwidth = 40; $ratiobutton = new ratibutton($xsize,$ysize,$textwidth); $ratiobutton-> setText("is Server online"); $ratiobutton-> setStatus(true); $this->_mainFrame->addComponent($ratiobutton);
Inputbox is currently implemented for future usage. Currently there is no way to return the value of an inputbox to servercontroller.
Public methods:
Usage:
$this->minLadder = new Inputbox("ladderMin"); $this->minLadder->setLabel("Ladderpoints minimum"); $this->minLadder->setText($server->ladderServerLimitMin); $this->frameLadder->addComponent($this->minLadder);
Provides minimizable and movable window, written in maniascript and manialib.
please use $this→mainFrame→addComponent($component); for adding window content.
namespace whaever; class myWindow extends \ManiaLivePlugins\eXpansion\Gui\Windows\Window { private $actionOK, $buttonOk; function onConstruct() { parent::onConstruct(); $this->actionOK = ActionHandler::getInstance()->createAction(array($this, "Ok")); $this->setTitle('My Window'); $this->buttonOK = new Button(); $this->buttonOK->setText("Apply"); $this->buttonOK->setAction($this->actionOK); $this->mainFrame->addComponent($this->buttonOK); } public function Ok($login) { $this->hide(); } // remember every time to create the destroy method and call destroy() for custom elements + frames. // do also clearComponents() for frames and basic layout to minimize memory leaks. function destroy() { $this->buttonOk->destroy(); ActionHandler::getInstance()->deleteAction($this->actionOK); $this->clearComponents(); parent::destroy(); } function onResize($oldX, $oldY) { parent::onResize($oldX, $oldY); } }
button = '' button active = '' checkbox = '' checkboxActive = '' ratiobutton = '' ratiobuttonActive = '' windowTitleBar = '' windowClosebutton = '' windowClosebuttonActive = '' windowMinbutton = '' windowMinbuttonActive = ''