SavvyUI C++ UI Library
Loading...
Searching...
No Matches
TextArea.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
8class TextArea : public Component
9{
10 wstring _text;
11 int _maxLength;
12 BOOL _readOnly;
13
14protected:
24 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
25
30
31public:
36
40 virtual ~TextArea();
41
42 void setReadOnly(BOOL readOnly);
43
44 void setMaxLength(int maxLen);
45
51 void setText(const wstring& text);
52
58 wstring getText();
59
63 void getLines(vector<wstring>& lines);
64
68 wstring getSelectedText();
69 void replaceSelectedText(const wstring& newText);
70
71 void selectText(int startPos, int endPos);
72
73 BOOL canUndo();
74 BOOL undo();
75
76 void setCaretPos(int newPos);
77
82
86 void setTextLimit(int textLimit);
87
94
102 void onDataChanged(WinHandle hTarget, const wstring& newValue, const ProcParams& procParams);
103
110};
HWND WinHandle
Definition Common.h:16
Component()
Constructs a new Component instance.
Definition EventListeners.h:15
Definition Component.h:9
void setReadOnly(BOOL readOnly)
BOOL undo()
wstring getSelectedText()
Gets the selected text content.
void replaceSelectedText(const wstring &newText)
BOOL canUndo()
int getTextLimit()
Gets the max allowed length of the text.
void onDataChanged(WinHandle hTarget, const wstring &newValue, const ProcParams &procParams)
Handles data changed events.
void setMaxLength(int maxLen)
wstring getText()
Gets the current text content.
void selectText(int startPos, int endPos)
void addDataChangedListener(DataChangeListener *l)
Adds a listener for data changed events.
void windowCreated()
Called when the window is created.
void setText(const wstring &text)
Sets the text content of the field.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Retrieves window creation options.
virtual ~TextArea()
Destructor.
void setTextLimit(int textLimit)
Sets the max allowed length of the text.
void setCaretPos(int newPos)
int getPreferredHeight()
Gets the preferred height of the text field control.
TextArea()
Constructs a new TextArea.
void getLines(vector< wstring > &lines)
Gets the text as separate lines.