41 int x,
int y,
int w,
int h,
57 int x,
int y,
int w,
int h,
91 if (FileName && !
Read())
309 FileName ? FileName :
untitled.c_str());
328#if OWL_PERSISTENT_STREAMS
347 o->FileName =
is.freadString();
360TEditFile::Streamer::Write(opstream&
os)
const
362 TEditFile*
o = GetObject();
365 os.fwriteString(
o->FileName ?
_W2A(
o->FileName) :
"");
Definition of class TApplication.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
TEditFile is a file-editing window.
virtual void ReplaceWith(LPCTSTR fileName)
Calls SetFileName and Read to replace the file currently being edited with a file whose name is suppl...
void SetFileName(LPCTSTR fileName)
Sets FileName and updates the caption of the window, replacing an empty name with 'Untitled' in its c...
virtual void NewFile()
Begins the edit of a new file after calling CanClear to determine that it is safe to clear the text o...
virtual bool SaveAs()
Saves the contents of the Editor to a file whose name is retrieved from the user, through execution o...
void CmSaveEnable(TCommandEnabler &commandHandler)
Enables save command (only if text is modified).
~TEditFile() override
Frees memory allocated to hold the name of the TEditFile.
virtual bool Write(LPCTSTR fileName=nullptr)
Saves the contents of the Editor to a file whose name is specified by FileName.
auto CanClose() -> bool override
Returns true if the edit window can be closed.
virtual bool Read(LPCTSTR fileName=nullptr)
Reads the contents of a previously specified file into the Editor.
virtual bool Save()
Saves changes to the contents of the Editor to a file.
virtual bool CanClear()
Returns true if the text of the associated edit control can be cleared which is if the text has not b...
void SetupWindow() override
Creates the edit window's Editor edit control by calling TEditFile::SetupWindow().
virtual void Open()
Opens a new file after determining that it is OK to clear the text of the Editor.
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,...
TEditSearch is an edit control that responds to Find, Replace, and FindNext menu commands.
The TFile class encapsulates standard file characteristics and operations.
@ OpenExisting
Opens the file. The function fails if the file does not exist.
@ CreateAlways
Creates a new file. The function overwrites the file if it exists.
TFileOpenDialog is a modal dialog box that lets you specify the name of a file to open.
TFileSaveDialog is a modal dialog box that lets you enter the name of a file to save.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TCHAR * FileName
Holds the name of the file to be saved or opened.
uint32 Flags
Flag contains one or more of the following constants:
void SetFilter(LPCTSTR filter=nullptr)
Makes a copy of the filter list used to display the file names.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
tstring LoadString(uint id) const
virtual int Execute()
Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
auto FormatMessageBox(const tstring &formatStr, const tstring &caption, uint flags,...) const -> int
virtual bool SetDocTitle(LPCTSTR docname, int index)
Default behavior for updating document title is to pass it to parent frame.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition of class TControl.
Definition of class TEdit.
Definition of class TEditFile, a text edit which can find/replace and read/write from/to a file.
Definition of class TEditSearch, an edit control that responds to Find, Replace and FindNext menu com...
#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 SetupWindow() override
void ClearModify()
Resets the change flag of the edit control causing IsModified to return false.
void UnlockBuffer(LPCTSTR buffer, bool updateHandle=false)
Unlock the edit control's buffer locked by LockBuffer.
bool IsModified() const
Returns true if the user has changed the text in the edit control.
TCHAR * LockBuffer(uint newSize=0)
Lock and unlock this edit control's buffer.
void Clear() override
Override TStatic virtual member functions.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core)
Definition of class TString, a flexible universal string envelope class.
Definition of TSystem, a system information provider class.
Base window class TWindow definition, including HWND encapsulation.
#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.