GameWidget Class Reference

#include <GameWidget.h>

Inheritance diagram for GameWidget:

Gump Object List of all members.

Public Types

 GAME_PLAY = 1
 GAME_LOAD = 2
 GAME_SETTINGS = 3
 GAME_REMOVE = 4
enum  Message { GAME_PLAY = 1, GAME_LOAD = 2, GAME_SETTINGS = 3, GAME_REMOVE = 4 }

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 GameWidget (int X, int Y, Pentagram::istring &game)
virtual ~GameWidget ()
Pentagram::istring getGameName ()
virtual void InitGump (Gump *newparent, bool take_focus=true)
virtual uint16 TraceObjId (int mx, int my)
virtual void PaintThis (RenderSurface *, sint32 lerp_factor, bool scaled)
virtual GumpOnMouseDown (int button, int mx, int my)
virtual void OnMouseOver ()
virtual void OnMouseLeft ()
virtual void ChildNotify (Gump *child, uint32 message)

Protected Attributes

GameInfoinfo
bool highlight

Detailed Description

Definition at line 26 of file GameWidget.h.


Member Enumeration Documentation

enum GameWidget::Message

Enumerator:
GAME_PLAY 
GAME_LOAD 
GAME_SETTINGS 
GAME_REMOVE 

Definition at line 49 of file GameWidget.h.


Constructor & Destructor Documentation

GameWidget::GameWidget ( int  X,
int  Y,
Pentagram::istring game 
)

Definition at line 32 of file GameWidget.cpp.

References GUIApp::get_instance(), CoreApp::getGameInfo(), and info.

GameWidget::~GameWidget (  )  [virtual]

Definition at line 39 of file GameWidget.cpp.


Member Function Documentation

void GameWidget::ChildNotify ( Gump child,
uint32  message 
) [virtual]

This function is used by our children to notifty us of 'something' Think of it as a generic call back function

Reimplemented from Gump.

Definition at line 90 of file GameWidget.cpp.

References ButtonWidget::BUTTON_CLICK, Gump::ChildNotify(), Gump::GetIndex(), Gump::index, and Gump::parent.

GameWidget::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Gump.

Pentagram::istring GameWidget::getGameName (  ) 

Definition at line 44 of file GameWidget.cpp.

References info, and GameInfo::name.

Referenced by PentagramMenuGump::ChildNotify().

void GameWidget::InitGump ( Gump newparent,
bool  take_focus = true 
) [virtual]

Init the gump and add it to parent; call after construction When newparent is 0, this will call GUIApp::addGump().

Parameters:
newparent The Gump's new parent or 0.
takefocus If true, set parent's focus_child to this

Reimplemented from Gump.

Definition at line 48 of file GameWidget.cpp.

References GAME_LOAD, GAME_PLAY, GAME_REMOVE, GAME_SETTINGS, GameInfo::getGameTitle(), GameInfo::getPrintableVersion(), info, Gump::InitGump(), GameInfo::name, Gump::SetIndex(), and PentagramVersion::version.

Referenced by PentagramMenuGump::InitGump().

Gump * GameWidget::OnMouseDown ( int  button,
int  mx,
int  my 
) [virtual]

Reimplemented from Gump.

Definition at line 109 of file GameWidget.cpp.

References Gump::OnMouseDown().

void GameWidget::OnMouseLeft (  )  [virtual]

Reimplemented from Gump.

Definition at line 121 of file GameWidget.cpp.

References highlight.

void GameWidget::OnMouseOver (  )  [virtual]

Reimplemented from Gump.

Definition at line 116 of file GameWidget.cpp.

References highlight.

void GameWidget::PaintThis ( RenderSurface ,
sint32  lerp_factor,
bool  scaled 
) [virtual]

Overloadable method to Paint just this Gump (RenderSurface is relative to this).

Reimplemented from Gump.

Definition at line 127 of file GameWidget.cpp.

References RenderSurface::Blit(), RenderedText::draw(), RenderSurface::Fill32(), font, FontManager::get_instance(), PentagramMenuGump::getCovers(), PentagramMenuGump::getFlags(), Gump::GetParent(), FontManager::getTTFont(), highlight, info, GameInfo::language, and GameInfo::type.

uint16 GameWidget::TraceObjId ( int  mx,
int  my 
) [virtual]

Trace a click, and return ObjId.

Reimplemented from Gump.

Definition at line 102 of file GameWidget.cpp.

References Object::getObjId(), Object::objid, and Gump::TraceObjId().


Member Data Documentation

bool GameWidget::highlight [protected]

Definition at line 60 of file GameWidget.h.

Referenced by OnMouseLeft(), OnMouseOver(), and PaintThis().

GameInfo* GameWidget::info [protected]

Definition at line 58 of file GameWidget.h.

Referenced by GameWidget(), getGameName(), InitGump(), and PaintThis().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:17 2007 for pentagram by  doxygen 1.4.7