#include <events.h>
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 UIElement * | findView (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 |
User interface element
|
protected |
Set a delay countdown in seconds
|
protected |
Set a delay countdown in frames
|
inlineprotected |
Returns true if a delay is active
|
inlineprotected |
Cancels any active delay
|
protected |
Ends an active delay and calls timeout
|
protectedvirtual |
Called when an active timeout countdown expired
Reimplemented in MM::MM1::ViewsEnh::Combat, MM::MM1::Views::Combat, MM::MM1::ViewsEnh::Encounter, MM::MM1::Views::Encounter, MM::MM1::Views::TextView, MM::MM1::ViewsEnh::Search, MM::MM1::Views::CharacterInfo, MM::MM1::ViewsEnh::ItemsView, MM::MM1::Views::Search, MM::MM1::Views::Spells::CastSpell, MM::MM1::ViewsEnh::CharacterInfo, MM::MM1::ViewsEnh::Spells::Fly, MM::MM1::Views::Title, MM::MM1::Views::Locations::Training, MM::MM1::Views::Locations::Market, MM::MM1::ViewsEnh::Interactions::Giant, MM::MM1::ViewsEnh::Interactions::Prisoner, MM::MM1::ViewsEnh::GameMessages, MM::MM1::Views::Spells::SpellView, MM::MM1::Views::Interactions::Prisoner, MM::MM1::Views::Trap, MM::MM1::ViewsEnh::Trap, MM::MM1::Views::GameMessages, MM::MM1::Views::Rest, MM::MM1::ViewsEnh::ColorQuestions, MM::MM1::ViewsEnh::Rest, MM::MM1::Views::ColorQuestions, MM::MM1::Views::Interactions::Giant, and MM::MM1::ViewsEnh::Locations::Location.
|
inline |
Returns true if the elements needs to be redrawn
void MM::MM1::UIElement::redraw | ( | ) |
Sets that the element needs to be redrawn
void MM::MM1::UIElement::focus | ( | ) |
Focuses the element as the current view
|
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.
void MM::MM1::UIElement::replaceView | ( | UIElement * | ui, |
bool | replaceAllViews = false |
||
) |
Sets the focus to a new view
void MM::MM1::UIElement::addView | ( | UIElement * | ui | ) |
Adds a focused view to the view stack without replacing current one
int MM::MM1::UIElement::getRandomNumber | ( | int | minNumber, |
int | maxNumber | ||
) |
Returns a random number
|
inline |
Gets the element's name
|
inlinevirtual |
Sets the element's bounds
Reimplemented in MM::MM1::ViewsEnh::ScrollText.
|
inline |
Gets the element's bounds
Graphics::ManagedSurface MM::MM1::UIElement::getSurface | ( | ) | const |
Returns a surface for drawing the element
|
virtual |
Clear the surface
Reimplemented in MM::MM1::ViewsEnh::TextView, and MM::MM1::Views::TextView.
|
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.
|
virtual |
Called for game frame ticks
Reimplemented in MM::MM1::Events, MM::MM1::ViewsEnh::Interactions::Interaction, MM::MM1::ViewsEnh::Locations::Location, and MM::MM1::ViewsEnh::GameView.
|
virtual |
Find a view by name