nomlib
Loading...
Searching...
No Matches
nom::UIQuestionDialogBox Class Reference

Simple question dialog model. More...

#include <UIQuestionDialogBox.hpp>

Inheritance diagram for nom::UIQuestionDialogBox:
[legend]

Public Types

typedef UIQuestionDialogBox self_type
typedef self_type * raw_ptr
Public Types inherited from nom::UIMessageBox
typedef UIMessageBox self_type
typedef self_type * raw_ptr
Public Types inherited from nom::UIWidget
enum  FocusPolicy { NONE = rocket::ElementDocument::FocusFlags::NONE , FOCUS = rocket::ElementDocument::FocusFlags::FOCUS , MODAL = rocket::ElementDocument::FocusFlags::MODAL }
typedef UIWidget self_type
typedef self_type * raw_ptr

Public Member Functions

 UIQuestionDialogBox ()
 Default constructor; initialize default element IDs.
virtual ~UIQuestionDialogBox ()
 Destructor.
const std::string & response_id () const
 The ID selector used to search for the number of children; the response elements to index, i.e.: form tag ID.
const std::string & element_type () const
 The element tag to use for indexing as a possible response choice (i.e.: button).
nom::size_type num_responses () const
int selection () const
 Obtain the current selection index (position) of the responses.
std::vector< std::string > responses () const
 Get the response element IDs.
std::string response (int pos) const
void set_response_id (const std::string &id)
void set_element_type (const std::string &type)
void set_selection (int pos)
 Set the current selection index (position).
Public Member Functions inherited from nom::UIMessageBox
 UIMessageBox ()
 Default constructor; initialize default element IDs.
virtual ~UIMessageBox ()
 Destructor.
bool enabled () const
std::string title_text () const
IntRect title_bounds () const
 Obtain the rectangle bounds of the title string.
uint32 title_alignment () const
std::string message_text () const
IntRect message_bounds () const
 Obtain the rectangle bounds of the message string.
uint32 message_alignment () const
const std::string & message_id () const
void disable ()
void enable ()
void set_title (const std::string &text, const std::string &font, uint point_size)
 Set the title (caption) text of the message box.
void set_title_text (const std::string &text)
 Set the title (caption) text of the message box.
void set_title_font (const std::string &font)
 Set the title (caption) text's font.
void set_title_font_size (int point_size)
 Set the title (caption) text's font size.
void set_title_alignment (uint32 align)
 Set the title (caption) text's alignment.
void set_message (const std::string &text, const std::string &font, uint point_size)
 Set the message text label.
void set_message_text (const std::string &text)
 Set the message text label.
void set_message_font (const std::string &font)
 Set the message text's font.
void set_message_font_size (int point_size)
 Set the message text's font size.
void set_message_alignment (uint32 align)
 Set the message text's alignment.
void set_message_id (const std::string &id)
Public Member Functions inherited from nom::UIWidget
 UIWidget ()
 Default constructor; initialize default title element ID.
virtual ~UIWidget ()
 Destructor.
virtual Point2i position () const
 Get the position of the widget.
virtual Size2i size () const
 Get the size of the widget.
virtual void set_position (const Point2i &pos)
 Set the position of the widget.
virtual void set_size (const Size2i &dims)
 Set the size of the widget.
UIContextcontext () const
rocket::ElementDocument * document () const
bool valid () const
bool valid (rocket::Element *target) const
bool visible () const
const std::string & title_id () const
std::string title () const
uint32 text_alignment (rocket::Element *target) const
 Get an element's text alignment.
bool set_context (UIContext *ctx)
bool load_document_file (const std::string &filename)
void show ()
void hide ()
void close ()
void set_focus (uint32 focus=FocusPolicy::FOCUS)
 Set the focus policy.
bool hit_test (rocket::Element *target, const Point2i &pt)
 Perform a bounds coordinates collision test.
void set_title (const std::string &text)
void set_title_id (const std::string &id)
void set_font (rocket::Element *target, const std::string &font)
void set_font_size (rocket::Element *target, int point_size)
bool set_alignment (uint32 alignment)
void set_text_alignment (rocket::Element *element, uint32 alignment)
void register_event_listener (rocket::Element *element, const std::string &ev, UIEventListener *observer, bool interruptible=false)
 Register an event listener for an element.

Private Attributes

std::string response_id_
std::string element_type_
int selection_
 Selected item, identified by its index (position).

Detailed Description

Simple question dialog model.

Remarks
This interface exists to ease the mapping & sync of keyboard, mouse and joystick inputs.
    [DESCRIPTION STUB]

Usage example:

Definition at line 46 of file UIQuestionDialogBox.hpp.

Member Typedef Documentation

◆ raw_ptr

typedef self_type* nom::UIQuestionDialogBox::raw_ptr

Definition at line 50 of file UIQuestionDialogBox.hpp.

◆ self_type

typedef UIQuestionDialogBox nom::UIQuestionDialogBox::self_type

Definition at line 49 of file UIQuestionDialogBox.hpp.

Constructor & Destructor Documentation

◆ UIQuestionDialogBox()

nom::UIQuestionDialogBox::UIQuestionDialogBox ( )

Default constructor; initialize default element IDs.

See also
UIWidget::set_desktop, UIWidget::load_document_file, UIWidget::show.

Member Function Documentation

◆ selection()

int nom::UIQuestionDialogBox::selection ( ) const

Obtain the current selection index (position) of the responses.

Returns
Index position of the selection; or negative one (-1) if nothing is selected.

Member Data Documentation

◆ element_type_

std::string nom::UIQuestionDialogBox::element_type_
private

Definition at line 89 of file UIQuestionDialogBox.hpp.

◆ response_id_

std::string nom::UIQuestionDialogBox::response_id_
private

Definition at line 88 of file UIQuestionDialogBox.hpp.

◆ selection_

int nom::UIQuestionDialogBox::selection_
private

Selected item, identified by its index (position).

Definition at line 92 of file UIQuestionDialogBox.hpp.


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