1 | 2 | simandl | <?php |
2 | | | |
3 | | | namespace Phem\Libraries\UI\Model; |
4 | | | |
5 | | | use Phem\Core\Collection; |
6 | | | |
7 | | | /** |
8 | | | * @author Jakub PetrĹžĂlka <petrzilka@czweb.net> |
9 | | | */ |
10 | | | class TextBox extends Control |
11 | | | { |
12 | | | |
13 | | | /** |
14 | | | * |
15 | | | * @\Phem\Libraries\UI\Annotations\DomPath(path="input") |
16 | | | * @\Phem\Libraries\UI\Annotations\DomAttr(name="value") |
17 | | | */ |
18 | | | private $text; |
19 | | | private $enabled = true; |
20 | | | private $readonly = false; |
21 | | | private $onChange; |
22 | | | private $onKeyup; |
23 | | | |
24 | | | function __construct($parent) |
25 | | | { |
26 | | | parent::__construct($parent); |
27 | | | $this->onChange = new Collection(); |
28 | | | $this->onKeyup = new Collection(); |
29 | | | } |
30 | | | |
31 | | | public function getText() |
32 | | | { |
33 | | | return $this->text; |
34 | | | } |
35 | | | |
36 | | | protected function setText($text) |
37 | | | { |
38 | | | $this->text = $text; |
39 | | | } |
40 | | | |
41 | | | public function getEnabled() |
42 | | | { |
43 | | | return $this->enabled; |
44 | | | } |
45 | | | |
46 | | | protected function setEnabled($enabled) |
47 | | | { |
48 | | | $this->enabled = $enabled; |
49 | | | } |
50 | | | |
51 | | | public function getReadonly() |
52 | | | { |
53 | | | return $this->readonly; |
54 | | | } |
55 | | | |
56 | | | protected function setReadonly($readonly) |
57 | | | { |
58 | | | $this->readonly = $readonly; |
59 | | | } |
60 | | | |
61 | | | public function OnChange() |
62 | | | { |
63 | | | return $this->onChange; |
64 | | | } |
65 | | | |
66 | | | public function OnKeyup() |
67 | | | { |
68 | | | return $this->onKeyup; |
69 | | | } |
70 | | | |
71 | | | public function getValue() |
72 | | | { |
73 | | | return $this->getText(); |
74 | | | } |
75 | | | |
76 | | | protected function setValue($value) |
77 | | | { |
78 | | | $this->setText($value); |
79 | | | } |
80 | | | |
81 | | | } |