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

StoringPosition Class Reference

#include <cargowidget.h>

Inheritance diagram for StoringPosition:

Inheritance graph
[legend]
List of all members.

Public Types

enum  DragTarget { NoDragging, TargetAvail, TargetNotAvail }

Public Member Functions

void setDragTarget (DragTarget dragTarget)
VehiclegetUnit ()
 StoringPosition (PG_Widget *parent, const PG_Point &pos, const PG_Point &unitPos, HighLightingManager &highLightingManager, const ContainerBase::Cargo &storageVector, int number, bool regularPosition, CargoWidget *cargoWidget=NULL)

Static Public Member Functions

static vector< StoringPosition * > setup (PG_Widget *parent, ContainerBase *container, HighLightingManager &highLightingManager, int &unitColumnCount)

Protected Member Functions

void markChanged (int old, int mark)
void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen
void setBargraphValue (const ASCString &widgetName, float fraction)
bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.
bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.
bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.

Protected Attributes

DragTarget dragTarget

Member Enumeration Documentation

enum StoringPosition::DragTarget
 

Enumeration values:
NoDragging 
TargetAvail 
TargetNotAvail 

Definition at line 75 of file cargowidget.h.


Constructor & Destructor Documentation

StoringPosition::StoringPosition PG_Widget parent,
const PG_Point pos,
const PG_Point unitPos,
HighLightingManager highLightingManager,
const ContainerBase::Cargo storageVector,
int  number,
bool  regularPosition,
CargoWidget cargoWidget = NULL
 

Definition at line 75 of file cargowidget.cpp.

References Surface::createSurface(), fieldsizex, fieldsizey, PG_Rect::Height(), markChanged(), HighLightingManager::markChanged, HighLightingManager::redrawAll, PG_Widget::Update(), PG_Rect::Width(), PG_Point::x, and PG_Point::y.

Referenced by setup().


Member Function Documentation

void StoringPosition::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_Widget.

Definition at line 100 of file cargowidget.cpp.

References MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), PG_Draw::BlitSurface(), ContainerBase::damage, dragTarget, Surface::getBaseSurface(), IconRepository::getIcon(), HighLightingManager::getMark(), ContainerBase::getResource(), PG_Application::GetScreen(), ContainerBase::getStorageCapacity(), maxint, NoDragging, setBargraphValue(), TargetAvail, PG_Point::x, and PG_Point::y.

bool StoringPosition::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent 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 150 of file cargowidget.cpp.

References HighLightingManager::clickOnMarkedUnit, CargoWidget::dragNdropEnabled(), PG_Application::GetEventSupplier(), HighLightingManager::getMark(), getUnit(), CGameOptions::Instance(), PG_MessageObject::SetCapture(), HighLightingManager::setNew(), PG_Point::x, and PG_Point::y.

bool StoringPosition::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent 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 201 of file cargowidget.cpp.

References PG_Widget::FindWidgetFromPos(), PG_Application::GetEventSupplier(), getUnit(), PG_Application::HARDWARE, PG_MessageObject::ReleaseCapture(), CargoWidget::releaseDrag(), and PG_Application::ShowCursor().

bool StoringPosition::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent 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 234 of file cargowidget.cpp.

References MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), Surface::createSurface(), fieldsizex, fieldsizey, Surface::getBaseSurface(), IconRepository::getIcon(), ContainerBase::getOwner(), getUnit(), PG_Application::SetCursor(), PG_Application::ShowCursor(), PG_Application::SOFTWARE, square, PG_Point::x, and PG_Point::y.

Vehicle * StoringPosition::getUnit  ) 
 

Definition at line 266 of file cargowidget.cpp.

Referenced by eventMouseButtonDown(), eventMouseButtonUp(), and eventMouseMotion().

void StoringPosition::markChanged int  old,
int  mark
[protected]
 

Definition at line 51 of file cargowidget.cpp.

References PG_Widget::Update().

Referenced by StoringPosition().

void StoringPosition::setBargraphValue const ASCString widgetName,
float  fraction
[protected]
 

Definition at line 92 of file cargowidget.cpp.

References PG_Widget::FindChild(), and BarGraphWidget::setFraction().

Referenced by eventBlit().

void StoringPosition::setDragTarget DragTarget  dragTarget  )  [inline]
 

Definition at line 80 of file cargowidget.h.

vector< StoringPosition * > StoringPosition::setup PG_Widget parent,
ContainerBase container,
HighLightingManager highLightingManager,
int &  unitColumnCount
[static]
 

Definition at line 275 of file cargowidget.cpp.

References ContainerBase::baseType, ContainerBase::getCargo(), ContainerBaseType::maxLoadableUnits, and StoringPosition().

Referenced by CargoWidget::CargoWidget().


Member Data Documentation

DragTarget StoringPosition::dragTarget [protected]
 

Definition at line 77 of file cargowidget.h.

Referenced by eventBlit().


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