diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-17 18:14:05 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-17 18:14:05 (GMT) |
| commit | 2479b8664d5c4cdd47208bdbca970828ba1a2520 (patch) | |
| tree | d453fa8de5272d83d03a4a72f776c6808c5f641e /src/interface/Textbox.cpp | |
| parent | 2329f98f0af9dffda5375aca7b05f9e76a84d06a (diff) | |
| download | powder-2479b8664d5c4cdd47208bdbca970828ba1a2520.zip powder-2479b8664d5c4cdd47208bdbca970828ba1a2520.tar.gz | |
Add comment box to save preview - doesn't work yet
Diffstat (limited to 'src/interface/Textbox.cpp')
| -rw-r--r-- | src/interface/Textbox.cpp | 8 |
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); } } |
