summaryrefslogtreecommitdiff
path: root/src/interface/Textbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/Textbox.cpp')
-rw-r--r--src/interface/Textbox.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp
index 12a4698..66af516 100644
--- a/src/interface/Textbox.cpp
+++ b/src/interface/Textbox.cpp
@@ -8,13 +8,15 @@
using namespace ui;
-Textbox::Textbox(Point position, Point size, std::string textboxText):
+Textbox::Textbox(Point position, Point size, std::string textboxText, std::string textboxPlaceholder):
Label(position, size, ""),
actionCallback(NULL),
masked(false),
border(true),
mouseDown(false)
{
+ placeHolder = textboxPlaceholder;
+
SetText(textboxText);
cursor = text.length();
}
@@ -231,6 +233,10 @@ void Textbox::Draw(const Point& screenPos)
}
else
{
+ if(!text.length())
+ {
+ g->drawtext(screenPos.X+textPosition.X, screenPos.Y+textPosition.Y, placeHolder, textColour.Red, textColour.Green, textColour.Blue, 170);
+ }
if(border) g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 160, 160, 160, 255);
}
}