Bearsampp 2026.7.11
Loading...
Searching...
No Matches
WinBinder Class Reference

Public Member Functions

 __construct ()
 createAppWindow ($caption, $width, $height, $style=null, $params=null)
 createButton ($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
 createControl ($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)
 createEditBox ($parent, $value, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
 createFont ($fontName, $size=null, $color=null, $style=null)
 createHyperLink ($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
 createInputText ($parent, $value, $xPos, $yPos, $width=null, $height=null, $maxLength=null, $style=null, $params=null)
 createLabel ($parent, $caption, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
 createNakedWindow ($caption, $width, $height, $style=null, $params=null)
 createProgressBar ($parent, $max, $xPos, $yPos, $width=null, $height=null, $style=null, $params=null)
 createRadioButton ($parent, $caption, $checked, $xPos, $yPos, $width=null, $height=null, $startGroup=false)
 createTimer ($wbobject, $wait=1000)
 createWindow ($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)
 destroyTimer ($wbobject, $timerobject)
 destroyWindow ($window)
 drawImage ($wbobject, $path, $xPos=0, $yPos=0, $width=0, $height=0)
 drawLine ($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height=1)
 drawRect ($parent, $xPos, $yPos, $width, $height, $color=15790320, $filled=true)
 drawText ($parent, $caption, $xPos, $yPos, $width=null, $height=null, $font=null)
 exec ($cmd, $params=null, $silent=false, $wait=true)
 findFile ($filename)
 getFocus ()
 getSystemInfo ($info)
 getText ($wbobject)
 getValue ($wbobject)
 incrProgressBar ($progressBar)
 isEnabled ($wbobject)
 mainLoop ()
 messageBox ($message, $type, $title=null)
 messageBoxError ($message, $title=null)
 messageBoxInfo ($message, $title=null)
 messageBoxOk ($message, $title=null)
 messageBoxOkCancel ($message, $title=null)
 messageBoxQuestion ($message, $title=null)
 messageBoxWarning ($message, $title=null)
 messageBoxYesNo ($message, $title=null)
 messageBoxYesNoCancel ($message, $title=null)
 refresh ($wbobject)
 reset ()
 resetProgressBar ($progressBar)
 setArea ($wbobject, $width, $height)
 setCursor ($wbobject, $type=self::CURSOR_ARROW)
 setDisabled ($wbobject)
 setEnabled ($wbobject, $enabled=true)
 setFocus ($wbobject)
 setHandler ($wbobject, $classCallback, $methodCallback, $launchTimer=null)
 setImage ($wbobject, $path)
 setMaxLength ($wbobject, $length)
 setProgressBarMax ($progressBar, $max)
 setProgressBarValue ($progressBar, $value)
 setRange ($wbobject, $min, $max)
 setStyle ($wbobject, $style)
 setText ($wbobject, $content)
 setValue ($wbobject, $content)
 sysDlgOpen ($parent, $title, $filter=null, $path=null)
 sysDlgPath ($parent, $title, $path=null)
 wait ($wbobject=null)

Data Fields

 $callback
 $gauge
const BOX_ERROR = WBC_STOP
const BOX_INFO = WBC_INFO
const BOX_OK = WBC_OK
const BOX_OKCANCEL = WBC_OKCANCEL
const BOX_QUESTION = WBC_QUESTION
const BOX_WARNING = WBC_WARNING
const BOX_YESNO = WBC_YESNO
const BOX_YESNOCANCEL = WBC_YESNOCANCEL
const CTRL_ID = 0
const CTRL_OBJ = 1
const CURSOR_ARROW = 'arrow'
const CURSOR_CROSS = 'cross'
const CURSOR_FINGER = 'finger'
const CURSOR_FORBIDDEN = 'forbidden'
const CURSOR_HELP = 'help'
const CURSOR_IBEAM = 'ibeam'
const CURSOR_NONE = null
const CURSOR_SIZEALL = 'sizeall'
const CURSOR_SIZENESW = 'sizenesw'
const CURSOR_SIZENS = 'sizens'
const CURSOR_SIZENWSE = 'sizenwse'
const CURSOR_SIZEWE = 'sizewe'
const CURSOR_UPARROW = 'uparrow'
const CURSOR_WAIT = 'wait'
const CURSOR_WAITARROW = 'waitarrow'
const INCR_PROGRESS_BAR = '++'
const NEW_LINE = '@nl@'
const SYSINFO_SCREENAREA = 'screenarea'
const SYSINFO_WORKAREA = 'workarea'

Private Member Functions

 callWinBinder ($function, $params=array(), $removeErrorHandler=false)
 processMessages ()
 quoteWindowsArg (string $arg)
 windowIsValid ($window)

Static Private Member Functions

static writeLog ($log)

Private Attributes

 $countCtrls
 $defaultTitle

Detailed Description

Class WinBinder

This class provides an interface to the WinBinder library, allowing for the creation and management of Windows GUI elements in PHP. It includes methods for creating windows, controls, handling events, and executing system commands.

Definition at line 18 of file class.winbinder.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

WinBinder constructor.

Initializes the WinBinder class, sets the default window title, and resets control counters.

Definition at line 68 of file class.winbinder.php.

69 {
70 global $bearsamppCore;
71 Log::initClass($this);
72
73 $this->defaultTitle = APP_TITLE . ' ' . $bearsamppCore->getAppVersion();
74 $this->reset();
75 }
global $bearsamppCore
static initClass($classInstance)
const APP_TITLE
Definition root.php:13

References $bearsamppCore, APP_TITLE, Log\initClass(), and reset().

Here is the call graph for this function:

Member Function Documentation

◆ callWinBinder()

callWinBinder ( $function,
$params = array(),
$removeErrorHandler = false )
private

Calls a WinBinder function with error handling.

Parameters
string$functionThe name of the WinBinder function to call.
array$paramsThe parameters to pass to the function.
bool$removeErrorHandlerWhether to suppress errors during the call.
Returns
mixed The result of the function call.

Definition at line 163 of file class.winbinder.php.

163 : 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 }
$result

References $result.

Referenced by createControl(), createFont(), createTimer(), createWindow(), destroyTimer(), destroyWindow(), drawImage(), drawLine(), drawRect(), drawText(), exec(), findFile(), getFocus(), getSystemInfo(), getText(), getValue(), isEnabled(), mainLoop(), messageBox(), processMessages(), refresh(), setArea(), setCursor(), setEnabled(), setFocus(), setHandler(), setImage(), setMaxLength(), setProgressBarValue(), setRange(), setStyle(), setText(), setValue(), sysDlgOpen(), sysDlgPath(), wait(), and windowIsValid().

Here is the caller graph for this function:

◆ createAppWindow()

createAppWindow ( $caption,
$width,
$height,
$style = null,
$params = null )

Creates a new application window.

Parameters
string$captionThe window caption.
int$widthThe width of the window.
int$heightThe height of the window.
mixed$styleThe window style.
mixed$paramsAdditional parameters for the window.
Returns
mixed The created window object.

Definition at line 97 of file class.winbinder.php.

97 : mixed
98 {
99 return $this->createWindow(null, AppWindow, $caption, WBC_CENTER, WBC_CENTER, $width, $height, $style, $params);
100 }
createWindow($parent, $wclass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)

References createWindow().

Here is the call graph for this function:

◆ createButton()

createButton ( $parent,
$caption,
$xPos,
$yPos,
$width = null,
$height = null,
$style = null,
$params = null )

Creates a button control.

Parameters
mixed$parentThe parent window or control.
string$captionThe caption for the button.
int$xPosThe x-coordinate of the button.
int$yPosThe y-coordinate of the button.
int | null$widthThe width of the button.
int | null$heightThe height of the button.
mixed$styleThe style for the button.
mixed$paramsAdditional parameters for the button.
Returns
array An array containing the control ID and object.

Definition at line 964 of file class.winbinder.php.

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 }
createControl($parent, $ctlClass, $caption, $xPos, $yPos, $width, $height, $style=null, $params=null)

References createControl().

Here is the call graph for this function:

◆ createControl()

createControl ( $parent,
$ctlClass,
$caption,
$xPos,
$yPos,
$width,
$height,
$style = null,
$params = null )

Creates a new control.

Parameters
mixed$parentThe parent window or control.
string$ctlClassThe control class.
string$captionThe control caption.
int$xPosThe x-coordinate of the control.
int$yPosThe y-coordinate of the control.
int$widthThe width of the control.
int$heightThe height of the control.
mixed$styleThe control style.
mixed$paramsAdditional parameters for the control.
Returns
array An array containing the control ID and object.

Definition at line 795 of file class.winbinder.php.

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 }
callWinBinder($function, $params=array(), $removeErrorHandler=false)

References callWinBinder().

Referenced by createButton(), createEditBox(), createHyperLink(), createInputText(), createLabel(), createProgressBar(), and createRadioButton().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createEditBox()

createEditBox ( $parent,
$value,
$xPos,
$yPos,
$width = null,
$height = null,
$style = null,
$params = null )

Creates an edit box control.

Parameters
mixed$parentThe parent window or control.
string$valueThe initial value for the edit box.
int$xPosThe x-coordinate of the edit box.
int$yPosThe y-coordinate of the edit box.
int | null$widthThe width of the edit box.
int | null$heightThe height of the edit box.
mixed$styleThe style for the edit box.
mixed$paramsAdditional parameters for the edit box.
Returns
array An array containing the control ID and object.

Definition at line 879 of file class.winbinder.php.

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 }

References createControl().

Here is the call graph for this function:

◆ createFont()

createFont ( $fontName,
$size = null,
$color = null,
$style = null )

Creates a font for use in WinBinder controls.

Parameters
string$fontNameThe name of the font.
int | null$sizeThe size of the font.
int | null$colorThe color of the font.
mixed$styleThe style of the font.
Returns
mixed The created font object.

Definition at line 555 of file class.winbinder.php.

556 {
557 return $this->callWinBinder('wb_create_font', array($fontName, $size, $color, $style));
558 }

References callWinBinder().

Here is the call graph for this function:

◆ createHyperLink()

createHyperLink ( $parent,
$caption,
$xPos,
$yPos,
$width = null,
$height = null,
$style = null,
$params = null )

Creates a hyperlink control.

Parameters
mixed$parentThe parent window or control.
string$captionThe caption for the hyperlink.
int$xPosThe x-coordinate of the hyperlink.
int$yPosThe y-coordinate of the hyperlink.
int | null$widthThe width of the hyperlink.
int | null$heightThe height of the hyperlink.
mixed$styleThe style for the hyperlink.
mixed$paramsAdditional parameters for the hyperlink.
Returns
array An array containing the control ID and object.

Definition at line 903 of file class.winbinder.php.

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 }
setCursor($wbobject, $type=self::CURSOR_ARROW)

References createControl(), and setCursor().

Here is the call graph for this function:

◆ createInputText()

createInputText ( $parent,
$value,
$xPos,
$yPos,
$width = null,
$height = null,
$maxLength = null,
$style = null,
$params = null )

Creates an input text control.

Parameters
mixed$parentThe parent window or control.
string | null$valueThe initial value for the input text. Null will be converted to empty string.
int$xPosThe x-coordinate of the input text.
int$yPosThe y-coordinate of the input text.
int | null$widthThe width of the input text.
int | null$heightThe height of the input text.
int | null$maxLengthThe maximum length of the input text.
mixed$styleThe style for the input text.
mixed$paramsAdditional parameters for the input text.
Returns
array An array containing the control ID and object.

Definition at line 835 of file class.winbinder.php.

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 }
setMaxLength($wbobject, $length)

References createControl(), and setMaxLength().

Here is the call graph for this function:

◆ createLabel()

createLabel ( $parent,
$caption,
$xPos,
$yPos,
$width = null,
$height = null,
$style = null,
$params = null )

Creates a label control.

Parameters
mixed$parentThe parent window or control.
string$captionThe caption for the label.
int$xPosThe x-coordinate of the label.
int$yPosThe y-coordinate of the label.
int | null$widthThe width of the label.
int | null$heightThe height of the label.
mixed$styleThe style for the label.
mixed$paramsAdditional parameters for the label.
Returns
array An array containing the control ID and object.

Definition at line 771 of file class.winbinder.php.

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 }

References createControl().

Here is the call graph for this function:

◆ createNakedWindow()

createNakedWindow ( $caption,
$width,
$height,
$style = null,
$params = null )

Creates a new naked window.

Parameters
string$captionThe window caption.
int$widthThe width of the window.
int$heightThe height of the window.
mixed$styleThe window style.
mixed$paramsAdditional parameters for the window.
Returns
mixed The created window object.

Definition at line 216 of file class.winbinder.php.

216 : 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 }
setArea($wbobject, $width, $height)

References createWindow(), and setArea().

Here is the call graph for this function:

◆ createProgressBar()

createProgressBar ( $parent,
$max,
$xPos,
$yPos,
$width = null,
$height = null,
$style = null,
$params = null )

Creates a progress bar control.

Parameters
mixed$parentThe parent window or control.
int$maxThe maximum value for the progress bar.
int$xPosThe x-coordinate of the progress bar.
int$yPosThe y-coordinate of the progress bar.
int | null$widthThe width of the progress bar.
int | null$heightThe height of the progress bar.
mixed$styleThe style for the progress bar.
mixed$paramsAdditional parameters for the progress bar.
Returns
array An array containing the control ID and object.

Definition at line 986 of file class.winbinder.php.

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 }
global $bearsamppLang
const LOADING
setRange($wbobject, $min, $max)

References $bearsamppLang, createControl(), Lang\LOADING, and setRange().

Here is the call graph for this function:

◆ createRadioButton()

createRadioButton ( $parent,
$caption,
$checked,
$xPos,
$yPos,
$width = null,
$height = null,
$startGroup = false )

Creates a radio button control.

Parameters
mixed$parentThe parent window or control.
string$captionThe caption for the radio button.
bool$checkedWhether the radio button is checked.
int$xPosThe x-coordinate of the radio button.
int$yPosThe y-coordinate of the radio button.
int | null$widthThe width of the radio button.
int | null$heightThe height of the radio button.
bool$startGroupWhether this radio button starts a new group.
Returns
array An array containing the control ID and object.

Definition at line 941 of file class.winbinder.php.

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 }

References createControl().

Here is the call graph for this function:

◆ createTimer()

createTimer ( $wbobject,
$wait = 1000 )

Creates a timer for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to create the timer for.
int$waitThe wait time in milliseconds.
Returns
array An array containing the timer ID and object.

Definition at line 629 of file class.winbinder.php.

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 }

References callWinBinder().

Referenced by setHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createWindow()

createWindow ( $parent,
$wclass,
$caption,
$xPos,
$yPos,
$width,
$height,
$style = null,
$params = null )

Creates a new window.

Parameters
mixed$parentThe parent window or null for a top-level window.
string$wclassThe window class.
string$captionThe window caption.
int$xPosThe x-coordinate of the window.
int$yPosThe y-coordinate of the window.
int$widthThe width of the window.
int$heightThe height of the window.
mixed$styleThe window style.
mixed$paramsAdditional parameters for the window.
Returns
mixed The created window object.

Definition at line 117 of file class.winbinder.php.

117 : 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 }
static getImagesPath($aetrayPath=false)
static writeLog($log)
setImage($wbobject, $path)

References $bearsamppCore, callWinBinder(), Path\getImagesPath(), setImage(), and writeLog().

Referenced by createAppWindow(), and createNakedWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroyTimer()

destroyTimer ( $wbobject,
$timerobject )

Destroys a timer for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to destroy the timer for.
mixed$timerobjectThe timer object to destroy.
Returns
mixed The result of the destroy operation.

Definition at line 580 of file class.winbinder.php.

581 {
582 return $this->callWinBinder('wb_destroy_timer', array($wbobject, $timerobject));
583 }

References callWinBinder().

Here is the call graph for this function:

◆ destroyWindow()

destroyWindow ( $window)

Destroys a window with proper cleanup and handling.

Parameters
mixed$windowThe window object to destroy.
Returns
boolean True if window was successfully destroyed

Definition at line 244 of file class.winbinder.php.

244 : 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 }
static getCurrentPid()
exec($cmd, $params=null, $silent=false, $wait=true)
windowIsValid($window)
getText($wbobject)

References callWinBinder(), exec(), Win32Ps\getCurrentPid(), getText(), processMessages(), reset(), windowIsValid(), and writeLog().

Here is the call graph for this function:

◆ drawImage()

drawImage ( $wbobject,
$path,
$xPos = 0,
$yPos = 0,
$width = 0,
$height = 0 )

Draws an image on a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to draw on.
string$pathThe path to the image file.
int$xPosThe x-coordinate of the image.
int$yPosThe y-coordinate of the image.
int$widthThe width of the image.
int$heightThe height of the image.
Returns
mixed The result of the draw operation.

Definition at line 475 of file class.winbinder.php.

475 : 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 }

References callWinBinder().

Here is the call graph for this function:

◆ drawLine()

drawLine ( $wbobject,
$xStartPos,
$yStartPos,
$xEndPos,
$yEndPos,
$color,
$height = 1 )

Draws a line on a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to draw on.
int$xStartPosThe starting x-coordinate of the line.
int$yStartPosThe starting y-coordinate of the line.
int$xEndPosThe ending x-coordinate of the line.
int$yEndPosThe ending y-coordinate of the line.
int$colorThe color of the line.
int$heightThe height of the line.
Returns
mixed The result of the draw operation.

Definition at line 540 of file class.winbinder.php.

541 {
542 return $this->callWinBinder('wb_draw_line', array($wbobject, $xStartPos, $yStartPos, $xEndPos, $yEndPos, $color, $height));
543 }

References callWinBinder().

Here is the call graph for this function:

◆ drawRect()

drawRect ( $parent,
$xPos,
$yPos,
$width,
$height,
$color = 15790320,
$filled = true )

Draws a rectangle on a WinBinder object.

Parameters
mixed$parentThe parent WinBinder object.
int$xPosThe x-coordinate of the rectangle.
int$yPosThe y-coordinate of the rectangle.
int$widthThe width of the rectangle.
int$heightThe height of the rectangle.
int$colorThe color of the rectangle.
bool$filledWhether the rectangle should be filled.
Returns
mixed The result of the draw operation.

Definition at line 522 of file class.winbinder.php.

523 {
524 return $this->callWinBinder('wb_draw_rect', array($parent, $xPos, $yPos, $width, $height, $color, $filled));
525 }

References callWinBinder().

Here is the call graph for this function:

◆ drawText()

drawText ( $parent,
$caption,
$xPos,
$yPos,
$width = null,
$height = null,
$font = null )

Draws text on a WinBinder object.

Parameters
mixed$parentThe parent WinBinder object.
string | null$captionThe text to draw. Null will be converted to empty string.
int$xPosThe x-coordinate of the text.
int$yPosThe y-coordinate of the text.
int | null$widthThe width of the text area.
int | null$heightThe height of the text area.
mixed$fontThe font to use for the text.
Returns
mixed The result of the draw operation.

Definition at line 498 of file class.winbinder.php.

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 }

References callWinBinder().

Here is the call graph for this function:

◆ exec()

exec ( $cmd,
$params = null,
$silent = false,
$wait = true )

Executes a system command.

Parameters
string$cmdThe command to execute.
string | array$paramsThe parameters to pass to the command. Can be a pre-formed string (for backwards compatibility) or array of individual arguments (recommended for automatic quoting).
bool$silentWhether to execute the command silently.
bool$waitWhether to wait for the process to exit.
Returns
mixed The result of the command execution.

Definition at line 346 of file class.winbinder.php.

346 : 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 }
quoteWindowsArg(string $arg)

References callWinBinder(), quoteWindowsArg(), and writeLog().

Referenced by destroyWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findFile()

findFile ( $filename)

Finds a file using WinBinder.

Parameters
string$filenameThe name of the file to find.
Returns
mixed The result of the find operation.

Definition at line 592 of file class.winbinder.php.

593 {
594 $result = $this->callWinBinder('wb_find_file', array($filename));
595 $this->writeLog('findFile ' . $filename . ': ' . $result);
596
597 return $result != $filename ? $result : false;
598 }

References $result, callWinBinder(), and writeLog().

Here is the call graph for this function:

◆ getFocus()

getFocus ( )

Retrieves the focus from a WinBinder object.

Returns
mixed The WinBinder object that has the focus.

Definition at line 661 of file class.winbinder.php.

662 {
663 return $this->callWinBinder('wb_get_focus');
664 }

References callWinBinder().

Here is the call graph for this function:

◆ getSystemInfo()

getSystemInfo ( $info)

Retrieves system information.

Parameters
string$infoThe type of system information to retrieve.
Returns
mixed The retrieved system information.

Definition at line 458 of file class.winbinder.php.

458 : mixed
459 {
460 return $this->callWinBinder('wb_get_system_info', array($info));
461 }

References callWinBinder().

Here is the call graph for this function:

◆ getText()

getText ( $wbobject)

Retrieves the text from a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to get the text from.
Returns
mixed The retrieved text.

Definition at line 302 of file class.winbinder.php.

302 : mixed
303 {
304 return $this->callWinBinder('wb_get_text', array($wbobject));
305 }

References callWinBinder().

Referenced by destroyWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue()

getValue ( $wbobject)

Retrieves the value from a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to get the value from.
Returns
mixed The retrieved value.

Definition at line 1007 of file class.winbinder.php.

1008 {
1009 return $this->callWinBinder('wb_get_value', array($wbobject));
1010 }

References callWinBinder().

Here is the call graph for this function:

◆ incrProgressBar()

incrProgressBar ( $progressBar)

Increments the value of a progress bar.

Parameters
array$progressBarThe progress bar control.

Definition at line 1031 of file class.winbinder.php.

1032 {
1033 $this->setProgressBarValue($progressBar, self::INCR_PROGRESS_BAR);
1034 }
setProgressBarValue($progressBar, $value)

References setProgressBarValue().

Here is the call graph for this function:

◆ isEnabled()

isEnabled ( $wbobject)

Checks if a WinBinder object is enabled.

Parameters
mixed$wbobjectThe WinBinder object to check.
Returns
mixed True if the object is enabled, false otherwise.

Definition at line 685 of file class.winbinder.php.

686 {
687 return $this->callWinBinder('wb_get_enabled', array($wbobject));
688 }

References callWinBinder().

Here is the call graph for this function:

◆ mainLoop()

mainLoop ( )

Starts the main event loop.

Returns
mixed The result of the main loop.

Definition at line 434 of file class.winbinder.php.

434 : mixed
435 {
436 return $this->callWinBinder('wb_main_loop');
437 }

References callWinBinder().

Here is the call graph for this function:

◆ messageBox()

messageBox ( $message,
$type,
$title = null )

Displays a message box.

Parameters
string$messageThe message to display.
int$typeThe type of message box.
string | null$titleThe title of the message box.
Returns
mixed The result of the message box operation.

Definition at line 1114 of file class.winbinder.php.

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 }

References $bearsamppCore, and callWinBinder().

Referenced by messageBoxError(), messageBoxInfo(), messageBoxOk(), messageBoxOkCancel(), messageBoxQuestion(), messageBoxWarning(), messageBoxYesNo(), and messageBoxYesNoCancel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ messageBoxError()

messageBoxError ( $message,
$title = null )

Displays an error message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box. If null, the default title will be used.
Returns
mixed The result of the message box operation.

Definition at line 1176 of file class.winbinder.php.

1177 {
1178 return $this->messageBox($message, self::BOX_ERROR, $title);
1179 }
messageBox($message, $type, $title=null)

References messageBox().

Here is the call graph for this function:

◆ messageBoxInfo()

messageBoxInfo ( $message,
$title = null )

Displays an informational message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box.
Returns
mixed The result of the message box operation.

Definition at line 1100 of file class.winbinder.php.

1101 {
1102 return $this->messageBox($message, self::BOX_INFO, $title);
1103 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxOk()

messageBoxOk ( $message,
$title = null )

Displays an OK message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box.
Returns
mixed The result of the message box operation.

Definition at line 1137 of file class.winbinder.php.

1138 {
1139 return $this->messageBox($message, self::BOX_OK, $title);
1140 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxOkCancel()

messageBoxOkCancel ( $message,
$title = null )

Displays an OK/Cancel message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box.
Returns
mixed The result of the message box operation.

Definition at line 1150 of file class.winbinder.php.

1151 {
1152 return $this->messageBox($message, self::BOX_OKCANCEL, $title);
1153 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxQuestion()

messageBoxQuestion ( $message,
$title = null )

Displays a question message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box. If null, the default title will be used.
Returns
mixed The result of the message box operation.

Definition at line 1163 of file class.winbinder.php.

1164 {
1165 return $this->messageBox($message, self::BOX_QUESTION, $title);
1166 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxWarning()

messageBoxWarning ( $message,
$title = null )

Displays a warning message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box. If null, the default title will be used.
Returns
mixed The result of the message box operation.

Definition at line 1189 of file class.winbinder.php.

1190 {
1191 return $this->messageBox($message, self::BOX_WARNING, $title);
1192 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxYesNo()

messageBoxYesNo ( $message,
$title = null )

Displays a Yes/No message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box. If null, the default title will be used.
Returns
mixed The result of the message box operation.

Definition at line 1202 of file class.winbinder.php.

1203 {
1204 return $this->messageBox($message, self::BOX_YESNO, $title);
1205 }

References messageBox().

Here is the call graph for this function:

◆ messageBoxYesNoCancel()

messageBoxYesNoCancel ( $message,
$title = null )

Displays a Yes/No/Cancel message box.

Parameters
string$messageThe message to display.
string | null$titleThe title of the message box. If null, the default title will be used.
Returns
mixed The result of the message box operation.

Definition at line 1215 of file class.winbinder.php.

1216 {
1217 return $this->messageBox($message, self::BOX_YESNOCANCEL, $title);
1218 }

References messageBox().

Here is the call graph for this function:

◆ processMessages()

processMessages ( )
private

Process any pending window messages.

Returns
void

Definition at line 329 of file class.winbinder.php.

329 : void
330 {
331 $this->callWinBinder('wb_wait', array(null, 1), true);
332 }

References callWinBinder().

Referenced by destroyWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quoteWindowsArg()

quoteWindowsArg ( string $arg)
private

Quotes a Windows command-line argument for use in WScript.Shell or cmd.exe.

Handles the following cases:

  • Arguments with spaces need to be quoted
  • Arguments with quotes need to have internal quotes escaped
  • Empty arguments need to be represented as ""
Parameters
string$argThe argument to quote.
Returns
string The quoted argument, suitable for use in a Windows command line.

Definition at line 401 of file class.winbinder.php.

401 : 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 }

Referenced by exec().

Here is the caller graph for this function:

◆ refresh()

refresh ( $wbobject)

Refreshes a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to refresh.
Returns
mixed The result of the refresh operation.

Definition at line 446 of file class.winbinder.php.

446 : mixed
447 {
448 return $this->callWinBinder('wb_refresh', array($wbobject, true));
449 }

References callWinBinder().

Here is the call graph for this function:

◆ reset()

reset ( )

Resets the control counter and callback array.

Definition at line 80 of file class.winbinder.php.

80 : void
81 {
82 $this->countCtrls = 1000;
83 $this->callback = array();
84 }

Referenced by __construct(), and destroyWindow().

Here is the caller graph for this function:

◆ resetProgressBar()

resetProgressBar ( $progressBar)

Resets the value of a progress bar to zero.

Parameters
array$progressBarThe progress bar control.

Definition at line 1076 of file class.winbinder.php.

1077 {
1078 $this->setProgressBarValue($progressBar, 0);
1079 }

References setProgressBarValue().

Here is the call graph for this function:

◆ setArea()

setArea ( $wbobject,
$width,
$height )

Sets the area of a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the area for.
int$widthThe width of the area.
int$heightThe height of the area.
Returns
mixed The result of the set area operation.

Definition at line 233 of file class.winbinder.php.

233 : mixed
234 {
235 return $this->callWinBinder('wb_set_area', array($wbobject, WBC_TITLE, 0, 0, $width, $height));
236 }

References callWinBinder().

Referenced by createNakedWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCursor()

setCursor ( $wbobject,
$type = self::CURSOR_ARROW )

Sets the cursor type for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the cursor for.
string$typeThe cursor type to set.
Returns
mixed The result of the set cursor operation.

Definition at line 922 of file class.winbinder.php.

923 {
924 return $this->callWinBinder('wb_set_cursor', array($wbobject, $type));
925 }

References callWinBinder().

Referenced by createHyperLink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDisabled()

setDisabled ( $wbobject)

Disables a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to disable.
Returns
mixed The result of the disable operation.

Definition at line 697 of file class.winbinder.php.

698 {
699 return $this->setEnabled($wbobject, false);
700 }
setEnabled($wbobject, $enabled=true)

References setEnabled().

Here is the call graph for this function:

◆ setEnabled()

setEnabled ( $wbobject,
$enabled = true )

Sets the enabled state for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the enabled state for.
bool$enabledTrue to enable the object, false to disable it.
Returns
mixed The result of the set enabled state operation.

Definition at line 710 of file class.winbinder.php.

711 {
712 return $this->callWinBinder('wb_set_enabled', array($wbobject, $enabled));
713 }

References callWinBinder().

Referenced by setDisabled().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFocus()

setFocus ( $wbobject)

Sets the focus to a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the focus to.
Returns
mixed The result of the set focus operation.

Definition at line 673 of file class.winbinder.php.

674 {
675 return $this->callWinBinder('wb_set_focus', array($wbobject));
676 }

References callWinBinder().

Here is the call graph for this function:

◆ setHandler()

setHandler ( $wbobject,
$classCallback,
$methodCallback,
$launchTimer = null )

Sets an event handler for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the handler for.
mixed$classCallbackThe class callback for the handler.
mixed$methodCallbackThe method callback for the handler.
mixed$launchTimerThe timer to launch for the handler.
Returns
mixed The result of the set handler operation.

Definition at line 610 of file class.winbinder.php.

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 }
createTimer($wbobject, $wait=1000)

References callWinBinder(), and createTimer().

Here is the call graph for this function:

◆ setImage()

setImage ( $wbobject,
$path )

Sets an image for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the image for.
string$pathThe path to the image file.
Returns
mixed The result of the set image operation.

Definition at line 188 of file class.winbinder.php.

188 : 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 }

References callWinBinder().

Referenced by createWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxLength()

setMaxLength ( $wbobject,
$length )

Sets the maximum length for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the maximum length for.
int$lengthThe maximum length to set.
Returns
mixed The result of the set maximum length operation.

Definition at line 858 of file class.winbinder.php.

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 }

References callWinBinder().

Referenced by createInputText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProgressBarMax()

setProgressBarMax ( $progressBar,
$max )

Sets the maximum value of a progress bar.

Parameters
array$progressBarThe progress bar control.
int$maxThe maximum value to set.

Definition at line 1087 of file class.winbinder.php.

1088 {
1089 $this->setRange($progressBar[self::CTRL_OBJ], 0, $max);
1090 }

References setRange().

Here is the call graph for this function:

◆ setProgressBarValue()

setProgressBarValue ( $progressBar,
$value )

Sets the value of a progress bar.

Parameters
array$progressBarThe progress bar control.
mixed$valueThe value to set.

Definition at line 1042 of file class.winbinder.php.

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 }

References callWinBinder().

Referenced by incrProgressBar(), and resetProgressBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRange()

setRange ( $wbobject,
$min,
$max )

Sets the range for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the range for.
int$minThe minimum value of the range.
int$maxThe maximum value of the range.
Returns
mixed The result of the set range operation.

Definition at line 1021 of file class.winbinder.php.

1022 {
1023 return $this->callWinBinder('wb_set_range', array($wbobject, $min, $max));
1024 }

References callWinBinder().

Referenced by createProgressBar(), and setProgressBarMax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStyle()

setStyle ( $wbobject,
$style )

Sets the style for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the style for.
mixed$styleThe style to set.
Returns
mixed The result of the set style operation.

Definition at line 723 of file class.winbinder.php.

724 {
725 return $this->callWinBinder('wb_set_style', array($wbobject, $style));
726 }

References callWinBinder().

Here is the call graph for this function:

◆ setText()

setText ( $wbobject,
$content )

Sets the text for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the text for.
string | null$contentThe text content to set. Null will be converted to empty string.
Returns
mixed The result of the set text operation.

Definition at line 647 of file class.winbinder.php.

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 }

References callWinBinder().

Here is the call graph for this function:

◆ setValue()

setValue ( $wbobject,
$content )

Sets the value for a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to set the value for.
mixed$contentThe value to set.
Returns
mixed The result of the set value operation.

Definition at line 1066 of file class.winbinder.php.

1067 {
1068 return $this->callWinBinder('wb_set_value', array($wbobject, $content));
1069 }

References callWinBinder().

Here is the call graph for this function:

◆ sysDlgOpen()

sysDlgOpen ( $parent,
$title,
$filter = null,
$path = null )

Opens a system dialog to open a file.

Parameters
mixed$parentThe parent window for the dialog.
string$titleThe title of the dialog.
string | null$filterThe file filter for the dialog.
string | null$pathThe initial path for the dialog.
Returns
mixed The selected file path.

Definition at line 752 of file class.winbinder.php.

753 {
754 return $this->callWinBinder('wb_sys_dlg_open', array($parent, $title, $filter, $path));
755 }

References callWinBinder().

Here is the call graph for this function:

◆ sysDlgPath()

sysDlgPath ( $parent,
$title,
$path = null )

Opens a system dialog to select a path.

Parameters
mixed$parentThe parent window for the dialog.
string$titleThe title of the dialog.
string | null$pathThe initial path for the dialog.
Returns
mixed The selected path.

Definition at line 737 of file class.winbinder.php.

738 {
739 return $this->callWinBinder('wb_sys_dlg_path', array($parent, $title, $path));
740 }

References callWinBinder().

Here is the call graph for this function:

◆ wait()

wait ( $wbobject = null)

Waits for an event on a WinBinder object.

Parameters
mixed$wbobjectThe WinBinder object to wait on.
Returns
mixed The result of the wait operation.

Definition at line 567 of file class.winbinder.php.

568 {
569 return $this->callWinBinder('wb_wait', array($wbobject), true);
570 }

References callWinBinder().

Here is the call graph for this function:

◆ windowIsValid()

windowIsValid ( $window)
private

Checks if a window handle is still valid.

Parameters
mixed$windowThe window object to check.
Returns
boolean True if window is valid

Definition at line 313 of file class.winbinder.php.

313 : 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 }

References callWinBinder().

Referenced by destroyWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLog()

writeLog ( $log)
staticprivate

Writes a log message to the WinBinder log file.

Parameters
string$logThe log message to write.

Definition at line 423 of file class.winbinder.php.

423 : void
424 {
425 global $bearsamppRoot;
427 }
global $bearsamppRoot
static debug($data, $file=null)
static getWinbinderLogFilePath($aetrayPath=false)

References $bearsamppRoot, Log\debug(), and Path\getWinbinderLogFilePath().

Referenced by createWindow(), destroyWindow(), exec(), and findFile().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $callback

$callback

Definition at line 58 of file class.winbinder.php.

◆ $countCtrls

$countCtrls
private

Definition at line 61 of file class.winbinder.php.

◆ $defaultTitle

$defaultTitle
private

Definition at line 60 of file class.winbinder.php.

◆ $gauge

$gauge

Definition at line 59 of file class.winbinder.php.

◆ BOX_ERROR

const BOX_ERROR = WBC_STOP

Definition at line 33 of file class.winbinder.php.

◆ BOX_INFO

const BOX_INFO = WBC_INFO

Definition at line 29 of file class.winbinder.php.

◆ BOX_OK

const BOX_OK = WBC_OK

Definition at line 30 of file class.winbinder.php.

◆ BOX_OKCANCEL

const BOX_OKCANCEL = WBC_OKCANCEL

Definition at line 31 of file class.winbinder.php.

◆ BOX_QUESTION

const BOX_QUESTION = WBC_QUESTION

Definition at line 32 of file class.winbinder.php.

◆ BOX_WARNING

const BOX_WARNING = WBC_WARNING

Definition at line 34 of file class.winbinder.php.

◆ BOX_YESNO

const BOX_YESNO = WBC_YESNO

Definition at line 35 of file class.winbinder.php.

◆ BOX_YESNOCANCEL

const BOX_YESNOCANCEL = WBC_YESNOCANCEL

Definition at line 36 of file class.winbinder.php.

◆ CTRL_ID

◆ CTRL_OBJ

◆ CURSOR_ARROW

const CURSOR_ARROW = 'arrow'

Definition at line 39 of file class.winbinder.php.

◆ CURSOR_CROSS

const CURSOR_CROSS = 'cross'

Definition at line 40 of file class.winbinder.php.

◆ CURSOR_FINGER

const CURSOR_FINGER = 'finger'

Definition at line 41 of file class.winbinder.php.

◆ CURSOR_FORBIDDEN

const CURSOR_FORBIDDEN = 'forbidden'

Definition at line 42 of file class.winbinder.php.

◆ CURSOR_HELP

const CURSOR_HELP = 'help'

Definition at line 43 of file class.winbinder.php.

◆ CURSOR_IBEAM

const CURSOR_IBEAM = 'ibeam'

Definition at line 44 of file class.winbinder.php.

◆ CURSOR_NONE

const CURSOR_NONE = null

Definition at line 45 of file class.winbinder.php.

◆ CURSOR_SIZEALL

const CURSOR_SIZEALL = 'sizeall'

Definition at line 46 of file class.winbinder.php.

◆ CURSOR_SIZENESW

const CURSOR_SIZENESW = 'sizenesw'

Definition at line 47 of file class.winbinder.php.

◆ CURSOR_SIZENS

const CURSOR_SIZENS = 'sizens'

Definition at line 48 of file class.winbinder.php.

◆ CURSOR_SIZENWSE

const CURSOR_SIZENWSE = 'sizenwse'

Definition at line 49 of file class.winbinder.php.

◆ CURSOR_SIZEWE

const CURSOR_SIZEWE = 'sizewe'

Definition at line 50 of file class.winbinder.php.

◆ CURSOR_UPARROW

const CURSOR_UPARROW = 'uparrow'

Definition at line 51 of file class.winbinder.php.

◆ CURSOR_WAIT

const CURSOR_WAIT = 'wait'

Definition at line 52 of file class.winbinder.php.

◆ CURSOR_WAITARROW

const CURSOR_WAITARROW = 'waitarrow'

Definition at line 53 of file class.winbinder.php.

◆ INCR_PROGRESS_BAR

const INCR_PROGRESS_BAR = '++'

Definition at line 25 of file class.winbinder.php.

◆ NEW_LINE

const NEW_LINE = '@nl@'

Definition at line 26 of file class.winbinder.php.

◆ SYSINFO_SCREENAREA

const SYSINFO_SCREENAREA = 'screenarea'

Definition at line 56 of file class.winbinder.php.

◆ SYSINFO_WORKAREA

const SYSINFO_WORKAREA = 'workarea'

Definition at line 57 of file class.winbinder.php.

Referenced by ActionLoading\__construct(), and Splash\init().


The documentation for this class was generated from the following file: