Bearsampp 2026.9.23
Loading...
Searching...
No Matches
class.winbinder.php
Go to the documentation of this file.
1<?php
2/*
3 *
4 * * Copyright (c) 2022-2025 Bearsampp
5 * * License: GNU General Public License version 3 or later; see LICENSE.txt
6 * * Website: https://bearsampp.com
7 * * Github: https://github.com/Bearsampp
8 *
9 */
10
19{
20 // Constants for control IDs and objects
21 const CTRL_ID = 0;
22 const CTRL_OBJ = 1;
23
24 // Constants for progress bar increment and new line
25 const INCR_PROGRESS_BAR = '++';
26 const NEW_LINE = '@nl@';
27
28 // Constants for message box types
29 const BOX_INFO = WBC_INFO;
30 const BOX_OK = WBC_OK;
31 const BOX_OKCANCEL = WBC_OKCANCEL;
32 const BOX_QUESTION = WBC_QUESTION;
33 const BOX_ERROR = WBC_STOP;
34 const BOX_WARNING = WBC_WARNING;
35 const BOX_YESNO = WBC_YESNO;
36 const BOX_YESNOCANCEL = WBC_YESNOCANCEL;
37
38 // Constants for cursor types
39 const CURSOR_ARROW = 'arrow';
40 const CURSOR_CROSS = 'cross';
41 const CURSOR_FINGER = 'finger';
42 const CURSOR_FORBIDDEN = 'forbidden';
43 const CURSOR_HELP = 'help';
44 const CURSOR_IBEAM = 'ibeam';
45 const CURSOR_NONE = null;
46 const CURSOR_SIZEALL = 'sizeall';
47 const CURSOR_SIZENESW = 'sizenesw';
48 const CURSOR_SIZENS = 'sizens';
49 const CURSOR_SIZENWSE = 'sizenwse';
50 const CURSOR_SIZEWE = 'sizewe';
51 const CURSOR_UPARROW = 'uparrow';
52 const CURSOR_WAIT = 'wait';
53 const CURSOR_WAITARROW = 'waitarrow';
54
55 // Constants for system information types
56 const SYSINFO_SCREENAREA = 'screenarea';
57 const SYSINFO_WORKAREA = 'workarea';
59 public $callback;
61 public $gauge;
65 private $countCtrls;
66
72 public function __construct()
73 {
74 global $bearsamppCore;
75 Log::initClass($this);
76
77 $this->defaultTitle = APP_TITLE . ' ' . $bearsamppCore->getAppVersion();
78 $this->reset();
79 }
80
86 public function reset(): void
87 {
88 $this->countCtrls = 1000;
89 $this->callback = array();
90 }
91
103 public function createAppWindow($caption, $width, $height, $style = null, $params = null): mixed
104 {
105 return $this->createWindow(null, AppWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
106 }
107
123 public function createWindow($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style = null, $params = null): mixed
124 {
125 global $bearsamppCore;
126
127 // Fix for PHP 8.4: Convert null to 0 for parent parameter
128 $parent = $parent === null ? 0 : $parent;
129
130 // Fix for PHP 8.4: Ensure style and params are proper types
131 $style = $style === null ? 0 : $style;
132 $params = $params === null ? 0 : $params;
133
134 // Log window creation attempt for debugging
135 $this->writeLog(
136 'Creating window: class=' . $wclass . ', caption=' . $caption . ', pos=(' . $xPos . ',' . $yPos . '), size=(' . $width . 'x' . $height . '), style=' . $style . ', params=' . $params
137 );
138
139 $caption = empty($caption) ? $this->defaultTitle : $this->defaultTitle . ' - ' . $caption;
140 $window = $this->callWinBinder('wb_create_window', array($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style, $params));
141
142 if ($window === false || $window === null) {
143 $this->writeLog('ERROR: Failed to create window - wb_create_window returned: ' . var_export($window, true));
144 // Check if WinBinder extension is loaded
145 if (!extension_loaded('winbinder')) {
146 $this->writeLog('ERROR: WinBinder extension is not loaded!');
147 }
148 // Check if the function exists
149 if (!function_exists('wb_create_window')) {
150 $this->writeLog('ERROR: wb_create_window function does not exist!');
151 }
152 } else {
153 $this->writeLog('Window created successfully: handle=' . $window);
154 // Set tiny window icon
155 // Use bmp for window icon to ensure orange icon is used everywhere as requested
156 $this->setImage($window, Path::getImagesPath() . '/bearsampp.bmp');
157 }
158
159 return $window;
160 }
161
171 private function callWinBinder($function, $params = array(), $removeErrorHandler = false): mixed
172 {
173 $result = false;
174 if (function_exists($function)) {
175 if ($removeErrorHandler) {
176 // Suppress all errors for this call
177 $oldErrorLevel = error_reporting(0);
178 $result = @call_user_func_array($function, $params);
179 error_reporting($oldErrorLevel);
180 } else {
181 $result = call_user_func_array($function, $params);
182 }
183 }
184
185 return $result;
186 }
187
196 public function setImage($wbobject, $path): mixed
197 {
198 if ($wbobject === null) {
199 error_log('Error: $wbobject is null.');
200
201 return false;
202 }
203
204 if (!file_exists($path)) {
205 error_log('Error: Image file does not exist at path: ' . $path);
206
207 return false;
208 }
209
210 return $this->callWinBinder('wb_set_image', array($wbobject, $path));
211 }
212
224 public function createNakedWindow($caption, $width, $height, $style = null, $params = null): mixed
225 {
226 $window = $this->createWindow(null, NakedWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
227 $this->setArea($window, $width, $height);
228
229 return $window;
230 }
231
241 public function setArea($wbobject, $width, $height): mixed
242 {
243 return $this->callWinBinder('wb_set_area', array($wbobject, WBC_TITLE, 0, 0, $width, $height));
244 }
245
253 public function destroyWindow($window): bool
254 {
255 // Check if window exists and is valid
256 if (!$window || !$this->windowIsValid($window)) {
257 return true; // Already closed or invalid window
258 }
259
260 // Get window title before destruction for fallback
261 $windowTitle = $this->getText($window);
262 $currentPid = Win32Ps::getCurrentPid();
263
264 // Attempt standard destruction
265 $this->callWinBinder('wb_destroy_window', array($window));
266
267 // Verify closure with retries
268 $maxAttempts = 3;
269 $attempt = 0;
270 $destroyed = false;
271
272 while ($attempt < $maxAttempts && !$destroyed) {
273 $this->processMessages();
274 usleep(100000); // 100ms delay
275 $destroyed = !$this->windowIsValid($window);
276 $attempt++;
277 }
278
279 // Fallback to process termination if window still exists
280 if (!$destroyed) {
281 // 1. Try to close using window title
282 $this->exec('taskkill', '/FI "WINDOWTITLE eq ' . $windowTitle . '" /F', true);
283
284 // 2. Try to kill process directly using Winbinder's PID method
285 $currentPid = Win32Ps::getCurrentPid();
286 if (!empty($currentPid)) {
287 $this->exec('taskkill', '/PID ' . $currentPid . ' /T /F', true);
288 $this->writeLog('Force-killed PID: ' . $currentPid . ' for window: ' . $window);
289 }
290
291 // 3. Final sanity check
292 if ($this->windowIsValid($window)) {
293 $this->callWinBinder('wb_destroy_window', array($window), true); // Force native call
294 }
295
296 // 4. Reset internal state to prevent memory leaks
297 $this->reset();
298 }
299
300 // Final verification
301 return !$this->windowIsValid($window);
302 }
303
311 public function getText($wbobject): mixed
312 {
313 return $this->callWinBinder('wb_get_text', array($wbobject));
314 }
315
323 private function windowIsValid($window): bool
324 {
325 if (!$window) {
326 return false;
327 }
328
329 // Try to get window text - if window is invalid, this will fail
330 $text = $this->callWinBinder('wb_get_text', array($window), true);
331
332 return ($text !== false);
333 }
334
340 private function processMessages(): void
341 {
342 $this->callWinBinder('wb_wait', array(null, 1), true);
343 }
344
358 public function exec($cmd, $params = null, $silent = false, $wait = true, $showWindow = false): mixed
359 {
360 // Handle array of arguments by quoting each one individually
361 if (is_array($params)) {
362 $quotedParams = [];
363 foreach ($params as $arg) {
364 $quotedParams[] = $this->quoteWindowsArg((string)$arg);
365 }
366 $params = implode(' ', $quotedParams);
367 }
368
369 if ($silent) {
370 // Use WScript.Shell via COM for true silent execution (zero window flashing)
371 // This is more reliable than powershell.exe -WindowStyle Hidden which can still flash
372 try {
373 $wsh = new COM('WScript.Shell');
374 $fullCmd = '"' . $cmd . '"' . (empty($params) ? '' : ' ' . $params);
375 // 0 = Hidden, $wait = wait for process to exit
376 $exitCode = $wsh->Run($fullCmd, 0, $wait);
377 $this->writeLog('exec (silent via COM): ' . $fullCmd . ' [ExitCode: ' . $exitCode . ']');
378
379 return $exitCode === 0;
380 } catch (Throwable $e) {
381 $this->writeLog('exec (silent via COM) failed: ' . $e->getMessage() . '. Falling back to PowerShell.');
382 // Fall back to PowerShell method if COM fails
383 $psCmd = 'Start-Process -FilePath \'' . str_replace("'", "''", $cmd) . '\'';
384 if (!empty($params)) {
385 $psCmd .= ' -ArgumentList \'' . str_replace("'", "''", $params) . '\'';
386 }
387 $psCmd .= ' -WindowStyle Hidden';
388 if ($wait) {
389 $psCmd .= ' -Wait';
390 }
391 $encodedCmd = base64_encode(mb_convert_encoding($psCmd, 'UTF-16LE', 'UTF-8'));
392 $cmd = 'powershell.exe';
393 $params = '-WindowStyle Hidden -ExecutionPolicy Bypass -EncodedCommand ' . $encodedCmd;
394 }
395 }
396
397 $this->writeLog('exec: ' . $cmd . ' ' . $params);
398
399 if ($showWindow) {
400 return $this->callWinBinder('wb_exec', array($cmd, $params, true));
401 }
402
403 return $this->callWinBinder('wb_exec', array($cmd, $params));
404 }
405
418 private function quoteWindowsArg(string $arg): string
419 {
420 // If argument is empty, return empty quotes
421 if ($arg === '') {
422 return '""';
423 }
424
425 // If argument contains spaces, quotes, or special shell characters, it needs quoting
426 if (preg_match('/[\s"&|<>^()]/', $arg)) {
427 // Escape any internal quotes by doubling them (Windows convention for cmd.exe/WScript.Shell)
428 $escaped = str_replace('"', '""', $arg);
429
430 return '"' . $escaped . '"';
431 }
432
433 return $arg;
434 }
435
443 private static function writeLog($log): void
444 {
445 global $bearsamppRoot;
447 }
448
454 public function mainLoop(): mixed
455 {
456 return $this->callWinBinder('wb_main_loop');
457 }
458
466 public function refresh($wbobject): mixed
467 {
468 return $this->callWinBinder('wb_refresh', array($wbobject, true));
469 }
470
478 public function getSystemInfo($info): mixed
479 {
480 return $this->callWinBinder('wb_get_system_info', array($info));
481 }
482
495 public function drawImage($wbobject, $path, $xPos = 0, $yPos = 0, $width = 0, $height = 0): mixed
496 {
497 $image = $this->callWinBinder('wb_load_image', array($path));
498 if ($image === null) {
499 return false;
500 }
501
502 return $this->callWinBinder('wb_draw_image', array($wbobject, $image, $xPos, $yPos, $width, $height));
503 }
504
518 public function drawText($parent, $caption, $xPos, $yPos, $width = null, $height = null, $font = null)
519 {
520 // Fix for PHP 8+: Convert null to empty string before str_replace
521 $caption = $caption === null ? '' : $caption;
522 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
523 $width = $width == null ? 120 : $width;
524 $height = $height == null ? 25 : $height;
525
526 return $this->callWinBinder('wb_draw_text', array($parent, $caption, $xPos, $yPos, $width, $height, $font));
527 }
528
542 public function drawRect($parent, $xPos, $yPos, $width, $height, $color = 15790320, $filled = true)
543 {
544 return $this->callWinBinder('wb_draw_rect', array($parent, $xPos, $yPos, $width, $height, $color, $filled));
545 }
546
560 public function drawLine($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height = 1)
561 {
562 return $this->callWinBinder('wb_draw_line', array($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height));
563 }
564
575 public function createFont($fontName, $size = null, $color = null, $style = null)
576 {
577 return $this->callWinBinder('wb_create_font', array($fontName, $size, $color, $style));
578 }
579
587 public function wait($wbobject = null)
588 {
589 return $this->callWinBinder('wb_wait', array($wbobject), true);
590 }
591
600 public function destroyTimer($wbobject, $timerobject)
601 {
602 return $this->callWinBinder('wb_destroy_timer', array($wbobject, $timerobject));
603 }
604
612 public function findFile($filename)
613 {
614 $result = $this->callWinBinder('wb_find_file', array($filename));
615 $this->writeLog('findFile ' . $filename . ': ' . $result);
616
617 return $result != $filename ? $result : false;
618 }
619
630 public function setHandler($wbobject, $classCallback, $methodCallback, $launchTimer = null)
631 {
632 if ($launchTimer != null) {
633 $launchTimer = $this->createTimer($wbobject, $launchTimer);
634 }
635
636 $this->callback[$wbobject] = array($classCallback, $methodCallback, $launchTimer);
637
638 return $this->callWinBinder('wb_set_handler', array($wbobject, '__winbinderEventHandler'));
639 }
640
649 public function createTimer($wbobject, $wait = 1000)
650 {
651 $this->countCtrls++;
652
653 return array(
654 self::CTRL_ID => $this->countCtrls,
655 self::CTRL_OBJ => $this->callWinBinder('wb_create_timer', array($wbobject, $this->countCtrls, $wait))
656 );
657 }
658
667 public function setText($wbobject, $content)
668 {
669 // Fix for PHP 8+: Convert null to empty string before str_replace
670 $content = $content === null ? '' : $content;
671 $content = str_replace(self::NEW_LINE, PHP_EOL, $content);
672
673 return $this->callWinBinder('wb_set_text', array($wbobject, $content));
674 }
675
681 public function getFocus()
682 {
683 return $this->callWinBinder('wb_get_focus');
684 }
685
693 public function setFocus($wbobject)
694 {
695 return $this->callWinBinder('wb_set_focus', array($wbobject));
696 }
697
705 public function isEnabled($wbobject)
706 {
707 return $this->callWinBinder('wb_get_enabled', array($wbobject));
708 }
709
717 public function setDisabled($wbobject)
718 {
719 return $this->setEnabled($wbobject, false);
720 }
721
730 public function setEnabled($wbobject, $enabled = true)
731 {
732 return $this->callWinBinder('wb_set_enabled', array($wbobject, $enabled));
733 }
734
743 public function setStyle($wbobject, $style)
744 {
745 return $this->callWinBinder('wb_set_style', array($wbobject, $style));
746 }
747
757 public function sysDlgPath($parent, $title, $path = null)
758 {
759 return $this->callWinBinder('wb_sys_dlg_path', array($parent, $title, $path));
760 }
761
772 public function sysDlgOpen($parent, $title, $filter = null, $path = null)
773 {
774 return $this->callWinBinder('wb_sys_dlg_open', array($parent, $title, $filter, $path));
775 }
776
791 public function createLabel($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
792 {
793 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
794 $width = $width == null ? 120 : $width;
795 $height = $height == null ? 25 : $height;
796
797 return $this->createControl($parent, Label, $caption, $xPos, $yPos, $width, $height, $style, $params);
798 }
799
815 public function createControl($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style = null, $params = null)
816 {
817 $this->countCtrls++;
818
819 // Fix for PHP 8.4: Ensure style and params are proper types
820 $style = $style === null ? 0 : $style;
821 $params = $params === null ? 0 : $params;
822
823 return array(
824 self::CTRL_ID => $this->countCtrls,
825 self::CTRL_OBJ => $this->callWinBinder('wb_create_control', array(
826 $parent,
827 $ctlClass,
828 $caption,
829 $xPos,
830 $yPos,
831 $width,
832 $height,
833 $this->countCtrls,
834 $style,
835 $params
836 )),
837 );
838 }
839
855 public function createInputText($parent, $value, $xPos, $yPos, $width = null, $height = null, $maxLength = null, $style = null, $params = null)
856 {
857 // Fix for PHP 8+: Convert null to empty string before str_replace
858 $value = $value === null ? '' : $value;
859 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
860 $width = $width == null ? 120 : $width;
861 $height = $height == null ? 25 : $height;
862 $inputText = $this->createControl($parent, EditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
863 if (is_numeric($maxLength) && $maxLength > 0) {
864 $this->setMaxLength($inputText[self::CTRL_OBJ], $maxLength);
865 }
866
867 return $inputText;
868 }
869
878 public function setMaxLength($wbobject, $length)
879 {
880 // Use error suppression for wb_send_message as it may be disabled in some PHP configurations
881 // This is a non-critical operation - if it fails, the input will just not have a max length
882 return $this->callWinBinder('wb_send_message', array($wbobject, 0x00c5, $length, 0), true);
883 }
884
899 public function createEditBox($parent, $value, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
900 {
901 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
902 $width = $width == null ? 540 : $width;
903 $height = $height == null ? 340 : $height;
904 $editBox = $this->createControl($parent, RTFEditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
905
906 return $editBox;
907 }
908
923 public function createHyperLink($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
924 {
925 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
926 $width = $width == null ? 120 : $width;
927 $height = $height == null ? 15 : $height;
928 $hyperLink = $this->createControl($parent, HyperLink, (string)$caption, $xPos, $yPos, $width, $height, $style, $params);
929 $this->setCursor($hyperLink[self::CTRL_OBJ], self::CURSOR_FINGER);
930
931 return $hyperLink;
932 }
933
942 public function setCursor($wbobject, $type = self::CURSOR_ARROW)
943 {
944 return $this->callWinBinder('wb_set_cursor', array($wbobject, $type));
945 }
946
961 public function createRadioButton($parent, $caption, $checked, $xPos, $yPos, $width = null, $height = null, $startGroup = false)
962 {
963 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
964 $width = $width == null ? 120 : $width;
965 $height = $height == null ? 25 : $height;
966
967 return $this->createControl($parent, RadioButton, (string)$caption, $xPos, $yPos, $width, $height, $startGroup ? WBC_GROUP : null, $checked ? 1 : 0);
968 }
969
984 public function createButton($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
985 {
986 $width = $width == null ? 80 : $width;
987 $height = $height == null ? 25 : $height;
988
989 return $this->createControl($parent, PushButton, $caption, $xPos, $yPos, $width, $height, $style, $params);
990 }
991
1006 public function createProgressBar($parent, $max, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
1007 {
1008 global $bearsamppLang;
1009
1010 $width = $width == null ? 200 : $width;
1011 $height = $height == null ? 15 : $height;
1012 $progressBar = $this->createControl($parent, Gauge, $bearsamppLang->getValue(Lang::LOADING), $xPos, $yPos, $width, $height, $style, $params);
1013
1014 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
1015 $this->gauge[$progressBar[self::CTRL_OBJ]] = 0;
1016
1017 return $progressBar;
1018 }
1019
1027 public function getValue($wbobject)
1028 {
1029 return $this->callWinBinder('wb_get_value', array($wbobject));
1030 }
1031
1041 public function setRange($wbobject, $min, $max)
1042 {
1043 return $this->callWinBinder('wb_set_range', array($wbobject, $min, $max));
1044 }
1045
1051 public function incrProgressBar($progressBar)
1052 {
1053 $this->setProgressBarValue($progressBar, self::INCR_PROGRESS_BAR);
1054 }
1055
1062 public function setProgressBarValue($progressBar, $value)
1063 {
1064 if ($progressBar != null && isset($progressBar[self::CTRL_OBJ]) && isset($this->gauge[$progressBar[self::CTRL_OBJ]])) {
1065 if (strval($value) == self::INCR_PROGRESS_BAR) {
1066 $value = $this->gauge[$progressBar[self::CTRL_OBJ]] + 1;
1067 }
1068 if (is_numeric($value)) {
1069 $this->gauge[$progressBar[self::CTRL_OBJ]] = $value;
1070
1071 // Check if the control is still valid before setting the value
1072 // This prevents errors when the parent window has been destroyed
1073 $this->callWinBinder('wb_set_value', array($progressBar[self::CTRL_OBJ], $value), true);
1074 }
1075 }
1076 }
1077
1086 public function setValue($wbobject, $content)
1087 {
1088 return $this->callWinBinder('wb_set_value', array($wbobject, $content));
1089 }
1090
1096 public function resetProgressBar($progressBar)
1097 {
1098 $this->setProgressBarValue($progressBar, 0);
1099 }
1100
1107 public function setProgressBarMax($progressBar, $max)
1108 {
1109 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
1110 }
1111
1120 public function messageBoxInfo($message, $title = null)
1121 {
1122 return $this->messageBox($message, self::BOX_INFO, $title);
1123 }
1124
1134 public function messageBox($message, $type, $title = null)
1135 {
1136 global $bearsamppCore;
1137
1138 $message = str_replace(self::NEW_LINE, PHP_EOL, $message);
1139 $messageBox = $this->callWinBinder('wb_message_box', array(
1140 0, // Use 0 instead of null for the window handle parameter
1141 strlen($message) < 64 ? str_pad($message, 64) : $message, // Pad message to display entire title
1142 $title == null ? $this->defaultTitle : $this->defaultTitle . ' - ' . $title,
1143 $type
1144 ));
1145
1146 return $messageBox;
1147 }
1148
1157 public function messageBoxOk($message, $title = null)
1158 {
1159 return $this->messageBox($message, self::BOX_OK, $title);
1160 }
1161
1170 public function messageBoxOkCancel($message, $title = null)
1171 {
1172 return $this->messageBox($message, self::BOX_OKCANCEL, $title);
1173 }
1174
1183 public function messageBoxQuestion($message, $title = null)
1184 {
1185 return $this->messageBox($message, self::BOX_QUESTION, $title);
1186 }
1187
1196 public function messageBoxError($message, $title = null)
1197 {
1198 return $this->messageBox($message, self::BOX_ERROR, $title);
1199 }
1200
1209 public function messageBoxWarning($message, $title = null)
1210 {
1211 return $this->messageBox($message, self::BOX_WARNING, $title);
1212 }
1213
1222 public function messageBoxYesNo($message, $title = null)
1223 {
1224 return $this->messageBox($message, self::BOX_YESNO, $title);
1225 }
1226
1235 public function messageBoxYesNoCancel($message, $title = null)
1236 {
1237 return $this->messageBox($message, self::BOX_YESNOCANCEL, $title);
1238 }
1239
1240}
1241
1255function __winbinderEventHandler($window, $id, $ctrl, $param1, $param2)
1256{
1257 global $bearsamppWinbinder;
1258
1259 if ($bearsamppWinbinder->callback[$window][2] != null) {
1260 $bearsamppWinbinder->destroyTimer($window, $bearsamppWinbinder->callback[$window][2][0]);
1261 }
1262
1263 call_user_func_array(
1264 array($bearsamppWinbinder->callback[$window][0], $bearsamppWinbinder->callback[$window][1]),
1265 array($window, $id, $ctrl, $param1, $param2)
1266 );
1267}
$result
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
__winbinderEventHandler($window, $id, $ctrl, $param1, $param2)
const LOADING
static debug($data, $file=null)
static initClass($classInstance)
static getImagesPath($aetrayPath=false)
static getWinbinderLogFilePath($aetrayPath=false)
static getCurrentPid()
setCursor($wbobject, $type=self::CURSOR_ARROW)
messageBoxYesNoCancel($message, $title=null)
getValue($wbobject)
setHandler($wbobject, $classCallback, $methodCallback, $launchTimer=null)
createFont($fontName, $size=null, $color=null, $style=null)
drawLine($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height=1)
findFile($filename)
setDisabled($wbobject)
messageBox($message, $type, $title=null)
const CURSOR_SIZEALL
createProgressBar($parent, $max, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
const CURSOR_FINGER
static writeLog($log)
createButton($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
messageBoxError($message, $title=null)
destroyTimer($wbobject, $timerobject)
const CURSOR_SIZEWE
callWinBinder($function, $params=array(), $removeErrorHandler=false)
const CURSOR_FORBIDDEN
incrProgressBar($progressBar)
setImage($wbobject, $path)
setValue($wbobject, $content)
createAppWindow($caption, $width, $height, $style=null, $params=null)
exec($cmd, $params=null, $silent=false, $wait=true, $showWindow=false)
windowIsValid($window)
createInputText($parent, $value, $xPos, $yPos, $width=null, $height=null, $maxLength=null, $style=null, $params=null)
getSystemInfo($info)
getText($wbobject)
const CURSOR_SIZENESW
setArea($wbobject, $width, $height)
wait($wbobject=null)
setStyle($wbobject, $style)
setProgressBarValue($progressBar, $value)
createControl($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)
refresh($wbobject)
setRange($wbobject, $min, $max)
const SYSINFO_SCREENAREA
const BOX_YESNOCANCEL
drawText($parent, $caption, $xPos, $yPos, $width=null, $height=null, $font=null)
const CURSOR_SIZENWSE
setFocus($wbobject)
createNakedWindow($caption, $width, $height, $style=null, $params=null)
messageBoxWarning($message, $title=null)
const INCR_PROGRESS_BAR
messageBoxOk($message, $title=null)
createHyperLink($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
drawRect($parent, $xPos, $yPos, $width, $height, $color=15790320, $filled=true)
isEnabled($wbobject)
resetProgressBar($progressBar)
messageBoxInfo($message, $title=null)
setText($wbobject, $content)
createRadioButton($parent, $caption, $checked, $xPos, $yPos, $width=null, $height=null, $startGroup=false)
quoteWindowsArg(string $arg)
createEditBox($parent, $value, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
const SYSINFO_WORKAREA
destroyWindow($window)
const CURSOR_UPARROW
sysDlgPath($parent, $title, $path=null)
const CURSOR_SIZENS
messageBoxOkCancel($message, $title=null)
messageBoxQuestion($message, $title=null)
sysDlgOpen($parent, $title, $filter=null, $path=null)
setProgressBarMax($progressBar, $max)
const CURSOR_WAITARROW
createLabel($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
setMaxLength($wbobject, $length)
createTimer($wbobject, $wait=1000)
createWindow($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)
drawImage($wbobject, $path, $xPos=0, $yPos=0, $width=0, $height=0)
setEnabled($wbobject, $enabled=true)
messageBoxYesNo($message, $title=null)
const APP_TITLE
Definition root.php:19