ObjecfWindows 2.0 Reference Guide
Can Clear
CanClose
CmFileNew
CmFileOpen
CmFileSave
CmFileSaveAs
NewFile
Open
TEditFile class
Frees memory allocated to hold the name of the TEditFile.
Public member functions
virtual BOOL CanClear();
Returns TRUE if the text of the associated edit control can be cleared.
virtual BOOL CanClose();
Returns TRUE if the edit window can be closed.
inline void CmFileNew();
Calls NewFile in response to an incoming File New command with a CM_FILENEW command identifier.
See also: TEditFile::NewFile inline void CmFileOpen();
Calls Open in response to an incoming File Open command with a CM_FILEOPEN command identifier.
See also: TEditFile::Open' inline void CmFileSave();
Calls Save in response to an incoming File Save command with a CM_FILESA VE command identifier.
See also: TEditFile::Save inline void CmFileSaveAs ();
Calls SaveAs in response to an incoming File SaveAs command with a CM_FILESA VEAS command identifier.
See also: TEditFile::SaveAs void NewFile();
Begins the edit of a new file after calling Can Clear to determine that it is safe to dear the text of the editor.
See also: TEditFilf?::CanClear Open() ;
Opens a new file after determining that it is OK to clear the text of the Editor. Calls CanClear, and if TRUE is returned, brings up a file dialog box to retrieve the name of a new file from the user. Calls Replace With to pass the name of the new file.
TEditFile class
Read
ReplaceWith
Save
SaveAs
SetFileName
Write
SetupWindow
184
See also: TEditFile::CanClear, TEditFile::Replace With BOOL Read(const char far* fileName=O);
Reads the contents of a previously specified file into the Editor. Returns TRUE if read operation is successful.
void ReplaceWith(const char far* fileName);
Calls SetFileName and Read to replace the file currently being edited with a file whose name is supplied.
See also: TEditFile::SetFileName, TEditFile::Read BOOL Save();
Saves changes to the contents of the Editor to a file. If Editor->IsModified returns FALSE, Save returns TRUE, indicating there have been no changes since the last open or save.
See also: TEditFile::SaveAs, TEditFile:: Write 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. If the user selects OK, SaveAs calls SetFileName and Write. Returns TRUE if the file was saved.
See also:· TEditFile::SetFileName, TEditFile:: Write void SetFileName (const char far* fileName);
Sets FileName and updates the caption of the window.
.. BOOL Write (const char far* fileName=O);
Saves the contents of the Editor to a file whose name is specified by FileName. Returns TRUE if the write operation is successful.
Protected member functions
void SetupWindow () ;
Creates the edit window's Editor edit control by calling
TEditFile::SetupWindow. Sets the window's caption to FileName, if available;
otherwise sets the name to "Untitled."
See also: TEditFile::SetFileName, TEditFile::Read
ObjecfWindows 2.0 Reference Guide
Response table entries
Response table entry
EV _COMMAND (CM_FILENEW, CmFileNew) EV_COMMAND (CM_FILEOPEN, CmFileOpen) EV_COMMAND (CM_FILESAVE, CmFileSave) EV_COMMAND (CM_FILESAVEAS, CmFileSaveAs)
TEditFile class
Member function . CmFileNew
CmFileOpen CmFileSave CmFileSaveAs
TEditSearch class editsear.h
,SearchCmd
Search Data
Search Dialog
Constructor
TEditSearch is an edit control that responds to Find, Replace, and FindNext menu commands. This dass is streamable.
( .
Public data members
UINT SearchCmd;
Contains the search command identifier that opened the dialog box if one is open.
TFindReplaceDialog: :TData SearchData;
The SearchData structure defines the search text string, the replacement text string, and the size of the text buffer.
See also: TFindReplaceDialog::TData TFindReplaceDialog* SearchDialog;
Contains find or replace dialog-box information (such as the text to find and replace) and check box settings.
Public constructors
TEditSearch(TWindow* parent
=
0, int Id=
0, const char far* text=
0, TModule* module = 0);Constructs a TEditSearch object given the parent window, resource ID, and character string (text).
TEditSearch class
CmEditFind
CmEditFindNext
CmEditReplace
DoSearch
EvFindMsg
SetupWindow
186
Public member functions
void CrnEditFind();
Opens a TFindDialog in response to an incoming Find command with a CM_EDITFIND command.
void CrnEditFindNext();
Responds to an incoming FiridNext command with a CM_EDITFINDNEXT command identifier by calling DoSearch to repeat the search operation.
See also: TEditSearch::DoSearch void CrnEditReplace();
Opens a TReplaceDia,log in response to an incoming Replace command with a CM_EDITREPLACEcommand.
void DoSearch();
Performs a search or replace operation base on information in SearchData.
See also: TFindReplaceDialog::TData LRESULT EvFindMsg(WPARAM, LPARAM);
Responds to a message sent by the modeless find or replace dialog box.
Calls DoSearch to continue searching if text is not found or the end of the document has not been reached.
See also: TEditSearch::DoSearch void SetupWindow();
Posts a CM_EDITFIND or a CM_EDITREPLACE message to re-open a find or replace modeless dialog box. Calls TEdit::SetupWindow .
. See also: Tedit::SetupWindow
Response
ta~leentries
Response table entry
EV _COMMAND(CM_EDITFIND, CmEditFind)
EV _COMMAND(CM_EDITFINDNEXT, CmEditFindNext) EV _COMMAND(CM_EDITREPLACE, CmEditReplace) , EV _REGISTERED(FINDMSGSTRING, EvFindMsg)
Member function CmEditFind CmEditFindNext CmEditReplace EvFindMsg
ObjecfWindows
2.0
Reference GuideTl:dltVlew class
TEditView class editview.h
Constructor
Destructor
CanClose
Create
GetViewName
GetWindow
Perform Create
Derived from TView and TEditSearch, TEditView provides a view wrapper for ObjectWindows text edit class (TEdit). A streamable class, TEditView includes several event-handling functions that handle messages between a document and its views.
Public constructors and destructor
TEditView(TDocument& doc, TWindow* parent = 0) i
Creat~s a TEditView object associated with the specified document and parent window. Sets Attr.AccelTable to IDA_EDITVIEW to identify the edit view. Sets TView::ViewMenu-to the new TMenuDescr for this view.
~TEdi tView ()
Destroys a TEd it View object.
Public member functions
inline BOOL CanClose() i
Returns nonzero if the view can be closed.
See also: TEditFile::CanClose BOOL Create ()
, Overrides TWindow::Create and calls TEditSearch::Create to create the view's window. Calls GetDocPath to determine if the file is new or already has data. If there is data, calls LoadData to add the data to the view. If the view's window can't be created, Create indicates the view is invalid.
in~ine LPCSTR GetViewName();
Overrides TView::GetViewName and returns the descriptive name of the class (StaticName).
See also: TEditView::StaticName, TView::GetViewName inline TWindow* GetWindow();
GetWindow overrides GetWindow in TView and returns this as a TWindow.
See also: TView::Get Window void PerformCreate(int menuOrld)i