Bearsampp 2026.7.11
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';
58 public $callback;
59 public $gauge;
61 private $countCtrls;
62
68 public function __construct()
69 {
70 global $bearsamppCore;
71 Log::initClass($this);
72
73 $this->defaultTitle = APP_TITLE . ' ' . $bearsamppCore->getAppVersion();
74 $this->reset();
75 }
76
80 public function reset(): void
81 {
82 $this->countCtrls = 1000;
83 $this->callback = array();
84 }
85
97 public function createAppWindow($caption, $width, $height, $style = null, $params = null): mixed
98 {
99 return $this->createWindow(null, AppWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
100 }
101
117 public function createWindow($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style = null, $params = null): mixed
118 {
119 global $bearsamppCore;
120
121 // Fix for PHP 8.4: Convert null to 0 for parent parameter
122 $parent = $parent === null ? 0 : $parent;
123
124 // Fix for PHP 8.4: Ensure style and params are proper types
125 $style = $style === null ? 0 : $style;
126 $params = $params === null ? 0 : $params;
127
128 // Log window creation attempt for debugging
129 $this->writeLog('Creating window: class=' . $wclass . ', caption=' . $caption . ', pos=(' . $xPos . ',' . $yPos . '), size=(' . $width . 'x' . $height . '), style=' . $style . ', params=' . $params);
130
131 $caption = empty($caption) ? $this->defaultTitle : $this->defaultTitle . ' - ' . $caption;
132 $window = $this->callWinBinder('wb_create_window', array($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style, $params));
133
134 if ($window === false || $window === null) {
135 $this->writeLog('ERROR: Failed to create window - wb_create_window returned: ' . var_export($window, true));
136 // Check if WinBinder extension is loaded
137 if (!extension_loaded('winbinder')) {
138 $this->writeLog('ERROR: WinBinder extension is not loaded!');
139 }
140 // Check if the function exists
141 if (!function_exists('wb_create_window')) {
142 $this->writeLog('ERROR: wb_create_window function does not exist!');
143 }
144 } else {
145 $this->writeLog('Window created successfully: handle=' . $window);
146 // Set tiny window icon
147 // Use bmp for window icon to ensure orange icon is used everywhere as requested
148 $this->setImage($window, Path::getImagesPath() . '/bearsampp.bmp');
149 }
150
151 return $window;
152 }
153
163 private function callWinBinder($function, $params = array(), $removeErrorHandler = false): mixed
164 {
165 $result = false;
166 if (function_exists($function)) {
167 if ($removeErrorHandler) {
168 // Suppress all errors for this call
169 $oldErrorLevel = error_reporting(0);
170 $result = @call_user_func_array($function, $params);
171 error_reporting($oldErrorLevel);
172 } else {
173 $result = call_user_func_array($function, $params);
174 }
175 }
176
177 return $result;
178 }
179
188 public function setImage($wbobject, $path): mixed
189 {
190 if ($wbobject === null) {
191 error_log('Error: $wbobject is null.');
192
193 return false;
194 }
195
196 if (!file_exists($path)) {
197 error_log('Error: Image file does not exist at path: ' . $path);
198
199 return false;
200 }
201
202 return $this->callWinBinder('wb_set_image', array($wbobject, $path));
203 }
204
216 public function createNakedWindow($caption, $width, $height, $style = null, $params = null): mixed
217 {
218 $window = $this->createWindow(null, NakedWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
219 $this->setArea($window, $width, $height);
220
221 return $window;
222 }
223
233 public function setArea($wbobject, $width, $height): mixed
234 {
235 return $this->callWinBinder('wb_set_area', array($wbobject, WBC_TITLE, 0, 0, $width, $height));
236 }
237
244 public function destroyWindow($window): bool
245 {
246 // Check if window exists and is valid
247 if (!$window || !$this->windowIsValid($window)) {
248 return true; // Already closed or invalid window
249 }
250
251 // Get window title before destruction for fallback
252 $windowTitle = $this->getText($window);
253 $currentPid = Win32Ps::getCurrentPid();
254
255 // Attempt standard destruction
256 $this->callWinBinder('wb_destroy_window', array($window));
257
258 // Verify closure with retries
259 $maxAttempts = 3;
260 $attempt = 0;
261 $destroyed = false;
262
263 while ($attempt < $maxAttempts && !$destroyed) {
264 $this->processMessages();
265 usleep(100000); // 100ms delay
266 $destroyed = !$this->windowIsValid($window);
267 $attempt++;
268 }
269
270 // Fallback to process termination if window still exists
271 if (!$destroyed) {
272 // 1. Try to close using window title
273 $this->exec('taskkill', '/FI "WINDOWTITLE eq ' . $windowTitle . '" /F', true);
274
275 // 2. Try to kill process directly using Winbinder's PID method
276 $currentPid = Win32Ps::getCurrentPid();
277 if (!empty($currentPid)) {
278 $this->exec('taskkill', '/PID ' . $currentPid . ' /T /F', true);
279 $this->writeLog('Force-killed PID: ' . $currentPid . ' for window: ' . $window);
280 }
281
282 // 3. Final sanity check
283 if ($this->windowIsValid($window)) {
284 $this->callWinBinder('wb_destroy_window', array($window), true); // Force native call
285 }
286
287 // 4. Reset internal state to prevent memory leaks
288 $this->reset();
289 }
290
291 // Final verification
292 return !$this->windowIsValid($window);
293 }
294
302 public function getText($wbobject): mixed
303 {
304 return $this->callWinBinder('wb_get_text', array($wbobject));
305 }
306
313 private function windowIsValid($window): bool
314 {
315 if (!$window) {
316 return false;
317 }
318
319 // Try to get window text - if window is invalid, this will fail
320 $text = $this->callWinBinder('wb_get_text', array($window), true);
321 return ($text !== false);
322 }
323
329 private function processMessages(): void
330 {
331 $this->callWinBinder('wb_wait', array(null, 1), true);
332 }
333
346 public function exec($cmd, $params = null, $silent = false, $wait = true): mixed
347 {
348 // Handle array of arguments by quoting each one individually
349 if (is_array($params)) {
350 $quotedParams = [];
351 foreach ($params as $arg) {
352 $quotedParams[] = $this->quoteWindowsArg((string)$arg);
353 }
354 $params = implode(' ', $quotedParams);
355 }
356
357 if ($silent) {
358 // Use WScript.Shell via COM for true silent execution (zero window flashing)
359 // This is more reliable than powershell.exe -WindowStyle Hidden which can still flash
360 try {
361 $wsh = new COM('WScript.Shell');
362 $fullCmd = '"' . $cmd . '"' . (empty($params) ? '' : ' ' . $params);
363 // 0 = Hidden, $wait = wait for process to exit
364 $exitCode = $wsh->Run($fullCmd, 0, $wait);
365 $this->writeLog('exec (silent via COM): ' . $fullCmd . ' [ExitCode: ' . $exitCode . ']');
366 return $exitCode === 0;
367 } catch (Throwable $e) {
368 $this->writeLog('exec (silent via COM) failed: ' . $e->getMessage() . '. Falling back to PowerShell.');
369 // Fall back to PowerShell method if COM fails
370 $psCmd = 'Start-Process -FilePath \'' . str_replace("'", "''", $cmd) . '\'';
371 if (!empty($params)) {
372 $psCmd .= ' -ArgumentList \'' . str_replace("'", "''", $params) . '\'';
373 }
374 $psCmd .= ' -WindowStyle Hidden';
375 if ($wait) {
376 $psCmd .= ' -Wait';
377 }
378 $encodedCmd = base64_encode(mb_convert_encoding($psCmd, 'UTF-16LE', 'UTF-8'));
379 $cmd = 'powershell.exe';
380 $params = '-WindowStyle Hidden -ExecutionPolicy Bypass -EncodedCommand ' . $encodedCmd;
381 }
382 }
383
384 $this->writeLog('exec: ' . $cmd . ' ' . $params);
385
386 return $this->callWinBinder('wb_exec', array($cmd, $params));
387 }
388
401 private function quoteWindowsArg(string $arg): string
402 {
403 // If argument is empty, return empty quotes
404 if ($arg === '') {
405 return '""';
406 }
407
408 // If argument contains spaces, quotes, or special shell characters, it needs quoting
409 if (preg_match('/[\s"&|<>^()]/', $arg)) {
410 // Escape any internal quotes by doubling them (Windows convention for cmd.exe/WScript.Shell)
411 $escaped = str_replace('"', '""', $arg);
412 return '"' . $escaped . '"';
413 }
414
415 return $arg;
416 }
417
423 private static function writeLog($log): void
424 {
425 global $bearsamppRoot;
427 }
428
434 public function mainLoop(): mixed
435 {
436 return $this->callWinBinder('wb_main_loop');
437 }
438
446 public function refresh($wbobject): mixed
447 {
448 return $this->callWinBinder('wb_refresh', array($wbobject, true));
449 }
450
458 public function getSystemInfo($info): mixed
459 {
460 return $this->callWinBinder('wb_get_system_info', array($info));
461 }
462
475 public function drawImage($wbobject, $path, $xPos = 0, $yPos = 0, $width = 0, $height = 0): mixed
476 {
477 $image = $this->callWinBinder('wb_load_image', array($path));
478 if ($image === null) {
479 return false;
480 }
481
482 return $this->callWinBinder('wb_draw_image', array($wbobject, $image, $xPos, $yPos, $width, $height));
483 }
484
498 public function drawText($parent, $caption, $xPos, $yPos, $width = null, $height = null, $font = null)
499 {
500 // Fix for PHP 8+: Convert null to empty string before str_replace
501 $caption = $caption === null ? '' : $caption;
502 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
503 $width = $width == null ? 120 : $width;
504 $height = $height == null ? 25 : $height;
505
506 return $this->callWinBinder('wb_draw_text', array($parent, $caption, $xPos, $yPos, $width, $height, $font));
507 }
508
522 public function drawRect($parent, $xPos, $yPos, $width, $height, $color = 15790320, $filled = true)
523 {
524 return $this->callWinBinder('wb_draw_rect', array($parent, $xPos, $yPos, $width, $height, $color, $filled));
525 }
526
540 public function drawLine($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height = 1)
541 {
542 return $this->callWinBinder('wb_draw_line', array($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height));
543 }
544
555 public function createFont($fontName, $size = null, $color = null, $style = null)
556 {
557 return $this->callWinBinder('wb_create_font', array($fontName, $size, $color, $style));
558 }
559
567 public function wait($wbobject = null)
568 {
569 return $this->callWinBinder('wb_wait', array($wbobject), true);
570 }
571
580 public function destroyTimer($wbobject, $timerobject)
581 {
582 return $this->callWinBinder('wb_destroy_timer', array($wbobject, $timerobject));
583 }
584
592 public function findFile($filename)
593 {
594 $result = $this->callWinBinder('wb_find_file', array($filename));
595 $this->writeLog('findFile ' . $filename . ': ' . $result);
596
597 return $result != $filename ? $result : false;
598 }
599
610 public function setHandler($wbobject, $classCallback, $methodCallback, $launchTimer = null)
611 {
612 if ($launchTimer != null) {
613 $launchTimer = $this->createTimer($wbobject, $launchTimer);
614 }
615
616 $this->callback[$wbobject] = array($classCallback, $methodCallback, $launchTimer);
617
618 return $this->callWinBinder('wb_set_handler', array($wbobject, '__winbinderEventHandler'));
619 }
620
629 public function createTimer($wbobject, $wait = 1000)
630 {
631 $this->countCtrls++;
632
633 return array(
634 self::CTRL_ID => $this->countCtrls,
635 self::CTRL_OBJ => $this->callWinBinder('wb_create_timer', array($wbobject, $this->countCtrls, $wait))
636 );
637 }
638
647 public function setText($wbobject, $content)
648 {
649 // Fix for PHP 8+: Convert null to empty string before str_replace
650 $content = $content === null ? '' : $content;
651 $content = str_replace(self::NEW_LINE, PHP_EOL, $content);
652
653 return $this->callWinBinder('wb_set_text', array($wbobject, $content));
654 }
655
661 public function getFocus()
662 {
663 return $this->callWinBinder('wb_get_focus');
664 }
665
673 public function setFocus($wbobject)
674 {
675 return $this->callWinBinder('wb_set_focus', array($wbobject));
676 }
677
685 public function isEnabled($wbobject)
686 {
687 return $this->callWinBinder('wb_get_enabled', array($wbobject));
688 }
689
697 public function setDisabled($wbobject)
698 {
699 return $this->setEnabled($wbobject, false);
700 }
701
710 public function setEnabled($wbobject, $enabled = true)
711 {
712 return $this->callWinBinder('wb_set_enabled', array($wbobject, $enabled));
713 }
714
723 public function setStyle($wbobject, $style)
724 {
725 return $this->callWinBinder('wb_set_style', array($wbobject, $style));
726 }
727
737 public function sysDlgPath($parent, $title, $path = null)
738 {
739 return $this->callWinBinder('wb_sys_dlg_path', array($parent, $title, $path));
740 }
741
752 public function sysDlgOpen($parent, $title, $filter = null, $path = null)
753 {
754 return $this->callWinBinder('wb_sys_dlg_open', array($parent, $title, $filter, $path));
755 }
756
771 public function createLabel($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
772 {
773 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
774 $width = $width == null ? 120 : $width;
775 $height = $height == null ? 25 : $height;
776
777 return $this->createControl($parent, Label, $caption, $xPos, $yPos, $width, $height, $style, $params);
778 }
779
795 public function createControl($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style = null, $params = null)
796 {
797 $this->countCtrls++;
798
799 // Fix for PHP 8.4: Ensure style and params are proper types
800 $style = $style === null ? 0 : $style;
801 $params = $params === null ? 0 : $params;
802
803 return array(
804 self::CTRL_ID => $this->countCtrls,
805 self::CTRL_OBJ => $this->callWinBinder('wb_create_control', array(
806 $parent,
807 $ctlClass,
808 $caption,
809 $xPos,
810 $yPos,
811 $width,
812 $height,
813 $this->countCtrls,
814 $style,
815 $params
816 )),
817 );
818 }
819
835 public function createInputText($parent, $value, $xPos, $yPos, $width = null, $height = null, $maxLength = null, $style = null, $params = null)
836 {
837 // Fix for PHP 8+: Convert null to empty string before str_replace
838 $value = $value === null ? '' : $value;
839 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
840 $width = $width == null ? 120 : $width;
841 $height = $height == null ? 25 : $height;
842 $inputText = $this->createControl($parent, EditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
843 if (is_numeric($maxLength) && $maxLength > 0) {
844 $this->setMaxLength($inputText[self::CTRL_OBJ], $maxLength);
845 }
846
847 return $inputText;
848 }
849
858 public function setMaxLength($wbobject, $length)
859 {
860 // Use error suppression for wb_send_message as it may be disabled in some PHP configurations
861 // This is a non-critical operation - if it fails, the input will just not have a max length
862 return $this->callWinBinder('wb_send_message', array($wbobject, 0x00c5, $length, 0), true);
863 }
864
879 public function createEditBox($parent, $value, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
880 {
881 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
882 $width = $width == null ? 540 : $width;
883 $height = $height == null ? 340 : $height;
884 $editBox = $this->createControl($parent, RTFEditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
885
886 return $editBox;
887 }
888
903 public function createHyperLink($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
904 {
905 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
906 $width = $width == null ? 120 : $width;
907 $height = $height == null ? 15 : $height;
908 $hyperLink = $this->createControl($parent, HyperLink, (string)$caption, $xPos, $yPos, $width, $height, $style, $params);
909 $this->setCursor($hyperLink[self::CTRL_OBJ], self::CURSOR_FINGER);
910
911 return $hyperLink;
912 }
913
922 public function setCursor($wbobject, $type = self::CURSOR_ARROW)
923 {
924 return $this->callWinBinder('wb_set_cursor', array($wbobject, $type));
925 }
926
941 public function createRadioButton($parent, $caption, $checked, $xPos, $yPos, $width = null, $height = null, $startGroup = false)
942 {
943 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
944 $width = $width == null ? 120 : $width;
945 $height = $height == null ? 25 : $height;
946
947 return $this->createControl($parent, RadioButton, (string)$caption, $xPos, $yPos, $width, $height, $startGroup ? WBC_GROUP : null, $checked ? 1 : 0);
948 }
949
964 public function createButton($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
965 {
966 $width = $width == null ? 80 : $width;
967 $height = $height == null ? 25 : $height;
968
969 return $this->createControl($parent, PushButton, $caption, $xPos, $yPos, $width, $height, $style, $params);
970 }
971
986 public function createProgressBar($parent, $max, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
987 {
988 global $bearsamppLang;
989
990 $width = $width == null ? 200 : $width;
991 $height = $height == null ? 15 : $height;
992 $progressBar = $this->createControl($parent, Gauge, $bearsamppLang->getValue(Lang::LOADING), $xPos, $yPos, $width, $height, $style, $params);
993
994 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
995 $this->gauge[$progressBar[self::CTRL_OBJ]] = 0;
996
997 return $progressBar;
998 }
999
1007 public function getValue($wbobject)
1008 {
1009 return $this->callWinBinder('wb_get_value', array($wbobject));
1010 }
1011
1021 public function setRange($wbobject, $min, $max)
1022 {
1023 return $this->callWinBinder('wb_set_range', array($wbobject, $min, $max));
1024 }
1025
1031 public function incrProgressBar($progressBar)
1032 {
1033 $this->setProgressBarValue($progressBar, self::INCR_PROGRESS_BAR);
1034 }
1035
1042 public function setProgressBarValue($progressBar, $value)
1043 {
1044 if ($progressBar != null && isset($progressBar[self::CTRL_OBJ]) && isset($this->gauge[$progressBar[self::CTRL_OBJ]])) {
1045 if (strval($value) == self::INCR_PROGRESS_BAR) {
1046 $value = $this->gauge[$progressBar[self::CTRL_OBJ]] + 1;
1047 }
1048 if (is_numeric($value)) {
1049 $this->gauge[$progressBar[self::CTRL_OBJ]] = $value;
1050
1051 // Check if the control is still valid before setting the value
1052 // This prevents errors when the parent window has been destroyed
1053 $this->callWinBinder('wb_set_value', array($progressBar[self::CTRL_OBJ], $value), true);
1054 }
1055 }
1056 }
1057
1066 public function setValue($wbobject, $content)
1067 {
1068 return $this->callWinBinder('wb_set_value', array($wbobject, $content));
1069 }
1070
1076 public function resetProgressBar($progressBar)
1077 {
1078 $this->setProgressBarValue($progressBar, 0);
1079 }
1080
1087 public function setProgressBarMax($progressBar, $max)
1088 {
1089 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
1090 }
1091
1100 public function messageBoxInfo($message, $title = null)
1101 {
1102 return $this->messageBox($message, self::BOX_INFO, $title);
1103 }
1104
1114 public function messageBox($message, $type, $title = null)
1115 {
1116 global $bearsamppCore;
1117
1118 $message = str_replace(self::NEW_LINE, PHP_EOL, $message);
1119 $messageBox = $this->callWinBinder('wb_message_box', array(
1120 0, // Use 0 instead of null for the window handle parameter
1121 strlen($message) < 64 ? str_pad($message, 64) : $message, // Pad message to display entire title
1122 $title == null ? $this->defaultTitle : $this->defaultTitle . ' - ' . $title,
1123 $type
1124 ));
1125
1126 return $messageBox;
1127 }
1128
1137 public function messageBoxOk($message, $title = null)
1138 {
1139 return $this->messageBox($message, self::BOX_OK, $title);
1140 }
1141
1150 public function messageBoxOkCancel($message, $title = null)
1151 {
1152 return $this->messageBox($message, self::BOX_OKCANCEL, $title);
1153 }
1154
1163 public function messageBoxQuestion($message, $title = null)
1164 {
1165 return $this->messageBox($message, self::BOX_QUESTION, $title);
1166 }
1167
1176 public function messageBoxError($message, $title = null)
1177 {
1178 return $this->messageBox($message, self::BOX_ERROR, $title);
1179 }
1180
1189 public function messageBoxWarning($message, $title = null)
1190 {
1191 return $this->messageBox($message, self::BOX_WARNING, $title);
1192 }
1193
1202 public function messageBoxYesNo($message, $title = null)
1203 {
1204 return $this->messageBox($message, self::BOX_YESNO, $title);
1205 }
1206
1215 public function messageBoxYesNoCancel($message, $title = null)
1216 {
1217 return $this->messageBox($message, self::BOX_YESNOCANCEL, $title);
1218 }
1219
1220}
1221
1235function __winbinderEventHandler($window, $id, $ctrl, $param1, $param2)
1236{
1237 global $bearsamppWinbinder;
1238
1239 if ($bearsamppWinbinder->callback[$window][2] != null) {
1240 $bearsamppWinbinder->destroyTimer($window, $bearsamppWinbinder->callback[$window][2][0]);
1241 }
1242
1243 call_user_func_array(
1244 array($bearsamppWinbinder->callback[$window][0], $bearsamppWinbinder->callback[$window][1]),
1245 array($window, $id, $ctrl, $param1, $param2)
1246 );
1247}
$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)
exec($cmd, $params=null, $silent=false, $wait=true)
const CURSOR_FORBIDDEN
incrProgressBar($progressBar)
setImage($wbobject, $path)
setValue($wbobject, $content)
createAppWindow($caption, $width, $height, $style=null, $params=null)
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:13