2024.8.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 14 of file class.action.about.php.

Constructor & Destructor Documentation

◆ __construct()

ActionAbout::__construct ( $args)

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

Parameters
array$argsArguments passed to the constructor.

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

32 {
33 global $bearsamppCore, $bearsamppLang, $bearsamppWinbinder;
34
35 $bearsamppWinbinder->reset();
36 $this->wbWindow = $bearsamppWinbinder->createAppWindow($bearsamppLang->getValue(Lang::ABOUT_TITLE), 500, 250, WBC_NOTIFY, WBC_KEYDOWN | WBC_KEYUP);
37
38 $aboutText = sprintf($bearsamppLang->getValue(Lang::ABOUT_TEXT), APP_TITLE . ' ' . $bearsamppCore->getAppVersion(), date('Y'), APP_AUTHOR_NAME);
39 $bearsamppWinbinder->createLabel($this->wbWindow, $aboutText, 80, 20, 470, 120);
40
41 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::WEBSITE) . ' :', 80, 105, 470, 15);
42 $this->wbLinkHomepage = $bearsamppWinbinder->createHyperLink($this->wbWindow, Util::getWebsiteUrlNoUtm(), 180, 105, 300, 15, WBC_LINES);
43
44 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::DONATE) . ' :', 80, 125, 470, 15);
45 $this->wbLinkDonate = $bearsamppWinbinder->createHyperLink($this->wbWindow, Util::getWebsiteUrlNoUtm('donate'), 180, 125, 300, 15, WBC_LINES | WBC_RIGHT);
46
47 $bearsamppWinbinder->createLabel($this->wbWindow, $bearsamppLang->getValue(Lang::GITHUB) . ' :', 80, 145, 470, 15);
48 $this->wbLinkGithub = $bearsamppWinbinder->createHyperLink($this->wbWindow, Util::getGithubUserUrl(), 180, 145, 300, 15, WBC_LINES | WBC_RIGHT);
49
50 $this->wbBtnOk = $bearsamppWinbinder->createButton($this->wbWindow, $bearsamppLang->getValue(Lang::BUTTON_OK), 390, 180);
51
52 $this->wbImage = $bearsamppWinbinder->drawImage($this->wbWindow, $bearsamppCore->getResourcesPath() . '/homepage/img/about.bmp');
53
54 $bearsamppWinbinder->setHandler($this->wbWindow, $this, 'processWindow');
55 $bearsamppWinbinder->mainLoop();
56 $bearsamppWinbinder->reset();
57 }
global $bearsamppLang
global $bearsamppCore
const BUTTON_OK
const WEBSITE
const GITHUB
const DONATE
const ABOUT_TEXT
const ABOUT_TITLE
static getGithubUserUrl($part=null)
static getWebsiteUrlNoUtm($path='', $fragment='')
const APP_AUTHOR_NAME
Definition root.php:11
const APP_TITLE
Definition root.php:12

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

Member Function Documentation

◆ processWindow()

ActionAbout::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 68 of file class.action.about.php.

69 {
70 global $bearsamppConfig, $bearsamppWinbinder;
71
72 switch ($id) {
73 case $this->wbLinkHomepage[WinBinder::CTRL_ID]:
74 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), Util::getWebsiteUrl());
75 break;
76 case $this->wbLinkDonate[WinBinder::CTRL_ID]:
77 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), Util::getWebsiteUrl('donate'));
78 break;
79 case $this->wbLinkGithub[WinBinder::CTRL_ID]:
80 $bearsamppWinbinder->exec($bearsamppConfig->getBrowser(), Util::getGithubUserUrl());
81 break;
82 case IDCLOSE:
83 case $this->wbBtnOk[WinBinder::CTRL_ID]:
84 $bearsamppWinbinder->destroyWindow($window);
85 break;
86 }
87 }
static getWebsiteUrl($path='', $fragment='', $utmSource=true)
global $bearsamppConfig
Definition homepage.php:26

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

Field Documentation

◆ $wbBtnOk

ActionAbout::$wbBtnOk
private

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

◆ $wbImage

ActionAbout::$wbImage
private

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

◆ $wbLinkDonate

ActionAbout::$wbLinkDonate
private

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

◆ $wbLinkGithub

ActionAbout::$wbLinkGithub
private

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

◆ $wbLinkHomepage

ActionAbout::$wbLinkHomepage
private

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

◆ $wbWindow

ActionAbout::$wbWindow
private

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

◆ GAUGE_SAVE

const ActionAbout::GAUGE_SAVE = 2

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


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