The DocManager class is part of the document/view framework supported by Widgets,
and cooperates with the View, Document and DocTemplate classes.
DocManager overview, Document, View, DocTemplate, FileHistory
View*m_currentView
The currently active view.
intm_defaultDocumentNameCounter
Stores the integer to be used for the next default document name.
FileHistory*m_fileHistory
A pointer to an instance of FileHistory,
which manages the history of recently-visited files on the File menu.
intm_maxDocsOpen
Stores the maximum number of documents that can be opened before
existing documents are closed. By default, this is 10,000.
Listm_docs
A list of all documents.
longm_flags
Stores the flags passed to the constructor.
The directory last selected by the user when opening a file.
FileHistory*m_fileHistory
Listm_templates
A list of all document templates.
Constructor. Create a document manager instance dynamically near the start of your application
before doing any document or view operations.
flags is currently unused.
If initialize is true, the Initialize function will be called
to create a default history list object. If you derive from DocManager, you may wish to call the
base constructor with false, and then call Initialize in your own constructor, to allow
your own Initialize or OnCreateFileHistory functions to be called.
Destructor.
Sets the current view.
Adds the document to the list of documents.
Adds a file to the file history list, if we have a pointer to an appropriate file menu.
Adds the template to the document manager’s template list.
Closes all currently opened documents.
Creates a new document in a manner determined by the flags parameter, which can be:
If DOC_NEW is present, a new document will be created and returned, possibly after
asking the user for a template to use if there is more than one document template.
If DOC_SILENT is present, a new document will be created and the given file loaded
into it. If neither of these flags is present, the user will be presented with
a file selector for the file to load, and the template to use will be determined by the
extension (Windows) or by popping up a template choice list (other platforms).
If the maximum number of documents has been reached, this function
will delete the oldest currently loaded document before creating a new one.
Creates a new view for the given document. If more than one view is allowed for the
document (by virtue of multiple templates mentioning the same document type), a choice
of view is presented to the user.
Removes the template from the list of templates.
Appends the files in the history list, to all menus managed by the file history object.
file_history_add_files_to_menu(%(arg-type)Menu% menu)Appends the files in the history list, to the given menu only.
Loads the file history from a config object.
Removes the given menu from the list of menus managed by the file history object.
Saves the file history into a config object. This must be called
explicitly by the application.
Use this menu for appending recently-visited document filenames, for convenient
access. Calling this function with a valid menu pointer enables the history
list functionality.
Note that you can add multiple menus using this function, to be managed by the
file history object.
Given a path, try to find template that matches the extension. This is only
an approximate method of finding a template for creating a document.
Returns the document associated with the currently active view (if any).
Returns the currently active view
Returns a reference to the list of documents.
Returns a pointer to file history.
Returns the directory last selected by the user when opening a file. Initially empty.
Returns the number of documents that can be open simultaneously.
Returns the number of files currently stored in the file history.
Returns a reference to the list of associated templates.
Initializes data; currently just calls OnCreateFileHistory. Some data cannot
always be initialized in the constructor because the programmer must be given
the opportunity to override functionality. If OnCreateFileHistory was called
from the constructor, an overridden virtual OnCreateFileHistory would not be
called due to C++’s `interesting’ constructor semantics. In fact Initialize
[This page automatically generated from the Textile source at 2023-06-09 00:45:35 +0000]