ScummVM API documentation
MM::MM1::UIElement Class Reference

#include <events.h>

Inheritance diagram for MM::MM1::UIElement:
MM::MM1::Events MM::MM1::Views::TextView MM::MM1::Views::Title MM::MM1::ViewsEnh::Map MM::MM1::ViewsEnh::TextView MM::MM1::MM1Engine MM::MM1::Game::ViewBase MM::MM1::Views::AreYouReady MM::MM1::Views::Bash MM::MM1::Views::CharacterBase MM::MM1::Views::Characters MM::MM1::Views::ColorQuestions MM::MM1::Views::Combat MM::MM1::Views::CreateCharacters MM::MM1::Views::Dead MM::MM1::Views::Encounter MM::MM1::Views::Game MM::MM1::Views::GameCommands MM::MM1::Views::GameMessages MM::MM1::Views::GameParty MM::MM1::Views::Interactions::Alamar MM::MM1::Views::Interactions::Alien MM::MM1::Views::Interactions::AnswerEntry MM::MM1::Views::Interactions::Arenko MM::MM1::Views::Interactions::Arrested MM::MM1::Views::Interactions::DogStatue MM::MM1::Views::Interactions::Ghost MM::MM1::Views::Interactions::Giant MM::MM1::Views::Interactions::Gypsy MM::MM1::Views::Interactions::Hacker MM::MM1::Views::Interactions::Inspectron MM::MM1::Views::Interactions::Keeper MM::MM1::Views::Interactions::Leprechaun MM::MM1::Views::Interactions::LordArcher MM::MM1::Views::Interactions::LordIronfist MM::MM1::Views::Interactions::Prisoner MM::MM1::Views::Interactions::Resistances MM::MM1::Views::Interactions::VirginPrisoner MM::MM1::Views::Interactions::WonGame MM::MM1::Views::Locations::Inn MM::MM1::Views::Locations::Location MM::MM1::Views::MainMenu MM::MM1::Views::Order MM::MM1::Views::Protect MM::MM1::Views::Rest MM::MM1::Views::Search MM::MM1::Views::Spells::SpellView MM::MM1::Views::TextEntry MM::MM1::Views::Trap MM::MM1::Views::Unlock MM::MM1::Views::WheelSpin MM::MM1::ViewsEnh::ButtonContainer MM::MM1::ViewsEnh::Game MM::MM1::ViewsEnh::Title MM::MM1::ViewsEnh::GameParty MM::MM1::ViewsEnh::ScrollView MM::MM1::ViewsEnh::TextEntry

Public Member Functions

 UIElement (const Common::String &name, UIElement *uiParent)
 
bool needsRedraw () const
 
void redraw ()
 
void focus ()
 
virtual void close ()
 
bool isFocused () 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)
 
Common::String getName () const
 
virtual void setBounds (const Common::Rect &r)
 
Common::Rect getBounds () const
 
Graphics::ManagedSurface getSurface () const
 
virtual void clearSurface ()
 
virtual void draw ()
 
virtual bool tick ()
 
virtual UIElementfindView (const Common::String &name)
 
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 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 HeaderMessage &msg)
 
bool send (const HeaderMessage &msg)
 
bool send (const Common::String &viewName, const InfoMessage &msg)
 
bool send (const InfoMessage &msg)
 
bool send (const Common::String &viewName, const DrawGraphicMessage &msg)
 
bool send (const DrawGraphicMessage &msg)
 

Protected Member Functions

Common::Rect getLineBounds (int line1, int line2) const
 
void delaySeconds (uint seconds)
 
void delayFrames (uint frames)
 
bool isDelayActive () const
 
void cancelDelay ()
 
bool endDelay ()
 
virtual void timeout ()
 
virtual bool msgFocus (const FocusMessage &e)
 
virtual bool msgUnfocus (const UnfocusMessage &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 msgHeader (const HeaderMessage &e)
 
virtual bool msgInfo (const InfoMessage &e)
 
virtual bool msgDrawGraphic (const DrawGraphicMessage &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 MM::MM1::UIElement::delaySeconds ( uint  seconds)
protected

Set a delay countdown in seconds

◆ delayFrames()

void MM::MM1::UIElement::delayFrames ( uint  frames)
protected

Set a delay countdown in frames

◆ isDelayActive()

bool MM::MM1::UIElement::isDelayActive ( ) const
inlineprotected

Returns true if a delay is active

◆ cancelDelay()

void MM::MM1::UIElement::cancelDelay ( )
inlineprotected

Cancels any active delay

◆ endDelay()

bool MM::MM1::UIElement::endDelay ( )
protected

Ends an active delay and calls timeout

◆ timeout()

◆ needsRedraw()

bool MM::MM1::UIElement::needsRedraw ( ) const
inline

Returns true if the elements needs to be redrawn

◆ redraw()

void MM::MM1::UIElement::redraw ( )

Sets that the element needs to be redrawn

◆ focus()

void MM::MM1::UIElement::focus ( )

Focuses the element as the current view

◆ close()

virtual void MM::MM1::UIElement::close ( )
virtual

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

Reimplemented in MM::MM1::Events, and MM::MM1::ViewsEnh::SelectNumberSubview.

◆ replaceView()

void MM::MM1::UIElement::replaceView ( UIElement ui,
bool  replaceAllViews = false 
)

Sets the focus to a new view

◆ addView()

void MM::MM1::UIElement::addView ( UIElement ui)

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

◆ getRandomNumber()

int MM::MM1::UIElement::getRandomNumber ( int  minNumber,
int  maxNumber 
)

Returns a random number

◆ getName()

Common::String MM::MM1::UIElement::getName ( ) const
inline

Gets the element's name

◆ setBounds()

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

Sets the element's bounds

Reimplemented in MM::MM1::ViewsEnh::ScrollText.

◆ getBounds()

Common::Rect MM::MM1::UIElement::getBounds ( ) const
inline

Gets the element's bounds

◆ getSurface()

Graphics::ManagedSurface MM::MM1::UIElement::getSurface ( ) const

Returns a surface for drawing the element

◆ clearSurface()

virtual void MM::MM1::UIElement::clearSurface ( )
virtual

Clear the surface

Reimplemented in MM::MM1::ViewsEnh::TextView, and MM::MM1::Views::TextView.

◆ draw()

virtual void MM::MM1::UIElement::draw ( )
virtual

Draws the element

Reimplemented in MM::MM1::Events, MM::MM1::ViewsEnh::Combat, MM::MM1::Views::Combat, MM::MM1::ViewsEnh::ScrollView, MM::MM1::ViewsEnh::CreateCharacters, MM::MM1::ViewsEnh::CharacterInventory, MM::MM1::ViewsEnh::Interactions::Interaction, MM::MM1::ViewsEnh::ButtonContainer, MM::MM1::ViewsEnh::Encounter, MM::MM1::Views::CreateCharacters, MM::MM1::Views::Encounter, MM::MM1::Views::Interactions::VirginPrisoner, MM::MM1::ViewsEnh::CharacterInfo, MM::MM1::ViewsEnh::ScrollText, MM::MM1::Views::CharacterInfo, MM::MM1::ViewsEnh::Search, MM::MM1::ViewsEnh::Locations::Location, MM::MM1::Views::Locations::Location, MM::MM1::Views::Search, MM::MM1::ViewsEnh::ItemsView, MM::MM1::Views::Spells::CastSpell, MM::MM1::ViewsEnh::Locations::BlacksmithItems, MM::MM1::Views::Locations::Training, MM::MM1::ViewsEnh::Spells::CastSpell, MM::MM1::ViewsEnh::GameView, MM::MM1::ViewsEnh::Spells::Spellbook, MM::MM1::ViewsEnh::PartyView, MM::MM1::Views::Spells::Teleport, MM::MM1::ViewsEnh::Spells::Teleport, MM::MM1::ViewsEnh::Trade, MM::MM1::Views::GameView, MM::MM1::Views::Title, MM::MM1::ViewsEnh::CharacterManage, MM::MM1::ViewsEnh::Locations::Training, MM::MM1::ViewsEnh::YesNo, MM::MM1::Views::Spells::Fly, MM::MM1::ViewsEnh::Spells::Fly, MM::MM1::Views::Locations::Temple, MM::MM1::Views::Bash, MM::MM1::Views::Locations::Tavern, MM::MM1::ViewsEnh::MainMenu, MM::MM1::ViewsEnh::CharacterBase, MM::MM1::ViewsEnh::Interactions::Resistances, MM::MM1::Views::Locations::Market, MM::MM1::Views::Spells::Duplication, MM::MM1::Views::TextEntry, MM::MM1::ViewsEnh::CharacterSelect, MM::MM1::ViewsEnh::Interactions::InteractionQuery, MM::MM1::ViewsEnh::TextEntry, MM::MM1::ViewsEnh::WhoWillTry, MM::MM1::ViewsEnh::Locations::Tavern, MM::MM1::Views::CharacterBase, MM::MM1::Views::Locations::Inn, MM::MM1::ViewsEnh::Locations::Market, MM::MM1::Views::Interactions::AnswerEntry, MM::MM1::ViewsEnh::GameParty, MM::MM1::ViewsEnh::Locations::Inn, MM::MM1::ViewsEnh::Locations::Temple, MM::MM1::Views::Locations::Blacksmith, MM::MM1::Views::Interactions::VolcanoGod, MM::MM1::Views::Spells::DetectMagic, MM::MM1::Views::Spells::RechargeItem, MM::MM1::Views::Game, MM::MM1::Views::Spells::Location, MM::MM1::ViewsEnh::Game, MM::MM1::ViewsEnh::GameMessages, MM::MM1::ViewsEnh::QuickRef, MM::MM1::Views::Interactions::Prisoner, MM::MM1::ViewsEnh::Exchange, MM::MM1::ViewsEnh::SelectNumberSubview, MM::MM1::Views::Interactions::Gypsy, MM::MM1::Views::Locations::BlacksmithSellItem, MM::MM1::Views::Trap, MM::MM1::ViewsEnh::Trap, MM::MM1::Views::CharacterViewCombat, MM::MM1::Views::Characters, MM::MM1::Views::QuickRef, MM::MM1::ViewsEnh::Confirm, MM::MM1::Views::CharacterManage, MM::MM1::Views::GameMessages, MM::MM1::Views::Interactions::Trivia, MM::MM1::ViewsEnh::CharacterView, MM::MM1::ViewsEnh::Characters, MM::MM1::ViewsEnh::ColorQuestions, MM::MM1::ViewsEnh::Rest, MM::MM1::Views::ColorQuestions, MM::MM1::Views::Dead, MM::MM1::Views::Interactions::AccessCode, MM::MM1::Views::Interactions::Arrested, MM::MM1::Views::Interactions::Giant, MM::MM1::Views::Interactions::Leprechaun, MM::MM1::Views::Order, MM::MM1::Views::Rest, MM::MM1::Views::Interactions::Arenko, MM::MM1::Views::Interactions::Chess, MM::MM1::Views::Interactions::Resistances, MM::MM1::Views::Unlock, MM::MM1::Views::CharacterView, MM::MM1::Views::Interactions::Alamar, MM::MM1::Views::Interactions::DogStatue, MM::MM1::Views::Interactions::Hacker, MM::MM1::Views::Interactions::IcePrincess, MM::MM1::Views::Interactions::Inspectron, MM::MM1::Views::Interactions::Keeper, MM::MM1::Views::Interactions::Lion, MM::MM1::Views::Interactions::LordIronfist, MM::MM1::Views::Interactions::Orango, MM::MM1::Views::Interactions::Ruby, MM::MM1::Views::Locations::Statue, MM::MM1::ViewsEnh::Map, MM::MM1::ViewsEnh::Unlock, MM::MM1::ViewsEnh::WhichCharacter, MM::MM1::Views::Locations::BlacksmithBuyWeapons, MM::MM1::Views::Protect, MM::MM1::ViewsEnh::MapPopup, MM::MM1::ViewsEnh::Spells::DetectMagic, MM::MM1::ViewsEnh::WhichItem, MM::MM1::Views::Interactions::LordArcher, MM::MM1::Views::Locations::BlacksmithBuyArmor, MM::MM1::Views::Locations::BlacksmithBuyMisc, MM::MM1::Views::WheelSpin, MM::MM1::ViewsEnh::Spells::Location, MM::MM1::ViewsEnh::WheelSpin, MM::MM1::Views::Interactions::Alien, MM::MM1::Views::Interactions::Ghost, MM::MM1::Views::Interactions::WonGame, MM::MM1::Views::MainMenu, MM::MM1::ViewsEnh::Dead, MM::MM1::ViewsEnh::Locations::Blacksmith, MM::MM1::Views::AreYouReady, MM::MM1::Views::GameCommands, MM::MM1::Views::GameParty, MM::MM1::ViewsEnh::Protect, and MM::MM1::ViewsEnh::WonGame.

◆ tick()

virtual bool MM::MM1::UIElement::tick ( )
virtual

◆ findView()

virtual UIElement* MM::MM1::UIElement::findView ( const Common::String name)
virtual

Find a view by name


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