OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
edit.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of class TEdit. This defines the basic behavior of all edit
7/// controls.
8//----------------------------------------------------------------------------
9
10#if !defined(OWL_EDIT_H)
11#define OWL_EDIT_H
12
13#include <owl/private/defs.h>
14#if defined(BI_HAS_PRAGMA_ONCE)
15# pragma once
16#endif
17
18#include <owl/static.h>
19#include <owl/edit.rh>
20#include <utility>
21
22
23namespace owl {
24
25class _OWLCLASS TValidator;
26class _OWLCLASS TNmUpDown;
27
28#include <owl/preclass.h>
29
30/// \addtogroup ctrl
31/// @{
32/// \class TEdit
33// ~~~~~ ~~~~~
34class _OWLCLASS TEdit : public TStatic {
35 public:
36 TEdit(TWindow* parent, int id, LPCTSTR text, int x, int y, int w, int h,
37 uint textLimit = 0, bool multiline = false, TModule* = nullptr);
38 TEdit(TWindow* parent, int id, const tstring& text, int x, int y, int w, int h,
39 uint textLimit = 0, bool multiline = false, TModule* = nullptr);
40 TEdit(TWindow* parent, int resourceId, uint textLimit = 0, TModule* = nullptr);
41 TEdit(THandle hWnd, TModule* = nullptr);
42
43 ~TEdit() override;
44
45 /// Represents a half-open range of positions in the edit control, e.g. a selection range.
46 /// The default range is [0, -1) for compatibility with TCharRange (see "richedit.h").
47 //
48 struct TRange
49 {
50 TRange(int b = 0, int e = -1) : cpMin(b), cpMax(e) {}
51
52 int GetSize() const {return cpMax - cpMin;}
53
54 int cpMin, cpMax;
55 };
56
57 /// \name Accessors
58 /// @{
59 int GetNumLines() const;
60 int GetLineLength(int lineNumber) const;
61 bool GetLine(LPTSTR str, int strSize, int lineNumber) const;
62 tstring GetLine(int lineNumber) const;
63 virtual void GetSelection(int& startPos, int& endPos) const;
64 TRange GetSelection() const;
65 virtual int GetCurrentPosition() const;
66 virtual tstring GetTextRange(const TRange &) const;
67 /// @}
68
69 /// Deprecated. Use GetTextRange instead.
70 //
71 virtual void GetSubText(LPTSTR textBuf, int startPos, int endPos) const;
72
73 bool IsModified() const;
74 void ClearModify();
75
76 virtual int GetLineFromPos(int charPos) const;
77 int GetLineIndex(int lineNumber) const;
78
79 auto Transfer(void* buffer, TTransferDirection) -> uint override;
80
81 //@{
82 /// Lock and unlock this edit control's buffer. Allows direct access to the
83 /// text in the edit control.
84 //
85 LPTSTR LockBuffer(uint newSize = 0);
86 void UnlockBuffer(LPCTSTR buffer, bool updateHandle = false);
87 //@}
88
89 /// \name Operations
90 //@{
91 //
92 bool DeleteSubText(int startPos, int endPos);
93 bool DeleteSubText(const TRange& r) {return DeleteSubText(r.cpMin, r.cpMax);}
94 bool DeleteLine(int lineNumber);
95 bool DeleteSelection();
96 virtual bool SetSelection(int startPos, int endPos);
97 bool SetSelection(const TRange& r) {return SetSelection(r.cpMin, r.cpMax);}
98 bool ClearSelection() {return SetSelection(-1, -1);}
99 //@}
100
101 //
102 /// \name Scrolling text
103 //@{
104 //
105 void Scroll(int horizontalUnit, int verticalUnit);
106 void ScrollCaret(); ///< EM_SCROLLCARET
107 int LineDown(); ///< EM_SCROLL, SB_LINEDOWN Scrolls down one line.
108 int LineUp(); ///< EM_SCROLL, SB_LINEUP Scrolls up one line.
109 int PageDown(); ///< EM_SCROLL, SB_PAGEDOWN Scrolls down one page.
110 int PageUp(); ///< EM_SCROLL, SB_PAGEUP Scrolls up one page.
111 //@}
112
113 void Insert(LPCTSTR str);
114 void Insert(const tstring& str) {Insert(str.c_str());}
115 virtual int Search(int startPos, LPCTSTR text, bool caseSensitive=false, bool wholeWord=false, bool up=false);
116 int Search(int startPos, const tstring& text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
117 {return Search(startPos, text.c_str(), caseSensitive, wholeWord, up);}
118
119 void GetRect(TRect& frmtRect) const;
120 void SetRect(const TRect& frmtRect);
121 void SetRectNP(const TRect& frmtRect);
122 bool FormatLines(bool addEOL);
123 void SetTabStops(int numTabs, const int * tabs);
124
125 virtual void LimitText(int);
126 virtual int GetLimitText() const;
127
128 HLOCAL GetMemHandle() const;
129 void SetMemHandle(HLOCAL localMem);
130
131 void SetPasswordChar(uint ch);
132
133 int GetFirstVisibleLine() const;
134 void SetReadOnly(bool readOnly);
135 uint GetPasswordChar() const;
136
137 EDITWORDBREAKPROC GetWordBreakProc() const;
138 void SetWordBreakProc(EDITWORDBREAKPROC proc);
139
140 /// \name Clipboard operations
141 //@{
142 bool CanUndo() const;
143 void EmptyUndoBuffer();
144 void Undo();
145 virtual void Paste();
146 void Copy();
147 void Cut();
148 //@}
149
150 /// \name Validator functions
151 //@{
152 bool IsValid(bool reportErr = false);
153 TValidator* GetValidator();
154 void SetValidator(TValidator* validator);
155 void ValidatorError();
156 bool IsRefocusing() const;
157 //@}
158
159 /// \name Requirement type and functions
160 //@{
161 enum TRequireOption { roNone, roNonEmpty, roNonBlank };
162 void SetNotRequired();
163 void SetRequired(TRequireOption option = roNonBlank);
164 TRequireOption GetRequired() const;
165 bool IsRequired() const;
166 //@}
167
168 /// \name Margin functions
169 //@{
170 void SetLeftMargin(uint16 margin);
171 void SetRightMargin(uint16 margin);
172 void SetMarginUseFontInfo();
173 uint32 GetMargins() const;
174 //@}
175
176 /// \name Position and character functions
177 //@{
178 virtual uint32 CharFromPos(int16 x, int16 y);
179 virtual uint32 PosFromChar(uint charIndex);
180 //@}
181
182 /// Override TStatic virtual member functions
183 //
184 void Clear() override;
185
186 protected:
187 /// \name Command response functions for edit menu items
188 /// @{
189 void CmEditCut(); ///< CM_EDITCUT
190 void CmEditCopy(); ///< CM_EDITCOPY
191 void CmEditPaste(); ///< CM_EDITPASTE
192 void CmEditDelete(); ///< CM_EDITDELETE
193 void CmEditClear(); ///< CM_EDITCLEAR
194 void CmEditUndo(); ///< CM_EDITUNDO
195 /// @}
196
197 /// \name Command enabler functions for edit menu items
198 // @{
199 void CmSelectEnable(TCommandEnabler& commandHandler);
200 void CmPasteEnable(TCommandEnabler& commandHandler);
201 void CmCharsEnable(TCommandEnabler& commandHandler);
202 void CmModEnable(TCommandEnabler& commandHandler);
203 // @}
204
205 /// \name Child id notification handled at the child
206 /// @{
207 void ENErrSpace(); ///< EN_ERRSPACE
208 // @}
209
210 /// \name Override TWindow virtual member functions
211 /// @{
212 auto GetWindowClassName() -> TWindowClassName override;
213 void SetupWindow() override;
214
215 void EvChar(uint key, uint repeatCount, uint flags);
216 void EvKeyDown(uint key, uint repeatCount, uint flags);
217 uint EvGetDlgCode(const MSG*);
218 void EvSetFocus(HWND hWndLostFocus);
219 void EvKillFocus(HWND hWndGetFocus);
220 bool EvUpDown(TNmUpDown &);
221 auto CanClose() -> bool override;
222 /// @}
223
224 /// Handler for input validation message sent by parent
225 //
226 void EvChildInvalid(HWND);
227
228 int ScrollText(int how);
229
231 /// Input validation object
232 //
233 TValidator* Validator;
234
235 /// Input requirement setting
236 //
237 TRequireOption Requirement;
238
239 private:
240 // Hidden to prevent accidental copying or assignment
241 //
242 TEdit(const TEdit&);
243 TEdit& operator =(const TEdit&);
244
245 static TEdit* ValidatorReFocus;
246
249};
250
252
253//
254// edit control notification macros. methods are: void method()
255//
256// EV_EN_CHANGE(id, method)
257// EV_EN_ERRSPACE(id, method)
258// EV_EN_HSCROLL(id, method)
259// EV_EN_KILLFOCUS(id, method)
260// EV_EN_MAXTEXT(id, method)
261// EV_EN_SETFOCUS(id, method)
262// EV_EN_UPDATE(id, method)
263// EV_EN_VSCROLL(id, method)
264
265#include <owl/posclass.h>
266
267
268//----------------------------------------------------------------------------
269// Inline implementations
270//
271
272//
273/// Resets the change flag of the edit control causing IsModified to return false.
274/// The flag is set when text is modified.
275//
281
282//
283/// SetPasswordChar sets the character to be displayed in place of a user-typed character.
284/// When the ES_PASSWORD style is specified, the default display character is an asterisk (*).
285//
291
292//
293/// If an operation inside the edit control can be undone,
294/// the edit control undo flag is set. EmptyUndoBuffer resets or clears this flag.
295//
301
302//
303/// Undoes the last edit.
304//
305inline void TEdit::Undo()
306{
309}
310
311//
312/// Inserts text from the Clipboard into the edit control at the current text insertion point (cursor position).
313//
314inline void TEdit::Paste()
315{
318}
319
320//
321/// Copies the currently selected text into the Clipboard.
322//
323inline void TEdit::Copy()
324{
327}
328
329//
330/// Deletes the currently selected text and copies it into the Clipboard.
331//
332inline void TEdit::Cut()
333{
336}
337
338//
339/// Return the validator associated with this edit control.
340//
342{
343 return Validator;
344}
345
346//
347/// Return true when this edit control is attempting to regain focus after an
348/// EvKillFocus() with invalid contents
349//
350inline bool TEdit::IsRefocusing() const
351{
352 return ValidatorReFocus == this;
353}
354
355//
356/// Automatically responds to a menu selection with a menu ID of CM_EDITCUT by calling Cut().
357//
358inline void TEdit::CmEditCut()
359{
360 Cut();
361}
362
363//
364/// Automatically responds to a menu selection with a menu ID of CM_EDITCOPY by calling Copy().
365//
366inline void TEdit::CmEditCopy()
367{
368 Copy();
369}
370
371//
372/// Automatically responds to a menu selection with a menu ID of CM_EDITPASTE by calling Paste().
373//
375{
376 Paste();
377}
378
379//
380/// Automatically responds to a menu selection with a menu ID of CM_EDITDELETE by calling DeleteSelection().
381//
383{
385}
386
387//
388/// Automatically responds to a menu selection with a menu ID of CM_EDITCLEAR by calling Clear().
389//
391{
392 Clear();
393}
394
395//
396/// Automatically responds to a menu selection with a menu ID of CM_EDITUNDO by calling Undo().
397//
398inline void TEdit::CmEditUndo()
399{
400 Undo();
401}
402
403//
404/// Return the number of lines in the associated edit control
405//
406/// \note return 1 when the edit control has no text (i.e. it has one line
407/// with no text in it). Return zero if an error occurs
408//
409inline int TEdit::GetNumLines() const
410{
412 return static_cast<int>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETLINECOUNT));
413}
414
415//
416/// Returns true if the user has changed the text in the edit control.
417//
418inline bool TEdit::IsModified() const
419{
421 return static_cast<bool>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETMODIFY));
422}
423
424//
425/// Select the characters in the range "startPos .. endPos"
426//
427/// Forces the selection of the text between the positions specified by startPos and
428/// endPos, but not including the character at endPos.
429//
431{
433 return SendMessage(EM_SETSEL, startPos, endPos) != 0;
434}
435
436//
437/// Return the starting and ending positions of the selected text
438//
439/// Returns the starting (startPos) and ending (endPos) positions of the currently
440/// selected text. By using GetSelection in conjunction with GetSubText, you can get
441/// the currently selected text.
442//
443inline void TEdit::GetSelection(int& startPos, int& endPos) const
444{
446 CONST_CAST(TEdit*,this)->SendMessage(EM_GETSEL, TParam1(&startPos), TParam2(&endPos));
447}
448
449
450
451//
452/// Return the current caret position.
453//
455{
457 int CurPos = 0;
458 GetSelection(CurPos, CurPos);
459 return CurPos;
460}
461
462
463//
464/// Return the line number associated with character index "CharPos"
465//
466/// From a multiline edit control, returns the line number on which the character
467/// position specified by charPos occurs. If charPos is greater than the position of
468/// the last character, the number of the last line is returned. If charPos is-1,
469/// the number of the line that contains the first selected character is returned.
470/// If there is no selection, the line containing the caret is returned.
471//
472inline int TEdit::GetLineFromPos(int charPos) const
473{
475 return static_cast<int>(CONST_CAST(TEdit*,this)->SendMessage(EM_LINEFROMCHAR, charPos));
476}
477
478//
479/// In a multiline edit control, GetLineIndex returns the number of characters that
480/// appear before the line number specified by lineNumber. If lineNumber is -1,
481/// GetLineIndex returns the number of the line that contains the caret is returned.
482//
483inline int TEdit::GetLineIndex(int lineNumber) const
484{
486 return static_cast<int>(CONST_CAST(TEdit*,this)->SendMessage(EM_LINEINDEX, lineNumber));
487}
488
489//
490/// Scroll the text by the specified horizontal and vertical amounts
491//
492/// Scrolls a multiline edit control horizontally and vertically using the numbers
493/// of characters specified in horizontalUnit and verticalUnit. Positive values
494/// result in scrolling to the right or down in the edit control, and negative
495/// values result in scrolling to the left or up.
496//
502//
503/// Sroll the caret into view in an edit control.
504//
509
510//
511//
512//
513inline int TEdit::ScrollText(int how){
515 if(HiUint16(ret) == TRUE)
516 return LoUint16(ret);
517 return -1;
518}
519
520//
521//
522//
523inline int TEdit::LineDown(){ // EM_SCROLL, SB_LINEDOWN Scrolls down one line.
524 return ScrollText(SB_LINEDOWN);
525}
526
527//
528//
529//
530inline int TEdit::LineUp(){ // EM_SCROLL, SB_LINEUP Scrolls up one line.
531 return ScrollText(SB_LINEUP);
532}
533
534//
535//
536//
537inline int TEdit::PageDown(){ // EM_SCROLL, SB_PAGEDOWN Scrolls down one page.
538 return ScrollText(SB_PAGEDOWN);
539}
540
541//
542//
543//
544inline int TEdit::PageUp(){ // EM_SCROLL, SB_PAGEUP Scrolls up one page.
545 return ScrollText(SB_PAGEUP);
546}
547
548//
549/// Inserts the text supplied in str into the edit control at the current text
550/// insertion point (cursor position), and replaces any currently selected text.
551/// Insert is similar to Paste(), but does not affect the Clipboard.
552//
553inline void TEdit::Insert(LPCTSTR str)
554{
557}
558
559//
560/// Gets the formatting rectangle of a multiline edit control.
561//
562inline void TEdit::GetRect(TRect& frmtRect) const
563{
565 CONST_CAST(TEdit*,this)->SendMessage(EM_GETRECT, 0, TParam2(&frmtRect));
566}
567
568//
569/// Sets the formatting rectangle for a multiline edit control.
570//
571inline void TEdit::SetRect(const TRect& frmtRect)
572{
575}
576
577//
578/// Sets the formatting rectangle for a multiline edit control. Unlike SetRect(),
579/// SetRectNP does not repaint the edit control.
580//
586
587//
588/// Indicates if the end-of-line characters (carriage return, linefeed) are to be
589/// added or removed from text lines that are wordwrapped in a multiline edit
590/// control. Returns true if these characters are placed at the end of wordwrapped
591/// lines or false if they are removed.
592//
593inline bool TEdit::FormatLines(bool addEOL)
594{
597}
598
599//
600/// Sets the tab stop positions in a multiline edit control.
601//
602inline void TEdit::SetTabStops(int numTabs, const int * tabs)
603{
606}
607
608//
609/// Limit the amount of new text that can be entered in the edit control.
610//
616
617//
618/// Return the memory handle for the edit control's buffer.
619//
621{
623 return reinterpret_cast<HLOCAL>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETHANDLE));
624}
625
626//
627/// Sets the memory handle for the edit control's buffer.
628//
634
635//
636/// Indicates the topmost visible line in an edit control. For single-line edit
637/// controls, the return value is 0. For multiline edit controls, the return value
638/// is the index of the topmost visible line.
639//
641{
643 return static_cast<int>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETFIRSTVISIBLELINE));
644}
645
646//
647/// Sets the edit control to be read-only or read-write.
648//
654
655//
656/// Returns the character to be displayed in place of a user-typed character. When
657/// the edit control is created with the ES_PASSWORD style specified, the default
658/// display character is an asterisk (*).
659//
661{
663 return static_cast<uint>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETPASSWORDCHAR));
664}
665
666//
667/// Get word-breaking procedure
668//
670{
672 return reinterpret_cast<EDITWORDBREAKPROC>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETWORDBREAKPROC));
673}
674
675//
676/// In a multiline edit control, SetWordBreakProc indicates that an
677/// application-supplied word-break function has replaced the default word-break
678/// function. The application-supplied word-break function might break the words in
679/// the text buffer at a character other than the default blank character.
680//
686
687//
688/// Returns true if it is possible to undo the last edit.
689//
690inline bool TEdit::CanUndo() const
691{
693 return static_cast<bool>(CONST_CAST(TEdit*,this)->SendMessage(EM_CANUNDO));
694}
695
696//
702
703//
709
710//
716
717//
719{
721 return static_cast<uint32>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETMARGINS));
722}
723
724//
725inline int TEdit::GetLimitText() const
726{
728 return static_cast<int>(CONST_CAST(TEdit*,this)->SendMessage(EM_GETLIMITTEXT));
729}
730
731//
734 return static_cast<uint32>(SendMessage(EM_CHARFROMPOS, 0, MkUint32(x, y)));
735}
736
737//
742
743//
744/// Sets the requirement option for the edit control.
745//
747{
748 Requirement = option;
749}
750
751//
752/// Sets the requirement option for the edit control to reflect a value
753/// is not required.
754//
756{
758}
759
760//
761/// Returns the requirement option for the edit control.
762//
764{
765 return Requirement;
766}
767
768//
769/// Returns true if a value is required for the edit control.
770//
771inline bool TEdit::IsRequired() const
772{
773 return GetRequired() != roNone;
774}
775
776} // OWL namespace
777
778#endif // OWL_EDIT_H
#define PRECONDITION(condition)
Definition checks.h:227
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
Definition window.h:209
A TEdit is an interface object that represents an edit control interface element.
Definition edit.h:34
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TNmUpDown is a wrapper of the NM_UPDOWN structure sent with notifications from an 'UpDown' control.
Definition commctrl.h:107
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
An interface object that represents a static text interface element.
Definition static.h:36
A streamable class, TValidator defines an abstract data validation object.
Definition validate.h:71
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:47
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
Definition window.cpp:3288
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition objstrm.h:1529
#define DECLARE_STREAMABLE_INLINES(cls)
Definition objstrm.h:1538
TRequireOption GetRequired() const
Returns the requirement option for the edit control.
Definition edit.h:763
void SetLeftMargin(uint16 margin)
Definition edit.h:697
void SetReadOnly(bool readOnly)
Sets the edit control to be read-only or read-write.
Definition edit.h:649
void SetRect(const TRect &frmtRect)
Sets the formatting rectangle for a multiline edit control.
Definition edit.h:571
bool DeleteSelection()
Deletes the currently selected text, and returns false if no text is selected.
Definition edit.cpp:819
TRequireOption
Definition edit.h:161
int ScrollText(int how)
Definition edit.h:513
void SetRightMargin(uint16 margin)
Definition edit.h:704
void ScrollCaret()
EM_SCROLLCARET.
Definition edit.h:505
EDITWORDBREAKPROC GetWordBreakProc() const
Get word-breaking procedure.
Definition edit.h:669
void Cut()
Deletes the currently selected text and copies it into the Clipboard.
Definition edit.h:332
void Scroll(int horizontalUnit, int verticalUnit)
Scroll the text by the specified horizontal and vertical amounts.
Definition edit.h:497
int GetSize() const
Definition edit.h:52
void SetMemHandle(HLOCAL localMem)
Sets the memory handle for the edit control's buffer.
Definition edit.h:629
bool ClearSelection()
Definition edit.h:98
virtual uint32 PosFromChar(uint charIndex)
Definition edit.h:738
bool FormatLines(bool addEOL)
Indicates if the end-of-line characters (carriage return, linefeed) are to be added or removed from t...
Definition edit.h:593
virtual uint32 CharFromPos(int16 x, int16 y)
Definition edit.h:732
void CmEditCut()
CM_EDITCUT.
Definition edit.h:358
virtual void LimitText(int)
Limit the amount of new text that can be entered in the edit control.
Definition edit.h:611
void CmEditUndo()
CM_EDITUNDO.
Definition edit.h:398
void CmEditClear()
CM_EDITCLEAR.
Definition edit.h:390
bool IsRefocusing() const
Return true when this edit control is attempting to regain focus after an EvKillFocus() with invalid ...
Definition edit.h:350
HLOCAL GetMemHandle() const
Return the memory handle for the edit control's buffer.
Definition edit.h:620
int LineUp()
EM_SCROLL, SB_LINEUP Scrolls up one line.
Definition edit.h:530
virtual void Paste()
Inserts text from the Clipboard into the edit control at the current text insertion point (cursor pos...
Definition edit.h:314
void SetMarginUseFontInfo()
Definition edit.h:711
void EmptyUndoBuffer()
If an operation inside the edit control can be undone, the edit control undo flag is set.
Definition edit.h:296
TValidator * GetValidator()
Return the validator associated with this edit control.
Definition edit.h:341
void Copy()
Copies the currently selected text into the Clipboard.
Definition edit.h:323
void GetRect(TRect &frmtRect) const
Gets the formatting rectangle of a multiline edit control.
Definition edit.h:562
void ClearModify()
Resets the change flag of the edit control causing IsModified to return false.
Definition edit.h:276
void Insert(const tstring &str)
Definition edit.h:114
virtual int GetLineFromPos(int charPos) const
Return the line number associated with character index "CharPos".
Definition edit.h:472
bool CanUndo() const
Returns true if it is possible to undo the last edit.
Definition edit.h:690
int GetFirstVisibleLine() const
Indicates the topmost visible line in an edit control.
Definition edit.h:640
uint GetPasswordChar() const
Returns the character to be displayed in place of a user-typed character.
Definition edit.h:660
int LineDown()
EM_SCROLL, SB_LINEDOWN Scrolls down one line.
Definition edit.h:523
uint32 GetMargins() const
Definition edit.h:718
void SetNotRequired()
Sets the requirement option for the edit control to reflect a value is not required.
Definition edit.h:755
void Insert(LPCTSTR str)
Inserts the text supplied in str into the edit control at the current text insertion point (cursor po...
Definition edit.h:553
bool IsRequired() const
Returns true if a value is required for the edit control.
Definition edit.h:771
void CmEditPaste()
CM_EDITPASTE.
Definition edit.h:374
int PageUp()
EM_SCROLL, SB_PAGEUP Scrolls up one page.
Definition edit.h:544
void SetRequired(TRequireOption option=roNonBlank)
Sets the requirement option for the edit control.
Definition edit.h:746
bool IsModified() const
Returns true if the user has changed the text in the edit control.
Definition edit.h:418
void Undo()
Undoes the last edit.
Definition edit.h:305
void CmEditCopy()
CM_EDITCOPY.
Definition edit.h:366
int GetNumLines() const
Return the number of lines in the associated edit control.
Definition edit.h:409
void Clear() override
Override TStatic virtual member functions.
Definition edit.cpp:421
bool SetSelection(const TRange &r)
Definition edit.h:97
void SetRectNP(const TRect &frmtRect)
Sets the formatting rectangle for a multiline edit control.
Definition edit.h:581
virtual int GetCurrentPosition() const
Return the current caret position.
Definition edit.h:454
void SetWordBreakProc(EDITWORDBREAKPROC proc)
In a multiline edit control, SetWordBreakProc indicates that an application-supplied word-break funct...
Definition edit.h:681
void SetTabStops(int numTabs, const int *tabs)
Sets the tab stop positions in a multiline edit control.
Definition edit.h:602
int GetLineIndex(int lineNumber) const
In a multiline edit control, GetLineIndex returns the number of characters that appear before the lin...
Definition edit.h:483
virtual bool SetSelection(int startPos, int endPos)
Select the characters in the range "startPos .. endPos".
Definition edit.h:430
int Search(int startPos, const tstring &text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
Definition edit.h:116
TRange GetSelection() const
Functional style overload.
Definition edit.cpp:979
TRange(int b=0, int e=-1)
Definition edit.h:50
int PageDown()
EM_SCROLL, SB_PAGEDOWN Scrolls down one page.
Definition edit.h:537
bool DeleteSubText(const TRange &r)
Definition edit.h:93
void SetPasswordChar(uint ch)
SetPasswordChar sets the character to be displayed in place of a user-typed character.
Definition edit.h:286
virtual int GetLimitText() const
Definition edit.h:725
void CmEditDelete()
CM_EDITDELETE.
Definition edit.h:382
@ roNone
Definition edit.h:161
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
uint32 MkUint32(uint16 lo, uint16 hi)
Definition defs.h:261
uint16 HiUint16(LRESULT r)
Definition defs.h:270
unsigned long uint32
Definition number.h:34
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
signed short int16
Definition number.h:29
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
uint16 LoUint16(LRESULT r)
Definition defs.h:264
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define protected_data
Definition defs.h:208
#define CONST_CAST(targetType, object)
Definition defs.h:273
#define _OWLCLASS
Definition defs.h:338
Definition of class TStatic, the class for static controls and base for any control that manages simp...
Represents a half-open range of positions in the edit control, e.g.
Definition edit.h:49