|
| 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 |
|
| | 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.
|
| UIContext * | context () 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.
|
Definition at line 45 of file UIWidget.hpp.
◆ raw_ptr
| typedef self_type* nom::UIWidget::raw_ptr |
◆ self_type
| typedef UIWidget nom::UIWidget::self_type |
◆ FocusPolicy
| enum nom::UIWidget::FocusPolicy |
◆ UIWidget()
| nom::UIWidget::UIWidget |
( |
| ) |
|
Default constructor; initialize default title element ID.
- See also
- UIWidget::set_context, UIWidget::load_document_file, UIWidget::show.
◆ context()
- Returns
- A non-owned object pointer.
◆ document()
| rocket::ElementDocument * nom::UIWidget::document |
( |
| ) |
const |
- Returns
- A non-owned object pointer.
◆ position()
| virtual Point2i nom::UIWidget::position |
( |
| ) |
const |
|
virtual |
Get the position of the widget.
- Returns
- The position of the widget (body element) upon success, or Point2i::null on failure, such as when a document has not yet been loaded into memory.
◆ register_event_listener()
| void nom::UIWidget::register_event_listener |
( |
rocket::Element * | element, |
|
|
const std::string & | ev, |
|
|
UIEventListener * | observer, |
|
|
bool | interruptible = false ) |
◆ set_focus()
| void nom::UIWidget::set_focus |
( |
uint32 | focus = FocusPolicy::FOCUS | ) |
|
Set the focus policy.
- See also
- UIWidget::FocusPolicy enumeration.
◆ set_position()
| virtual void nom::UIWidget::set_position |
( |
const Point2i & | pos | ) |
|
|
virtual |
Set the position of the widget.
- Parameters
-
| pos | The X, Y coordinates used for document positioning; these will be relative to the context in use. |
◆ set_size()
| virtual void nom::UIWidget::set_size |
( |
const Size2i & | dims | ) |
|
|
virtual |
Set the size of the widget.
- Parameters
-
| dims | The width and height to use for document dimensions; these will be relative to the context in use. |
- Note
- The size does not take precedence over the max-width and max-height style sheet properties when they have been set by the end-user.
◆ set_text_alignment()
| void nom::UIWidget::set_text_alignment |
( |
rocket::Element * | element, |
|
|
uint32 | alignment ) |
- Parameters
-
| alignment | One of the following Anchor enumerations: Anchor::Left, Anchor::Center, Anchor::Right. |
- Todo
- Change return type to boolean
◆ size()
| virtual Size2i nom::UIWidget::size |
( |
| ) |
const |
|
virtual |
Get the size of the widget.
- Returns
- The size of the widget (body element) upon success, or Size2i::null on failure, such as when a document has not yet been loaded into memory.
◆ text_alignment()
| uint32 nom::UIWidget::text_alignment |
( |
rocket::Element * | target | ) |
const |
Get an element's text alignment.
- Returns
- One of the nom::Anchor enumeration values.
◆ ctx_
◆ document_
| rocket::ElementDocument* nom::UIWidget::document_ |
|
private |
◆ title_id_
| std::string nom::UIWidget::title_id_ |
|
private |
The documentation for this class was generated from the following file:
- /home/jeff/Projects/nomlib.git/include/nomlib/gui/UIWidget.hpp