Bearsampp 2026.5.5
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 $this->setImage($window, $bearsamppCore->getIconsPath() . '/app.ico');
148 }
149
150 return $window;
151 }
152
162 private function callWinBinder($function, $params = array(), $removeErrorHandler = false): mixed
163 {
164 $result = false;
165 if (function_exists($function)) {
166 if ($removeErrorHandler) {
167 // Suppress all errors for this call
168 $oldErrorLevel = error_reporting(0);
169 $result = @call_user_func_array($function, $params);
170 error_reporting($oldErrorLevel);
171 } else {
172 $result = call_user_func_array($function, $params);
173 }
174 }
175
176 return $result;
177 }
178
187 public function setImage($wbobject, $path): mixed
188 {
189 if ($wbobject === null) {
190 error_log('Error: $wbobject is null.');
191
192 return false;
193 }
194
195 if (!file_exists($path)) {
196 error_log('Error: Image file does not exist at path: ' . $path);
197
198 return false;
199 }
200
201 return $this->callWinBinder('wb_set_image', array($wbobject, $path));
202 }
203
215 public function createNakedWindow($caption, $width, $height, $style = null, $params = null): mixed
216 {
217 $window = $this->createWindow(null, NakedWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
218 $this->setArea($window, $width, $height);
219
220 return $window;
221 }
222
232 public function setArea($wbobject, $width, $height): mixed
233 {
234 return $this->callWinBinder('wb_set_area', array($wbobject, WBC_TITLE, 0, 0, $width, $height));
235 }
236
243 public function destroyWindow($window): bool
244 {
245 // Check if window exists and is valid
246 if (!$window || !$this->windowIsValid($window)) {
247 return true; // Already closed or invalid window
248 }
249
250 // Get window title before destruction for fallback
251 $windowTitle = $this->getText($window);
252 $currentPid = Win32Ps::getCurrentPid();
253
254 // Attempt standard destruction
255 $this->callWinBinder('wb_destroy_window', array($window));
256
257 // Verify closure with retries
258 $maxAttempts = 3;
259 $attempt = 0;
260 $destroyed = false;
261
262 while ($attempt < $maxAttempts && !$destroyed) {
263 $this->processMessages();
264 usleep(100000); // 100ms delay
265 $destroyed = !$this->windowIsValid($window);
266 $attempt++;
267 }
268
269 // Fallback to process termination if window still exists
270 if (!$destroyed) {
271 // 1. Try to close using window title
272 $this->exec('taskkill', '/FI "WINDOWTITLE eq ' . $windowTitle . '" /F', true);
273
274 // 2. Try to kill process directly using Winbinder's PID method
275 $currentPid = Win32Ps::getCurrentPid();
276 if (!empty($currentPid)) {
277 $this->exec('taskkill', '/PID ' . $currentPid . ' /T /F', true);
278 $this->writeLog('Force-killed PID: ' . $currentPid . ' for window: ' . $window);
279 }
280
281 // 3. Final sanity check
282 if ($this->windowIsValid($window)) {
283 $this->callWinBinder('wb_destroy_window', array($window), true); // Force native call
284 }
285
286 // 4. Reset internal state to prevent memory leaks
287 $this->reset();
288 }
289
290 // Final verification
291 return !$this->windowIsValid($window);
292 }
293
301 public function getText($wbobject): mixed
302 {
303 return $this->callWinBinder('wb_get_text', array($wbobject));
304 }
305
312 private function windowIsValid($window): bool
313 {
314 if (!$window) {
315 return false;
316 }
317
318 // Try to get window text - if window is invalid, this will fail
319 $text = $this->callWinBinder('wb_get_text', array($window), true);
320 return ($text !== false);
321 }
322
328 private function processMessages(): void
329 {
330 $this->callWinBinder('wb_wait', array(null, 1), true);
331 }
332
342 public function exec($cmd, $params = null, $silent = false): mixed
343 {
344 if ($silent) {
345 // Use PowerShell with -EncodedCommand for silent execution (no window flashing)
346 // This avoids all quoting/escaping issues by encoding the command in UTF-16LE base64
347
348 // Build the PowerShell command using single quotes to avoid nested quote issues
349 $psCmd = 'Start-Process -FilePath \'' . str_replace("'", "''", $cmd) . '\'';
350 if (!empty($params)) {
351 // Escape single quotes in params for PowerShell
352 $psCmd .= ' -ArgumentList \'' . str_replace("'", "''", $params) . '\'';
353 }
354 $psCmd .= ' -WindowStyle Hidden -Wait';
355
356 // Encode the command in UTF-16LE and then base64
357 $encodedCmd = base64_encode(mb_convert_encoding($psCmd, 'UTF-16LE', 'UTF-8'));
358
359 // Log the original PowerShell command at TRACE level for debugging
360 global $bearsamppConfig;
361 if ($bearsamppConfig && $bearsamppConfig->getLogsVerbose() == Config::VERBOSE_TRACE) {
362 $this->writeLog('[TRACE] PowerShell command: ' . $psCmd);
363 $this->writeLog('[TRACE] Encoded command length: ' . strlen($encodedCmd));
364 }
365
366 $cmd = 'powershell.exe';
367 $params = '-WindowStyle Hidden -ExecutionPolicy Bypass -EncodedCommand ' . $encodedCmd;
368 }
369
370 $this->writeLog('exec: ' . $cmd . ' ' . $params);
371
372 return $this->callWinBinder('wb_exec', array($cmd, $params));
373 }
374
380 private static function writeLog($log): void
381 {
382 global $bearsamppRoot;
383 Log::debug($log, $bearsamppRoot->getWinbinderLogFilePath());
384 }
385
391 public function mainLoop(): mixed
392 {
393 return $this->callWinBinder('wb_main_loop');
394 }
395
403 public function refresh($wbobject): mixed
404 {
405 return $this->callWinBinder('wb_refresh', array($wbobject, true));
406 }
407
415 public function getSystemInfo($info): mixed
416 {
417 return $this->callWinBinder('wb_get_system_info', array($info));
418 }
419
432 public function drawImage($wbobject, $path, $xPos = 0, $yPos = 0, $width = 0, $height = 0): mixed
433 {
434 $image = $this->callWinBinder('wb_load_image', array($path));
435
436 return $this->callWinBinder('wb_draw_image', array($wbobject, $image, $xPos, $yPos, $width, $height));
437 }
438
452 public function drawText($parent, $caption, $xPos, $yPos, $width = null, $height = null, $font = null)
453 {
454 // Fix for PHP 8+: Convert null to empty string before str_replace
455 $caption = $caption === null ? '' : $caption;
456 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
457 $width = $width == null ? 120 : $width;
458 $height = $height == null ? 25 : $height;
459
460 return $this->callWinBinder('wb_draw_text', array($parent, $caption, $xPos, $yPos, $width, $height, $font));
461 }
462
476 public function drawRect($parent, $xPos, $yPos, $width, $height, $color = 15790320, $filled = true)
477 {
478 return $this->callWinBinder('wb_draw_rect', array($parent, $xPos, $yPos, $width, $height, $color, $filled));
479 }
480
494 public function drawLine($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height = 1)
495 {
496 return $this->callWinBinder('wb_draw_line', array($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height));
497 }
498
509 public function createFont($fontName, $size = null, $color = null, $style = null)
510 {
511 return $this->callWinBinder('wb_create_font', array($fontName, $size, $color, $style));
512 }
513
521 public function wait($wbobject = null)
522 {
523 return $this->callWinBinder('wb_wait', array($wbobject), true);
524 }
525
534 public function destroyTimer($wbobject, $timerobject)
535 {
536 return $this->callWinBinder('wb_destroy_timer', array($wbobject, $timerobject));
537 }
538
546 public function findFile($filename)
547 {
548 $result = $this->callWinBinder('wb_find_file', array($filename));
549 $this->writeLog('findFile ' . $filename . ': ' . $result);
550
551 return $result != $filename ? $result : false;
552 }
553
564 public function setHandler($wbobject, $classCallback, $methodCallback, $launchTimer = null)
565 {
566 if ($launchTimer != null) {
567 $launchTimer = $this->createTimer($wbobject, $launchTimer);
568 }
569
570 $this->callback[$wbobject] = array($classCallback, $methodCallback, $launchTimer);
571
572 return $this->callWinBinder('wb_set_handler', array($wbobject, '__winbinderEventHandler'));
573 }
574
583 public function createTimer($wbobject, $wait = 1000)
584 {
585 $this->countCtrls++;
586
587 return array(
588 self::CTRL_ID => $this->countCtrls,
589 self::CTRL_OBJ => $this->callWinBinder('wb_create_timer', array($wbobject, $this->countCtrls, $wait))
590 );
591 }
592
601 public function setText($wbobject, $content)
602 {
603 // Fix for PHP 8+: Convert null to empty string before str_replace
604 $content = $content === null ? '' : $content;
605 $content = str_replace(self::NEW_LINE, PHP_EOL, $content);
606
607 return $this->callWinBinder('wb_set_text', array($wbobject, $content));
608 }
609
615 public function getFocus()
616 {
617 return $this->callWinBinder('wb_get_focus');
618 }
619
627 public function setFocus($wbobject)
628 {
629 return $this->callWinBinder('wb_set_focus', array($wbobject));
630 }
631
639 public function isEnabled($wbobject)
640 {
641 return $this->callWinBinder('wb_get_enabled', array($wbobject));
642 }
643
651 public function setDisabled($wbobject)
652 {
653 return $this->setEnabled($wbobject, false);
654 }
655
664 public function setEnabled($wbobject, $enabled = true)
665 {
666 return $this->callWinBinder('wb_set_enabled', array($wbobject, $enabled));
667 }
668
677 public function setStyle($wbobject, $style)
678 {
679 return $this->callWinBinder('wb_set_style', array($wbobject, $style));
680 }
681
691 public function sysDlgPath($parent, $title, $path = null)
692 {
693 return $this->callWinBinder('wb_sys_dlg_path', array($parent, $title, $path));
694 }
695
706 public function sysDlgOpen($parent, $title, $filter = null, $path = null)
707 {
708 return $this->callWinBinder('wb_sys_dlg_open', array($parent, $title, $filter, $path));
709 }
710
725 public function createLabel($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
726 {
727 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
728 $width = $width == null ? 120 : $width;
729 $height = $height == null ? 25 : $height;
730
731 return $this->createControl($parent, Label, $caption, $xPos, $yPos, $width, $height, $style, $params);
732 }
733
749 public function createControl($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style = null, $params = null)
750 {
751 $this->countCtrls++;
752
753 // Fix for PHP 8.4: Ensure style and params are proper types
754 $style = $style === null ? 0 : $style;
755 $params = $params === null ? 0 : $params;
756
757 return array(
758 self::CTRL_ID => $this->countCtrls,
759 self::CTRL_OBJ => $this->callWinBinder('wb_create_control', array(
760 $parent,
761 $ctlClass,
762 $caption,
763 $xPos,
764 $yPos,
765 $width,
766 $height,
767 $this->countCtrls,
768 $style,
769 $params
770 )),
771 );
772 }
773
789 public function createInputText($parent, $value, $xPos, $yPos, $width = null, $height = null, $maxLength = null, $style = null, $params = null)
790 {
791 // Fix for PHP 8+: Convert null to empty string before str_replace
792 $value = $value === null ? '' : $value;
793 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
794 $width = $width == null ? 120 : $width;
795 $height = $height == null ? 25 : $height;
796 $inputText = $this->createControl($parent, EditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
797 if (is_numeric($maxLength) && $maxLength > 0) {
798 $this->setMaxLength($inputText[self::CTRL_OBJ], $maxLength);
799 }
800
801 return $inputText;
802 }
803
812 public function setMaxLength($wbobject, $length)
813 {
814 // Use error suppression for wb_send_message as it may be disabled in some PHP configurations
815 // This is a non-critical operation - if it fails, the input will just not have a max length
816 return $this->callWinBinder('wb_send_message', array($wbobject, 0x00c5, $length, 0), true);
817 }
818
833 public function createEditBox($parent, $value, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
834 {
835 $value = str_replace(self::NEW_LINE, PHP_EOL, $value);
836 $width = $width == null ? 540 : $width;
837 $height = $height == null ? 340 : $height;
838 $editBox = $this->createControl($parent, RTFEditBox, (string)$value, $xPos, $yPos, $width, $height, $style, $params);
839
840 return $editBox;
841 }
842
857 public function createHyperLink($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
858 {
859 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
860 $width = $width == null ? 120 : $width;
861 $height = $height == null ? 15 : $height;
862 $hyperLink = $this->createControl($parent, HyperLink, (string)$caption, $xPos, $yPos, $width, $height, $style, $params);
863 $this->setCursor($hyperLink[self::CTRL_OBJ], self::CURSOR_FINGER);
864
865 return $hyperLink;
866 }
867
876 public function setCursor($wbobject, $type = self::CURSOR_ARROW)
877 {
878 return $this->callWinBinder('wb_set_cursor', array($wbobject, $type));
879 }
880
895 public function createRadioButton($parent, $caption, $checked, $xPos, $yPos, $width = null, $height = null, $startGroup = false)
896 {
897 $caption = str_replace(self::NEW_LINE, PHP_EOL, $caption);
898 $width = $width == null ? 120 : $width;
899 $height = $height == null ? 25 : $height;
900
901 return $this->createControl($parent, RadioButton, (string)$caption, $xPos, $yPos, $width, $height, $startGroup ? WBC_GROUP : null, $checked ? 1 : 0);
902 }
903
918 public function createButton($parent, $caption, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
919 {
920 $width = $width == null ? 80 : $width;
921 $height = $height == null ? 25 : $height;
922
923 return $this->createControl($parent, PushButton, $caption, $xPos, $yPos, $width, $height, $style, $params);
924 }
925
940 public function createProgressBar($parent, $max, $xPos, $yPos, $width = null, $height = null, $style = null, $params = null)
941 {
942 global $bearsamppLang;
943
944 $width = $width == null ? 200 : $width;
945 $height = $height == null ? 15 : $height;
946 $progressBar = $this->createControl($parent, Gauge, $bearsamppLang->getValue(Lang::LOADING), $xPos, $yPos, $width, $height, $style, $params);
947
948 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
949 $this->gauge[$progressBar[self::CTRL_OBJ]] = 0;
950
951 return $progressBar;
952 }
953
961 public function getValue($wbobject)
962 {
963 return $this->callWinBinder('wb_get_value', array($wbobject));
964 }
965
975 public function setRange($wbobject, $min, $max)
976 {
977 return $this->callWinBinder('wb_set_range', array($wbobject, $min, $max));
978 }
979
985 public function incrProgressBar($progressBar)
986 {
987 $this->setProgressBarValue($progressBar, self::INCR_PROGRESS_BAR);
988 }
989
996 public function setProgressBarValue($progressBar, $value)
997 {
998 if ($progressBar != null && isset($progressBar[self::CTRL_OBJ]) && isset($this->gauge[$progressBar[self::CTRL_OBJ]])) {
999 if (strval($value) == self::INCR_PROGRESS_BAR) {
1000 $value = $this->gauge[$progressBar[self::CTRL_OBJ]] + 1;
1001 }
1002 if (is_numeric($value)) {
1003 $this->gauge[$progressBar[self::CTRL_OBJ]] = $value;
1004
1005 // Check if the control is still valid before setting the value
1006 // This prevents errors when the parent window has been destroyed
1007 $this->callWinBinder('wb_set_value', array($progressBar[self::CTRL_OBJ], $value), true);
1008 }
1009 }
1010 }
1011
1020 public function setValue($wbobject, $content)
1021 {
1022 return $this->callWinBinder('wb_set_value', array($wbobject, $content));
1023 }
1024
1030 public function resetProgressBar($progressBar)
1031 {
1032 $this->setProgressBarValue($progressBar, 0);
1033 }
1034
1041 public function setProgressBarMax($progressBar, $max)
1042 {
1043 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
1044 }
1045
1054 public function messageBoxInfo($message, $title = null)
1055 {
1056 return $this->messageBox($message, self::BOX_INFO, $title);
1057 }
1058
1068 public function messageBox($message, $type, $title = null)
1069 {
1070 global $bearsamppCore;
1071
1072 $message = str_replace(self::NEW_LINE, PHP_EOL, $message);
1073 $messageBox = $this->callWinBinder('wb_message_box', array(
1074 0, // Use 0 instead of null for the window handle parameter
1075 strlen($message) < 64 ? str_pad($message, 64) : $message, // Pad message to display entire title
1076 $title == null ? $this->defaultTitle : $this->defaultTitle . ' - ' . $title,
1077 $type
1078 ));
1079
1080 return $messageBox;
1081 }
1082
1091 public function messageBoxOk($message, $title = null)
1092 {
1093 return $this->messageBox($message, self::BOX_OK, $title);
1094 }
1095
1104 public function messageBoxOkCancel($message, $title = null)
1105 {
1106 return $this->messageBox($message, self::BOX_OKCANCEL, $title);
1107 }
1108
1117 public function messageBoxQuestion($message, $title = null)
1118 {
1119 return $this->messageBox($message, self::BOX_QUESTION, $title);
1120 }
1121
1130 public function messageBoxError($message, $title = null)
1131 {
1132 return $this->messageBox($message, self::BOX_ERROR, $title);
1133 }
1134
1143 public function messageBoxWarning($message, $title = null)
1144 {
1145 return $this->messageBox($message, self::BOX_WARNING, $title);
1146 }
1147
1156 public function messageBoxYesNo($message, $title = null)
1157 {
1158 return $this->messageBox($message, self::BOX_YESNO, $title);
1159 }
1160
1169 public function messageBoxYesNoCancel($message, $title = null)
1170 {
1171 return $this->messageBox($message, self::BOX_YESNOCANCEL, $title);
1172 }
1173
1174}
1175
1189function __winbinderEventHandler($window, $id, $ctrl, $param1, $param2)
1190{
1191 global $bearsamppWinbinder;
1192
1193 if ($bearsamppWinbinder->callback[$window][2] != null) {
1194 $bearsamppWinbinder->destroyTimer($window, $bearsamppWinbinder->callback[$window][2][0]);
1195 }
1196
1197 call_user_func_array(
1198 array($bearsamppWinbinder->callback[$window][0], $bearsamppWinbinder->callback[$window][1]),
1199 array($window, $id, $ctrl, $param1, $param2)
1200 );
1201}
$result
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
__winbinderEventHandler($window, $id, $ctrl, $param1, $param2)
const VERBOSE_TRACE
const LOADING
static debug($data, $file=null)
static initClass($classInstance)
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)
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)
exec($cmd, $params=null, $silent=false)
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)
global $bearsamppConfig
Definition homepage.php:41
const APP_TITLE
Definition root.php:13