@@ -5,7 +5,7 @@ |
||
5 | 5 | abstract class CommonDialog extends Component |
6 | 6 | { |
7 | 7 | protected ?string $classname = 'System.Windows.Forms.CommonDialog'; |
8 | - protected ?string $assembly = 'System.Windows.Forms'; |
|
8 | + protected ?string $assembly = 'System.Windows.Forms'; |
|
9 | 9 | |
10 | 10 | public function execute (): int |
11 | 11 | { |
@@ -5,10 +5,10 @@ |
||
5 | 5 | abstract class CommonDialog extends Component |
6 | 6 | { |
7 | 7 | protected ?string $classname = 'System.Windows.Forms.CommonDialog'; |
8 | - protected ?string $assembly = 'System.Windows.Forms'; |
|
8 | + protected ?string $assembly = 'System.Windows.Forms'; |
|
9 | 9 | |
10 | - public function execute (): int |
|
10 | + public function execute(): int |
|
11 | 11 | { |
12 | - return $this->callMethod ('ShowDialog'); |
|
12 | + return $this->callMethod('ShowDialog'); |
|
13 | 13 | } |
14 | 14 | } |
@@ -6,8 +6,8 @@ |
||
6 | 6 | { |
7 | 7 | protected ?string $classname = 'System.Windows.Forms.FolderBrowserDialog'; |
8 | 8 | |
9 | - public function get_path () |
|
9 | + public function get_path() |
|
10 | 10 | { |
11 | - return $this->getProperty ('SelectedPath'); |
|
11 | + return $this->getProperty('SelectedPath'); |
|
12 | 12 | } |
13 | 13 | } |
@@ -7,8 +7,8 @@ |
||
7 | 7 | protected ?string $classname = 'System.Windows.Forms.MessageBox'; |
8 | 8 | protected ?string $assembly = 'System.Windows.Forms'; |
9 | 9 | |
10 | - public function __construct () |
|
10 | + public function __construct() |
|
11 | 11 | { |
12 | - parent::__construct ($this->classname, $this->assembly); |
|
12 | + parent::__construct($this->classname, $this->assembly); |
|
13 | 13 | } |
14 | 14 | } |
@@ -6,101 +6,100 @@ discard block |
||
6 | 6 | |
7 | 7 | abstract class Control extends Component |
8 | 8 | { |
9 | - public function __construct (NetObject $parent = null, ...$args) |
|
9 | + public function __construct(NetObject $parent = null, ...$args) |
|
10 | 10 | { |
11 | - parent::__construct (...$args); |
|
11 | + parent::__construct(...$args); |
|
12 | 12 | |
13 | 13 | if ($parent !== null) |
14 | 14 | $this->parent = $parent; |
15 | 15 | } |
16 | 16 | |
17 | - public function get_caption (): string |
|
17 | + public function get_caption(): string |
|
18 | 18 | { |
19 | 19 | return $this->text; |
20 | 20 | } |
21 | 21 | |
22 | - public function set_caption (string $caption): void |
|
22 | + public function set_caption(string $caption): void |
|
23 | 23 | { |
24 | 24 | $this->text = $caption; |
25 | 25 | } |
26 | 26 | |
27 | - public function set_font ($font): void |
|
27 | + public function set_font($font): void |
|
28 | 28 | { |
29 | - if (is_array ($font)) |
|
29 | + if (is_array($font)) |
|
30 | 30 | { |
31 | - $font = array_values ($font); |
|
31 | + $font = array_values($font); |
|
32 | 32 | |
33 | 33 | $obj = isset ($font[2]) ? |
34 | - VoidCore::createObject ('System.Drawing.Font', 'System.Drawing', $font[0], $font[1], [$font[2], 'System.Drawing.FontStyle, System.Drawing']) : |
|
35 | - VoidCore::createObject ('System.Drawing.Font', 'System.Drawing', $font[0], $font[1]); |
|
34 | + VoidCore::createObject('System.Drawing.Font', 'System.Drawing', $font[0], $font[1], [$font[2], 'System.Drawing.FontStyle, System.Drawing']) : VoidCore::createObject('System.Drawing.Font', 'System.Drawing', $font[0], $font[1]); |
|
36 | 35 | |
37 | - $this->setProperty ('Font', $obj); |
|
36 | + $this->setProperty('Font', $obj); |
|
38 | 37 | } |
39 | 38 | |
40 | - else $this->setProperty ('Font', EngineAdditions::uncoupleSelector ($font)); |
|
39 | + else $this->setProperty('Font', EngineAdditions::uncoupleSelector($font)); |
|
41 | 40 | } |
42 | 41 | |
43 | - public function get_backgroundColor () |
|
42 | + public function get_backgroundColor() |
|
44 | 43 | { |
45 | - return $this->getProperty (['BackColor', VC_COLOR]); |
|
44 | + return $this->getProperty(['BackColor', VC_COLOR]); |
|
46 | 45 | } |
47 | 46 | |
48 | - public function set_backgroundColor ($color): void |
|
47 | + public function set_backgroundColor($color): void |
|
49 | 48 | { |
50 | - $this->setProperty ('BackColor', $color); |
|
49 | + $this->setProperty('BackColor', $color); |
|
51 | 50 | } |
52 | 51 | |
53 | - public function get_foregroundColor () |
|
52 | + public function get_foregroundColor() |
|
54 | 53 | { |
55 | - return $this->getProperty (['ForeColor', VC_COLOR]); |
|
54 | + return $this->getProperty(['ForeColor', VC_COLOR]); |
|
56 | 55 | } |
57 | 56 | |
58 | - public function set_foregroundColor ($color): void |
|
57 | + public function set_foregroundColor($color): void |
|
59 | 58 | { |
60 | - $this->setProperty ('ForeColor', $color); |
|
59 | + $this->setProperty('ForeColor', $color); |
|
61 | 60 | } |
62 | 61 | |
63 | - public function get_w (): int |
|
62 | + public function get_w(): int |
|
64 | 63 | { |
65 | 64 | return $this->width; |
66 | 65 | } |
67 | 66 | |
68 | - public function set_w (int $w): void |
|
67 | + public function set_w(int $w): void |
|
69 | 68 | { |
70 | 69 | $this->width = $w; |
71 | 70 | } |
72 | 71 | |
73 | - public function get_h (): int |
|
72 | + public function get_h(): int |
|
74 | 73 | { |
75 | 74 | return $this->height; |
76 | 75 | } |
77 | 76 | |
78 | - public function set_h (int $h): void |
|
77 | + public function set_h(int $h): void |
|
79 | 78 | { |
80 | 79 | $this->height = $h; |
81 | 80 | } |
82 | 81 | |
83 | - public function get_x (): int |
|
82 | + public function get_x(): int |
|
84 | 83 | { |
85 | 84 | return $this->left; |
86 | 85 | } |
87 | 86 | |
88 | - public function set_x (int $x): void |
|
87 | + public function set_x(int $x): void |
|
89 | 88 | { |
90 | 89 | $this->left = $x; |
91 | 90 | } |
92 | 91 | |
93 | - public function get_y (): int |
|
92 | + public function get_y(): int |
|
94 | 93 | { |
95 | 94 | return $this->top; |
96 | 95 | } |
97 | 96 | |
98 | - public function set_y (int $y): void |
|
97 | + public function set_y(int $y): void |
|
99 | 98 | { |
100 | 99 | $this->top = $y; |
101 | 100 | } |
102 | 101 | |
103 | - public function get_bounds (): array |
|
102 | + public function get_bounds(): array |
|
104 | 103 | { |
105 | 104 | return [ |
106 | 105 | $this->left, |
@@ -110,11 +109,11 @@ discard block |
||
110 | 109 | ]; |
111 | 110 | } |
112 | 111 | |
113 | - public function set_bounds ($bounds): void |
|
112 | + public function set_bounds($bounds): void |
|
114 | 113 | { |
115 | - if (is_array ($bounds)) |
|
114 | + if (is_array($bounds)) |
|
116 | 115 | { |
117 | - $bounds = array_values ($bounds); |
|
116 | + $bounds = array_values($bounds); |
|
118 | 117 | |
119 | 118 | $this->left = (int) $bounds[0]; |
120 | 119 | $this->top = (int) $bounds[1]; |
@@ -122,10 +121,10 @@ discard block |
||
122 | 121 | $this->height = (int) $bounds[3]; |
123 | 122 | } |
124 | 123 | |
125 | - else $this->setProperty ('Bounds', EngineAdditions::uncoupleSelector ($bounds)); |
|
124 | + else $this->setProperty('Bounds', EngineAdditions::uncoupleSelector($bounds)); |
|
126 | 125 | } |
127 | 126 | |
128 | - public function get_location (): array |
|
127 | + public function get_location(): array |
|
129 | 128 | { |
130 | 129 | return [ |
131 | 130 | $this->left, |
@@ -133,20 +132,20 @@ discard block |
||
133 | 132 | ]; |
134 | 133 | } |
135 | 134 | |
136 | - public function set_location ($location) |
|
135 | + public function set_location($location) |
|
137 | 136 | { |
138 | - if (is_array ($location)) |
|
137 | + if (is_array($location)) |
|
139 | 138 | { |
140 | - $location = array_values ($location); |
|
139 | + $location = array_values($location); |
|
141 | 140 | |
142 | 141 | $this->left = $location[0]; |
143 | 142 | $this->top = $location[1]; |
144 | 143 | } |
145 | 144 | |
146 | - else $this->setProperty ('Location', EngineAdditions::uncoupleSelector ($location)); |
|
145 | + else $this->setProperty('Location', EngineAdditions::uncoupleSelector($location)); |
|
147 | 146 | } |
148 | 147 | |
149 | - public function get_size (): array |
|
148 | + public function get_size(): array |
|
150 | 149 | { |
151 | 150 | return [ |
152 | 151 | $this->width, |
@@ -154,41 +153,41 @@ discard block |
||
154 | 153 | ]; |
155 | 154 | } |
156 | 155 | |
157 | - public function set_size ($size): void |
|
156 | + public function set_size($size): void |
|
158 | 157 | { |
159 | - if (is_array ($size)) |
|
158 | + if (is_array($size)) |
|
160 | 159 | { |
161 | - $size = array_values ($size); |
|
160 | + $size = array_values($size); |
|
162 | 161 | |
163 | 162 | $this->width = (int) $size[0]; |
164 | 163 | $this->height = (int) $size[1]; |
165 | 164 | } |
166 | 165 | |
167 | - else $this->setProperty ('Size', EngineAdditions::uncoupleSelector ($size)); |
|
166 | + else $this->setProperty('Size', EngineAdditions::uncoupleSelector($size)); |
|
168 | 167 | } |
169 | 168 | |
170 | - public function setBounds (int $x, int $y, int $w, int $h): void |
|
169 | + public function setBounds(int $x, int $y, int $w, int $h): void |
|
171 | 170 | { |
172 | - $this->set_bounds ([$x, $y, $w, $h]); |
|
171 | + $this->set_bounds([$x, $y, $w, $h]); |
|
173 | 172 | } |
174 | 173 | |
175 | - public function setLocation (int $x, int $y): void |
|
174 | + public function setLocation(int $x, int $y): void |
|
176 | 175 | { |
177 | - $this->set_location ([$x, $y]); |
|
176 | + $this->set_location([$x, $y]); |
|
178 | 177 | } |
179 | 178 | |
180 | - public function setSize (int $w, int $h): void |
|
179 | + public function setSize(int $w, int $h): void |
|
181 | 180 | { |
182 | - $this->set_size ([$w, $h]); |
|
181 | + $this->set_size([$w, $h]); |
|
183 | 182 | } |
184 | 183 | |
185 | - public function toBack (): void |
|
184 | + public function toBack(): void |
|
186 | 185 | { |
187 | - $this->callMethod ('SendToBack'); |
|
186 | + $this->callMethod('SendToBack'); |
|
188 | 187 | } |
189 | 188 | |
190 | - public function toFront (): void |
|
189 | + public function toFront(): void |
|
191 | 190 | { |
192 | - $this->callMethod ('BringToFront'); |
|
191 | + $this->callMethod('BringToFront'); |
|
193 | 192 | } |
194 | 193 | } |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | { |
11 | 11 | parent::__construct (...$args); |
12 | 12 | |
13 | - if ($parent !== null) |
|
14 | - $this->parent = $parent; |
|
13 | + if ($parent !== null) { |
|
14 | + $this->parent = $parent; |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function get_caption (): string |
@@ -35,9 +36,9 @@ discard block |
||
35 | 36 | VoidCore::createObject ('System.Drawing.Font', 'System.Drawing', $font[0], $font[1]); |
36 | 37 | |
37 | 38 | $this->setProperty ('Font', $obj); |
39 | + } else { |
|
40 | + $this->setProperty ('Font', EngineAdditions::uncoupleSelector ($font)); |
|
38 | 41 | } |
39 | - |
|
40 | - else $this->setProperty ('Font', EngineAdditions::uncoupleSelector ($font)); |
|
41 | 42 | } |
42 | 43 | |
43 | 44 | public function get_backgroundColor () |
@@ -120,9 +121,9 @@ discard block |
||
120 | 121 | $this->top = (int) $bounds[1]; |
121 | 122 | $this->width = (int) $bounds[2]; |
122 | 123 | $this->height = (int) $bounds[3]; |
124 | + } else { |
|
125 | + $this->setProperty ('Bounds', EngineAdditions::uncoupleSelector ($bounds)); |
|
123 | 126 | } |
124 | - |
|
125 | - else $this->setProperty ('Bounds', EngineAdditions::uncoupleSelector ($bounds)); |
|
126 | 127 | } |
127 | 128 | |
128 | 129 | public function get_location (): array |
@@ -141,9 +142,9 @@ discard block |
||
141 | 142 | |
142 | 143 | $this->left = $location[0]; |
143 | 144 | $this->top = $location[1]; |
145 | + } else { |
|
146 | + $this->setProperty ('Location', EngineAdditions::uncoupleSelector ($location)); |
|
144 | 147 | } |
145 | - |
|
146 | - else $this->setProperty ('Location', EngineAdditions::uncoupleSelector ($location)); |
|
147 | 148 | } |
148 | 149 | |
149 | 150 | public function get_size (): array |
@@ -162,9 +163,9 @@ discard block |
||
162 | 163 | |
163 | 164 | $this->width = (int) $size[0]; |
164 | 165 | $this->height = (int) $size[1]; |
166 | + } else { |
|
167 | + $this->setProperty ('Size', EngineAdditions::uncoupleSelector ($size)); |
|
165 | 168 | } |
166 | - |
|
167 | - else $this->setProperty ('Size', EngineAdditions::uncoupleSelector ($size)); |
|
168 | 169 | } |
169 | 170 | |
170 | 171 | public function setBounds (int $x, int $y, int $w, int $h): void |