summaryrefslogtreecommitdiff
path: root/src/interface/Textbox.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-02-05 16:37:36 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-02-05 16:37:36 (GMT)
commit7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90 (patch)
treeb76fc14cca5e19c5482209f34131973ad1f80e6a /src/interface/Textbox.cpp
parent8024caec55ff1b93eefe50663d4ddf63934f8d63 (diff)
downloadpowder-7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90.zip
powder-7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90.tar.gz
Started intrepreter for tpt script and various things for console
Diffstat (limited to 'src/interface/Textbox.cpp')
-rw-r--r--src/interface/Textbox.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp
index 0341ff3..bef3465 100644
--- a/src/interface/Textbox.cpp
+++ b/src/interface/Textbox.cpp
@@ -71,18 +71,8 @@ void Textbox::TextPosition()
void Textbox::SetText(std::string text)
{
cursor = text.length();
- if(masked)
- {
- char tempText[text.length()];
- memset(tempText, 0x8d, text.length());
- tempText[text.length()] = 0;
- displayText = tempText;
- }
- else
- {
- displayText = text;
- }
this->text = text;
+ this->displayText = text;
TextPosition();
}
@@ -168,7 +158,17 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
}
if(changed)
{
- SetText(text);
+ if(masked)
+ {
+ char tempText[text.length()];
+ memset(tempText, 0x8d, text.length());
+ tempText[text.length()] = 0;
+ displayText = tempText;
+ }
+ else
+ {
+ displayText = text;
+ }
if(actionCallback)
actionCallback->TextChangedCallback(this);
}