Started the rest of the UI

This commit is contained in:
FrankBro 2012-01-22 00:45:03 -05:00
parent 43cebb5780
commit cb92acd0b7
3 changed files with 103 additions and 2 deletions

View File

@ -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)

View File

@ -22,6 +22,13 @@ private:
//UI Elements
ui::Button * pauseButton;
ui::Button * searchButton;
ui::Button * reloadButton;
ui::Button * saveSimulationButton;
ui::Button * downVoteButton;
ui::Button * upVoteButton;
ui::Button * tagSimulationButton;
ui::Button * displayModeButton;
public:
GameView();
void AttachController(GameController * _c){ c = _c; }

View File

@ -107,12 +107,12 @@ SearchView::~SearchView()
void SearchView::NotifySortChanged(SearchModel * sender)
{
sortButton->SetText("Sort: "+sender->GetSort());
sortButton->SetText("Sort: "+sender->GetSort());
}
void SearchView::NotifyShowOwnChanged(SearchModel * sender)
{
sortButton->SetToggleState(sender->GetShowOwn());
sortButton->SetToggleState(sender->GetShowOwn());
}
void SearchView::NotifyPageChanged(SearchModel * sender)