diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-13 19:54:29 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-13 19:54:29 (GMT) |
| commit | 41e1d28c56b6e4b9b380022e9220161c57612006 (patch) | |
| tree | c21a061f94ba1a8282b1ef962ca7d9affe68ccc8 /src/interface | |
| parent | 7758fe52cb9ef78b562bc2587b17b6344d8829fe (diff) | |
| download | powder-41e1d28c56b6e4b9b380022e9220161c57612006.zip powder-41e1d28c56b6e4b9b380022e9220161c57612006.tar.gz | |
Correct air include path for OptionsModel, correct Window debugmode logic, justifications for sign
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/DropDown.cpp | 12 | ||||
| -rw-r--r-- | src/interface/DropDown.h | 1 | ||||
| -rw-r--r-- | src/interface/Window.cpp | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/interface/DropDown.cpp b/src/interface/DropDown.cpp index ea7d56a..d5af4c4 100644 --- a/src/interface/DropDown.cpp +++ b/src/interface/DropDown.cpp @@ -79,7 +79,8 @@ public: DropDown::DropDown(Point position, Point size): Component(position, size), isMouseInside(false), - optionIndex(-1) + optionIndex(-1), + callback(NULL) { background = activeBackground = Colour(0, 0, 0); activeText = text = activeBackground = border = activeBorder = Colour(255, 255, 255); @@ -114,6 +115,15 @@ void DropDown::Draw(const Point& screenPos) } + std::pair<std::string, int> DropDown::GetOption() + { + if(optionIndex!=-1) + { + return options[optionIndex]; + } + return std::pair<std::string, int>("", -1); + } + void DropDown::SetOption(std::string option) { for(int i = 0; i < options.size(); i++) diff --git a/src/interface/DropDown.h b/src/interface/DropDown.h index 34310df..40fac68 100644 --- a/src/interface/DropDown.h +++ b/src/interface/DropDown.h @@ -33,6 +33,7 @@ class DropDown: public ui::Component { std::vector<std::pair<std::string, int> > options; public: DropDown(Point position, Point size); + std::pair<std::string, int> GetOption(); void SetOption(int option); void SetOption(std::string option); void AddOption(std::pair<std::string, int> option); diff --git a/src/interface/Window.cpp b/src/interface/Window.cpp index 86221ab..8dba69a 100644 --- a/src/interface/Window.cpp +++ b/src/interface/Window.cpp @@ -1,3 +1,4 @@ +#include <iostream> #include "Window.h" #include "Component.h" #include "interface/Point.h" @@ -209,7 +210,7 @@ void Window::DoTick(float dt) void Window::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { #ifdef DEBUG - if(character = 'd' && ctrl && shift) + if(key == KEY_TAB && ctrl) debugMode = !debugMode; if(debugMode) { |
