OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TRichEdit Class Reference

TRichEdit encapsulates a rich edit control, a window in which a user can enter, edit and format text. More...

#include <owl/richedit.h>

Inheritance diagram for owl::TRichEdit:
owl::TEditFile owl::TEditSearch owl::TEdit owl::TStatic owl::TControl owl::TWindow owl::TEventHandler owl::TStreamableBase owl::TRichEditView

Public Types

enum  TFmtStatus { No , Yes , Partly }
 Enumeration of flags returned when querrying a RichEdit about a particular character attribute for a chunk of selected text. More...
 
- Public Types inherited from owl::TEdit
enum  TRequireOption { roNone , roNonEmpty , roNonBlank }
 
- Public Types inherited from owl::TStatic
enum  TImageType { Bitmap = IMAGE_BITMAP , Icon = IMAGE_ICON , Cursor = IMAGE_CURSOR , EnhMetaFile = IMAGE_ENHMETAFILE }
 
enum  TTransferBufferFieldType { tbftCharArray , tbftString }
 
- Public Types inherited from owl::TWindow
typedef HWND THandle
 TWindow encapsulates an HWND.
 
using TChildrenIterator = TChildrenIteratorTemplate<TWindow>
 
using TConstChildrenIterator = TChildrenIteratorTemplate<const TWindow>
 
using TChildrenRange = TChildrenRangeTemplate<TWindow>
 
using TConstChildrenRange = TChildrenRangeTemplate<const TWindow>
 
typedef std::pair< int, intTScrollRange
 
- Public Types inherited from owl::TEventHandler
typedef bool(* TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)
 

Public Member Functions

 TRichEdit (TWindow *parent, int id, LPCTSTR text, int x, int y, int w, int h, LPCTSTR fileName=nullptr, TModule *module=nullptr)
 Constructor for a TRichEdit object.
 
 TRichEdit (TWindow *parent, int id, const tstring &text, int x, int y, int w, int h, const tstring &fileName=tstring(), TModule *=nullptr)
 String-aware overload.
 
 TRichEdit (TWindow *parent, int resourceId, TModule *module=nullptr)
 Constructor for TRichEdit associated with a MS-Windows interface element created by MS-Windows from a resource definition.
 
ulong GetCharFormat (TCharFormat &, bool selection=false) const
 Retrieves the current character formatting in an edit control.
 
ulong GetParaFormat (TParaFormat &) const
 Retrieves the paragraph formatting of the current selection of the rich edit control.
 
bool SetCharFormat (const TCharFormat &, uint flags=SCF_SELECTION)
 Sets the character formatting of a rich edit control.
 
bool SetParaFormat (const TParaFormat &)
 Sets the paragraph formatting of the current selection of the rich edit control.
 
TColor SetBkgndColor (const TColor &=TColor::None)
 Sets the background color of the rich edit control.
 
uint HasCharAttribute (ulong mask, uint32 effects)
 Function returns whether or not the current selection has a particular attribute.
 
bool ToggleCharAttribute (ulong mask, uint32 effects)
 Toggles a set of character attributes.
 
bool ChangeCharPointSize (int pointSizeDelta)
 Increases or decreases (using a positive or negative value respectively) the point size of the current selection.
 
bool HasSelection () const
 Returns true if the rich edit control has an active selection.
 
void GetSelRange (TCharRange &) const
 Retrieves the starting and ending character positions of the selection of the richedit control.
 
int SetSelRange (const TCharRange &)
 Selects a range of characters in the rich edit control.
 
void HideSelection (bool hide, bool changeStyle)
 Shows or hides the selection in the rich edit control.
 
ulong GetSelectionType () const
 Returns the selection type of the rich edit control.
 
void GetSelection (int &startPos, int &endPos) const override
 Retrieves the starting and ending character position of the selection in the rich edit control.
 
auto SetSelection (int startPos, int endPos) -> bool override
 Selects a range of characters in the rich edit control.
 
bool EnableAutoURL (bool enable=true)
 
int GetIMEMode () const
 
void SetLangOptions (int options)
 
int GetLangOptions () const
 
void SetTextMode (int mode)
 
int GetTextMode () const
 
void SetUndoLimit (int maxnum)
 
void StopGroupTyping ()
 
int GetTextLength () const
 
int GetTextRange (TTextRange &) const
 Retrieves a specified range of text from the rich edit control.
 
int GetTextRange (const TCharRange &, TCHAR *buffer) const
 Retrieves a specified range of text from the rich edit control.
 
int GetSelectedText (TCHAR *buffer) const
 Retrieves the currently-selected text of the rich edit control.
 
tstring GetSelectedText () const
 String-aware overload.
 
int FindText (uint flags, const TFindText &)
 Finds text within the rich edit control.
 
int FindText (uint flags, const TCharRange &, LPCTSTR text)
 Finds text within the rich edit control.
 
int FindText (uint flags, const TCharRange &r, const tstring &text)
 
auto GetTextRange (const TRange &) const -> tstring override
 Retrieves a specified range of text from the rich edit control.
 
void GetSubText (TCHAR *textBuf, int startPos, int endPos) const override
 Retrieves a specified range of text from the rich edit control.
 
auto Search (int startPos, LPCTSTR text, bool caseSensitive=false, bool wholeWord=false, bool up=false) -> int override
 
int Search (int startPos, const tstring &text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
 
void LimitText (int maxValue) override
 Sets an upper limit to the amount of text in the richedit control.
 
auto GetLineFromPos (int charPos) const -> int override
 
auto CharFromPos (int16 x, int16 y) -> uint32 override
 
auto PosFromChar (uint charIndex) -> uint32 override
 
int FindWordBreak (uint code, int start)
 
bool CanPaste (uint format) const
 
bool CanRedo () const
 
int GetUndoName () const
 
int GetRedoName () const
 
void Redo ()
 
void PasteSpecial (uint format)
 
void Paste () override
 
ulong StreamIn (uint format, TEditStream &)
 
ulong StreamOut (uint format, TEditStream &)
 
bool DisplayBand (TRect &)
 
int FormatRange (const TFormatRange &range, bool render=true)
 
int FormatRange ()
 
bool SetTargetDevice (HDC, int lineWidth)
 
void RequestResize ()
 
bool GetOleInterface (IRichEditOle *&) const
 
bool SetOleInterface (IRichEditOleCallback *)
 
uint GetFormat () const
 
void SetFormat (uint fmt)
 
bool IsRTF () const
 
ulong GetEventMask () const
 
ulong SetEventMask (ulong msk)
 
auto Transfer (void *buffer, TTransferDirection) -> uint override
 
auto Read (LPCTSTR fileName=nullptr) -> bool override
 
auto Write (LPCTSTR fileName=nullptr) -> bool override
 < String-aware overload
 
bool ReadFromStream (tistream &, uint format=SF_RTF)
 < String-aware overload
 
bool WriteToStream (tostream &, uint format=SF_RTF)
 
virtual bool Read (LPCTSTR fileName=nullptr)
 Reads the contents of a previously specified file into the Editor.
 
bool Read (const tstring &fileName)
 
virtual bool Write (LPCTSTR fileName=nullptr)
 Saves the contents of the Editor to a file whose name is specified by FileName.
 
bool Write (const tstring &fileName)
 
- Public Member Functions inherited from owl::TEditFile
 TEditFile (TWindow *parent=nullptr, int id=0, LPCTSTR text=nullptr, int x=0, int y=0, int w=0, int h=0, LPCTSTR fileName=nullptr, TModule *module=nullptr)
 Constructs a TEditFile window given the parent window, resource ID (Id), text, file name, and module ID.
 
 TEditFile (TWindow *parent, int id, const tstring &text, int x=0, int y=0, int w=0, int h=0, const tstring &fileName=tstring(), TModule *module=nullptr)
 String-aware overload.
 
 TEditFile (TWindow *parent, int resourceId, TModule &module)
 This constructor, which aliases an Edit control created from a dialog resource is 'unconventional' in that it expects a TModule reference instead of the traditional 'TModule* = 0'.
 
 ~TEditFile () override
 Frees memory allocated to hold the name of the TEditFile.
 
virtual bool CanClear ()
 Returns true if the text of the associated edit control can be cleared which is if the text has not been changed, or if the user Oks the clearing of the text.
 
auto CanClose () -> bool override
 Returns true if the edit window can be closed.
 
virtual void NewFile ()
 Begins the edit of a new file after calling CanClear to determine that it is safe to clear the text of the editor.
 
virtual void Open ()
 Opens a new file after determining that it is OK to clear the text of the Editor.
 
bool Read (const tstring &fileName)
 
virtual void ReplaceWith (LPCTSTR fileName)
 Calls SetFileName and Read to replace the file currently being edited with a file whose name is supplied.
 
void ReplaceWith (const tstring &fileName)
 
virtual bool Save ()
 Saves changes to the contents of the Editor to a file.
 
virtual bool SaveAs ()
 Saves the contents of the Editor to a file whose name is retrieved from the user, through execution of a File Save dialog box.
 
bool Write (const tstring &fileName)
 
LPCTSTR GetFileName () const
 Return the filename for this buffer.
 
void SetFileName (LPCTSTR fileName)
 Sets FileName and updates the caption of the window, replacing an empty name with 'Untitled' in its caption.
 
void SetFileName (const tstring &fileName)
 
TOpenSaveDialog::TDataGetFileData ()
 Return the FileData data member used for the common dialogs.
 
void SetFileData (const TOpenSaveDialog::TData &fd)
 
- Public Member Functions inherited from owl::TEdit
 TEdit (TWindow *parent, int id, LPCTSTR text, int x, int y, int w, int h, uint textLimit=0, bool multiline=false, TModule *=nullptr)
 Constructs an edit control object with a parent window (parent).
 
 TEdit (TWindow *parent, int id, const tstring &text, int x, int y, int w, int h, uint textLimit=0, bool multiline=false, TModule *=nullptr)
 String-aware overload.
 
 TEdit (TWindow *parent, int resourceId, uint textLimit=0, TModule *=nullptr)
 Constructor for TEdit associated with a MS-Windows interface element created by MS-Windows from a resource definition.
 
 TEdit (THandle hWnd, TModule *=nullptr)
 Constructs a TEdit object to encapsulate (alias) an existing control.
 
 ~TEdit () override
 Destructor for a TEdit control.
 
bool IsModified () const
 Returns true if the user has changed the text in the edit control.
 
void ClearModify ()
 Resets the change flag of the edit control causing IsModified to return false.
 
int GetLineIndex (int lineNumber) const
 In a multiline edit control, GetLineIndex returns the number of characters that appear before the line number specified by lineNumber.
 
TCHARLockBuffer (uint newSize=0)
 Lock and unlock this edit control's buffer.
 
void UnlockBuffer (LPCTSTR buffer, bool updateHandle=false)
 Unlock the edit control's buffer locked by LockBuffer.
 
int GetNumLines () const
 Return the number of lines in the associated edit control.
 
int GetLineLength (int lineNumber) const
 Return the length of line number "lineNumber".
 
bool GetLine (TCHAR *str, int strSize, int lineNumber) const
 Return the text of line number "lineNumber" (0-terminated)
 
tstring GetLine (int lineNumber) const
 String-aware overload If the length of the returned string differs from GetLineLength an error occured.
 
TRange GetSelection () const
 Functional style overload.
 
virtual int GetCurrentPosition () const
 Return the current caret position.
 
bool DeleteSubText (int startPos, int endPos)
 Deletes the text between the starting and ending positions specified by startPos and endPos, respectively.
 
bool DeleteSubText (const TRange &r)
 
bool DeleteLine (int lineNumber)
 Deletes the text in the line specified by lineNumber in a multiline edit control.
 
bool DeleteSelection ()
 Deletes the currently selected text, and returns false if no text is selected.
 
bool SetSelection (const TRange &r)
 
bool ClearSelection ()
 
void Scroll (int horizontalUnit, int verticalUnit)
 Scroll the text by the specified horizontal and vertical amounts.
 
void ScrollCaret ()
 EM_SCROLLCARET.
 
int LineDown ()
 EM_SCROLL, SB_LINEDOWN Scrolls down one line.
 
int LineUp ()
 EM_SCROLL, SB_LINEUP Scrolls up one line.
 
int PageDown ()
 EM_SCROLL, SB_PAGEDOWN Scrolls down one page.
 
int PageUp ()
 EM_SCROLL, SB_PAGEUP Scrolls up one page.
 
void Insert (LPCTSTR str)
 Inserts the text supplied in str into the edit control at the current text insertion point (cursor position), and replaces any currently selected text.
 
void Insert (const tstring &str)
 
int Search (int startPos, const tstring &text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
 
void GetRect (TRect &frmtRect) const
 Gets the formatting rectangle of a multiline edit control.
 
void SetRect (const TRect &frmtRect)
 Sets the formatting rectangle for a multiline edit control.
 
void SetRectNP (const TRect &frmtRect)
 Sets the formatting rectangle for a multiline edit control.
 
bool FormatLines (bool addEOL)
 Indicates if the end-of-line characters (carriage return, linefeed) are to be added or removed from text lines that are wordwrapped in a multiline edit control.
 
void SetTabStops (int numTabs, const int *tabs)
 Sets the tab stop positions in a multiline edit control.
 
virtual int GetLimitText () const
 
HLOCAL GetMemHandle () const
 Return the memory handle for the edit control's buffer.
 
void SetMemHandle (HLOCAL localMem)
 Sets the memory handle for the edit control's buffer.
 
void SetPasswordChar (uint ch)
 SetPasswordChar sets the character to be displayed in place of a user-typed character.
 
int GetFirstVisibleLine () const
 Indicates the topmost visible line in an edit control.
 
void SetReadOnly (bool readOnly)
 Sets the edit control to be read-only or read-write.
 
uint GetPasswordChar () const
 Returns the character to be displayed in place of a user-typed character.
 
EDITWORDBREAKPROC GetWordBreakProc () const
 Get word-breaking procedure.
 
void SetWordBreakProc (EDITWORDBREAKPROC proc)
 In a multiline edit control, SetWordBreakProc indicates that an application-supplied word-break function has replaced the default word-break function.
 
bool CanUndo () const
 Returns true if it is possible to undo the last edit.
 
void EmptyUndoBuffer ()
 If an operation inside the edit control can be undone, the edit control undo flag is set.
 
void Undo ()
 Undoes the last edit.
 
void Copy ()
 Copies the currently selected text into the Clipboard.
 
void Cut ()
 Deletes the currently selected text and copies it into the Clipboard.
 
bool IsValid (bool reportErr=false)
 Always returns true if the TEdit object does not have an associated TValidator object (i.e.
 
TValidatorGetValidator ()
 Return the validator associated with this edit control.
 
void SetValidator (TValidator *validator)
 Sets a new validator for this control, can be 0. Cleans up the old validator.
 
void ValidatorError ()
 Handles validation errors that occur as a result of validating the edit control.
 
bool IsRefocusing () const
 Return true when this edit control is attempting to regain focus after an EvKillFocus() with invalid contents.
 
void SetLeftMargin (uint16 margin)
 
void SetRightMargin (uint16 margin)
 
void SetMarginUseFontInfo ()
 
uint32 GetMargins () const
 
void Clear () override
 Override TStatic virtual member functions.
 
void SetNotRequired ()
 Sets the requirement option for the edit control to reflect a value is not required.
 
void SetRequired (TRequireOption option=roNonBlank)
 Sets the requirement option for the edit control.
 
TRequireOption GetRequired () const
 Returns the requirement option for the edit control.
 
bool IsRequired () const
 Returns true if a value is required for the edit control.
 
- Public Member Functions inherited from owl::TStatic
 TStatic (TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, uint textLen=0, TModule *=nullptr)
 Constructs a static control object with the supplied parent window (parent), control ID (Id), text (title), position (x, y) relative to the origin of the parent window's client area, width (w), height (h), and default text length (textLimit) of zero.
 
 TStatic (TWindow *parent, int id, const tstring &title, int x, int y, int w, int h, uint textLen=0, TModule *=nullptr)
 String-aware overload.
 
 TStatic (TWindow *parent, int resourceId, uint textLen=0, TModule *=nullptr)
 Constructs a TStatic object to be associated with a static control interface control of a TDialog object.
 
 TStatic (TWindow *parent, int resourceId, const tstring &title, uint textLimit=0, TModule *=nullptr)
 Overload for static controls loaded from resource Allows the title specified in the resource data to be overridden.
 
 TStatic (THandle hWnd, TModule *=nullptr)
 Constructs a TEdit object to encapsulate (alias) an existing control.
 
int GetTextLen () const
 Return the current length of the text in the control, excluding the terminating null character.
 
int GetText (TCHAR *str, int maxChars) const
 Retrieves the static control's text, stores it in the str argument of maxChars size, and returns the number of characters copied, excluding the terminating null character.
 
tstring GetText () const
 String-aware overload.
 
void SetText (LPCTSTR str)
 Sets the static control's text to the string supplied in str.
 
void SetText (const tstring &str)
 
void SetText (uint resourceStringId)
 Sets the static control's text to the resource string identified by the given id.
 
uint GetTextLimit () const
 Returns the length limit of the control's text.
 
void SetTextLimit (uint textlimit)
 Sets the size of the static control's transfer buffer; including space for the terminating null character.
 
HICON GetIcon () const
 Returns the handle of the icon used for this static control.
 
HICON SetIcon (HICON)
 Sets the handle of the icon.
 
auto Transfer (void *buffer, TTransferDirection) -> uint override
 TWindow override Transfers TextLimit characters of text to or from a transfer buffer pointed to by buffer.
 
HANDLE GetImage (TImageType imageType=Bitmap) const
 Return handle of image used for static control.
 
HANDLE SetImage (HANDLE image, TImageType imageType=Bitmap)
 Set handle of image.
 
TTransferBufferFieldType GetTransferBufferFieldType () const
 
void SetTransferBufferFieldType (TTransferBufferFieldType)
 
- Public Member Functions inherited from owl::TControl
 TControl (TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
 Invokes TWindow's constructor, passing it parent (parent window), title (caption text), and module.
 
 TControl (TWindow *parent, int id, const tstring &title, int x, int y, int w, int h, TModule *module=nullptr)
 String-aware overload.
 
 TControl (TWindow *parent, int resourceId, TModule *module=nullptr)
 Constructs an object to be associated with an interface control of a TDialog object.
 
 TControl (TWindow *parent, int resourceId, const tstring &title, TModule *=nullptr)
 Overload for controls loaded from resource Allows the title specified in the resource data to be overridden.
 
 ~TControl () override
 
- Public Member Functions inherited from owl::TWindow
void TraceWindowPlacement ()
 
 TWindow (TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
 Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent.
 
 TWindow (TWindow *parent, const tstring &title, TModule *module=nullptr)
 String-aware overload.
 
 TWindow (HWND handle, TModule *module=nullptr)
 Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias.
 
virtual ~TWindow () override
 Destroys this window (unless this is an alias) and the children.
 
TApplicationGetApplication () const
 Gets a pointer to the TApplication object associated with this.
 
virtual bool Register ()
 Registers the Windows registration class of this window, if this window is not already registered.
 
TScrollerGetScroller ()
 Returns the associated scroller object for this window.
 
void SetScroller (TScroller *scroller)
 Sets the scroller object for this window.
 
virtual void CloseWindow (int retVal=0)
 Determines if it is okay to close a window before actually closing the window.
 
TWindowAttrGetWindowAttr ()
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
const TWindowAttrGetWindowAttr () const
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
LPCTSTR GetCaption () const
 Returns the Title member of TWindow.
 
void ChildBroadcastMessage (TMsgId, TParam1=0, TParam2=0)
 Sends the specified message to all immediate children using SendMessage.
 
TResult HandleMessage (TMsgId, TParam1=0, TParam2=0)
 Dispatches the given message using the response table.
 
virtual TResult EvCommand (uint id, HWND hWndCtl, uint notifyCode)
 WindowProc calls EvCommand to handle WM_COMMAND messages.
 
virtual TResult EvNotify (uint id, TNotify &notifyInfo)
 Handles WM_NOTIFY and subdispatch messages from child controls.
 
TResult DefaultProcessing ()
 Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications.
 
virtual void Paint (TDC &dc, bool erase, TRect &rect)
 Repaints the client area (the area you can use for drawing) of a window.
 
void SubclassWindowFunction ()
 Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc.
 
void SetFlag (uint mask)
 Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
void ClearFlag (uint mask)
 Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
bool IsFlagSet (uint mask)
 Returns the state of the bit flag in Attr.Flags whose mask is supplied.
 
void EnableAutoCreate ()
 Ensures that an associated child window interface element is created and displayed along with its parent window.
 
void DisableAutoCreate ()
 Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window.
 
virtual TTooltipGetTooltip () const
 
virtual void EnableTooltip (bool enable=true)
 
void SetTooltip (TTooltip *tooltip)
 
void EnableTransfer ()
 Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer.
 
void DisableTransfer ()
 Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer.
 
TModuleGetModule () const
 Returns a pointer to the module object.
 
void SetModule (TModule *module)
 Sets the default module for this window.
 
tstring LoadString (uint id) const
 
HBITMAP LoadBitmap (TResId id) const
 
HACCEL LoadAccelerators (TResId id) const
 
HMENU LoadMenu (TResId id) const
 
HCURSOR LoadCursor (TResId id) const
 
HICON LoadIcon (TResId id) const
 
std::string LoadHtml (TResId id) const
 
virtual bool Create ()
 Creates the window interface element to be associated with this ObjectWindows interface element.
 
bool CreateChildren ()
 Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set.
 
virtual void Destroy (int retVal=0)
 Destroys an MS-Windows element associated with the TWindow.
 
virtual int Execute ()
 Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
 
virtual int DoExecute ()
 Do actual modal execution using the Begin/End Modal support of TApplication.
 
void AttachHandle (HWND handle)
 
void DetachHandle ()
 
virtual bool PreProcessMsg (MSG &msg)
 Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message.
 
virtual bool IdleAction (long idleCount)
 Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned.
 
virtual bool HoldFocusHWnd (HWND hLose, HWND hGain)
 Responds to a request by a child window to hold its HWND when it is losing focus.
 
int GetId () const
 Returns Attr.Id, the ID used to find the window in a specified parent's child list.
 
auto ChildWithId (int id) const -> const TWindow *
 
auto ChildWithId (int id) -> TWindow *
 Returns a pointer to the window in the child window list that has the supplied id.
 
HWND GetParentH () const
 Return the handle of the parent.
 
TWindowGetParentO () const
 Return the OWL's parent for this window.
 
TWindowGetParent () const
 Retrieves the OWL object of the parent window. If none exists, returns 0.
 
virtual void SetParent (TWindow *newParent)
 Sets the parent for the specified window by setting Parent to the specified new Parent window object.
 
void SetNext (TWindow *next)
 Sets the next window in the sibling list.
 
virtual bool SetDocTitle (LPCTSTR docname, int index)
 Default behavior for updating document title is to pass it to parent frame.
 
bool SetDocTitle (const tstring &docname, int index)
 
void SetCaption (LPCTSTR title)
 Copies title to an allocated string pointed to by title.
 
void SetCaption (const tstring &title)
 
void SetCaption (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
bool SetCursor (TModule *module, TResId resId)
 Sets the mouse cursor for the window, loading the given resId from the given module.
 
auto GetBkgndColor () const -> TColor
 Returns the overriding background color set for the window.
 
void SetBkgndColor (TColor color, bool shouldUpdate=true)
 Sets the background color for the window.
 
auto GetTextColor () const -> TColor
 Returns the overriding text color set for the window.
 
void SetTextColor (TColor color, bool shouldUpdate=true)
 Sets the text color for the window.
 
void SetAcceleratorTable (TResId resId)
 
TResult ForwardMessage (HWND handle, bool send=true)
 Forwards the window's current message.
 
TResult ForwardMessage (bool send=true)
 Forwards the window's current message.
 
void SendNotification (int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
void SendNotification (HWND receiver, int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
TResult SendNotification (int id, NMHDR &, TMsgId=WM_NOTIFY)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
TResult SendNotification (HWND receiver, uint id, NMHDR &, TMsgId=WM_NOTIFY)
 Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
 
virtual TResult WindowProc (TMsgId, TParam1, TParam2)
 First virtual function called to handling incoming messages to a TWindow.
 
virtual TResult DefWindowProc (TMsgId, TParam1, TParam2)
 Virtual function provides final default processing for an incoming message Calls original window proc that was subclassed, using ::CallWindowProc to make sure that registers get setup correctly.
 
virtual void EvCommandEnable (TCommandEnabler &ce)
 Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message.
 
void RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce)
 Walks the chain of windows from the initial target window to this window.
 
void SetTransferBuffer (void *transferBuffer, uint size)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TBuffer >
void SetTransferBuffer (TBuffer *transferBuffer)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TElement , uint Count>
void SetTransferBuffer (TElement(&transferBuffer)[Count])
 Sets TransferBuffer and TransferBufferSize.
 
voidGetTransferBuffer () const
 
uint GetTransferBufferSize () const
 
virtual void TransferData (TTransferDirection direction)
 Transfers data between the TWindow's data buffer and the child windows in its ChildList (data is not transfered between any child windows whose wfTransfer flag is not set)
 
HWND GetHandle () const
 Returns the handle of the window.
 
 operator HWND () const
 Allows a TWindow& to be used as an HWND in Windows API calls by providing an implicit conversion from TWindow to HWND.
 
bool IsWindow () const
 Returns true if an HWND is being used.
 
auto GetClassName (TCHAR *className, int maxCount) const -> int
 Returns the Windows class name for this object's window handle.
 
long GetClassLong (int index) const
 Retrieves the 32-bit value containing information about the window class.
 
long SetClassLong (int index, long newLong)
 Sets the long value at the specified offset (index).
 
uint16 GetClassWord (int index) const
 Gets a 16-bit value containing information about the class or style of the window.
 
uint16 SetClassWord (int index, uint16 newWord)
 Sets the word value at the specified offset (index).
 
LONG_PTR GetWindowLongPtr (int index) const
 Retrieves information about the window depending on the value stored in index.
 
LONG_PTR SetWindowLongPtr (int index, LONG_PTR newLong)
 Changes information about the window. For a list of constants, see GetWindowLongPtr()
 
long GetWindowLong (int index) const
 Retrieves information about the window depending on the value stored in index.
 
long SetWindowLong (int index, long newLong)
 Changes information about the window.
 
uint16 GetWindowWord (int index) const
 Retrieves information about this window depending on the value of index.
 
uint16 SetWindowWord (int index, uint16 newWord)
 Changes information about the window.
 
WNDPROC GetWindowProc () const
 
WNDPROC SetWindowProc (WNDPROC wndProc)
 
int EnumProps (PROPENUMPROC proc)
 Enumerates all the items in the property list of the current window and passes them one by one to the callback function indicated in proc.
 
HANDLE GetProp (uint16 atom) const
 Returns a handle to the property list of the specified window.
 
HANDLE RemoveProp (uint16 atom) const
 Removes the property specified by atom from the application's property list.
 
bool SetProp (uint16 atom, HANDLE data) const
 Adds an item to the property list of the specified window.
 
HANDLE GetProp (LPCTSTR str) const
 Returns a handle to the property list of the specified window.
 
HANDLE GetProp (const tstring &str) const
 
HANDLE RemoveProp (LPCTSTR str) const
 Removes the property specified by str, a null-terminated string, from the application's property list.
 
HANDLE RemoveProp (const tstring &str) const
 
bool SetProp (LPCTSTR str, HANDLE data) const
 Adds an item to the property list of the specified window.
 
bool SetProp (const tstring &str, HANDLE data) const
 
uint32 GetStyle () const
 Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 SetStyle (uint32 style)
 Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 GetExStyle () const
 Gets the extra style bits of the window.
 
uint32 SetExStyle (uint32 style)
 Sets the extra style bits of the window.
 
bool ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
bool ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
bool MoveWindow (int x, int y, int w, int h, bool repaint=false)
 Repositions the specified window.
 
bool MoveWindow (const TRect &rect, bool repaint=false)
 Repositions the window.
 
virtual bool ShowWindow (int cmdShow)
 Displays this TWindow in a given state.
 
void ShowOwnedPopups (bool show)
 Shows or hides all owned pop-up windows according to the value of show.
 
bool IsWindowVisible () const
 Returns true if the window is visible.
 
bool IsZoomed () const
 Returns true if window is zoomed or maximized.
 
bool IsIconic () const
 Returns true if window is iconic or minimized.
 
int GetWindowTextLength () const
 Returns the length, in characters, of the specified window's title.
 
int GetWindowText (TCHAR *str, int maxCount) const
 Copies the window's title into a buffer pointed to by string.
 
tstring GetWindowText () const
 String-aware overload.
 
void SetWindowText (LPCTSTR str)
 Sets the window's text to the given string (by copying).
 
void SetWindowText (const tstring &str)
 
void SetWindowText (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
WINDOWPLACEMENT GetWindowPlacement () const
 Wrapper for Windows API.
 
void SetWindowPlacement (const WINDOWPLACEMENT &place)
 Wrapper for Windows API.
 
virtual void Invalidate (bool erase=true)
 Invalidates (mark for painting) the entire client area of a window.
 
virtual void InvalidateRect (const TRect &rect, bool erase=true)
 Invalidates a specified client area.
 
void InvalidateRgn (HRGN hRgn, bool erase=true)
 Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message.
 
void Validate ()
 Calls the function ValidateRect to validate (that is, remove from the area to be updated) the entire client area (the area you can use for drawing).
 
void ValidateRect (const TRect &rect)
 Validates a portion of the client area indicated by rect.
 
void ValidateRgn (HRGN hRgn)
 Validates the client area within a region of the current window.
 
void UpdateWindow ()
 Updates the client area of the specified window by immediately sending a WM_PAINT message.
 
bool FlashWindow (bool invert)
 Changes the window from active to inactive or vice versa.
 
bool GetUpdateRect (TRect &rect, bool erase=true) const
 Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window.
 
int GetUpdateRgn (TRegion &rgn, bool erase=true) const
 Copies a window's update region into a region specified by region.
 
bool LockWindowUpdate (bool lock=true)
 Prevents or enables window drawing for one window at a time.
 
bool RedrawWindow (TRect *update, HRGN hUpdateRgn, uint redrawFlags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 Redraws the rectangle specified by update and the region specified by hUpdateRgn.
 
auto GetWindowRgn (TRegion &) const -> int
 Obtains a copy of the region of the window within which the system permits drawing.
 
void ResetWindowRgn (bool repaint=false)
 Calls SetWindowRgn(nullptr, repaint).
 
auto SetWindowRgn (HRGN, bool repaint=false) -> bool
 Sets the area within the window where the system permits drawing.
 
auto SetWindowRgn (const TRegion &, bool repaint=false) -> bool=delete
 
auto SetWindowRgn (TRegion &&r, bool repaint=false) -> bool
 Overload for TRegion.
 
int GetDlgCtrlID () const
 Returns the ID of the control.
 
HWND GetDlgItem (int childId) const
 Retrieves the handle of a control specified by childId.
 
uint GetDlgItemInt (int childId, bool *translated=0, bool isSigned=true) const
 Translates the text of a specified control into an integer value and returns it.
 
void SetDlgItemInt (int childId, uint value, bool isSigned=true) const
 Sets the child window with the Id (childId) in the window to the integer value specified in value.
 
int GetDlgItemText (int childId, TCHAR *text, int maxValue) const
 Retrieves the text of a control specified by childId.
 
tstring GetDlgItemText (int childId) const
 String-aware overload.
 
void SetDlgItemText (int childId, LPCTSTR text) const
 Sets the title or text of a control in a dialog box.
 
void SetDlgItemText (int childId, const tstring &text) const
 
void SetDlgItemText (int childId, uint resourceStringId) const
 
uint IsDlgButtonChecked (int buttonId) const
 Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither.
 
bool IsChild (HWND hWnd) const
 Returns true if the window is a child window or a descendant window of this window.
 
HWND GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const
 Returns either the next or the previous control in the dialog box.
 
HWND GetNextDlgTabItem (HWND hWndCtrl, bool previous=false) const
 Returns the handle of the first control that lets the user press the Tab key to move to the next control (that is, the first control with the WS_TABSTOP style associated with it).
 
void CheckDlgButton (int buttonId, uint check)
 Places a check mark in (or removes a check mark from) the button specified in buttonId.
 
void CheckRadioButton (int firstButtonId, int lastButtonId, int checkButtonId)
 Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group.
 
void SetDlgItemFont (int childId, HFONT f, bool redraw=false) const
 
HFONT GetDlgItemFont (int childId) const
 
TRect GetDlgItemRect (int childId) const
 Returns the window rectangle of the given child, specified in this window's client coordinates.
 
HMENU GetMenu () const
 Returns the handle to the menu of the indicated window.
 
HMENU GetSystemMenu (bool revert=false) const
 Returns a handle to the system menu so that an application can access the system menu.
 
bool SetMenu (HMENU hMenu)
 Sets the specified window's menu to the menu indicated by hMenu.
 
bool HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite)
 Either highlights or removes highlighting from a top-level item in the menu.
 
void DrawMenuBar ()
 DrawMenuBar redraws the menu bar.
 
bool KillTimer (UINT_PTR timerId)
 Gets rid of the timer and removes any WM_TIMER messages from the message queue.
 
UINT_PTR SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
 Creates a timer object associated with this window.
 
bool RegisterHotKey (int idHotKey, uint modifiers, uint virtKey)
 Registers a hotkey ID with the current application.
 
bool UnregisterHotKey (int idHotKey)
 Unregisters a hotkey ID with the current application.
 
bool WinHelp (LPCTSTR helpFile, uint command, ULONG_PTR data) const
 Invokes a specified help system.
 
bool WinHelp (const tstring &helpFile, uint command, ULONG_PTR data) const
 
void AssignContextMenu (TPopupMenu *menu)
 Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message.
 
TPopupMenuGetContextMenu () const
 Returns the associated popup menu used by the window.
 
int MessageBox (LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK) const
 Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type).
 
int MessageBox (const tstring &text, const tstring &caption=tstring(), uint flags=MB_OK) const
 
int MessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK) const
 
int MessageBox (uint resId, const tstring &caption, uint flags=MB_OK) const
 
auto MessageBoxIndirect (HINSTANCE resourceModule, TResId text, TResId caption, uint flags, TResId icon, DWORD_PTR contextHelpId, MSGBOXCALLBACK, DWORD languageId) const -> int
 Displays a standard message box.
 
auto MessageBoxIndirect (TResId icon, const tstring &text, const tstring &caption, uint flags=MB_OK) const -> int
 Displays a standard message box using the given icon.
 
auto FormatMessageBox (const tstring &formatStr, const tstring &caption, uint flags,...) const -> int
 
auto FormatMessageBox (const tstring &, std::nullptr_t, uint,...) const -> int=delete
 
HTASK GetWindowTask () const
 Returns a handle to the task that created the specified window.
 
void DragAcceptFiles (bool accept)
 If a window can process dropped files, DragAcceptFiles sets accept to true.
 
TCurrentEventGetCurrentEvent ()
 Returns the current event to be processed in the message queue.
 
void SethAccel (HACCEL)
 
auto GetChildren ()
 Returns a TWindow::TChildrenRange that can be iterated by standard means.
 
auto GetChildren () const
 Const overload of TWindow::GetChildren.
 
TWindowNext ()
 Returns a pointer to the next sibling window in the window's sibling list.
 
auto Next () const -> const TWindow *
 
TWindowPrevious ()
 Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list)
 
auto Previous () const -> const TWindow *
 
TWindowGetFirstChild ()
 Returns a pointer to the first child window, which is the first window created in the interface object's child list.
 
auto GetFirstChild () const -> const TWindow *
 
TWindowGetLastChild ()
 Returns a pointer to the last child window in the interface object's child list.
 
auto GetLastChild () const -> const TWindow *
 
uint NumChildren () const
 Returns the number of child windows of the window.
 
bool GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const
 Retrieves the properties of the given scroll bar.
 
SCROLLINFO GetScrollInfo (int bar, uint mask=SIF_ALL) const
 Function-style overload Returns selected properties of the given scroll bar.
 
int SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true)
 Sets the properties of the given scroll bar.
 
int GetScrollPos (int bar) const
 Returns the thumb position in the scroll bar.
 
int SetScrollPos (int bar, int pos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
int GetScrollTrackPos (int bar) const
 Returns the thumb track position in the scroll bar.
 
void GetScrollRange (int bar, int &minPos, int &maxPos) const
 Returns the minimum and maximum positions in the scroll bar.
 
TScrollRange GetScrollRange (int bar) const
 Function-style overload.
 
void SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
void SetScrollRange (int bar, const TScrollRange &, bool redraw=true)
 Overload taking the range as a pair.
 
int GetScrollPage (int bar) const
 Returns the page property (SCROLLINFO::nPage) of the given scroll bar.
 
void SetScrollPage (int bar, int page, bool redraw=true)
 Sets the page property (SCROLLINFO::nPage) of the given scroll bar.
 
bool EnableScrollBar (uint sbFlags=SB_BOTH, uint arrowFlags=ESB_ENABLE_BOTH)
 Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window.
 
void ShowScrollBar (int bar, bool show=true)
 Displays or hides the scroll bar.
 
void ScrollWindow (int dx, int dy, const TRect *scroll=nullptr, const TRect *clip=nullptr)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 
void ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=nullptr, TRect *update=0, uint flags=0)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 
void ShutDownWindow (int retVal=0)
 This inline version of ShutDownWindow calls the static version of ShutDownWindow.
 
TResult SendMessage (TMsgId, TParam1=0, TParam2=0) const
 Sends a message (msg) to a specified window or windows.
 
TResult SendDlgItemMessage (int childId, TMsgId, TParam1=0, TParam2=0)
 Sends a message (msg) to the control specified in childId.
 
bool PostMessage (TMsgId, TParam1=0, TParam2=0)
 Posts a message (msg) to the window in the application's message queue.
 
HWND SetCapture ()
 Sets the mouse capture to the current window.
 
HWND SetFocus ()
 Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window.
 
bool IsWindowEnabled () const
 Returns true if the window is enabled.
 
virtual bool EnableWindow (bool enable)
 Allows the given window to receive input from the keyboard of mouse.
 
void SetRedraw (bool redraw)
 Sends a WM_SETREDRAW message to a window so that changes can be redrawn (redraw = true) or to prevent changes from being redrawn (redraw = false).
 
bool TrackMouseEvent (uint flags=TME_HOVER|TME_LEAVE, int hoverTime=HOVER_DEFAULT)
 Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time.
 
bool CancelMouseEvent (uint flags=TME_HOVER|TME_LEAVE)
 Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag.
 
TRACKMOUSEEVENT QueryMouseEventTracking () const
 Returns the current state of mouse event tracking initiated by TrackMouseEvent.
 
void ClientToScreen (TPoint &point) const
 Converts the client coordinates specified in point to screen coordinates for the new window.
 
TPoint MapClientToScreen (const TPoint &p) const
 Function-style version of ClientToScreen.
 
void MapClientToScreen (TPoint *p, int count) const
 Maps the given points, specified in client coordinates in this window, to screen coordinates.
 
template<size_t Count>
void MapClientToScreen (TPoint(&p)[Count]) const
 Overload for array See MapClientToScreen(TPoint*, int).
 
TRect MapClientToScreen (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void ScreenToClient (TPoint &point) const
 Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point.
 
TPoint MapScreenToClient (const TPoint &p) const
 Functional-style version of ScreenToClient.
 
void MapScreenToClient (TPoint *p, int count) const
 Maps the given points, specified in screen coordinates, to client coordinates in this window.
 
template<size_t Count>
void MapScreenToClient (TPoint(&p)[Count]) const
 Overload for array See MapScreenToClient(TPoint*, int).
 
TRect MapScreenToClient (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void MapWindowPoints (HWND hWndTo, TPoint *pts, int count) const
 Maps a set of points in one window to a relative set of points in another window.
 
void MapWindowPoints (const TWindow &wndTo, TPoint *p, int n) const
 Overload for TWindow See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (HWND hWndTo, TPoint(&p)[Count]) const
 Overload for array See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (const TWindow &wndTo, TPoint(&p)[Count]) const
 Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int).
 
TPoint MapWindowPoints (HWND hWndTo, const TPoint &p) const
 Functional-style overload for TPoint; converts the given point coordinates and returns the result.
 
TPoint MapWindowPoints (const TWindow &wndTo, const TPoint &p) const
 Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&).
 
TRect MapWindowPoints (HWND hWndTo, const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
TRect MapWindowPoints (const TWindow &wndTo, const TRect &r) const
 Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&).
 
TRect MapWindowRect (HWND hWndTo) const
 Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window.
 
TRect MapWindowRect (const TWindow &wndTo) const
 Overload for TWindow See MapWindowRect(HWND).
 
TRect MapClientRect (HWND hWndTo) const
 Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window.
 
TRect MapClientRect (const TWindow &wndTo) const
 Overload for TWindow See MapClientRect(HWND).
 
void GetClientRect (TRect &rect) const
 Gets the coordinates of the window's client area and then copies them into the object referred to by TRect.
 
TRect GetClientRect () const
 Gets the coordinates of the window's client area (the area in a window you can use for drawing).
 
HWND ChildWindowFromPoint (const TPoint &point) const
 Determines which of the child windows contains the point specified in TPoint.
 
void GetWindowRect (TRect &rect) const
 Gets the screen coordinates of the window's rectangle and copies them into rect.
 
TRect GetWindowRect () const
 Gets the screen coordinates of the window's rectangle.
 
TRect GetChildRect (HWND hWnd) const
 Returns the window rectangle of the given window, specified in this window's client coordinates.
 
TRect GetChildRect (const TWindow &wnd) const
 Overload for TWindow See GetChildRect(HWND).
 
void BringWindowToTop ()
 Brings a pop-up or child window to the top of the stack of overlapping windows and activates it.
 
HWND SetActiveWindow ()
 Activates a top-level window.
 
HWND GetLastActivePopup () const
 Returns the last active pop-up window in the list.
 
HWND GetNextWindow (uint dirFlag) const
 Finds the handle associated with either the next or previous window in the window manager's list.
 
HWND GetTopWindow () const
 Returns a handle to the top window currently owned by this parent window.
 
HWND GetWindow (uint cmd) const
 Returns the handle of the window that has the indicated relationship to this window.
 
bool SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags)
 Changes the size of the window pointed to by rect.
 
bool SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags)
 Set the new window position.
 
void CreateCaret (HBITMAP hBitmap)
 Creates a new caret for the system.
 
void CreateCaret (bool isGray, int width, int height)
 Create a new caret for the system with the specified shape, bitmap shade, width, and height.
 
void HideCaret ()
 Removes the caret from the specified display screen.
 
void ShowCaret ()
 Displays the caret in the specified shape in the active window at the current position.
 
void SetWindowFont (HFONT font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
void SetWindowFont (const TFont &font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
HFONT GetWindowFont ()
 Gets the font the control uses to draw text.
 
- Public Member Functions inherited from owl::TEventHandler
virtual bool Find (TEventInfo &info, TEqualOperator op=0)
 Searches the list of response table entries looking for a match.
 
TResult Dispatch (TEventInfo &info, TParam1, TParam2=0)
 Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function.
 
TResult DispatchMsg (TMsgId, uint id, TParam1, TParam2)
 Search for the event given the message and it and dispatch to the event handler if found.
 
- Public Member Functions inherited from owl::TStreamableBase
virtual ~TStreamableBase ()
 

Protected Member Functions

void CmEditCut ()
 Handler of the CM_EDITCUT command - Invokes the 'Cut' method.
 
void CmEditCopy ()
 Handler of the CM_EDITCOPY command - invokes the'Copy' method.
 
void CmEditPaste ()
 Handler of the CM_EDITPASTE command - invokes the 'Paste' method.
 
void CmEditDelete ()
 Handler of the CM_EDITDELETE command - invokes the 'DeleteSelection' method.
 
void CmEditClear ()
 Handler of the CM_EDITCLEAR command - invokes the 'Clear' method.
 
void CmEditUndo ()
 Handler of the CM_EDITUNDO command - invokes the 'Undo' method.
 
void CeHasSelect (TCommandEnabler &commandHandler)
 
void CeEditPaste (TCommandEnabler &commandHandler)
 
void CeEditClear (TCommandEnabler &commandHandler)
 
void CeEditUndo (TCommandEnabler &commandHandler)
 
void ENErrSpace ()
 
auto GetWindowClassName () -> TWindowClassName override
 Returns name of predefined Windows edit class.
 
void SetupWindow () override
 Updates the list of filters describing files which can be opened by the rich edit control.
 
void EvChar (uint key, uint repeatCount, uint flags)
 WM_CHAR handler to bypass TEdit's handler (which caters to validators).
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).
 
uint EvGetDlgCode (const MSG *)
 WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).
 
void EvSetFocus (HWND hWndLostFocus)
 WM_SETFOCUS handler to bypass TEdit's handler (which caters to validators).
 
void EvKillFocus (HWND hWndGetFocus)
 WM_KILLFOCUS handler to bypass TEdit's handler (which caters to validators).
 
- Protected Member Functions inherited from owl::TEditFile
void CmFileNew ()
 CM_FILENEW.
 
void CmFileOpen ()
 CM_FILEOPEN.
 
void CmFileSave ()
 CM_FILESAVE.
 
void CmFileSaveAs ()
 CM_FILESAVEAS.
 
void CmSaveEnable (TCommandEnabler &commandHandler)
 Enables save command (only if text is modified).
 
- Protected Member Functions inherited from owl::TEdit
void EvChildInvalid (HWND)
 Handler for input validation message sent by parent.
 
int ScrollText (int how)
 
void CmEditCut ()
 CM_EDITCUT.
 
void CmEditCopy ()
 CM_EDITCOPY.
 
void CmEditPaste ()
 CM_EDITPASTE.
 
void CmEditDelete ()
 CM_EDITDELETE.
 
void CmEditClear ()
 CM_EDITCLEAR.
 
void CmEditUndo ()
 CM_EDITUNDO.
 
void CmSelectEnable (TCommandEnabler &commandHandler)
 This function is called for Cut/Copy/Delete menu items to determine whether or not the item is enabled.
 
void CmPasteEnable (TCommandEnabler &commandHandler)
 This function is called for the Paste menu item to determine whether or not the item is enabled.
 
void CmCharsEnable (TCommandEnabler &commandHandler)
 This function is called for the Clear menu item to determine whether or not the item is enabled.
 
void CmModEnable (TCommandEnabler &commandHandler)
 This function is called for the Undo menu item to determine whether or not the item is enabled.
 
void ENErrSpace ()
 EN_ERRSPACE.
 
void EvChar (uint key, uint repeatCount, uint flags)
 Validates Self whenever a character is entered.
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 EvKeyDown translates the virtual key code into a movement.
 
uint EvGetDlgCode (const MSG *)
 Responds to WM_GETDLGCODE messages that are sent to a dialog box associated with a control.
 
void EvSetFocus (HWND hWndLostFocus)
 Handle the set focus message and make sure the anti-oscillation flag is cleared.
 
void EvKillFocus (HWND hWndGetFocus)
 Validates this whenever the focus is about to be lost.
 
bool EvUpDown (TNmUpDown &)
 Handles up-down messages from an up-down control and adjusts contents if there is a validator to help.
 
- Protected Member Functions inherited from owl::TStatic
auto GetWindowClassName () -> TWindowClassName override
 Returns the name of TStatic's registration class (STATIC)
 
void EvSize (uint sizeType, const TSize &size)
 Overrides TWindow's virtual EvSize function.
 
- Protected Member Functions inherited from owl::TControl
 TControl (HWND hWnd, TModule *module=nullptr)
 Constructor to alias non-OWL control.
 
virtual int CompareItem (COMPAREITEMSTRUCT &compareInfo)
 Function called when a WM_COMPAREITEM is sent to parent on our behalf.
 
virtual void DeleteItem (DELETEITEMSTRUCT &deleteInfo)
 Function called when a WM_DELETEITEM is sent to parent on our behalf.
 
virtual void MeasureItem (MEASUREITEMSTRUCT &measureInfo)
 Function called when a WM_MEASUREITEM is sent to parent on our behalf.
 
virtual void DrawItem (DRAWITEMSTRUCT &drawInfo)
 Function called when a WM_DRAWITEM is sent to parent on our behalf.
 
virtual void ODADrawEntire (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification message sent to a drawable control when the control needs to be drawn.
 
virtual void ODAFocus (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification sent to a drawable control when the focus has shifted to or from the control.
 
virtual void ODASelect (DRAWITEMSTRUCT &drawInfo)
 Responds to a notification sent to a drawable control when the selection state of the control changes.
 
void EvPaint ()
 Intercept WM_PAINT to redirect from TWindow to the underlying control if this Owl object is just a wrapper for a predefined class.
 
auto EvEraseBkgnd (HDC) -> bool
 Provides special handling for predefined controls.
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &comp)
 Handles WM_COMPAREITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &del)
 Handles WM_DELETEITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &draw)
 Handles WM_DRAWITEM message (for owner draw controls) by calling the corresponding virtual function.
 
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &meas)
 Handles WM_MEASUREITEM message (for owner draw controls) by calling the corresponding virtual function.
 
- Protected Member Functions inherited from owl::TWindow
 TWindow ()
 Protected constructor for use by immediate virtually derived classes.
 
void Init (TWindow *parent, LPCTSTR title, TModule *module)
 Normal initialization of a default constructed TWindow.
 
void Init (TWindow *parent, const tstring &title, TModule *module)
 
void Init (HWND hWnd, TModule *module)
 Wrapper initialization of a default constructed TWindow.
 
virtual THandle PerformCreate ()
 Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow.
 
void SetHandle (THandle)
 Sets the window handle in a derived class.
 
void GetHWndState (bool forceStyleSync=false)
 Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members.
 
void GetWindowTextTitle ()
 Updates the TWindow internal caption (Title) from the current window's caption.
 
virtual void GetWindowClass (WNDCLASS &wndClass)
 Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered.
 
void PerformSetupAndTransfer ()
 Ensures that the window is fully set up; then transfers data into the window.
 
virtual void CleanupWindow ()
 Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources.
 
void DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl)
 Called by EvHScroll and EvVScroll to dispatch messages from scroll bars.
 
void LoadAcceleratorTable ()
 Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable).
 
virtual void RemoveChild (TWindow *child)
 Removes a child window.
 
TWindowGetWindowPtr (HWND hWnd) const
 Calls TApplication:GetWindowPtr on the application associated with this window.
 
void EvClose ()
 The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed.
 
bool EvCreate (CREATESTRUCT &)
 Response method for an incoming WM_CREATE message.
 
void EvDestroy ()
 Responds to an incoming WM_DESTROY message.
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &compareInfo)
 Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &deleteInfo)
 Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &drawInfo)
 
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &measureInfo)
 Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself.
 
void EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_HSCROLL message.
 
void EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_VSCROLL message.
 
void EvMove (const TPoint &clientOrigin)
 Save the normal position of the window.
 
void EvNCDestroy ()
 Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element.
 
bool EvQueryEndSession (uint flags)
 Respond to Windows attempt to close down.
 
void EvSize (uint sizeType, const TSize &size)
 Response method for an incoming WM_SIZE message.
 
void EvLButtonDown (uint modKeys, const TPoint &point)
 Response method for an incoming WM_LBUTTONDOWN message.
 
bool EvEraseBkgnd (HDC)
 Handler for WM_ERASEBKGND.
 
void EvPaint ()
 Response method for an incoming WM_PAINT message.
 
void EvSysColorChange ()
 Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.
 
void EvChildInvalid (HWND hWnd)
 Handle message posted to us by a control needing assistance in dealing with invalid inputs.
 
void EvCompacting (uint compactRatio)
 The default message handler for WM_COMPACTING.
 
void EvDevModeChange (LPCTSTR devName)
 The default message handler for WM_DEVMODECHANGE.
 
void EvEnable (bool enabled)
 The default message handler for WM_ENABLE.
 
void EvEndSession (bool endSession, uint flags)
 Provides default handling for WM_ENDSESSION.
 
void EvFontChange ()
 The default message handler for WM_FONTCHANGE.
 
void EvSysCommand (uint cmdType, const TPoint &point)
 Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box.
 
void EvTimeChange ()
 The default message handler for WM_TIMECHANGE.
 
void EvTimer (uint timerId)
 The default message handler for WM_TIMER.
 
void EvSettingChange (uint flags, LPCTSTR section)
 
void EvActivate (uint active, bool minimized, HWND hWndOther)
 Default message handler for WM_ACTIVATE.
 
void EvActivateApp (bool active, DWORD threadId)
 The default message handler for WM_ACTIVATEAPP.
 
void EvCancelMode ()
 The default message handler for WM_CANCELMODE.
 
void EvGetMinMaxInfo (MINMAXINFO &minmaxinfo)
 The default message handler for WM_GETMINMAXINFO.
 
int EvGetText (int bufSize, TCHAR *buf)
 The default message handler for WM_GETTEXT.
 
int EvGetTextLength ()
 The default message handler for WM_GETTEXTLENGTH.
 
void EvKillFocus (HWND hWndGetFocus)
 Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.
 
uint EvMouseActivate (HWND hTopLevel, uint hitCode, TMsgId)
 The default message handler for WM_MOUSEACTIVATE.
 
void EvHotKey (int idHotKey, uint modifiers, uint vk)
 
bool EvCopyData (HWND hwnd, const COPYDATASTRUCT &)
 
void EvNextDlgCtl (TParam1 handleOrDirectionFlag, bool isHandle)
 
void EvParentNotify (const TParentNotify &)
 The default message handler for WM_PARENTNOTIFY.
 
HICON EvQueryDragIcon ()
 The default message handler for WM_QUERYDRAGICON.
 
bool EvQueryOpen ()
 The default message handler for WM_QUERYOPEN.
 
void EvQueueSync ()
 The default message handler for WM_QUEUESYNC.
 
bool EvSetCursor (HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
 Response method for an incoming WM_SETCURSOR message.
 
void EvSetFocus (HWND hWndLostFocus)
 The default message handler for WM_SETFOCUS.
 
HFONT EvGetFont ()
 The default message handler for WM_GETFONT.
 
void EvSetFont (HFONT hFont, bool redraw)
 The default message handler for WM_SETFONT.
 
void EvSetRedraw (bool redraw)
 The default message handler for WM_SETREDRAW.
 
void EvSetText (LPCTSTR text)
 The default message handler for WM_SETTEXT.
 
void EvShowWindow (bool show, uint status)
 The default message handler for WM_SHOWWINDOW.
 
void EvWindowPosChanged (const WINDOWPOS &windowPos)
 The default message handler for WM_WINDOWPOSCHANGED.
 
bool EvWindowPosChanging (WINDOWPOS &)
 The default message handler for WM_WINDOWPOSCHANGING.
 
HBRUSH EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType)
 Handler for control color messages (WM_CTLCOLOR family).
 
void EvChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_CHAR.
 
void EvDeadChar (uint deadKey, uint repeatCount, uint flags)
 The default message handler for WM_DEADCHAR.
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYDOWN.
 
void EvKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYUP.
 
void EvSysChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSCHAR.
 
void EvSysDeadChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSDEADCHAR.
 
void EvSysKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYDOWN.
 
void EvSysKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYUP.
 
void EvLButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONDBLCLK.
 
void EvLButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONUP.
 
void EvMButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDBLCLK.
 
void EvMButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDOWN.
 
void EvMButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONUP.
 
void EvMouseMove (uint modKeys, const TPoint &point)
 The default message handler for WM_MOUSEMOVE.
 
void EvMouseHWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEHWHEEL.
 
void EvMouseWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEWHEEL.
 
void EvRButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDBLCLK.
 
void EvRButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDOWN.
 
void EvRButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONUP.
 
void EvInitMenu (HMENU hMenu)
 The default message handler for WM_INITMENU.
 
void EvInitMenuPopup (HMENU hPopupMenu, uint index, bool isSysMenu)
 Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items.
 
int32 EvMenuChar (uint nChar, uint menuType, HMENU hMenu)
 The default message handler for WM_MENUCHAR.
 
void EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu)
 The default message handler for WM_MENUSELECT.
 
void EvContextMenu (HWND childHwnd, int x, int y)
 The default message handler for WM_CONTEXTMENU.
 
uint EvGetDlgCode (const MSG *msg)
 The default message handler for WM_GETDLGCODE.
 
void EvEnterIdle (uint source, HWND hWndDlg)
 The default message handler for WM_ENTERIDLE.
 
void EvSpoolerStatus (uint jobStatus, uint jobsLeft)
 The default message handler for WM_SPOOLERSTATUS.
 
void EvAskCBFormatName (uint bufLen, TCHAR *buffer)
 The default message handler for WM_ASKCBFORMATNAME.
 
void EvChangeCBChain (HWND hWndRemoved, HWND hWndNext)
 The default message handler for WM_CHANGECBCHAIN.
 
void EvDrawClipboard ()
 The default message handler for WM_DRAWCLIPBOARD.
 
void EvDestroyClipboard ()
 The default message handler for WM_DESTROYCLIPBOARD.
 
void EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_HSCROLLCLIPBOARD.
 
void EvPaintClipboard (HWND hWnd, const PAINTSTRUCT &)
 The default message handler for WM_PAINTCLIPBOARD.
 
void EvRenderAllFormats ()
 The default message handler for WM_RENDERALLFORMATS.
 
void EvRenderFormat (uint dataFormat)
 The default message handler for WM_RENDERFORMAT.
 
void EvSizeClipboard (HWND hWndViewer, const TRect &)
 The default message handler for WM_SIZECLIPBOARD.
 
void EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_VSCROLLCLIPBOARD.
 
void EvPaletteChanged (HWND hWndPalChg)
 The default message handler for WM_PALETTECHANGED.
 
void EvPaletteIsChanging (HWND hWndPalChg)
 The default message handler for WM_PALETTEISCHANGING.
 
bool EvQueryNewPalette ()
 The default message handler for WM_QUERYNEWPALETTE.
 
void EvDropFiles (TDropInfo dropInfo)
 The default message handler for WM_DROPFILES.
 
int EvCharToItem (uint ch, HWND hWndListBox, int caretIndex)
 The default message handler for WM_CHARTOITEM.
 
int EvVKeyToItem (uint key, HWND hWndListBox, int caretIndex)
 The default message handler for WM_VKEYTOITEM.
 
bool EvNCActivate (bool active)
 The default message handler for WM_NCACTIVATE.
 
uint EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &)
 The default message handler for WM_NCCALCSIZE.
 
bool EvNCCreate (CREATESTRUCT &)
 The default message handler for WM_NCCREATE.
 
uint EvNCHitTest (const TPoint &)
 The default message handler for WM_NCHITTEST.
 
void EvNCLButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDBLCLK.
 
void EvNCLButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDOWN.
 
void EvNCLButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONUP.
 
void EvNCMButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDBLCLK.
 
void EvNCMButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDOWN.
 
void EvNCMButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONUP.
 
void EvNCMouseMove (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMOUSEMOVE.
 
void EvNCPaint (HRGN)
 The default message handler for WM_NCPAINT.
 
void EvNCRButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDBLCLK.
 
void EvNCRButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDOWN.
 
void EvNCRButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONUP.
 
HICON EvGetIcon (bool isBigIcon)
 
HICON EvSetIcon (bool isBigIcon, HICON)
 
- Protected Member Functions inherited from owl::TEventHandler
bool SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op)
 Low-level response table search function.
 

Protected Attributes

uint Format
 
- Protected Attributes inherited from owl::TStatic
TTransferBufferFieldType TransferBufferFieldType
 

Additional Inherited Members

- Static Public Member Functions inherited from owl::TWindow
static void ShutDownWindow (TWindow *win, int retVal=0)
 This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object.
 
static HWND GetCapture ()
 Returns the handle of the window that has captured the mouse.
 
static void ReleaseCapture ()
 Releases the mouse capture from this window.
 
static HWND GetFocus ()
 Gets a handle to the window that has the focus.
 
static HWND WindowFromPoint (const TPoint &point)
 Returns the handle of the window in which the specified point (point) lies.
 
static void AdjustWindowRect (TRect &rect, uint32 style, bool menu)
 Calculates the size of the window rectangle according to the indicated client-rectangle size.
 
static void AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle)
 Calculates the size of a window rectangle that has an extended style.
 
static HWND GetActiveWindow ()
 Retrieves the handle of the active window.
 
static HWND GetDesktopWindow ()
 Returns a handle to the desktop window.
 
static uint GetCaretBlinkTime ()
 Retrieves the caret blink rate in milliseconds.
 
static void GetCaretPos (TPoint &point)
 Gets the position of the caret in the coordinates of the client window.
 
static TPoint GetCaretPos ()
 
static void SetCaretBlinkTime (uint16 milliSecs)
 Sets the caret blink rate in milliseconds.
 
static void SetCaretPos (int x, int y)
 Sets the position of the caret in the coordinates of the client window.
 
static void SetCaretPos (const TPoint &pos)
 Sets the position of the caret in the coordinates of the client window.
 
static void DestroyCaret ()
 DestroyCaret first checks the ownership of the caret.
 
static void GetCursorPos (TPoint &pos)
 Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos.
 
static TPoint GetCursorPos ()
 
static TPoint GetMessagePos ()
 
- Static Protected Member Functions inherited from owl::TWindow
static LRESULT CALLBACK InitWndProc (HWND, UINT msg, WPARAM, LPARAM)
 Callback process for hooking TWindow to native window.
 

Detailed Description

TRichEdit encapsulates a rich edit control, a window in which a user can enter, edit and format text.

Definition at line 261 of file richedit.h.

Member Enumeration Documentation

◆ TFmtStatus

Enumeration of flags returned when querrying a RichEdit about a particular character attribute for a chunk of selected text.

Enumerator
No 

The whole selection has the attribute.

Yes 

The attribute is absent from the selection.

Partly 

Part of the selection has the attribute.

Definition at line 293 of file richedit.h.

Constructor & Destructor Documentation

◆ TRichEdit() [1/3]

owl::TRichEdit::TRichEdit ( TWindow * parent,
int id,
LPCTSTR text,
int x,
int y,
int w,
int h,
LPCTSTR fileName = nullptr,
TModule * module = nullptr )

Constructor for a TRichEdit object.

By default, edit control has a border and its text is left-justified. Multiline edit control has horizontal vertical scroll bars.

Definition at line 707 of file richedit.cpp.

References owl::TWindow::ModifyStyle(), owl::TXCommCtrl::Raise(), and SetFormat().

◆ TRichEdit() [2/3]

owl::TRichEdit::TRichEdit ( TWindow * parent,
int id,
const tstring & text,
int x,
int y,
int w,
int h,
const tstring & fileName = tstring(),
TModule * module = nullptr )

String-aware overload.

Definition at line 737 of file richedit.cpp.

References owl::TWindow::ModifyStyle(), owl::TXCommCtrl::Raise(), and SetFormat().

◆ TRichEdit() [3/3]

owl::TRichEdit::TRichEdit ( TWindow * parent,
int resourceId,
TModule * module = nullptr )

Constructor for TRichEdit associated with a MS-Windows interface element created by MS-Windows from a resource definition.

By default, data transfer is enabled

Definition at line 771 of file richedit.cpp.

References owl::TXCommCtrl::Raise().

Member Function Documentation

◆ CanPaste()

bool owl::TRichEdit::CanPaste ( uint format) const

Definition at line 1374 of file richedit.cpp.

References CONST_CAST, owl::TWindow::SendMessage(), and owl::ToBool().

◆ CanRedo()

bool owl::TRichEdit::CanRedo ( ) const

◆ CeEditClear()

void owl::TRichEdit::CeEditClear ( TCommandEnabler & commandHandler)
protected

Definition at line 1714 of file richedit.cpp.

References owl::TEdit::GetLineLength(), and owl::TEdit::GetNumLines().

◆ CeEditPaste()

void owl::TRichEdit::CeEditPaste ( TCommandEnabler & commandHandler)
protected

Definition at line 1677 of file richedit.cpp.

◆ CeEditUndo()

void owl::TRichEdit::CeEditUndo ( TCommandEnabler & commandHandler)
protected

Definition at line 1724 of file richedit.cpp.

References owl::TEdit::CanUndo().

◆ CeHasSelect()

void owl::TRichEdit::CeHasSelect ( TCommandEnabler & commandHandler)
protected

Definition at line 1664 of file richedit.cpp.

References owl::TEdit::GetSelection().

◆ ChangeCharPointSize()

bool owl::TRichEdit::ChangeCharPointSize ( int pointSizeDelta)

Increases or decreases (using a positive or negative value respectively) the point size of the current selection.

Definition at line 888 of file richedit.cpp.

References owl::MaxPointSize, owl::MinPointSize, and SetCharFormat().

◆ CharFromPos()

uint32 owl::TRichEdit::CharFromPos ( int16 x,
int16 y ) -> uint32
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1762 of file richedit.cpp.

References owl::TWindow::GetHandle(), PRECONDITION, and owl::TWindow::SendMessage().

◆ CmEditClear()

void owl::TRichEdit::CmEditClear ( )
inlineprotected

Handler of the CM_EDITCLEAR command - invokes the 'Clear' method.

Definition at line 558 of file richedit.h.

References owl::TEdit::Clear().

◆ CmEditCopy()

void owl::TRichEdit::CmEditCopy ( )
inlineprotected

Handler of the CM_EDITCOPY command - invokes the'Copy' method.

Definition at line 534 of file richedit.h.

References owl::TEdit::Copy().

◆ CmEditCut()

void owl::TRichEdit::CmEditCut ( )
inlineprotected

Handler of the CM_EDITCUT command - Invokes the 'Cut' method.

Definition at line 526 of file richedit.h.

References owl::TEdit::Cut().

◆ CmEditDelete()

void owl::TRichEdit::CmEditDelete ( )
inlineprotected

Handler of the CM_EDITDELETE command - invokes the 'DeleteSelection' method.

Definition at line 550 of file richedit.h.

References owl::TEdit::DeleteSelection().

◆ CmEditPaste()

void owl::TRichEdit::CmEditPaste ( )
inlineprotected

Handler of the CM_EDITPASTE command - invokes the 'Paste' method.

Definition at line 542 of file richedit.h.

References Paste().

◆ CmEditUndo()

void owl::TRichEdit::CmEditUndo ( )
inlineprotected

Handler of the CM_EDITUNDO command - invokes the 'Undo' method.

Definition at line 566 of file richedit.h.

References owl::TEdit::Undo().

◆ DisplayBand()

bool owl::TRichEdit::DisplayBand ( TRect & rc)

Definition at line 1505 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ EnableAutoURL()

bool owl::TRichEdit::EnableAutoURL ( bool enable = true)

Definition at line 1284 of file richedit.cpp.

References owl::TWindow::SendMessage(), and owl::ToBool().

◆ ENErrSpace()

void owl::TRichEdit::ENErrSpace ( )
protected

◆ EvChar()

void owl::TRichEdit::EvChar ( uint key,
uint repeatCount,
uint flags )
protected

WM_CHAR handler to bypass TEdit's handler (which caters to validators).

Definition at line 1627 of file richedit.cpp.

References owl::TWindow::DefaultProcessing().

◆ EvGetDlgCode()

uint owl::TRichEdit::EvGetDlgCode ( const MSG * msg)
protected

WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).

Definition at line 1618 of file richedit.cpp.

References owl::TWindow::EvGetDlgCode().

◆ EvKeyDown()

void owl::TRichEdit::EvKeyDown ( uint key,
uint repeatCount,
uint flags )
protected

WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).

Definition at line 1636 of file richedit.cpp.

References owl::TWindow::DefaultProcessing().

◆ EvKillFocus()

void owl::TRichEdit::EvKillFocus ( HWND hWndGetFocus)
protected

WM_KILLFOCUS handler to bypass TEdit's handler (which caters to validators).

Definition at line 1645 of file richedit.cpp.

References owl::TWindow::EvKillFocus().

◆ EvSetFocus()

void owl::TRichEdit::EvSetFocus ( HWND hWndLostFocus)
protected

WM_SETFOCUS handler to bypass TEdit's handler (which caters to validators).

Definition at line 1654 of file richedit.cpp.

References owl::TWindow::DefaultProcessing().

◆ FindText() [1/3]

int owl::TRichEdit::FindText ( uint flags,
const TCharRange & cr,
LPCTSTR text )

Finds text within the rich edit control.

The 'flags' parameter can be a combination of the following values:

  • FT_MATCHCASE Performs a case sensitiv search.
  • FT_MATCHWORD Matches whole words.

Definition at line 1187 of file richedit.cpp.

References FindText().

◆ FindText() [2/3]

int owl::TRichEdit::FindText ( uint flags,
const TCharRange & r,
const tstring & text )
inline

Definition at line 348 of file richedit.h.

References FindText().

◆ FindText() [3/3]

int owl::TRichEdit::FindText ( uint flags,
const TFindText & ft )

Finds text within the rich edit control.

The 'flags' parameter can be a combination of the following values:

  • FT_MATCHCASE Performs a case sensitiv search.
  • FT_MATCHWORD Matches whole words.

Definition at line 1175 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ FindWordBreak()

int owl::TRichEdit::FindWordBreak ( uint code,
int start )

Definition at line 1262 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ FormatRange() [1/2]

int owl::TRichEdit::FormatRange ( )

Definition at line 1525 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ FormatRange() [2/2]

int owl::TRichEdit::FormatRange ( const TFormatRange & range,
bool render = true )

Definition at line 1516 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetCharFormat()

ulong owl::TRichEdit::GetCharFormat ( TCharFormat & cf,
bool selection = false ) const

Retrieves the current character formatting in an edit control.

If 'selection' parameter is 'true', the attribute of the current selection is retrieved. Otherwise, the default formatting attribute is retrieved.

Definition at line 790 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetEventMask()

ulong owl::TRichEdit::GetEventMask ( ) const

Definition at line 1585 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetFormat()

uint owl::TRichEdit::GetFormat ( ) const
inline

Definition at line 699 of file richedit.h.

References Format.

◆ GetIMEMode()

int owl::TRichEdit::GetIMEMode ( ) const

Definition at line 1295 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetLangOptions()

int owl::TRichEdit::GetLangOptions ( ) const

Definition at line 1316 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetLineFromPos()

int owl::TRichEdit::GetLineFromPos ( int charPos) const -> int
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1273 of file richedit.cpp.

References CONST_CAST.

◆ GetOleInterface()

bool owl::TRichEdit::GetOleInterface ( IRichEditOle *& pInterface) const

Definition at line 1560 of file richedit.cpp.

References CONST_CAST.

◆ GetParaFormat()

ulong owl::TRichEdit::GetParaFormat ( TParaFormat & pf) const

Retrieves the paragraph formatting of the current selection of the rich edit control.

Note
If more than one paragraph is selected, the structure receives the attributes of the first paragraph, and the dwMask member specifies which attributes are consistent throughout the entire selection.

Definition at line 804 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetRedoName()

int owl::TRichEdit::GetRedoName ( ) const

Definition at line 1405 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetSelectedText() [1/2]

tstring owl::TRichEdit::GetSelectedText ( ) const

String-aware overload.

Definition at line 1153 of file richedit.cpp.

References owl::CopyText(), owl::TEdit::GetSelection(), and owl::TEdit::TRange::GetSize().

◆ GetSelectedText() [2/2]

int owl::TRichEdit::GetSelectedText ( TCHAR * buffer) const

Retrieves the currently-selected text of the rich edit control.

Definition at line 1132 of file richedit.cpp.

References CONST_CAST.

◆ GetSelection()

void owl::TRichEdit::GetSelection ( int & startPos,
int & endPos ) const
overridevirtual

Retrieves the starting and ending character position of the selection in the rich edit control.

Reimplemented from owl::TEdit.

Definition at line 916 of file richedit.cpp.

References CONST_CAST.

◆ GetSelectionType()

ulong owl::TRichEdit::GetSelectionType ( ) const

Returns the selection type of the rich edit control.

Returns SEL_EMPTY if the selection is empty, or one or more of the following values:

  • SEL_TEXT Text
  • SEL_OBJECT At least one OLE object
  • SEL_MULTICHAR More than one character of text
  • SEL_MULTIOBJECT More than one OLE object

Definition at line 978 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetSelRange()

void owl::TRichEdit::GetSelRange ( TCharRange & cr) const

Retrieves the starting and ending character positions of the selection of the richedit control.

Definition at line 929 of file richedit.cpp.

References _T, CONST_CAST, and WARN.

◆ GetSubText()

void owl::TRichEdit::GetSubText ( TCHAR * str,
int startPos,
int endPos ) const
overridevirtual

Retrieves a specified range of text from the rich edit control.

NB! Deprecated. Use GetTextRange instead.

Reimplemented from owl::TEdit.

Definition at line 1121 of file richedit.cpp.

References _T, GetTextRange(), and WARN.

◆ GetTextLength()

int owl::TRichEdit::GetTextLength ( ) const

◆ GetTextMode()

int owl::TRichEdit::GetTextMode ( ) const

Definition at line 1342 of file richedit.cpp.

References IsRTF(), and owl::TWindow::SendMessage().

◆ GetTextRange() [1/3]

int owl::TRichEdit::GetTextRange ( const TCharRange & cr,
TCHAR * buffer ) const

Retrieves a specified range of text from the rich edit control.

NB! Deprecated. Use GetTextRange(const TRange&) instead.

Definition at line 1026 of file richedit.cpp.

References _T, CONST_CAST, and WARN.

◆ GetTextRange() [2/3]

tstring owl::TRichEdit::GetTextRange ( const TRange & r) const -> tstring
overridevirtual

Retrieves a specified range of text from the rich edit control.

The range is half-open; i.e. range [0,2) for "abc" returns "ab". An empty string is returned if either

  • the control is empty (no text), or
  • the range is invalid (empty or inverted), or
  • both startPos and endPos is beyond the extents of the actual text.

If endPos is beyond the valid range then it is limited to the valid range. A special case is the range [0, -1). It will return the full text.

Todo
Must be tested

Reimplemented from owl::TEdit.

Definition at line 1065 of file richedit.cpp.

References _T, CHECK, owl::CopyText(), GetTextLength(), and WARN.

◆ GetTextRange() [3/3]

int owl::TRichEdit::GetTextRange ( TTextRange & tr) const

Retrieves a specified range of text from the rich edit control.

NB! Deprecated. Use GetTextRange(const TRange&) instead.

Definition at line 1016 of file richedit.cpp.

References CONST_CAST.

◆ GetUndoName()

int owl::TRichEdit::GetUndoName ( ) const

Definition at line 1394 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ GetWindowClassName()

auto owl::TRichEdit::GetWindowClassName ( ) -> TWindowClassName
overrideprotectedvirtual

Returns name of predefined Windows edit class.

Reimplemented from owl::TEdit.

Definition at line 1732 of file richedit.cpp.

References _T.

◆ HasCharAttribute()

uint owl::TRichEdit::HasCharAttribute ( ulong mask,
uint32 effects )

Function returns whether or not the current selection has a particular attribute.

The 'mask' identifies the attribute of interest. The 'effects' contains the state of the attributes. The function returns

Definition at line 857 of file richedit.cpp.

References No, Partly, and Yes.

◆ HasSelection()

bool owl::TRichEdit::HasSelection ( ) const

Returns true if the rich edit control has an active selection.

Returns false otherwise.

Definition at line 905 of file richedit.cpp.

References owl::TEdit::GetSelection().

◆ HideSelection()

void owl::TRichEdit::HideSelection ( bool hide,
bool changeStyle )

Shows or hides the selection in the rich edit control.

The 'hide' parameter specifies whether to hide or show the selection. If it is 'false' the selection is shown. Otherwise, the selection is hidden. The 'changeStyle' parameter specifies whether to change the control's ES_NOHIDESEL window style. If this parameter is 'false', the selection is temporarily shown or hidden. Otherwise, the style is changed. If this parameter is 'true' and the control has the focus, the selection is hidden or shown as appropriate.

Definition at line 964 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ IsRTF()

bool owl::TRichEdit::IsRTF ( ) const
inline

Definition at line 715 of file richedit.h.

References Format.

◆ LimitText()

void owl::TRichEdit::LimitText ( int maxValue)
overridevirtual

Sets an upper limit to the amount of text in the richedit control.

Reimplemented from owl::TEdit.

Definition at line 1163 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ Paste()

void owl::TRichEdit::Paste ( )
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1437 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ PasteSpecial()

void owl::TRichEdit::PasteSpecial ( uint format)

Definition at line 1428 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ PosFromChar()

uint32 owl::TRichEdit::PosFromChar ( uint charIndex) -> uint32
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1774 of file richedit.cpp.

References owl::TWindow::GetHandle(), owl::MkUint32(), PRECONDITION, and owl::TWindow::SendMessage().

◆ Read() [1/3]

bool owl::TEditFile::Read ( const tstring & fileName)
inline

Definition at line 64 of file editfile.h.

◆ Read() [2/3]

bool owl::TEditFile::Read ( LPCTSTR fileName = nullptr)
virtual

Reads the contents of a previously specified file into the Editor.

Returns true if read operation is successful. The caller is responsible for any error UI

Reimplemented from owl::TEditFile.

Definition at line 63 of file editfile.cpp.

◆ Read() [3/3]

bool owl::TRichEdit::Read ( LPCTSTR fileName = nullptr) -> bool
overridevirtual

◆ ReadFromStream()

bool owl::TRichEdit::ReadFromStream ( tistream & is,
uint format = SF_RTF )

< String-aware overload

Definition at line 1883 of file richedit.cpp.

References owl::RichEditStrmInWithIStream(), and StreamIn().

◆ Redo()

void owl::TRichEdit::Redo ( )

Definition at line 1416 of file richedit.cpp.

References owl::TWindow::SendMessage(), and owl::TEdit::Undo().

◆ RequestResize()

void owl::TRichEdit::RequestResize ( )

Definition at line 1549 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ Search() [1/2]

int owl::TRichEdit::Search ( int startPos,
const tstring & text,
bool caseSensitive = false,
bool wholeWord = false,
bool up = false )
inline

Definition at line 355 of file richedit.h.

◆ Search() [2/2]

int owl::TRichEdit::Search ( int startPos,
LPCTSTR text,
bool caseSensitive = false,
bool wholeWord = false,
bool up = false ) -> int
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1202 of file richedit.cpp.

References _tcslen, FindText(), owl::TEdit::GetSelection(), and SetSelection().

◆ SetBkgndColor()

TColor owl::TRichEdit::SetBkgndColor ( const TColor & bkColor = TColor::None)

Sets the background color of the rich edit control.

Note
If 'TColor::None' is specified, the color is set to the window background system color.

Definition at line 841 of file richedit.cpp.

References owl::TColor::None, and owl::TWindow::SendMessage().

◆ SetCharFormat()

bool owl::TRichEdit::SetCharFormat ( const TCharFormat & cf,
uint flags = SCF_SELECTION )

Sets the character formatting of a rich edit control.

The 'flags' parameter can be one of the following:

  • SCF_SELECTION Applies the formatting to the current selection, or sets the default formatting if the selection is empty.
  • SCF_WORD Applies the formatting to the selected word or words. If the selection is empty but the insertion point is inside a word, the formatting is applied to the word. This value must be used in conjunction with the SCF_SELECTION value.

Definition at line 821 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetEventMask()

ulong owl::TRichEdit::SetEventMask ( ulong msk)

Definition at line 1609 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetFormat()

void owl::TRichEdit::SetFormat ( uint fmt)
inline

Definition at line 707 of file richedit.h.

References Format.

◆ SetLangOptions()

void owl::TRichEdit::SetLangOptions ( int options)

Definition at line 1306 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetOleInterface()

bool owl::TRichEdit::SetOleInterface ( IRichEditOleCallback * pInterface)

Definition at line 1572 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetParaFormat()

bool owl::TRichEdit::SetParaFormat ( const TParaFormat & pf)

Sets the paragraph formatting of the current selection of the rich edit control.

Definition at line 830 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetSelection()

bool owl::TRichEdit::SetSelection ( int startPos,
int endPos ) -> bool
overridevirtual

Selects a range of characters in the rich edit control.

Reimplemented from owl::TEdit.

Definition at line 939 of file richedit.cpp.

References SetSelRange().

◆ SetSelRange()

int owl::TRichEdit::SetSelRange ( const TCharRange & cr)

Selects a range of characters in the rich edit control.

Definition at line 949 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetTargetDevice()

bool owl::TRichEdit::SetTargetDevice ( HDC dc,
int lineWidth )

Definition at line 1535 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetTextMode()

void owl::TRichEdit::SetTextMode ( int mode)

Definition at line 1327 of file richedit.cpp.

References Format, and owl::TWindow::SendMessage().

◆ SetUndoLimit()

void owl::TRichEdit::SetUndoLimit ( int maxnum)

Definition at line 1353 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ SetupWindow()

void owl::TRichEdit::SetupWindow ( )
overrideprotectedvirtual

Updates the list of filters describing files which can be opened by the rich edit control.

Reimplemented from owl::TEditFile.

Reimplemented in owl::TRichEditView.

Definition at line 1751 of file richedit.cpp.

References owl::TEditFile::GetFileData(), owl::TWindow::LoadString(), owl::TOpenSaveDialog::TData::SetFilter(), and owl::TEditFile::SetupWindow().

◆ StopGroupTyping()

void owl::TRichEdit::StopGroupTyping ( )

Definition at line 1363 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ StreamIn()

ulong owl::TRichEdit::StreamIn ( uint format,
TEditStream & es )

Definition at line 1468 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ StreamOut()

ulong owl::TRichEdit::StreamOut ( uint format,
TEditStream & es )

Definition at line 1493 of file richedit.cpp.

References owl::TWindow::SendMessage().

◆ ToggleCharAttribute()

bool owl::TRichEdit::ToggleCharAttribute ( ulong mask,
uint32 effects )

Toggles a set of character attributes.

The 'mask' identifies the attributes of interest while 'effects' identifies the state of the attributes.

Definition at line 875 of file richedit.cpp.

References SetCharFormat(), and owl::TCharFormat::ToggleEffectsBit().

◆ Transfer()

uint owl::TRichEdit::Transfer ( void * buffer,
TTransferDirection  ) -> uint
overridevirtual

Reimplemented from owl::TEdit.

Definition at line 1861 of file richedit.cpp.

◆ Write() [1/3]

bool owl::TEditFile::Write ( const tstring & fileName)
inline

Definition at line 70 of file editfile.h.

◆ Write() [2/3]

bool owl::TEditFile::Write ( LPCTSTR fileName = nullptr)
virtual

Saves the contents of the Editor to a file whose name is specified by FileName.

Returns true if the write operation is successful. The caller is responsible for any error UI

Reimplemented from owl::TEditFile.

Definition at line 69 of file editfile.cpp.

◆ Write() [3/3]

bool owl::TRichEdit::Write ( LPCTSTR fileName = nullptr) -> bool
overridevirtual

< String-aware overload

Reimplemented from owl::TEditFile.

Definition at line 1957 of file richedit.cpp.

References _USES_CONVERSION, _W2A, owl::TEdit::ClearModify(), Format, owl::TEditFile::GetFileName(), and WriteToStream().

◆ WriteToStream()

bool owl::TRichEdit::WriteToStream ( tostream & os,
uint format = SF_RTF )

Definition at line 1911 of file richedit.cpp.

References owl::RichEditStrmOutWithOstream(), and StreamOut().

Member Data Documentation

◆ Format

uint owl::TRichEdit::Format
protected

Definition at line 442 of file richedit.h.


The documentation for this class was generated from the following files: