diff options
Diffstat (limited to 'src/interface/DropDown.cpp')
| -rw-r--r-- | src/interface/DropDown.cpp | 12 |
1 files changed, 11 insertions, 1 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++) |
