tbx  0.7.6
Classes
tbx::doc Namespace Reference

Helper classes to create a document based application. More...

Classes

class  DocCreator
 Templated class to provide information on a documents file type and how to create the document and its window. More...
 
class  DocCreatorBase
 Base class to help create a document and a window to show it in. More...
 
class  DocFileInfo
 Show the File information dialog box and automatically fill it in from the document in it's ancestor window. More...
 
class  DocIconbar
 Class to tie clicks and icon bar load events to document creation. More...
 
class  DocManager
 Class to manage all the documents. More...
 
class  DocModifiedChangedListener
 Listener for document modified state changed. More...
 
class  DocPositionWindow
 Class to reposition each newly opened document window so the titles don't overlap. More...
 
class  DocSaveAs
 Class to use save as dialogue box to save the document. More...
 
class  Document
 Base class for a document. More...
 
class  DocWindow
 Base class for the document window. More...
 

Detailed Description

Helper classes to create a document based application.

The doc namespace provides helper classes to make it easy to produce a document editing application.

Using these classes means you can concentrate on application functionality as they handle all the plumbing for you.

e.g.

The main entry point to it then becomes

tbx::Application docex_app("<TbxDocEx$Dir>");
tbx::doc::DocManager doc_manager(&doc_creator);
tbx::doc::DocFileInfo doc_fileinfo;
if (argc > 1) doc_manager.load_files(argc-1, argv+1);
docex_app.run();

All that is then needed is to derive your document from tbx::doc::Document and overload the document_size, load(std::istream &is) and save(std::ostream &os) functions.

The window to display the document should be derived from tbx::doc::DocWindow and modified to show the data when it is created.

If more functionality is required from the iconbar you may want to derive a class from DocIconbar as well.

For this functionality to work you need to have the following resources.

Also you will want to create a icon bar menu with the Quit option on and a menu for the main window that has entries to show SaveAs and FileInfo.

Set the Doc... class descriptions for other settings needed for the resources.

tbx::doc::DocManager
Class to manage all the documents.
Definition: docmanager.h:129
tbx::Application
The main application class.
Definition: application.h:79
tbx::doc::DocSaveAs
Class to use save as dialogue box to save the document.
Definition: docsaveas.h:59
tbx::doc::DocCreator
Templated class to provide information on a documents file type and how to create the document and it...
Definition: docmanager.h:87
tbx::doc::DocFileInfo
Show the File information dialog box and automatically fill it in from the document in it's ancestor ...
Definition: docfileinfo.h:52
tbx::doc::DocIconbar
Class to tie clicks and icon bar load events to document creation.
Definition: dociconbar.h:51