CGameToolBar Class Reference

#include <GameToolBar.h>

Inheritance diagram for CGameToolBar:

CRobotControlToolBar CToolBarEx List of all members.

Public Member Functions

 CGameToolBar ()
virtual void Init ()
virtual bool handleCommand (UINT command)
virtual bool handleSelChange (UINT nID)
virtual bool HasButtonText (UINT nID)
virtual void updateUI (CCmdUI *pCmdUI)
virtual void OnIdle ()

Private Member Functions

 DECLARE_DYNAMIC (CGameToolBar)
void send ()

Private Attributes

CComboBox redScoreCombo
CComboBox blueScoreCombo
CSliderCtrl gameSpeedSlider
GlobalGameControlData globalGameControlData
int lastGameSpeedSliderPosition

Detailed Description

A toolbar that simulates the RoboCupGameManager by Sony.

Definition at line 21 of file GameToolBar.h.


Constructor & Destructor Documentation

CGameToolBar::CGameToolBar (  ) 

Constructor

Definition at line 16 of file GameToolBar.cpp.

References GlobalGameControlData::notPenalized.


Member Function Documentation

CGameToolBar::DECLARE_DYNAMIC ( CGameToolBar   )  [private]

bool CGameToolBar::handleCommand ( UINT  command  )  [virtual]

Handles control notifications which arrived in the main frame

Parameters:
command The id of the control, menu, accelerator etc.
Returns:
If the command was handled.

Reimplemented from CRobotControlToolBar.

Definition at line 123 of file GameToolBar.cpp.

References GlobalGameControlData::blueScore, blueScoreCombo, GlobalGameControlData::finished, globalGameControlData, IDC_GAME_BLUE_GOAL, IDC_GAME_FINISHED, IDC_GAME_INITIAL, IDC_GAME_KICKOFF_BLUE, IDC_GAME_KICKOFF_RED, IDC_GAME_PENALIZED, IDC_GAME_PLAYING, IDC_GAME_READY, IDC_GAME_RED_GOAL, IDC_GAME_SET, GlobalGameControlData::initial, GlobalGameControlData::kickoff, GlobalGameControlData::kickoffBlueTeam, GlobalGameControlData::kickoffRedTeam, GlobalGameControlData::penalized, GlobalGameControlData::playing, GlobalGameControlData::ready, GlobalGameControlData::redScore, redScoreCombo, send(), GlobalGameControlData::set, and GlobalGameControlData::state.

bool CGameToolBar::handleSelChange ( UINT  nID  )  [virtual]

Handles selection change events for combo boxes. That function must be called from the main frame window for all combo boxes of the toolbar.

Parameters:
nID the command id of the combo box
Returns:
if the message was handled

Reimplemented from CRobotControlToolBar.

Definition at line 178 of file GameToolBar.cpp.

References GlobalGameControlData::blueScore, blueScoreCombo, globalGameControlData, IDC_GAME_BLUE_SCORE, IDC_GAME_RED_SCORE, GlobalGameControlData::redScore, redScoreCombo, and send().

bool CGameToolBar::HasButtonText ( UINT  nID  )  [virtual]

Determines if the buttons have a text

Reimplemented from CRobotControlToolBar.

Definition at line 70 of file GameToolBar.cpp.

References IDC_GAME_SPEED.

void CGameToolBar::Init (  )  [virtual]

Initializes the tool bar

Implements CRobotControlToolBar.

Definition at line 25 of file GameToolBar.cpp.

References CToolBarEx::AddCombo(), CToolBarEx::AddSlider(), blueScoreCombo, gameSpeedSlider, IDB_GAME, IDB_GAME_COLD, IDC_GAME_BLUE_GOAL, IDC_GAME_BLUE_SCORE, IDC_GAME_FINISHED, IDC_GAME_INITIAL, IDC_GAME_KICKOFF_BLUE, IDC_GAME_KICKOFF_RED, IDC_GAME_PENALIZED, IDC_GAME_PLAYING, IDC_GAME_READY, IDC_GAME_RED_GOAL, IDC_GAME_RED_SCORE, IDC_GAME_SET, IDC_GAME_SPEED, lastGameSpeedSliderPosition, redScoreCombo, CToolBarEx::SetBitmaps(), and CToolBarEx::SetButtons().

void CGameToolBar::OnIdle (  )  [virtual]

Should be called when the application is idle to check the position of the slider

Reimplemented from CRobotControlToolBar.

Definition at line 195 of file GameToolBar.cpp.

References CRobotControlQueuesToRobots::allRobots, OutMessage::bin, OutMessage::finishMessage(), gameSpeedSlider, getQueues(), idGameSpeed, lastGameSpeedSliderPosition, MessageQueue::out, CRobotControlQueues::toPhysical, and CRobotControlQueues::toSimulated.

void CGameToolBar::send (  )  [private]

Sends gameControlData to the queues

Definition at line 79 of file GameToolBar.cpp.

References CRobotControlQueuesToRobots::allRobots, OutMessage::bin, OutMessage::finishMessage(), getQueues(), globalGameControlData, idGlobalGameControlData, MessageQueue::out, CRobotControlQueues::toPhysical, and CRobotControlQueues::toSimulated.

Referenced by handleCommand(), and handleSelChange().

void CGameToolBar::updateUI ( CCmdUI *  pCmdUI  )  [virtual]

Enables the controls in the toolbar. This function is called from the main window for all controls.

Parameters:
pCmdUI An interface to the control that allows enabling/disabling, checking etc.

Reimplemented from CRobotControlToolBar.

Definition at line 88 of file GameToolBar.cpp.

References FALSE, GlobalGameControlData::finished, globalGameControlData, IDC_GAME_FINISHED, IDC_GAME_INITIAL, IDC_GAME_KICKOFF_BLUE, IDC_GAME_KICKOFF_RED, IDC_GAME_PENALIZED, IDC_GAME_PLAYING, IDC_GAME_READY, IDC_GAME_SET, GlobalGameControlData::initial, GlobalGameControlData::kickoff, GlobalGameControlData::kickoffBlueTeam, GlobalGameControlData::kickoffRedTeam, GlobalGameControlData::penalized, GlobalGameControlData::playing, GlobalGameControlData::ready, GlobalGameControlData::set, GlobalGameControlData::state, and TRUE.


Member Data Documentation

CComboBox CGameToolBar::blueScoreCombo [private]

A combo box for the blue score

Definition at line 64 of file GameToolBar.h.

Referenced by handleCommand(), handleSelChange(), and Init().

CSliderCtrl CGameToolBar::gameSpeedSlider [private]

A slider for the game speed

Definition at line 67 of file GameToolBar.h.

Referenced by Init(), and OnIdle().

GlobalGameControlData CGameToolBar::globalGameControlData [private]

The GlobalGameControlData to be sent

Definition at line 73 of file GameToolBar.h.

Referenced by handleCommand(), handleSelChange(), send(), and updateUI().

int CGameToolBar::lastGameSpeedSliderPosition [private]

The last position of the game speed slider

Definition at line 76 of file GameToolBar.h.

Referenced by Init(), and OnIdle().

CComboBox CGameToolBar::redScoreCombo [private]

A combo box for the red score

Definition at line 61 of file GameToolBar.h.

Referenced by handleCommand(), handleSelChange(), and Init().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:20:31 2006 for DT2005.panorama by  doxygen 1.4.7