diff options
| author | FrankBro <brodeur_francois@hotmail.com> | 2012-01-22 05:45:03 (GMT) |
|---|---|---|
| committer | FrankBro <brodeur_francois@hotmail.com> | 2012-01-22 05:45:03 (GMT) |
| commit | cb92acd0b7dd9e958330a9b8e3c4b302f236542c (patch) | |
| tree | 4e7ee00df28ba5398defe25697e0e3528115bb81 /src/game/GameView.cpp | |
| parent | 43cebb5780ecb3baf4c5ae8207f62287f9aa9844 (diff) | |
| download | powder-cb92acd0b7dd9e958330a9b8e3c4b302f236542c.zip powder-cb92acd0b7dd9e958330a9b8e3c4b302f236542c.tar.gz | |
Started the rest of the UI
Diffstat (limited to 'src/game/GameView.cpp')
| -rw-r--r-- | src/game/GameView.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 2fbed31..336acf9 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -39,6 +39,100 @@ GameView::GameView(): searchButton->SetTogglable(false); searchButton->SetActionCallback(new SearchAction(this)); AddComponent(searchButton); + + class ReloadAction : public ui::ButtonAction + { + GameView * v; + public: + ReloadAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + reloadButton = new ui::Button(ui::Point(16, Size.Y-18), ui::Point(16, 16), "\x91"); // TODO Position? + reloadButton->SetTogglable(false); + reloadButton->SetActionCallback(new ReloadAction(this)); + AddComponent(reloadButton); + + class SaveSimulationAction : public ui::ButtonAction + { + GameView * v; + public: + SaveSimulationAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + saveSimulationButton = new ui::Button(ui::Point(32, Size.Y-18), ui::Point(152, 16), "\x82"); // TODO All arguments + saveSimulationButton->SetTogglable(false); + saveSimulationButton->SetActionCallback(new SaveSimulationAction(this)); + AddComponent(saveSimulationButton); + + class UpVoteAction : public ui::ButtonAction + { + GameView * v; + public: + UpVoteAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + upVoteButton = new ui::Button(ui::Point(184, Size.Y-18), ui::Point(16, 16), "\xCB"); // TODO All arguments + upVoteButton->SetTogglable(false); + upVoteButton->SetActionCallback(new UpVoteAction(this)); + AddComponent(upVoteButton); + + class DownVoteAction : public ui::ButtonAction + { + GameView * v; + public: + DownVoteAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + downVoteButton = new ui::Button(ui::Point(200, Size.Y-18), ui::Point(16, 16), "\xCA"); // TODO All arguments + downVoteButton->SetTogglable(false); + downVoteButton->SetActionCallback(new DownVoteAction(this)); + AddComponent(downVoteButton); + + class TagSimulationAction : public ui::ButtonAction + { + GameView * v; + public: + TagSimulationAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + tagSimulationButton = new ui::Button(ui::Point(216, Size.Y-18), ui::Point(152, 16), "\x83"); // TODO All arguments + tagSimulationButton->SetTogglable(false); + tagSimulationButton->SetActionCallback(new TagSimulationAction(this)); + AddComponent(tagSimulationButton); + + //simul option + //erase all + // login + + class DisplayModeAction : public ui::ButtonAction + { + GameView * v; + public: + DisplayModeAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->SetPaused(sender->GetToggleState()); // TODO call proper function + } + }; + displayModeButton = new ui::Button(ui::Point(Size.X-34, Size.Y-18), ui::Point(16, 16), "\xDA"); // TODO All arguments + displayModeButton->SetTogglable(true); + displayModeButton->SetActionCallback(new DisplayModeAction(this)); + AddComponent(displayModeButton); } void GameView::NotifyRendererChanged(GameModel * sender) |
