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

Public Member Functions

 __construct ($args)
 processWindow ($window, $id, $ctrl, $param1, $param2)

Data Fields

const GAUGE_SAVE = 2

Private Attributes

 $wbBtnOk
 $wbImage
 $wbLinkDonate
 $wbLinkGithub
 $wbLinkHomepage
 $wbWindow

Detailed Description

Class ActionAbout Handles the creation and management of the "About" window in the Bearsampp application.

Definition at line 15 of file class.action.about.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $args)

ActionAbout constructor. Initializes the "About" window and its components.

Parameters
array$argsArguments passed to the constructor.

Definition at line 38 of file class.action.about.php.

39 {
40 global $bearsamppCore, $bearsamppLang, $bearsamppWinbinder;
41
42 $bearsamppWinbinder->reset();
43 $this->wbWindow = $bearsamppWinbinder->createAppWindow($bearsamppLang->getValue(Lang::ABOUT_TITLE), 520, 250, WBC_NOTIFY, WBC_KEYDOWN | WBC_KEYUP);
44
45 // Get the about text
46 $aboutText = sprintf($bearsamppLang->getValue(Lang::ABOUT_TEXT), APP_TITLE . ' ' . $bearsamppCore->getAppVersion(), date('Y'), APP_AUTHOR_NAME);
47
48 // Split the text using the custom newline marker "@nl@"
49 $textLines = explode('@nl@', $aboutText);
50
51 // Display each line at a specific position
52 $yPos = 20;
53 $lineHeight = 20;
54 foreach ($textLines as $line) {
55 $bearsamppWinbinder->createLabel($this->wbWindow, trim($line), 80, $yPos, 470, $lineHeight);
56 $yPos += $lineHeight;
57 }
58
59 // Add exactly one line of blank space
60 $yPos = 125;
61
62 // Add hyperlinks
63 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::WEBSITE) . ' :', 80, $yPos, 100, 15);
64 $this->wbLinkHomepage = $bearsamppWinbinder->createHyperLink($this->wbWindow, HttpClient::getWebsiteUrlNoUtm(), 180, $yPos, 300, 15, WBC_LINES);
65 $yPos += 20;
66
67 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::DONATE) . ' :', 80, $yPos, 100, 15);
68 $this->wbLinkDonate = $bearsamppWinbinder->createHyperLink($this->wbWindow, HttpClient::getWebsiteUrlNoUtm('donate'), 180, $yPos, 300, 15, WBC_LINES);
69 $yPos += 20;
70
71 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::GITHUB) . ' :', 80, $yPos, 100, 15);
72 $this->wbLinkGithub = $bearsamppWinbinder->createHyperLink($this->wbWindow, HttpClient::getGithubUserUrl(), 180, $yPos, 300, 15, WBC_LINES);
73 $yPos += 10;
74
75 $this->wbBtnOk = $bearsamppWinbinder->createButton($this->wbWindow, $bearsamppLang->getValue(Lang::BUTTON_OK), 390, 180);
76
77 $this->wbImage = $bearsamppWinbinder->drawImage($this->wbWindow, Path::getImagesPath() . '/about.bmp');
78
79 $bearsamppWinbinder->setHandler($this->wbWindow, $this, 'processWindow');
80 $bearsamppWinbinder->mainLoop();
81 $bearsamppWinbinder->reset();
82 }
global $bearsamppLang
global $bearsamppCore
static getWebsiteUrlNoUtm($path='', $fragment='')
static getGithubUserUrl()
const BUTTON_OK
const DONATE
const GITHUB
const ABOUT_TEXT
const ABOUT_TITLE
const WEBSITE
static getImagesPath($aetrayPath=false)
const APP_AUTHOR_NAME
Definition root.php:18
const APP_TITLE
Definition root.php:19

References $bearsamppCore, $bearsamppLang, Lang\ABOUT_TEXT, Lang\ABOUT_TITLE, APP_AUTHOR_NAME, APP_TITLE, Lang\BUTTON_OK, Lang\DONATE, HttpClient\getGithubUserUrl(), Path\getImagesPath(), HttpClient\getWebsiteUrlNoUtm(), Lang\GITHUB, and Lang\WEBSITE.

Here is the call graph for this function:

Member Function Documentation

◆ processWindow()

processWindow ( $window,
$id,
$ctrl,
$param1,
$param2 )

Processes window events and handles user interactions.

Parameters
int$windowThe window identifier.
int$idThe control identifier.
int$ctrlThe control object.
mixed$param1Additional parameter 1.
mixed$param2Additional parameter 2.

Definition at line 93 of file class.action.about.php.

94 {
95 global $bearsamppConfig, $bearsamppWinbinder;
96
97 switch ($id) {
98 case $this->wbLinkHomepage[WinBinder::CTRL_ID]:
99 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), HttpClient::getWebsiteUrl());
100 break;
101 case $this->wbLinkDonate[WinBinder::CTRL_ID]:
102 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), HttpClient::getWebsiteUrl('donate'));
103 break;
104 case $this->wbLinkGithub[WinBinder::CTRL_ID]:
105 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), HttpClient::getGithubUserUrl());
106 break;
107 case IDCLOSE:
108 case $this->wbBtnOk[WinBinder::CTRL_ID]:
109 $bearsamppWinbinder->destroyWindow($window);
110 break;
111 }
112 }
static getWebsiteUrl($path='', $fragment='', $utmSource=true)
global $bearsamppConfig
Definition homepage.php:46

References $bearsamppConfig, WinBinder\CTRL_ID, HttpClient\getGithubUserUrl(), and HttpClient\getWebsiteUrl().

Here is the call graph for this function:

Field Documentation

◆ $wbBtnOk

$wbBtnOk
private

Definition at line 30 of file class.action.about.php.

◆ $wbImage

$wbImage
private

Definition at line 22 of file class.action.about.php.

◆ $wbLinkDonate

$wbLinkDonate
private

Definition at line 26 of file class.action.about.php.

◆ $wbLinkGithub

$wbLinkGithub
private

Definition at line 28 of file class.action.about.php.

◆ $wbLinkHomepage

$wbLinkHomepage
private

Definition at line 24 of file class.action.about.php.

◆ $wbWindow

$wbWindow
private

Definition at line 20 of file class.action.about.php.

◆ GAUGE_SAVE

const GAUGE_SAVE = 2

Definition at line 18 of file class.action.about.php.


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