diff options
Diffstat (limited to 'src/text.cpp')
-rw-r--r-- | src/text.cpp | 43 |
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 |