summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-03-29 01:22:42 +0000
committerIan C <ianc@noddybox.co.uk>2005-03-29 01:22:42 +0000
commiteffc648f262bd3bd7b57d4e76db2f768510be55c (patch)
treed77a2e04e58847a3517649ffa83f86b066de08f6 /src/window.cpp
parent82f1d860690dc0a2d0210db12344f7ea5e88b6a4 (diff)
Tweaks to Text controls and text handling.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 492ecfd..af662b9 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -68,14 +68,23 @@ void Window::SetText(const char *text)
// ------------------------------------------------------------
//
-std::string Window::GetText(int maxlen)
+void Window::SetText(const std::string& text)
{
- char *buff=new char[maxlen+1];
+ SetText(text.c_str());
+}
+
+
+// ------------------------------------------------------------
+//
+std::string Window::GetText()
+{
+ int len=GetWindowTextLength(m_wnd);
+ char *buff=new char[len+1];
std::string res;
buff[0]=0;
- SendMsg(WM_GETTEXT,maxlen,reinterpret_cast<LPARAM>(buff));
+ SendMsg(WM_GETTEXT,len+1,reinterpret_cast<LPARAM>(buff));
res=buff;
delete[] buff;