summaryrefslogtreecommitdiff
path: root/src/text.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/text.cpp
parent82f1d860690dc0a2d0210db12344f7ea5e88b6a4 (diff)
Tweaks to Text controls and text handling.
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/text.cpp b/src/text.cpp
index ff4241d..4e77387 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -39,6 +39,49 @@ Text::~Text()
}
+// ------------------------------------------------------------
+//
+void Text::OnTextChanged(Window *owner, W32DLibCallback callback)
+{
+ Control::AddCallback(WM_COMMAND,EN_CHANGE,owner,callback);
+}
+
+
+// ------------------------------------------------------------
+//
+void Text::MaxLen(int count)
+{
+ SendMsg(EM_LIMITTEXT,count,0);
+}
+
+
+// ------------------------------------------------------------
+//
+void Text::ReadOnly(bool readonly)
+{
+ SendMsg(EM_SETREADONLY,readonly ? TRUE:FALSE,0);
+}
+
+
+// ------------------------------------------------------------
+//
+void Text::AppendText(const char *text)
+{
+ int len=GetWindowTextLength(GetHWND());
+ SendMsg(EM_SETSEL,len,len);
+ SendMsg(EM_REPLACESEL,FALSE,reinterpret_cast<LPARAM>(text));
+}
+
+
+// ------------------------------------------------------------
+//
+void Text::AppendText(const std::string& text)
+{
+ AppendText(text.c_str());
+}
+
+
+
}; // namespace W32DLib
// END OF FILE