Bearsampp 2026.9.23
Loading...
Searching...
No Matches
Splash Class Reference

Public Member Functions

 __construct ()
 getWbWindow ()
 incrProgressBar ($nb=1)
 init ($title, $gauge, $text)
 setTextLoading ($caption)

Data Fields

const WINDOW_HEIGHT = 90
const WINDOW_WIDTH = 460

Private Attributes

 $currentImg
 $wbImage
 $wbProgressBar
 $wbTextLoading
 $wbWindow

Detailed Description

Class Splash

This class represents a splash screen with a progress bar for the Bearsampp application. It provides methods to initialize the splash screen, set loading text, and increment the progress bar.

Definition at line 16 of file class.splash.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Splash constructor.

Initializes the Splash class and sets the current image to null.

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

40 {
41 Log::initClass($this);
42 $this->currentImg = null;
43 }
static initClass($classInstance)

References Log\initClass().

Here is the call graph for this function:

Member Function Documentation

◆ getWbWindow()

getWbWindow ( )

Retrieves the window object of the splash screen.

Returns
mixed The window object of the splash screen.

Definition at line 120 of file class.splash.php.

121 {
122 return $this->wbWindow;
123 }

References $wbWindow.

◆ incrProgressBar()

incrProgressBar ( $nb = 1)

Increments the progress bar by a specified number of steps.

Parameters
int$nbThe number of steps to increment the progress bar by. Default is 1.

Definition at line 102 of file class.splash.php.

103 {
104 global $bearsamppCore, $bearsamppWinbinder;
105
106 for ($i = 0; $i < $nb; $i++) {
107 $bearsamppWinbinder->drawImage($this->wbWindow, Path::getImagesPath() . '/bearsampp.bmp', 4, 4, 32, 32);
108 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
109 }
110
111 $bearsamppWinbinder->wait();
112 $bearsamppWinbinder->wait($this->wbWindow);
113 }
global $bearsamppCore
static getImagesPath($aetrayPath=false)

References $bearsamppCore, and Path\getImagesPath().

Referenced by init().

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

◆ init()

init ( $title,
$gauge,
$text )

Initializes the splash screen.

Parameters
string$titleThe title of the splash screen window.
int$gaugeThe maximum value for the progress bar.
string$textThe initial loading text to display.

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

53 {
54 global $bearsamppCore, $bearsamppWinbinder;
55
56 $bearsamppWinbinder->reset();
57
58 $screenArea = explode(' ', $bearsamppWinbinder->getSystemInfo(WinBinder::SYSINFO_WORKAREA));
59 $screenWidth = intval($screenArea[2]);
60 $screenHeight = intval($screenArea[3]);
61 $xPos = $screenWidth - self::WINDOW_WIDTH;
62 $yPos = $screenHeight - self::WINDOW_HEIGHT - 5;
63
64 $this->wbWindow = $bearsamppWinbinder->createWindow(null, ToolDialog, $title, $xPos, $yPos, self::WINDOW_WIDTH, self::WINDOW_HEIGHT, WBC_TOP | WBC_READONLY, null);
65
66 // Check if window was created successfully
67 if ($this->wbWindow === false || $this->wbWindow === null) {
68 Log::error('Failed to create splash window');
69
70 return;
71 }
72
73 // CRITICAL: wb_set_visible() must be called AFTER window creation in PHP 8.4
74 // The WS_VISIBLE flag during creation doesn't work
75 wb_set_visible($this->wbWindow, true);
76
77 $this->wbImage = $bearsamppWinbinder->drawImage($this->wbWindow, Path::getImagesPath() . '/bearsampp.bmp');
78 $this->wbProgressBar = $bearsamppWinbinder->createProgressBar($this->wbWindow, $gauge + 1, 42, 24, 390, 15);
79
80 $this->setTextLoading($text);
81 $this->incrProgressBar();
82 }
static error($data, $file=null)
setTextLoading($caption)
incrProgressBar($nb=1)
const SYSINFO_WORKAREA

References $bearsamppCore, Log\error(), Path\getImagesPath(), incrProgressBar(), setTextLoading(), and WinBinder\SYSINFO_WORKAREA.

Here is the call graph for this function:

◆ setTextLoading()

setTextLoading ( $caption)

Sets the loading text on the splash screen.

Parameters
string$captionThe loading text to display.

Definition at line 89 of file class.splash.php.

90 {
91 global $bearsamppWinbinder;
92
93 $bearsamppWinbinder->drawRect($this->wbWindow, 42, 0, self::WINDOW_WIDTH - 42, self::WINDOW_HEIGHT);
94 $this->wbTextLoading = $bearsamppWinbinder->drawText($this->wbWindow, $caption, 42, 0, self::WINDOW_WIDTH - 44, 25);
95 }

Referenced by init().

Here is the caller graph for this function:

Field Documentation

◆ $currentImg

$currentImg
private

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

◆ $wbImage

$wbImage
private

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

◆ $wbProgressBar

$wbProgressBar
private

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

◆ $wbTextLoading

$wbTextLoading
private

Definition at line 27 of file class.splash.php.

◆ $wbWindow

$wbWindow
private

Definition at line 23 of file class.splash.php.

Referenced by getWbWindow().

◆ WINDOW_HEIGHT

const WINDOW_HEIGHT = 90

Definition at line 20 of file class.splash.php.

◆ WINDOW_WIDTH

const WINDOW_WIDTH = 460

Definition at line 19 of file class.splash.php.


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