#include <GameToolBar.h>
Inheritance diagram for CGameToolBar:
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 |
Definition at line 21 of file GameToolBar.h.
CGameToolBar::CGameToolBar | ( | ) |
Constructor
Definition at line 16 of file GameToolBar.cpp.
References GlobalGameControlData::notPenalized.
CGameToolBar::DECLARE_DYNAMIC | ( | CGameToolBar | ) | [private] |
bool CGameToolBar::handleCommand | ( | UINT | command | ) | [virtual] |
Handles control notifications which arrived in the main frame
command | The id of the control, menu, accelerator etc. |
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.
nID | the command id of the combo box |
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.
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.
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.
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.
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().