#include <editors.h>
Inheritance diagram for TFileEditor::
Public Methods | |
TFileEditor (const TRect &bounds, TScrollBar *aHScrollBar, TScrollBar *aVScrollBar, TIndicator *aIndicator, const char *aFileName) | |
virtual void | doneBuffer () |
virtual void | handleEvent (TEvent &) |
virtual void | initBuffer () |
Boolean | loadFile () |
Boolean | save () |
Boolean | saveAs () |
Boolean | saveFile () |
virtual Boolean | setBufSize (uint newSize) |
virtual void | shutDown () |
virtual void | updateCommands () |
virtual Boolean | valid (ushort) |
Static Public Methods | |
TStreamable* | build () |
Public Attributes | |
char | fileName [PATH_MAX] |
Static Public Attributes | |
const char* const | name |
Protected Methods | |
TFileEditor (StreamableInit) | |
virtual void | write (opstream &) |
virtual void* | read (ipstream &) |
Definition at line 1185 of file editors.h.
|
Creates a TFileEditor object with the given scroll bars and indicator and loads the contents of the file given in `aFileName'. If the file is not found or invalid, an error message will be displayed and the object's valid() member function will return False. The options variable is set to ofSelectable and the eventMask is set to allow the handling of broadcast events. Any of `aHScrollBar', `aVScrollBar' or `aIndicator' arguments can be set to 0 if you do not want them. |
|
Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit. |
|
Called to create an object in certain stream-reading situations. Reimplemented from TEditor. |
|
Deletes the buffer. Reimplemented from TEditor. |
|
Calls TEditor::handleEvent(), then handles cmSave and cmSaveAs commands. The cmSave command invokes save(); the cmSaveAs command invokes saveAs(). Reimplemented from TEditor. |
|
Allocates bufSize bytes of memory for the file editor buffer. Reimplemented from TEditor. |
|
Reads the fileName file from disk and checks for errors. Returns True if all is well; otherwise returns False. Depending on the reason for failure, the edOutOfMemory or edReadError dialog box is displayed with a call to editorDialog. |
|
Reads from the input stream `is'. Reimplemented from TEditor. |
|
Calls saveAs() if the file being edited is "Untitled" (that is, no fileName is allocated) and returns the return value from saveAs(). If there is a valid fileName, saveFile() is invoked, and save() returns the return value of saveFile(). |
|
Invokes the edSaveAs dialog, which prompts for a "save as" file name. If a valid file name is supplied, the current text will be saved with this name using the saveFile() member function.
False is also returned if the edSaveAs dialog is cancelled. |
|
Saves the fileName file to disk. Returns False if the save fails; otherwise returns True. If editorFlags has the efBackupFiles bit set, a backup file is created. The edCreateError or edWriteError dialog box will be displayed to indicate the reason for failure if save fails.
|
|
Overrides TEditor::setBufSize() to grow and shrink the buffer. Will grow and shrink the buffer in 4K byte increments. gapLen data member is adjusted appropriately. Reimplemented from TEditor. |
|
Undocumented. Reimplemented from TEditor. |
|
Calls TEditor::updateCommands(), then enables the cmSave and cmSaveAs commands. These commands are only valid if the selected view is an editor, otherwise they should be disabled. Reimplemented from TEditor. |
|
Overrides TEditor::valid() to warn that the file might need saving before the program exits. The edSaveUntitled or edSaveModify dialogs are displayed as appropriate.
Reimplemented from TEditor. |
|
Writes to the output stream `os'. Reimplemented from TEditor. |
|
The name of the file being edited. |
|
Undocumented. Reimplemented from TEditor. |