diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-08 13:35:27 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-08 13:35:27 (GMT) |
| commit | 10e82df5434c086c2afc3627e5cdf7b88205487f (patch) | |
| tree | 50fa2561d17305530cf4384c7d75dd4b84fd8129 /src/options/OptionsView.cpp | |
| parent | 152bc8f0924a4502fe6013b1d9957ffe9df8316f (diff) | |
| download | powder-10e82df5434c086c2afc3627e5cdf7b88205487f.zip powder-10e82df5434c086c2afc3627e5cdf7b88205487f.tar.gz | |
Fullscreen and scale setting from sim options
Diffstat (limited to 'src/options/OptionsView.cpp')
| -rw-r--r-- | src/options/OptionsView.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/options/OptionsView.cpp b/src/options/OptionsView.cpp index 002bc8d..cd4e319 100644 --- a/src/options/OptionsView.cpp +++ b/src/options/OptionsView.cpp @@ -12,7 +12,7 @@ #include "interface/DropDown.h" OptionsView::OptionsView(): - ui::Window(ui::Point(-1, -1), ui::Point(300, 226)){ + ui::Window(ui::Point(-1, -1), ui::Point(300, 266)){ ui::Label * tempLabel = new ui::Label(ui::Point(4, 5), ui::Point(Size.X-8, 14), "Simulation Options"); tempLabel->SetTextColour(style::Colour::InformationTitle); @@ -136,6 +136,29 @@ OptionsView::OptionsView(): tempLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; tempLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; AddComponent(tempLabel); + class ScaleAction: public ui::CheckboxAction + { + OptionsView * v; + public: + ScaleAction(OptionsView * v_){ v = v_; } + virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetScale(sender->GetChecked()); } + }; + + scale = new ui::Checkbox(ui::Point(8, 206), ui::Point(Size.X-6, 16), "Large screen"); + scale->SetActionCallback(new ScaleAction(this)); + AddComponent(scale); + + class FullscreenAction: public ui::CheckboxAction + { + OptionsView * v; + public: + FullscreenAction(OptionsView * v_){ v = v_; } + virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFullscreen(sender->GetChecked()); } + }; + + fullscreen = new ui::Checkbox(ui::Point(8, 226), ui::Point(Size.X-6, 16), "Fullscreen"); + fullscreen->SetActionCallback(new FullscreenAction(this)); + AddComponent(fullscreen); class CloseAction: public ui::ButtonAction { @@ -164,6 +187,8 @@ void OptionsView::NotifySettingsChanged(OptionsModel * sender) airMode->SetOption(sender->GetAirMode()); gravityMode->SetOption(sender->GetGravityMode()); edgeMode->SetOption(sender->GetEdgeMode()); + scale->SetChecked(sender->GetScale()); + fullscreen->SetChecked(sender->GetFullscreen()); } void OptionsView::AttachController(OptionsController * c_) |
