Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

NewGuiHost Class Reference

#include <guiiconhandler.h>

Inheritance diagram for NewGuiHost:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 NewGuiHost (MainScreenWidget *parent, MapDisplayPG *mapDisplay, const PG_Rect &r)
void eval (const MapCoordinate &pos, ContainerBase *subject)
bool showSmallIcons (PG_Widget *parent, const SPoint &pos, bool cursorChanged)
bool clearSmallIcons ()
GuiButtongetButton (int i)
void disableButtons (int i)
 disables all button from i onward
bool ProcessEvent (const SDL_Event *event, bool bModal)
 Process a native PG_ event.
 ~NewGuiHost ()

Static Public Member Functions

static void pushIconHandler (GuiIconHandler *iconHandler)
static GuiIconHandlergetIconHandler ()
static void popIconHandler ()

Protected Types

typedef vector< GuiButton * > Buttons
typedef vector< SmallGuiButton * > SmallButtons

Protected Member Functions

bool mapIconProcessing (const MapCoordinate &pos, const SPoint &mousePos, bool cursorChanged, int button, int prio)
SmallGuiButtongetSmallButton (int i)
bool eventKeyDown (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.
bool eventKeyUp (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.
bool setNewButtonPressed (int i)
 when operated by keyboard, set a new button as the pressed one
void evalCursor ()

Protected Attributes

Buttons buttons
SmallButtons smallButtons

Static Protected Attributes

static SmallButtonHoldersmallButtonHolder = NULL

Member Typedef Documentation

typedef vector<GuiButton*> NewGuiHost::Buttons [protected]
 

Definition at line 161 of file guiiconhandler.h.

typedef vector<SmallGuiButton*> NewGuiHost::SmallButtons [protected]
 

Definition at line 164 of file guiiconhandler.h.


Constructor & Destructor Documentation

NewGuiHost::NewGuiHost MainScreenWidget parent,
MapDisplayPG mapDisplay,
const PG_Rect r
 

Definition at line 248 of file guiiconhandler.cpp.

References clearSmallIcons(), cursorMoved, evalCursor(), eventKeyDown(), eventKeyUp(), PG_Application::GetApp(), MainScreenWidget::lockOptionsChanged, mapIconProcessing(), MapDisplayPG::mouseButtonOnField, PG_ThemeWidget::SetTransparency(), GameMap::sigMapDeletion, and updateFieldInfo.

NewGuiHost::~NewGuiHost  ) 
 

Definition at line 682 of file guiiconhandler.cpp.

References GuiIconHandler::registerHost().


Member Function Documentation

bool NewGuiHost::clearSmallIcons  ) 
 

Definition at line 672 of file guiiconhandler.cpp.

References PG_Widget::Hide(), PG_Widget::IsVisible(), smallButtonHolder, and SmallButtonHolder::Unlock().

Referenced by NewGuiHost(), popIconHandler(), showSmallIcons(), and SmallGuiButton::SmallGuiButton().

void NewGuiHost::disableButtons int  i  ) 
 

disables all button from i onward

Definition at line 412 of file guiiconhandler.cpp.

References buttons, getButton(), PG_Widget::Hide(), and GuiButton::unregisterFunc().

Referenced by GuiIconHandler::eval(), GuiFunctions::BuildingConstruction::eval(), GuiFunctions::VehicleBuildingGui::eval(), GuiFunctions::ObjectBuildingGui::eval(), GuiFunctions::AttackGui::eval(), and GuiFunctions::BuildingConstruction::setup().

void NewGuiHost::eval const MapCoordinate pos,
ContainerBase subject
 

Definition at line 352 of file guiiconhandler.cpp.

References GuiIconHandler::eval().

void NewGuiHost::evalCursor  )  [protected]
 

Definition at line 325 of file guiiconhandler.cpp.

References actmap, DashboardPanel::eval(), GameMap::getCursor(), GameMap::getField(), MapCoordinate::valid(), MapCoordinate::x, GameMap::xsize, MapCoordinate::y, and GameMap::ysize.

Referenced by NewGuiHost().

bool NewGuiHost::eventKeyDown const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Definition at line 567 of file guiiconhandler.cpp.

References buttons, getButton(), guiIconColumnNum, PG_Widget::IsVisible(), MapDisplayPG::keyboadCursorMovement(), and setNewButtonPressed().

Referenced by NewGuiHost().

bool NewGuiHost::eventKeyUp const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from pressed to unpressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Definition at line 624 of file guiiconhandler.cpp.

References GuiButton::exec(), getButton(), MapDisplayPG::keyboadCursorMovement(), and setNewButtonPressed().

Referenced by NewGuiHost().

GuiButton * NewGuiHost::getButton int  i  ) 
 

Definition at line 400 of file guiiconhandler.cpp.

References buttons, guiIconColumnNum, guiIconSizeX, guiIconSizeY, guiIconSpace, PG_Widget::Hide(), PG_Rect::PG_Rect(), and PG_Rect::Width().

Referenced by GuiFunctions::BuildingConstruction::addButton(), GuiFunctions::VehicleBuildingGui::addButton(), GuiFunctions::ObjectBuildingGui::addButton(), disableButtons(), GuiIconHandler::eval(), GuiFunctions::BuildingConstruction::eval(), GuiFunctions::VehicleBuildingGui::eval(), GuiFunctions::ObjectBuildingGui::eval(), GuiFunctions::AttackGui::eval(), eventKeyDown(), eventKeyUp(), getSmallButton(), setNewButtonPressed(), GuiFunctions::BuildingConstruction::setup(), and showSmallIcons().

GuiIconHandler * NewGuiHost::getIconHandler  )  [static]
 

Definition at line 374 of file guiiconhandler.cpp.

References handler.

Referenced by ReplayGuiIconHandleHandler::ReplayGuiIconHandleHandler().

SmallGuiButton * NewGuiHost::getSmallButton int  i  )  [protected]
 

Definition at line 460 of file guiiconhandler.cpp.

References assert, getButton(), PG_Widget::Hide(), PG_Rect::PG_Rect(), smallButtonHolder, smallButtons, smallGuiIconSizeX, smallGuiIconSizeY, and smallGuiIconSpace.

Referenced by showSmallIcons().

bool NewGuiHost::mapIconProcessing const MapCoordinate pos,
const SPoint mousePos,
bool  cursorChanged,
int  button,
int  prio
[protected]
 

Definition at line 423 of file guiiconhandler.cpp.

References tfield::a, actmap, tfield::building, fieldvisiblenow(), GameMap::getField(), CGameOptions::Instance(), mainScreenWidget, showSmallIcons(), smallGuiIconSizeX, smallGuiIconSizeY, and tfield::vehicle.

Referenced by NewGuiHost().

void NewGuiHost::popIconHandler  )  [static]
 

Definition at line 383 of file guiiconhandler.cpp.

References assert, clearSmallIcons(), handler, iconHandlerStack, GuiIconHandler::registerHost(), and updateFieldInfo.

Referenced by GuiFunctions::ConstructBuilding::execute(), GuiFunctions::BuildingConstruction::execute(), GuiFunctions::VehicleBuildingGui::execute(), GuiFunctions::ObjectBuildingGui::execute(), GuiFunctions::AttackGui::execute(), CargoGuiFunctions::Movement::execute(), CargoDialog::~CargoDialog(), and ReplayGuiIconHandleHandler::~ReplayGuiIconHandleHandler().

bool NewGuiHost::ProcessEvent const SDL_Event *  event,
bool  bModal
[virtual]
 

Process a native PG_ event.

Parameters:
event PG_ event to process
bModal set to true if processing takes place in a modal loop
Returns:
true if the event was sucessfully processed
ProcessEvent asks the widget to process a given event. It also asks its parent and, if bModal is true, its children.

Reimplemented from PG_Widget.

Definition at line 474 of file guiiconhandler.cpp.

References PG_Widget::ProcessEvent(), SmallButtonHolder::ProcessEvent(), and smallButtonHolder.

void NewGuiHost::pushIconHandler GuiIconHandler iconHandler  )  [static]
 

Definition at line 361 of file guiiconhandler.cpp.

References handler, iconHandlerStack, GuiIconHandler::registerHost(), and updateFieldInfo.

Referenced by CargoDialog::CargoDialog(), GuiFunctions::ConstructBuilding::execute(), GuiFunctions::BuildVehicle::execute(), GuiFunctions::BuildObject::execute(), GuiFunctions::Attack::execute(), CargoGuiFunctions::Movement::execute(), ReplayGuiIconHandleHandler::ReplayGuiIconHandleHandler(), and ASC_MainScreenWidget::spawnPanel().

bool NewGuiHost::setNewButtonPressed int  i  )  [protected]
 

when operated by keyboard, set a new button as the pressed one

Definition at line 538 of file guiiconhandler.cpp.

References buttons, getButton(), PG_Button::SetPressed(), PG_Button::SetToggle(), and GuiButton::showInfoText().

Referenced by eventKeyDown(), and eventKeyUp().

bool NewGuiHost::showSmallIcons PG_Widget parent,
const SPoint pos,
bool  cursorChanged
 

Definition at line 487 of file guiiconhandler.cpp.

References PG_Widget::BringToFront(), buttons, clearSmallIcons(), getButton(), getSmallButton(), CGameOptions::Instance(), PG_Widget::IsHidden(), PG_Widget::IsMouseInside(), SmallButtonHolder::Lock(), PG_Widget::MoveWidget(), PG_Rect::null, PG_Rect::PG_Rect(), BulkGraphicUpdates::release(), PG_Widget::SetHidden(), PG_Widget::Show(), smallButtonHolder, smallGuiIconSizeX, smallGuiIconSizeY, smallGuiIconSpace, and SmallGuiButton::updateIcon().

Referenced by mapIconProcessing().


Member Data Documentation

Buttons NewGuiHost::buttons [protected]
 

Definition at line 162 of file guiiconhandler.h.

Referenced by disableButtons(), eventKeyDown(), getButton(), setNewButtonPressed(), and showSmallIcons().

SmallButtonHolder * NewGuiHost::smallButtonHolder = NULL [static, protected]
 

Definition at line 322 of file guiiconhandler.cpp.

Referenced by clearSmallIcons(), getSmallButton(), ProcessEvent(), and showSmallIcons().

SmallButtons NewGuiHost::smallButtons [protected]
 

Definition at line 165 of file guiiconhandler.h.

Referenced by getSmallButton().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:18:34 2008 for Advanced Strategic Command by  doxygen 1.4.2