1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13: namespace ManiaLib\Gui\Cards\Dialogs;
14:
15: use ManiaLib\Gui\Elements\Label;
16:
17: class OneButton extends \ManiaLib\Gui\Cards\Panel
18: {
19:
20: 21: 22:
23: public $button;
24:
25: 26: 27:
28: public $text;
29:
30: function __construct($sizeX = 65, $sizeY = 25)
31: {
32: parent::__construct($sizeX, $sizeY);
33:
34: $this->setSubStyle(\ManiaLib\Gui\Elements\Bgs1::BgWindow2);
35: $this->title->setStyle(\ManiaLib\Gui\Elements\Label::TextTitle2);
36: $this->addCardElement($this->title);
37:
38: $this->button = new \ManiaLib\Gui\Elements\Button;
39: $this->button->setAlign('center', 'bottom');
40: $this->addCardElement($this->button);
41:
42: $this->text = new Label();
43: $this->text->setAlign('center', 'center');
44: $this->text->enableAutonewline();
45:
46: $this->addCardElement($this->text);
47: }
48:
49: function preFilter()
50: {
51: parent::preFilter();
52: $this->text->setSize($this->sizeX - 6, $this->sizeY - 11);
53: $this->text->setPositionY(- $this->sizeY / 2 - 5);
54: $this->button->setPositionY(5 - $this->sizeY);
55: }
56:
57: }
58:
59: ?>