12#if defined(__BORLANDC__)
33# if defined(MSFTEDIT_CLASS)
34# define OWL_USERICHEDIT41
39#if defined(OWL_USERICHEDIT41)
57 memset(
this, 0,
sizeof(CHARFORMAT2));
60 if(TRichEditDll::Dll()->GetVersion() >= 2)
61 cbSize =
sizeof(CHARFORMAT2);
246 lf.lfFaceName[0] =
_T(
'\0');
467 memset(
this, 0,
sizeof(PARAFORMAT2));
470 if(TRichEditDll::Dll()->GetVersion() >= 2)
471 cbSize =
sizeof(PARAFORMAT2);
484 memset(
this, 0,
sizeof(PARAFORMAT2));
487 if(TRichEditDll::Dll()->GetVersion() >= 2)
488 cbSize =
sizeof(PARAFORMAT2);
710 int x,
int y,
int w,
int h,
718 if (!TRichEditDll::IsAvailable())
741 int x,
int y,
int w,
int h,
749 if (!TRichEditDll::IsAvailable())
779 if (!TRichEditDll::IsAvailable())
860 if (cf.dwMask &
mask) {
908 return r.cpMin !=
r.cpMax;
931 WARN(
true,
_T(
"TRichEdit::GetSelRange is deprecated. Use GetSelection instead."));
991 if (TRichEditDll::Dll()->GetVersion() >= 2)
1028 WARN(
true,
_T(
"TRichEdit::GetTextRange(const TCharRange&, LPTSTR) is deprecated. Use GetTextRange(const TRange&) instead."));
1037struct TRichEditGetTextRange
1043 int operator()(
LPTSTR buf,
int)
1045 TTextRange
tr(range, buf);
1067 const int begin =
r.cpMin;
1077 if (begin == 0 && end == -1)
1081 else if (begin < 0 || end < 0)
1083 WARN(
true,
_T(
"Arguments out of range"));
1086 else if (begin == end)
1088 WARN(
true,
_T(
"Empty range"));
1091 else if (begin > end)
1093 WARN(
true,
_T(
"Inverted range"));
1105 end = std::min(end,
n);
1111 CHECK(begin >= 0 && end >= 0 && begin <
n && end <=
n);
1123 WARN(
true,
_T(
"TRichEdit::GetSubText is deprecated. Use GetTextRange instead."));
1140struct TRichEditGetSelectedText
1143 TRichEditGetSelectedText(
const TRichEdit&
e) : edit(
e){}
1145 int operator()(
LPTSTR buf,
int)
1286 if(TRichEditDll::Dll()->GetVersion() >= 2)
1297 return TRichEditDll::Dll()->GetVersion() >= 2 ?
1308 if(TRichEditDll::Dll()->GetVersion() >= 2)
1318 return TRichEditDll::Dll()->GetVersion() >= 2 ?
1329 if(TRichEditDll::Dll()->GetVersion() >= 2)
1344 return TRichEditDll::Dll()->GetVersion() >= 2 ?
1355 if(TRichEditDll::Dll()->GetVersion() >= 2)
1365 if(TRichEditDll::Dll()->GetVersion() >= 2)
1385 if(TRichEditDll::Dll()->GetVersion() >= 2)
1396 return TRichEditDll::Dll()->GetVersion() >= 2 ?
1407 return TRichEditDll::Dll()->GetVersion() >= 2 ?
1418 if(TRichEditDll::Dll()->GetVersion() >= 2)
1694 (
clip.CountClipboardFormats()!=0) &&
1734#if defined(OWL_USERICHEDIT41)
1735 if(TRichEditDll::Dll()->GetVersion() >= 4)
1739 if(TRichEditDll::Dll()->GetVersion() >= 2)
1778 if (TRichEditDll::Dll()->GetVersion() == 2)
1816 is.read(
reinterpret_cast<char*
>(
pbBuff),
cb);
1888 return edStrm.dwError == 0;
1916 return edStrm.dwError == 0;
1981#if OWL_PERSISTENT_STREAMS
1995TRichEdit::Streamer::Write(opstream&
os)
const
2019static int CheckREVersion()
2023#if defined(OWL_USERICHEDIT41)
2048#if defined(_BUILDOWLDLL)
#define WARN(condition, message)
#define PRECONDITION(condition)
TCharRange encapsulates the CHARRANGE structure, which specifies a range of characters in a rich edit...
The clipboard class encapsulates the methods for the clipboard object of Windows.
Class wrapper for management of color values.
static const TColor None
not-a-color
static const TColor SysWindowText
The symbolic system color value for text in every window.
static const TColor SysWindow
The symbolic system color value for the background of each window.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
TEditFile is a file-editing window.
LPCTSTR GetFileName() const
Return the filename for this buffer.
TOpenSaveDialog::TData & GetFileData()
Return the FileData data member used for the common dialogs.
void SetupWindow() override
Creates the edit window's Editor edit control by calling TEditFile::SetupWindow().
TEditStream encapsulates the EDITSTREAM structure, which contains information about a data stream use...
Simple encapsulation of the SetErrorMode call.
TFindText encapsulates the FINDTEXT structure, which contains information about text to search for in...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
void SetFilter(LPCTSTR filter=nullptr)
Makes a copy of the filter list used to display the file names.
TRect is a mathematical class derived from tagRect.
TRichEdit encapsulates a rich edit control, a window in which a user can enter, edit and format text.
bool ToggleCharAttribute(ulong mask, uint32 effects)
Toggles a set of character attributes.
bool DisplayBand(TRect &)
bool ReadFromStream(tistream &, uint format=SF_RTF)
< String-aware overload
ulong StreamOut(uint format, TEditStream &)
bool SetCharFormat(const TCharFormat &, uint flags=SCF_SELECTION)
Sets the character formatting of a rich edit control.
bool WriteToStream(tostream &, uint format=SF_RTF)
int GetTextRange(TTextRange &) const
Retrieves a specified range of text from the rich edit control.
auto GetLineFromPos(int charPos) const -> int override
void CeEditClear(TCommandEnabler &commandHandler)
ulong GetSelectionType() const
Returns the selection type of the rich edit control.
void CeHasSelect(TCommandEnabler &commandHandler)
void EvKillFocus(HWND hWndGetFocus)
WM_KILLFOCUS handler to bypass TEdit's handler (which caters to validators).
int GetLangOptions() const
auto SetSelection(int startPos, int endPos) -> bool override
Selects a range of characters in the rich edit control.
void GetSelRange(TCharRange &) const
Retrieves the starting and ending character positions of the selection of the richedit control.
void CeEditPaste(TCommandEnabler &commandHandler)
auto Read(LPCTSTR fileName=nullptr) -> bool override
void CeEditUndo(TCommandEnabler &commandHandler)
@ Partly
Part of the selection has the attribute.
@ Yes
The attribute is absent from the selection.
@ No
The whole selection has the attribute.
void LimitText(int maxValue) override
Sets an upper limit to the amount of text in the richedit control.
bool SetParaFormat(const TParaFormat &)
Sets the paragraph formatting of the current selection of the rich edit control.
tstring GetSelectedText() const
String-aware overload.
auto Write(LPCTSTR fileName=nullptr) -> bool override
< String-aware overload
auto PosFromChar(uint charIndex) -> uint32 override
int SetSelRange(const TCharRange &)
Selects a range of characters in the rich edit control.
ulong GetParaFormat(TParaFormat &) const
Retrieves the paragraph formatting of the current selection of the rich edit control.
ulong GetEventMask() const
void SetTextMode(int mode)
int GetTextLength() const
bool SetTargetDevice(HDC, int lineWidth)
void PasteSpecial(uint format)
bool EnableAutoURL(bool enable=true)
bool ChangeCharPointSize(int pointSizeDelta)
Increases or decreases (using a positive or negative value respectively) the point size of the curren...
auto Transfer(void *buffer, TTransferDirection) -> uint override
void HideSelection(bool hide, bool changeStyle)
Shows or hides the selection in 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.
TColor SetBkgndColor(const TColor &=TColor::None)
Sets the background color of the rich edit control.
void EvSetFocus(HWND hWndLostFocus)
WM_SETFOCUS handler to bypass TEdit's handler (which caters to validators).
auto GetWindowClassName() -> TWindowClassName override
Returns name of predefined Windows edit class.
int FindWordBreak(uint code, int start)
uint HasCharAttribute(ulong mask, uint32 effects)
Function returns whether or not the current selection has a particular attribute.
bool SetOleInterface(IRichEditOleCallback *)
bool HasSelection() const
Returns true if the rich edit control has an active selection.
void SetUndoLimit(int maxnum)
void EvKeyDown(uint key, uint repeatCount, uint flags)
WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).
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.
int FindText(uint flags, const TFindText &)
Finds text within the rich edit control.
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).
auto CharFromPos(int16 x, int16 y) -> uint32 override
uint EvGetDlgCode(const MSG *)
WM_GETDLGCODE handler to bypass TEdit's handler (which caters to validators).
auto Search(int startPos, LPCTSTR text, bool caseSensitive=false, bool wholeWord=false, bool up=false) -> int override
ulong StreamIn(uint format, TEditStream &)
ulong SetEventMask(ulong msk)
ulong GetCharFormat(TCharFormat &, bool selection=false) const
Retrieves the current character formatting in an edit control.
bool CanPaste(uint format) const
void SetLangOptions(int options)
bool GetOleInterface(IRichEditOle *&) const
static int GetVersion(bool force_old=false)
TTextRange encapsulates the TEXTRANGE structure, which contains information about a range of text in ...
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
tstring LoadString(uint id) const
uint EvGetDlgCode(const MSG *msg)
The default message handler for WM_GETDLGCODE.
void EvKillFocus(HWND hWndGetFocus)
Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore foc...
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
HWND GetHandle() const
Returns the handle of the window.
int GetWindowTextLength() const
Returns the length, in characters, of the specified window's title.
static void Raise()
Constructs a TXCommCtrl exception from scratch, and throws it.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
void ReadBaseObject(Base *base, ipstream &in)
#define IMPLEMENT_STREAMABLE1(cls, base1)
void WriteBaseObject(Base *base, opstream &out)
void ClearModify()
Resets the change flag of the edit control causing IsModified to return false.
bool CanUndo() const
Returns true if it is possible to undo the last edit.
int GetLineLength(int lineNumber) const
Return the length of line number "lineNumber".
void Undo()
Undoes the last edit.
int GetNumLines() const
Return the number of lines in the associated edit control.
void Clear() override
Override TStatic virtual member functions.
TRange GetSelection() const
Functional style overload.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Object Windows Library (OWLNext Core)
const tchar RichEdit20DllName[]
uint32 MkUint32(uint16 lo, uint16 hi)
LPARAM TParam2
Second parameter type.
tstring CopyText(int size, TGetText get_text)
Copies text from a C-string (null-terminated character array) into a string object,...
DWORD CALLBACK RichEditStrmOutWithOstream(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
WPARAM TParam1
First parameter type.
const tchar RichEditDllName[]
DWORD CALLBACK RichEditStrmInWithIStream(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
#define CONST_CAST(targetType, object)
Definition of class TRichEdit.
Represents a half-open range of positions in the edit control, e.g.
#define EV_COMMAND_ENABLE(id, method)
Response table entry for enabling a command.
#define EV_COMMAND(id, method)
Response table entry for a menu/accelerator/push button message.