2024.8.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()

Splash::__construct ( )

Splash constructor.

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

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

35 {
36 Util::logInitClass($this);
37 $this->currentImg = null;
38 }
static logInitClass($classInstance)

References Util\logInitClass().

Member Function Documentation

◆ getWbWindow()

Splash::getWbWindow ( )

Retrieves the window object of the splash screen.

Returns
mixed The window object of the splash screen.

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

104 {
105 return $this->wbWindow;
106 }

References $wbWindow.

◆ incrProgressBar()

Splash::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 85 of file class.splash.php.

86 {
87 global $bearsamppCore, $bearsamppWinbinder;
88
89 for ($i = 0; $i < $nb; $i++) {
90 $bearsamppWinbinder->drawImage($this->wbWindow, $bearsamppCore->getResourcesPath() . '/homepage/img/bearsampp.bmp', 4, 4, 32, 32);
91 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
92 }
93
94 $bearsamppWinbinder->wait();
95 $bearsamppWinbinder->wait($this->wbWindow);
96 }
global $bearsamppCore

References $bearsamppCore.

Referenced by init().

+ Here is the caller graph for this function:

◆ init()

Splash::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 47 of file class.splash.php.

48 {
49 global $bearsamppCore, $bearsamppWinbinder;
50
51 $bearsamppWinbinder->reset();
52
53 $screenArea = explode(' ', $bearsamppWinbinder->getSystemInfo(WinBinder::SYSINFO_WORKAREA));
54 $screenWidth = intval($screenArea[2]);
55 $screenHeight = intval($screenArea[3]);
56 $xPos = $screenWidth - self::WINDOW_WIDTH;
57 $yPos = $screenHeight - self::WINDOW_HEIGHT - 5;
58
59 $this->wbWindow = $bearsamppWinbinder->createWindow(null, ToolDialog, $title, $xPos, $yPos, self::WINDOW_WIDTH, self::WINDOW_HEIGHT, WBC_TOP | WBC_READONLY, null);
60 $this->wbImage = $bearsamppWinbinder->drawImage($this->wbWindow, $bearsamppCore->getResourcesPath() . '/homepage/img/bearsampp.bmp');
61 $this->wbProgressBar = $bearsamppWinbinder->createProgressBar($this->wbWindow, $gauge + 1, 42, 24, 390, 15);
62
63 $this->setTextLoading($text);
64 $this->incrProgressBar();
65 }
incrProgressBar($nb=1)
const WINDOW_WIDTH
setTextLoading($caption)
const SYSINFO_WORKAREA

References $bearsamppCore, incrProgressBar(), setTextLoading(), WinBinder\SYSINFO_WORKAREA, and WINDOW_WIDTH.

◆ setTextLoading()

Splash::setTextLoading ( $caption)

Sets the loading text on the splash screen.

Parameters
string$captionThe loading text to display.

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

73 {
74 global $bearsamppWinbinder;
75
76 $bearsamppWinbinder->drawRect($this->wbWindow, 42, 0, self::WINDOW_WIDTH - 42, self::WINDOW_HEIGHT);
77 $this->wbTextLoading = $bearsamppWinbinder->drawText($this->wbWindow, $caption, 42, 0, self::WINDOW_WIDTH - 44, 25);
78 }

Referenced by init().

+ Here is the caller graph for this function:

Field Documentation

◆ $currentImg

Splash::$currentImg
private

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

◆ $wbImage

Splash::$wbImage
private

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

◆ $wbProgressBar

Splash::$wbProgressBar
private

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

◆ $wbTextLoading

Splash::$wbTextLoading
private

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

◆ $wbWindow

Splash::$wbWindow
private

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

Referenced by getWbWindow().

◆ WINDOW_HEIGHT

const Splash::WINDOW_HEIGHT = 90

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

◆ WINDOW_WIDTH

const Splash::WINDOW_WIDTH = 460

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

Referenced by init().


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