API Documentation
Loading...
Searching...
No Matches
QCustomMessageBox Class Reference

A message box displays a primary text to alert the user to a situation, an informative text to further explain the situation, and an optional detailed text to provide even more data if the user requests it. The interface for this object allows from either a set of predifined user options (OK, Load, Cancel, etc) or a set of program defined responses that the user can choose from. More...

#include <QCustomMessageBox.h>

Inheritance diagram for QCustomMessageBox:
[legend]
Collaboration diagram for QCustomMessageBox:
[legend]

Public Member Functions

void clearButtons ()
 
virtual bool processKeyEvent (const String &id, const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) override
 
virtual void resetKeyControllerToDefaults () override
 
void setButtons (const Buffer< TranslatedString > &button_labels)
 
void setButtons (QMessageBox::StandardButtons buttons)
 
void setCallback (std::function< void(QMessageBox::StandardButton, PopupInfo)> callback)
 
void setGenericOptionCallback (std::function< void(GenericOption, PopupInfo)> callback)
 
void setIcon (const String &image, fltp08 icon_size_mult=1.0)
 
void setLabelCallback (std::function< void(TranslatedString, PopupInfo)> callback)
 
void setText (const TranslatedString &text)
 
QSize sizeHint () const override
 
- Public Member Functions inherited from BasicKeyController
virtual void addKeyOption (const KeyOption &option)
 
 BasicKeyController (const TranslatedString &key_controller_title)
 
const Buffer< KeyOption > & currentKeyMaps () const
 
virtual void getINI (INIFactory &factory) override
 
const TranslatedStringkeyControllerTitle () const
 
bool processKeyEvent (const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) final override
 
virtual void setKeyOption (const KeyOption &option)
 
- Public Member Functions inherited from KeyControllerBase
- Public Member Functions inherited from INIInterface
virtual void finishReadingINI (INIFactory &)
 
 INIInterface (const File &default_ini)
 
virtual void prepareForINI (INIFactory &)
 
virtual bool readINIOptions ()
 
virtual bool readINIOptions (File &ini_file)
 
virtual bool saveINIOptions (bool multithead=false)
 
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 
void setDefaultINIFile (const File &file)
 
virtual void writeToLog (const String &title, ProgressInfo *log, uint01 log_level=2U)
 
virtual void writeToLog (ProgressInfo *log, uint01 log_level=2U)
 
virtual ~INIInterface ()
 

Static Public Member Functions

static QCustomMessageBoxCreateMessageBox (const GenericOption &entry_type, std::function< void(GenericOption, PopupInfo)> on_select=nullptr)
 
static QCustomMessageBoxCreateMessageBox (const TranslatedString &title, const TranslatedString &text, const Buffer< TranslatedString > &button_labels, std::function< void(TranslatedString, PopupInfo)> on_select=nullptr)
 
static QCustomMessageBoxCreateMessageBox (const TranslatedString &title, const TranslatedString &text, QMessageBox::StandardButtons buttons, std::function< void(QMessageBox::StandardButton, PopupInfo)> on_select=nullptr)
 

Protected Member Functions

void addButtonsToLayout ()
 
void buttonPressed (const TranslatedString &button_label, PopupInfo)
 
void buttonPressed (QMessageBox::StandardButton button, PopupInfo)
 
 QCustomMessageBox (const GenericOption &entry_type, std::function< void(GenericOption, PopupInfo)> on_select)
 
 QCustomMessageBox (const TranslatedString &title, const TranslatedString &text, const Buffer< TranslatedString > &button_labels, std::function< void(TranslatedString, PopupInfo)> on_select=nullptr)
 
 QCustomMessageBox (const TranslatedString &title, const TranslatedString &text, QMessageBox::StandardButtons buttons, std::function< void(QMessageBox::StandardButton, PopupInfo)> on_select=nullptr)
 
virtual ~QCustomMessageBox ()
 

Protected Attributes

Buffer< Button * > m_buttons
 
std::function< void(QMessageBox::StandardButton, PopupInfo)> m_callback
 
GenericOption m_generic_option
 
ImageViewm_image_view
 
std::function< void(TranslatedString, PopupInfo)> m_label_callback
 
String m_pixmap
 
QLabel * m_text
 
QHBoxLayout * m_top_layout
 
std::function< void(GenericOption, PopupInfo)> m_user_entry_callback
 
- Protected Attributes inherited from BasicKeyController
TranslatedString m_key_controller_title
 
Buffer< KeyOptionm_key_options
 
bool m_save_ini_on_change_key_option_change = false
 
- Protected Attributes inherited from INIInterface
File m_default_ini
 

Static Protected Attributes

static Dictionary< UUID, QPointer< QCustomMessageBox > > s_message_boxes
 

Detailed Description

A message box displays a primary text to alert the user to a situation, an informative text to further explain the situation, and an optional detailed text to provide even more data if the user requests it. The interface for this object allows from either a set of predifined user options (OK, Load, Cancel, etc) or a set of program defined responses that the user can choose from.


Constructor & Destructor Documentation

◆ QCustomMessageBox() [1/3]

QCustomMessageBox ( const TranslatedString & title,
const TranslatedString & text,
QMessageBox::StandardButtons buttons,
std::function< void(QMessageBox::StandardButton, PopupInfo)> on_select = nullptr )
protected

◆ QCustomMessageBox() [2/3]

QCustomMessageBox ( const TranslatedString & title,
const TranslatedString & text,
const Buffer< TranslatedString > & button_labels,
std::function< void(TranslatedString, PopupInfo)> on_select = nullptr )
protected

◆ QCustomMessageBox() [3/3]

QCustomMessageBox ( const GenericOption & entry_type,
std::function< void(GenericOption, PopupInfo)> on_select )
protected

◆ ~QCustomMessageBox()

virtual ~QCustomMessageBox ( )
protectedvirtual

Member Function Documentation

◆ addButtonsToLayout()

void addButtonsToLayout ( )
protected

◆ buttonPressed() [1/2]

void buttonPressed ( const TranslatedString & button_label,
PopupInfo  )
protected

◆ buttonPressed() [2/2]

void buttonPressed ( QMessageBox::StandardButton button,
PopupInfo  )
protected

◆ clearButtons()

void clearButtons ( )

◆ CreateMessageBox() [1/3]

static QCustomMessageBox * CreateMessageBox ( const GenericOption & entry_type,
std::function< void(GenericOption, PopupInfo)> on_select = nullptr )
static

◆ CreateMessageBox() [2/3]

static QCustomMessageBox * CreateMessageBox ( const TranslatedString & title,
const TranslatedString & text,
const Buffer< TranslatedString > & button_labels,
std::function< void(TranslatedString, PopupInfo)> on_select = nullptr )
static

◆ CreateMessageBox() [3/3]

static QCustomMessageBox * CreateMessageBox ( const TranslatedString & title,
const TranslatedString & text,
QMessageBox::StandardButtons buttons,
std::function< void(QMessageBox::StandardButton, PopupInfo)> on_select = nullptr )
static

◆ processKeyEvent()

virtual bool processKeyEvent ( const String & id,
const KeyEvent & key_event,
DesignObjectLookup * lookup,
Camera * camera )
overridevirtual

Implements BasicKeyController.

◆ resetKeyControllerToDefaults()

virtual void resetKeyControllerToDefaults ( )
overridevirtual

Implements BasicKeyController.

◆ setButtons() [1/2]

void setButtons ( const Buffer< TranslatedString > & button_labels)

◆ setButtons() [2/2]

void setButtons ( QMessageBox::StandardButtons buttons)

◆ setCallback()

void setCallback ( std::function< void(QMessageBox::StandardButton, PopupInfo)> callback)
inline

◆ setGenericOptionCallback()

void setGenericOptionCallback ( std::function< void(GenericOption, PopupInfo)> callback)
inline

◆ setIcon()

void setIcon ( const String & image,
fltp08 icon_size_mult = 1.0 )

◆ setLabelCallback()

void setLabelCallback ( std::function< void(TranslatedString, PopupInfo)> callback)
inline

◆ setText()

void setText ( const TranslatedString & text)

◆ sizeHint()

QSize sizeHint ( ) const
override

Member Data Documentation

◆ m_buttons

Buffer<Button*> m_buttons
protected

◆ m_callback

std::function<void(QMessageBox::StandardButton, PopupInfo)> m_callback
protected

◆ m_generic_option

GenericOption m_generic_option
protected

◆ m_image_view

ImageView* m_image_view
protected

◆ m_label_callback

std::function<void(TranslatedString, PopupInfo)> m_label_callback
protected

◆ m_pixmap

String m_pixmap
protected

◆ m_text

QLabel* m_text
protected

◆ m_top_layout

QHBoxLayout* m_top_layout
protected

◆ m_user_entry_callback

std::function<void(GenericOption, PopupInfo)> m_user_entry_callback
protected

◆ s_message_boxes

Dictionary<UUID, QPointer<QCustomMessageBox> > s_message_boxes
staticprotected

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