GDocApp< OptionsFmt > Class Template Reference

#include <GDocApp.h>

Inheritance diagram for GDocApp< OptionsFmt >:

GWindow GView GDragDropTarget

List of all members.

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.


Detailed Description

template<typename OptionsFmt>
class GDocApp< OptionsFmt >

A base for a document processing application. The 2 types you can use for OptionsFmt are (ideally) GOptionsFile or (deprecated) ObjProperties.

Constructor & Destructor Documentation

template<typename OptionsFmt >
GDocApp< OptionsFmt >::GDocApp ( char *  appname = 0,
char *  icon = 0,
char *  optsname = 0 
) [inline]

Creates the class.

Parameters:
appname  The name of the application
icon  [Optional] The icon resource for the window.
optsname  Options file base name..

References GDocApp< OptionsFmt >::_LangOptsName, GView::MoveToCenter(), GWindow::SetPos(), and GWindow::SetQuitOnClose().


Member Function Documentation

template<typename OptionsFmt >
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.

See also:
Requires _LangOptsName to be set to the option name of the language setting.

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.


The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:02 2010 for Lgi by  doxygen 1.5.7.1