diff options
| author | jacob1 <jfu614@gmail.com> | 2012-10-03 22:55:19 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-10-05 15:31:04 (GMT) |
| commit | 97cea273e5d02ed13d674ec8cc8308afe51e54b0 (patch) | |
| tree | 3aff41d10f9f2dd08f98245369a6da70f0944693 /src/options/OptionsView.cpp | |
| parent | 71db872e6422dd264ffa00a848d3f8a76e08b279 (diff) | |
| download | powder-97cea273e5d02ed13d674ec8cc8308afe51e54b0.zip powder-97cea273e5d02ed13d674ec8cc8308afe51e54b0.tar.gz | |
Fast quit option (disable to make "X" act like in tpt)
Diffstat (limited to 'src/options/OptionsView.cpp')
| -rw-r--r-- | src/options/OptionsView.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/options/OptionsView.cpp b/src/options/OptionsView.cpp index 9811154..3adf7d7 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, 270)){ + ui::Window(ui::Point(-1, -1), ui::Point(300, 290)){ ui::Label * tempLabel = new ui::Label(ui::Point(4, 5), ui::Point(Size.X-8, 14), "Simulation Options"); tempLabel->SetTextColour(style::Colour::InformationTitle); @@ -146,8 +146,12 @@ OptionsView::OptionsView(): scale = new ui::Checkbox(ui::Point(8, 210), ui::Point(Size.X-6, 16), "Large screen", ""); scale->SetActionCallback(new ScaleAction(this)); + tempLabel = new ui::Label(ui::Point(scale->Position.X+Graphics::textwidth(scale->GetText().c_str())+20, scale->Position.Y), ui::Point(Size.X-28, 16), "\bg- Double window size for smaller screen"); + tempLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; tempLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; + AddComponent(tempLabel); AddComponent(scale); + class FullscreenAction: public ui::CheckboxAction { OptionsView * v; @@ -158,8 +162,27 @@ OptionsView::OptionsView(): fullscreen = new ui::Checkbox(ui::Point(8, 230), ui::Point(Size.X-6, 16), "Fullscreen", ""); fullscreen->SetActionCallback(new FullscreenAction(this)); + tempLabel = new ui::Label(ui::Point(fullscreen->Position.X+Graphics::textwidth(fullscreen->GetText().c_str())+20, fullscreen->Position.Y), ui::Point(Size.X-28, 16), "\bg- Use the entire screen"); + tempLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; tempLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; + AddComponent(tempLabel); AddComponent(fullscreen); + + class FastQuitAction: public ui::CheckboxAction + { + OptionsView * v; + public: + FastQuitAction(OptionsView * v_){ v = v_; } + virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFastQuit(sender->GetChecked()); } + }; + + fastquit = new ui::Checkbox(ui::Point(8, 250), ui::Point(Size.X-6, 16), "Fast Quit", ""); + fastquit->SetActionCallback(new FastQuitAction(this)); + tempLabel = new ui::Label(ui::Point(fastquit->Position.X+Graphics::textwidth(fastquit->GetText().c_str())+20, fastquit->Position.Y), ui::Point(Size.X-28, 16), "\bg- Always exit completely when hitting close"); + tempLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; tempLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; + AddComponent(tempLabel); + AddComponent(fastquit); + class CloseAction: public ui::ButtonAction { public: @@ -189,6 +212,7 @@ void OptionsView::NotifySettingsChanged(OptionsModel * sender) edgeMode->SetOption(sender->GetEdgeMode()); scale->SetChecked(sender->GetScale()); fullscreen->SetChecked(sender->GetFullscreen()); + fastquit->SetChecked(sender->GetFastQuit()); } void OptionsView::AttachController(OptionsController * c_) @@ -204,6 +228,11 @@ void OptionsView::OnDraw() g->draw_line(Position.X+1, Position.Y+scale->Position.Y-4, Position.X+Size.X-1, Position.Y+scale->Position.Y-4, 255, 255, 255, 180); } +void OptionsView::OnTryExit(ExitMethod method) +{ + c->Exit(); +} + OptionsView::~OptionsView() { // TODO Auto-generated destructor stub |
