ScummVM API documentation
Ultima::Ultima0::UIElement Class Reference

#include <events.h>

Inheritance diagram for Ultima::Ultima0::UIElement:
Ultima::Ultima0::Events Ultima::Ultima0::Views::View Ultima::Ultima0::Ultima0Engine Ultima::Ultima0::Views::Acknowledgements Ultima::Ultima0::Views::Attack Ultima::Ultima0::Views::Castle Ultima::Ultima0::Views::CreateCharacter Ultima::Ultima0::Views::Dead Ultima::Ultima0::Views::Dungeon Ultima::Ultima0::Views::Info Ultima::Ultima0::Views::Intro Ultima::Ultima0::Views::Startup Ultima::Ultima0::Views::Status Ultima::Ultima0::Views::Title Ultima::Ultima0::Views::WorldMap

Public Member Functions

 UIElement (const Common::String &name, UIElement *uiParent)
 
 UIElement (const Common::String &name)
 
bool needsRedraw () const
 
void redraw ()
 
void focus ()
 
virtual void close ()
 
bool isFocused () const
 
Common::String getName () const
 
void replaceView (UIElement *ui, bool replaceAllViews=false)
 
void replaceView (const Common::String &name, bool replaceAllViews=false)
 
void addView (UIElement *ui)
 
void addView (const Common::String &name)
 
void addView ()
 
void open ()
 
int getRandomNumber (int minNumber, int maxNumber)
 
int getRandomNumber (int maxNumber)
 
virtual void setBounds (const Common::Rect &r)
 
Common::Rect getBounds () const
 
Gfx::GfxSurface getSurface () const
 
virtual void clearSurface ()
 
virtual void draw ()
 
virtual bool tick ()
 
virtual UIElementfindView (const Common::String &name)
 
bool send (const MouseMoveMessage &msg)
 
bool send (const Common::String &viewName, const FocusMessage &msg)
 
bool send (const FocusMessage &msg)
 
bool send (const Common::String &viewName, const UnfocusMessage &msg)
 
bool send (const UnfocusMessage &msg)
 
bool send (const Common::String &viewName, const MouseEnterMessage &msg)
 
bool send (const MouseEnterMessage &msg)
 
bool send (const Common::String &viewName, const MouseLeaveMessage &msg)
 
bool send (const MouseLeaveMessage &msg)
 
bool send (const Common::String &viewName, const KeypressMessage &msg)
 
bool send (const KeypressMessage &msg)
 
bool send (const Common::String &viewName, const MouseDownMessage &msg)
 
bool send (const MouseDownMessage &msg)
 
bool send (const Common::String &viewName, const MouseUpMessage &msg)
 
bool send (const MouseUpMessage &msg)
 
bool send (const Common::String &viewName, const ActionMessage &msg)
 
bool send (const ActionMessage &msg)
 
bool send (const Common::String &viewName, const GameMessage &msg)
 
bool send (const GameMessage &msg)
 
bool send (const Common::String &viewName, const ValueMessage &msg)
 
bool send (const ValueMessage &msg)
 

Protected Member Functions

void delaySeconds (uint seconds)
 
void delayFrames (uint frames)
 
bool isDelayActive () const
 
void cancelDelay ()
 
virtual void timeout ()
 
virtual bool msgMouseMove (const MouseMoveMessage &msg)
 
virtual bool msgFocus (const FocusMessage &e)
 
virtual bool msgUnfocus (const UnfocusMessage &e)
 
virtual bool msgMouseEnter (const MouseEnterMessage &e)
 
virtual bool msgMouseLeave (const MouseLeaveMessage &e)
 
virtual bool msgKeypress (const KeypressMessage &e)
 
virtual bool msgMouseDown (const MouseDownMessage &e)
 
virtual bool msgMouseUp (const MouseUpMessage &e)
 
virtual bool msgAction (const ActionMessage &e)
 
virtual bool msgGame (const GameMessage &e)
 
virtual bool msgValue (const ValueMessage &e)
 

Protected Attributes

UIElement_parent
 
Common::Array< UIElement * > _children
 
Common::Rect _innerBounds
 
Bounds _bounds
 
bool _needsRedraw = true
 
Common::String _name
 

Detailed Description

User interface element

Member Function Documentation

◆ delaySeconds()

void Ultima::Ultima0::UIElement::delaySeconds ( uint  seconds)
protected

Set a delay countdown in seconds, after which timeout() is called

◆ delayFrames()

void Ultima::Ultima0::UIElement::delayFrames ( uint  frames)
protected

Set a delay countdown in frames, after which timeout() is called

◆ isDelayActive()

bool Ultima::Ultima0::UIElement::isDelayActive ( ) const
inlineprotected

Returns true if a delay is active

◆ cancelDelay()

void Ultima::Ultima0::UIElement::cancelDelay ( )
inlineprotected

Cancels any active delay

◆ timeout()

virtual void Ultima::Ultima0::UIElement::timeout ( )
protectedvirtual

◆ needsRedraw()

bool Ultima::Ultima0::UIElement::needsRedraw ( ) const
inline

Returns true if the elements needs to be redrawn

◆ redraw()

void Ultima::Ultima0::UIElement::redraw ( )

Sets that the element needs to be redrawn

◆ focus()

void Ultima::Ultima0::UIElement::focus ( )

Focuses the element as the current view

◆ close()

virtual void Ultima::Ultima0::UIElement::close ( )
virtual

Closes the current view. The view must have been added via addView, so there's a remaining view afterwards

Reimplemented in Ultima::Ultima0::Events.

◆ getName()

Common::String Ultima::Ultima0::UIElement::getName ( ) const
inline

Returns the view name

◆ replaceView()

void Ultima::Ultima0::UIElement::replaceView ( UIElement ui,
bool  replaceAllViews = false 
)

Sets the focus to a new view

◆ addView()

void Ultima::Ultima0::UIElement::addView ( UIElement ui)

Adds a focused view to the view stack without replacing current one

◆ getRandomNumber()

int Ultima::Ultima0::UIElement::getRandomNumber ( int  minNumber,
int  maxNumber 
)

Returns a random number

◆ setBounds()

virtual void Ultima::Ultima0::UIElement::setBounds ( const Common::Rect r)
inlinevirtual

Sets the element's bounds

◆ getBounds()

Common::Rect Ultima::Ultima0::UIElement::getBounds ( ) const
inline

Gets the element's bounds

◆ getSurface()

Gfx::GfxSurface Ultima::Ultima0::UIElement::getSurface ( ) const

Returns a surface for drawing the element

◆ clearSurface()

virtual void Ultima::Ultima0::UIElement::clearSurface ( )
virtual

Clear the surface

◆ draw()

◆ tick()

virtual bool Ultima::Ultima0::UIElement::tick ( )
virtual

Called for game frame ticks

Reimplemented in Ultima::Ultima0::Events, and Ultima::Ultima0::Views::Acknowledgements.

◆ findView()

virtual UIElement* Ultima::Ultima0::UIElement::findView ( const Common::String name)
virtual

Find a view by name

◆ msgMouseMove()

virtual bool Ultima::Ultima0::UIElement::msgMouseMove ( const MouseMoveMessage msg)
inlineprotectedvirtual

Handles events

Reimplemented in Ultima::Ultima0::Events, and Ultima::Ultima0::Views::View.


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