Minetest  5.4.0
GUIModalMenu Class Referenceabstract

#include <modalMenu.h>

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

Classes

struct  clickpos
 

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 ()
 
void removeChildren ()
 
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
 
bool DoubleClickDetection (const SEvent &event)
 check if event is part of a double click More...
 

Protected Attributes

v2s32 m_pointer
 
v2s32 m_old_pointer
 
v2u32 m_screensize_old
 
float m_gui_scale
 

Private Attributes

clickpos m_doubleclickdetect [2]
 
IMenuManagerm_menumgr
 
bool m_remap_dbl_click
 
bool m_allow_focus_removal = false
 

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, porting::getDisplayDensity(), Settings::getFloat(), m_doubleclickdetect, m_gui_scale, m_menumgr, GUIModalMenu::clickpos::pos, and GUIModalMenu::clickpos::time.

+ 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 GUIConfirmRegistration::OnEvent(), GUIFormSpecMenu::OnEvent(), GUIKeyChangeMenu::OnEvent(), GUIPasswordChange::OnEvent(), and GUIVolumeChange::OnEvent().

+ Here is the caller graph for this function:

◆ DoubleClickDetection()

bool GUIModalMenu::DoubleClickDetection ( const SEvent &  event)
protected

check if event is part of a double click

Parameters
eventevent to evaluate
Returns
true/false if a doubleclick was detected

References porting::getDeltaMs(), porting::getTimeMs(), m_doubleclickdetect, m_pointer, m_remap_dbl_click, OnEvent(), GUIModalMenu::clickpos::pos, and GUIModalMenu::clickpos::time.

Referenced by preprocessEvent().

+ Here is the call graph for this function:
+ 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 GUIVolumeChange, GUIFileSelectMenu, GUIPasswordChange, GUIKeyChangeMenu, GUIFormSpecMenu, and GUIConfirmRegistration.

Referenced by draw().

+ Here is the caller graph for this function:

◆ getLabelByID()

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

Implemented in GUIVolumeChange, GUIFileSelectMenu, GUIPasswordChange, GUIKeyChangeMenu, GUIFormSpecMenu, and GUIConfirmRegistration.

Referenced by preprocessEvent().

+ Here is the caller graph for this function:

◆ getNameByID()

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

Implemented in GUIVolumeChange, GUIFileSelectMenu, GUIPasswordChange, GUIKeyChangeMenu, GUIFormSpecMenu, and GUIConfirmRegistration.

Referenced by preprocessEvent().

+ Here is the caller graph for this function:

◆ OnEvent()

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

Reimplemented in GUIVolumeChange, GUIFileSelectMenu, GUIPasswordChange, GUIKeyChangeMenu, GUIFormSpecMenu, and GUIConfirmRegistration.

Referenced by DoubleClickDetection().

+ Here is the caller graph for this function:

◆ pausesGame()

virtual bool GUIModalMenu::pausesGame ( )
inlinevirtual

Reimplemented in GUIVolumeChange, GUIKeyChangeMenu, and GUIFormSpecMenu.

Referenced by MainMenuManager::pausesGame().

+ Here is the caller graph for this function:

◆ preprocessEvent()

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

Reimplemented in GUIFormSpecMenu.

References DoubleClickDetection(), getLabelByID(), getNameByID(), irr_ptr< ReferenceCounted, class >::grab(), isChild(), m_pointer, porting::showInputDialog(), and wide_to_utf8().

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

+ 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_touchscreengui, m_menumgr, and TouchScreenGUI::show().

Referenced by GUIEngine::GUIEngine(), GUIFileSelectMenu::acceptInput(), GUIConfirmRegistration::closeMenu(), GUIFormSpecMenu::OnEvent(), GUIKeyChangeMenu::OnEvent(), GUIPasswordChange::OnEvent(), GUIVolumeChange::OnEvent(), GUIFormSpecMenu::preprocessEvent(), 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 GUIVolumeChange, GUIFileSelectMenu, GUIPasswordChange, GUIKeyChangeMenu, GUIFormSpecMenu, and GUIConfirmRegistration.

Referenced by draw().

+ Here is the caller graph for this function:

◆ removeChildren()

void GUIModalMenu::removeChildren ( )

Referenced by GUIFileSelectMenu::~GUIFileSelectMenu(), and GUIFileSelectMenu::regenerateGui().

+ 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_doubleclickdetect

clickpos GUIModalMenu::m_doubleclickdetect[2]
private

◆ m_gui_scale

◆ m_menumgr

IMenuManager* GUIModalMenu::m_menumgr
private

◆ m_old_pointer

v2s32 GUIModalMenu::m_old_pointer
protected

◆ m_pointer

◆ m_remap_dbl_click

bool GUIModalMenu::m_remap_dbl_click
private

Referenced by DoubleClickDetection().

◆ m_screensize_old

v2u32 GUIModalMenu::m_screensize_old
protected

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