13#include <owl/docview.rh>
14#include <owl/richedv.rh>
18#if defined(__BORLANDC__)
34#define TOHIENGLISH(x) static_cast<long> ((1000)*(x))
81 Attr.AccelTable = IDA_RICHEDITVIEW;
124 Doc->PostError(IDS_UNABLEOPEN, MB_OK);
136 Doc->PostError(IDS_READERROR, MB_OK);
157 Doc->PostError(IDS_NOMEMORYFORVIEW, MB_OK);
161 if (Doc->GetDocPath() ==
nullptr) {
180 Doc->PostError(IDS_UNABLEOPEN, MB_OK);
198 Doc->PostError(IDS_WRITEERROR, MB_OK);
245 SendMessage( EM_EXLIMITTEXT, 0, (DWORD)0xFFFFFFF );
288 fontData.
Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_EFFECTS;
290 fontData.
FontType = SCREEN_FONTTYPE;
359 else if( result ==
No )
458 pFormat.
SetNumbering((pFormat.wNumbering == 0) ? (WORD)PFN_BULLET : (WORD)0);
473 tce.
SetCheck( (pFormat.wAlignment == PFA_LEFT) ?
485 tce.
SetCheck( (pFormat.wAlignment == PFA_CENTER) ?
497 tce.
SetCheck((pFormat.wAlignment == PFA_RIGHT) ?
509 tce.
SetCheck( (pFormat.wNumbering == PFN_BULLET) ?
522 static TColor custColors[16];
524 data.
Flags = CC_RGBINIT;
550 static TColor custColors[16];
552 data.
Flags = CC_RGBINIT;
573#if OWL_PERSISTENT_STREAMS
588TRichEditView::Streamer::Write(opstream& os)
const
Definition of Choose Color Common Dialog class.
Definition of Choose Font Common Dialog class.
Defines information necessary to initialize the dialog box with the user's color selection.
uint32 Flags
Flags can be a combination of the following values that control the appearance and functionality of t...
TColor * CustColors
Points to an array of 16 colors.
TColor Color
Specifies the color that is initially selected when the dialog box is created.
TChooseColorDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=0, TModule *module=0)
Initialize the choose color common dialog data members.
Defines information necessary to initialize the dialog box with the user's font selection.
HDC DC
Handle to the device context from which fonts are obtained.
uint32 Flags
Flags can be a combination of the following constants that control the appearance and functionality o...
uint16 FontType
Font type or name.
LOGFONT LogFont
Attributes of the font.
TColor Color
Indicates the font color that is initially selected when the dialog box is created; contains the user...
TChooseFontDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Initialize the ChooseFont data members.
TClientDC(HWND wnd)
Creates a TClientDC object with the given owned window.
Class wrapper for management of color values.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
virtual void Enable(bool enable=true)
Enables or disables the command sender.
virtual void SetCheck(int check)=0
Changes the check state of the command sender to either unchecked, checked, or indeterminate.
@ Unchecked
Command is not enabled.
@ Checked
Command is enabled.
@ Indeterminate
Command is unavaiable.
virtual bool CanClear()
Returns true if the text of the associated edit control can be cleared which is if the text has not b...
Smart pointer to a single object. Provides member access operator ->.
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 ReadFromStream(tistream &, uint format=SF_RTF)
< String-aware overload
bool SetCharFormat(const TCharFormat &, uint flags=SCF_SELECTION)
Sets the character formatting of a rich edit control.
bool WriteToStream(tostream &, uint format=SF_RTF)
auto SetSelection(int startPos, int endPos) -> bool override
Selects a range of characters in the rich edit control.
@ Yes
The attribute is absent from the selection.
@ No
The whole selection has the attribute.
bool SetParaFormat(const TParaFormat &)
Sets the paragraph formatting of the current selection of the rich edit control.
uint HasCharAttribute(ulong mask, uint32 effects)
Function returns whether or not the current selection has a particular attribute.
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.
void CeParagraphBullet(TCommandEnabler &)
~TRichEditView() override
void CeFormatItalic(TCommandEnabler &)
TRichEditView(TDocument &doc, TWindow *parent=0)
void CeParagraphLeft(TCommandEnabler &)
bool VnDocClosed(int omode)
void CeFormatColor(TCommandEnabler &)
void CeFormatFont(TCommandEnabler &)
void SetupWindow() override
bool VnCommit(bool force)
void CeFormatBold(TCommandEnabler &)
void CeFormatUnderline(TCommandEnabler &)
void CeFormatStrikeout(TCommandEnabler &)
void CeParagraphCenter(TCommandEnabler &)
bool VnRevert(bool clear)
void CeParagraphRight(TCommandEnabler &)
void CeFormatBkColor(TCommandEnabler &)
bool VnIsWindow(HWND hWnd)
Abstract base class for view access from document.
friend class TDocument
needs access to NextView
TView(TDocument &doc)
Constructs a TView object of the document associated with the view.
void SetViewMenu(TMenuDescr *menu)
static uint GetNextViewId()
Next global ID to assign.
void NotOK()
To flag errors in creation.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual int Execute()
Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
TModule * GetModule() const
Returns a pointer to the module object.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
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.
TXOwl is root class of the ObjectWindows exception hierarchy.
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)
void WriteBaseObject(Base *base, opstream &out)
void ClearModify()
Resets the change flag of the edit control causing IsModified to return false.
void Clear() override
Override TStatic virtual member functions.
@ ofWrite
ios::out, open for writing
Object Windows Library (OWLNext Core).
IMPLEMENT_STREAMABLE2(TEditView, TEditSearch, TView)
EV_COMMAND_ENABLE(CM_FILENEW, CeFileNew)
EV_COMMAND(IDOK, CmOkCancel)
DIAG_DECLARE_GROUP(OwlThread)
Definition of class TRichEditView Based on Russell Morris class.
#define EV_COMMAND(id, method)
Response table entry for a menu/accelerator/push button message.