Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
GUIModalMenu Class Referenceabstract

#include <modalMenu.h>

+ Inheritance diagram for GUIModalMenu:
+ Collaboration diagram for GUIModalMenu:

Classes

struct  ScalingInfo
 

Public Member Functions

 GUIModalMenu (gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, IMenuManager *menumgr, bool remap_dbl_click=true)
 
virtual ~GUIModalMenu ()
 
void allowFocusRemoval (bool allow)
 
bool canTakeFocus (gui::IGUIElement *e)
 
void draw ()
 
void quitMenu ()
 
virtual void regenerateGui (v2u32 screensize)=0
 
virtual void drawMenu ()=0
 
virtual bool preprocessEvent (const SEvent &event)
 
virtual bool OnEvent (const SEvent &event)
 
virtual bool pausesGame ()
 

Protected Member Functions

virtual std::wstring getLabelByID (s32 id)=0
 
virtual std::string getNameByID (s32 id)=0
 
ScalingInfo getScalingInfo (v2u32 screensize, v2u32 base_size)
 

Protected Attributes

v2s32 m_pointer
 
v2s32 m_old_pointer
 
v2u32 m_screensize_old
 
float m_gui_scale
 
bool m_second_touch = false
 

Private Member Functions

bool remapClickOutside (const SEvent &event)
 
bool simulateMouseEvent (ETOUCH_INPUT_EVENT touch_event, bool second_try=false)
 
void enter (gui::IGUIElement *element)
 
void leave ()
 

Private Attributes

IMenuManagerm_menumgr
 
bool m_remap_click_outside
 
PointerAction m_last_click_outside {}
 
bool m_allow_focus_removal = false
 
irr_ptr< gui::IGUIElement > m_touch_hovered
 
PointerAction m_last_touch {}
 

Constructor & Destructor Documentation

◆ GUIModalMenu()

GUIModalMenu::GUIModalMenu ( gui::IGUIEnvironment * env,
gui::IGUIElement * parent,
s32 id,
IMenuManager * menumgr,
bool remap_dbl_click = true )

References IMenuManager::createdMenu(), g_settings, RenderingEngine::getDisplayDensity(), Settings::getFloat(), m_gui_scale, and m_menumgr.

+ Here is the call graph for this function:

◆ ~GUIModalMenu()

GUIModalMenu::~GUIModalMenu ( )
virtual

References IMenuManager::deletingMenu(), and m_menumgr.

+ Here is the call graph for this function:

Member Function Documentation

◆ allowFocusRemoval()

void GUIModalMenu::allowFocusRemoval ( bool allow)

References m_allow_focus_removal.

Referenced by quitMenu().

+ Here is the caller graph for this function:

◆ canTakeFocus()

bool GUIModalMenu::canTakeFocus ( gui::IGUIElement * e)

References m_allow_focus_removal.

Referenced by GUIFormSpecMenu::OnEvent(), GUIKeyChangeMenu::OnEvent(), GUIOpenURLMenu::OnEvent(), GUIPasswordChange::OnEvent(), and GUIVolumeChange::OnEvent().

+ Here is the caller graph for this function:

◆ draw()

void GUIModalMenu::draw ( )

References drawMenu(), m_screensize_old, and regenerateGui().

+ Here is the call graph for this function:

◆ drawMenu()

virtual void GUIModalMenu::drawMenu ( )
pure virtual

Implemented in GUIFileSelectMenu, GUIFormSpecMenu, GUIKeyChangeMenu, GUIOpenURLMenu, GUIPasswordChange, GUITouchscreenLayout, and GUIVolumeChange.

Referenced by draw().

+ Here is the caller graph for this function:

◆ enter()

void GUIModalMenu::enter ( gui::IGUIElement * element)
private

References m_touch_hovered, and sanity_check.

Referenced by preprocessEvent().

+ Here is the caller graph for this function:

◆ getLabelByID()

virtual std::wstring GUIModalMenu::getLabelByID ( s32 id)
protectedpure virtual

◆ getNameByID()

virtual std::string GUIModalMenu::getNameByID ( s32 id)
protectedpure virtual

Implemented in GUIFileSelectMenu, GUIFormSpecMenu, GUIKeyChangeMenu, GUIOpenURLMenu, GUIPasswordChange, GUITouchscreenLayout, and GUIVolumeChange.

Referenced by preprocessEvent().

+ Here is the caller graph for this function:

◆ getScalingInfo()

GUIModalMenu::ScalingInfo GUIModalMenu::getScalingInfo ( v2u32 screensize,
v2u32 base_size )
protected

References m_gui_scale.

Referenced by GUIKeyChangeMenu::regenerateGui(), GUIOpenURLMenu::regenerateGui(), GUIPasswordChange::regenerateGui(), and GUIVolumeChange::regenerateGui().

+ Here is the caller graph for this function:

◆ leave()

void GUIModalMenu::leave ( )
private

References m_touch_hovered.

Referenced by preprocessEvent().

+ Here is the caller graph for this function:

◆ OnEvent()

virtual bool GUIModalMenu::OnEvent ( const SEvent & event)
inlinevirtual

Reimplemented in GUIFileSelectMenu, GUIFormSpecMenu, GUIKeyChangeMenu, GUIOpenURLMenu, GUIPasswordChange, GUITouchscreenLayout, and GUIVolumeChange.

Referenced by remapClickOutside().

+ Here is the caller graph for this function:

◆ pausesGame()

virtual bool GUIModalMenu::pausesGame ( )
inlinevirtual

Reimplemented in GUIFormSpecMenu, GUIKeyChangeMenu, and GUIVolumeChange.

Referenced by MainMenuManager::pausesGame().

+ Here is the caller graph for this function:

◆ preprocessEvent()

bool GUIModalMenu::preprocessEvent ( const SEvent & event)
virtual

Reimplemented in GUIFormSpecMenu.

References enter(), PointerAction::fromEvent(), getNameByID(), porting::hasPhysicalKeyboardAndroid(), PointerAction::isRelated(), leave(), m_last_touch, m_pointer, m_second_touch, m_touch_hovered, remapClickOutside(), porting::showComboBoxDialog(), porting::showTextInputDialog(), simulateMouseEvent(), and wide_to_utf8().

Referenced by GUIFormSpecMenu::preprocessEvent(), MainMenuManager::preprocessEvent(), and simulateMouseEvent().

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

◆ quitMenu()

void GUIModalMenu::quitMenu ( )

References allowFocusRemoval(), IMenuManager::deletingMenu(), g_touchcontrols, m_menumgr, remove(), and TouchControls::show().

Referenced by GUIFileSelectMenu::acceptInput(), Game::handleClientEvent_ShowFormSpec(), GUIFormSpecMenu::OnEvent(), GUIKeyChangeMenu::OnEvent(), GUIOpenURLMenu::OnEvent(), GUIPasswordChange::OnEvent(), GUITouchscreenLayout::OnEvent(), GUIVolumeChange::OnEvent(), GUIFormSpecMenu::preprocessEvent(), Game::shutdown(), and GUIFormSpecMenu::tryClose().

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

◆ regenerateGui()

virtual void GUIModalMenu::regenerateGui ( v2u32 screensize)
pure virtual

Implemented in GUIFileSelectMenu, GUIFormSpecMenu, GUIKeyChangeMenu, GUIOpenURLMenu, GUIPasswordChange, GUITouchscreenLayout, and GUIVolumeChange.

Referenced by draw().

+ Here is the caller graph for this function:

◆ remapClickOutside()

bool GUIModalMenu::remapClickOutside ( const SEvent & event)
private

References PointerAction::fromEvent(), isChild(), PointerAction::isRelated(), m_last_click_outside, m_remap_click_outside, GUIInventoryList::OnEvent(), OnEvent(), and PointerAction::pos.

Referenced by preprocessEvent().

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

◆ simulateMouseEvent()

bool GUIModalMenu::simulateMouseEvent ( ETOUCH_INPUT_EVENT touch_event,
bool second_try = false )
private

References m_pointer, m_touch_hovered, preprocessEvent(), and simulateMouseEvent().

Referenced by preprocessEvent(), and simulateMouseEvent().

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

Member Data Documentation

◆ m_allow_focus_removal

bool GUIModalMenu::m_allow_focus_removal = false
private

Referenced by allowFocusRemoval(), and canTakeFocus().

◆ m_gui_scale

float GUIModalMenu::m_gui_scale
protected

◆ m_last_click_outside

PointerAction GUIModalMenu::m_last_click_outside {}
private

Referenced by remapClickOutside().

◆ m_last_touch

PointerAction GUIModalMenu::m_last_touch {}
private

Referenced by preprocessEvent().

◆ m_menumgr

IMenuManager* GUIModalMenu::m_menumgr
private

◆ m_old_pointer

v2s32 GUIModalMenu::m_old_pointer
protected

◆ m_pointer

◆ m_remap_click_outside

bool GUIModalMenu::m_remap_click_outside
private

Referenced by remapClickOutside().

◆ m_screensize_old

v2u32 GUIModalMenu::m_screensize_old
protected

◆ m_second_touch

bool GUIModalMenu::m_second_touch = false
protected

◆ m_touch_hovered

irr_ptr<gui::IGUIElement> GUIModalMenu::m_touch_hovered
private

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