ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Got::UIElement Class Reference

#include <events.h>

Inheritance diagram for Got::UIElement:
Got::Events Got::Views::View Got::GotEngine Got::Views::Credits Got::Views::Dialogs::Dialog Got::Views::Game Got::Views::GameContent Got::Views::GameStatus Got::Views::Opening Got::Views::PartTitle Got::Views::SplashScreen Got::Views::Story Got::Views::TitleBackground

Public Member Functions

 UIElement (const Common::String &name, UIElement *uiParent)
 
 UIElement (const Common::String &name)
 
bool needsRedraw () const
 
void redraw ()
 
virtual void close ()
 
virtual void replaceView (UIElement *ui, bool replaceAllViews=false, bool fadeOutIn=false)
 
virtual void replaceView (const Common::String &name, bool replaceAllViews=false, bool fadeOutIn=false)
 
virtual void addView (UIElement *ui)
 
virtual 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
 
const Common::StringgetName () const
 
Gfx::GfxSurface getSurface (bool innerBounds=false) const
 
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

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

◆ isDelayActive()

bool Got::UIElement::isDelayActive ( ) const
inlineprotected

Returns true if a delay is active

◆ cancelDelay()

void Got::UIElement::cancelDelay ( )
inlineprotected

Cancels any active delay

◆ timeout()

virtual void Got::UIElement::timeout ( )
protectedvirtual

Called when an active timeout countdown expired

◆ needsRedraw()

bool Got::UIElement::needsRedraw ( ) const
inline

Returns true if the elements needs to be redrawn

◆ redraw()

void Got::UIElement::redraw ( )

Sets that the element needs to be redrawn

◆ close()

virtual void Got::UIElement::close ( )
virtual

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

Reimplemented in Got::Events.

◆ replaceView()

virtual void Got::UIElement::replaceView ( UIElement ui,
bool  replaceAllViews = false,
bool  fadeOutIn = false 
)
virtual

Sets the focus to a new view

Reimplemented in Got::Events.

◆ addView()

virtual void Got::UIElement::addView ( UIElement ui)
virtual

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

Reimplemented in Got::Events.

◆ getRandomNumber()

int Got::UIElement::getRandomNumber ( int  minNumber,
int  maxNumber 
)

Returns a random number

◆ setBounds()

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

Sets the element's bounds

◆ getBounds()

Common::Rect Got::UIElement::getBounds ( ) const
inline

Gets the element's bounds

◆ getName()

const Common::String& Got::UIElement::getName ( ) const
inline

Gets a view's name

◆ getSurface()

Gfx::GfxSurface Got::UIElement::getSurface ( bool  innerBounds = false) const

Returns a surface for drawing the element

◆ draw()

◆ tick()

◆ findView()

virtual UIElement* Got::UIElement::findView ( const Common::String name)
virtual

Find a view by name

◆ msgMouseMove()

virtual bool Got::UIElement::msgMouseMove ( const MouseMoveMessage msg)
inlineprotectedvirtual

Handles events

Reimplemented in Got::Events, and Got::Views::View.


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