#include <GDocApp.h>
Public Member Functions | |
GDocApp (char *appname=0, char *icon=0, char *optsname=0) | |
Creates the class. | |
void | SetCurFile (char *f) |
Sets the current file name. | |
char * | GetCurFile () |
Gets the current file name. | |
bool | SetDirty (bool Dirty) |
Sets the dirty state. If the doc is clean you are not asked to save it when you close the window. | |
bool | GetDirty () |
Gets the dirty state. | |
OptionsFmt * | GetOptions () |
Gets the options list. | |
char * | GetAppName () |
Gets the application name. | |
char * | GetOptionsFileName () |
Gets the options file name. | |
virtual void | Empty () |
Implement this to clear your docment from memory, i.e. "Close". | |
virtual bool | SerializeOptions (OptionsFmt *Options, bool Write) |
Implement this to read/write your application specific options. | |
virtual void | OnDirty (bool NewValue) |
This is called when the dirty state changes. | |
bool | SetLanguage (char *LangId) |
void | OnReceiveFiles (GArray< char * > &Files) |
Called when files are dropped on the window. | |
bool | OnRequestClose (bool OsShuttingDown) |
Called on a top level window when something requests to close the window. | |
int | OnCommand (int Cmd, int Event, OsView Window) |
Called when a menu command is activated by the user. | |
int | OnEvent (GMessage *m) |
Called to process every message received by this window. | |
Protected Member Functions | |
bool | _LoadMenu (char *Resource=0, char *Tags=0) |
Loads the given menu. | |
bool | _Create () |
Call this to create the window, usually in the constructor of your main window class. | |
bool | _Destroy () |
Call this to destroy the window, usually in the destuctor of your main window class. | |
bool | _OpenFile (char *File, bool ReadOnly) |
Use the open file dialog to select a docuement to open. | |
bool | _SaveFile (char *File) |
Save the current document. | |
Protected Attributes | |
char * | _LangOptsName |
Set this to the name of the language setting in the option file. |
GDocApp< OptionsFmt >::GDocApp | ( | char * | appname = 0 , |
|
char * | icon = 0 , |
|||
char * | optsname = 0 | |||
) | [inline] |
Creates the class.
appname | The name of the application |
icon | [Optional] The icon resource for the window. |
optsname | Options file base name.. |
References GDocApp< OptionsFmt >::_LangOptsName, GPointer::c, GPointer::i, GView::MoveToCenter(), GWindow::SetPos(), and GWindow::SetQuitOnClose().
bool GDocApp< OptionsFmt >::SetLanguage | ( | char * | LangId | ) | [inline] |
Set the language for the application, which causes a restart. The lang id is saved to the options file, the user is asked whether they want to restart, if yes, then the application closes, and executes itself.
Uses the resource string L_DOCAPP_RESTART_APP to warn the user of the restart (there is an english default).
References GDocApp< OptionsFmt >::_LangOptsName, GDocApp< OptionsFmt >::GetOptions(), IDYES, LgiCloseApp, and MB_YESNO.