[logo] JX Application Framework
   
Home     
* Cart

Introduction

Why use a framework?

Download

Vision
    API stability

    Code optimization

    Bibliography

Features
    Object messaging

    Extensibility

    Drag-and-Drop

    Networking

    3D Graphics

    Powerful tables

    Styled text editor

    Memory leak debugger

    Tutorial
    Class tree

    Open protocols

    Known bugs

    Next release
    Future plans

    Projects

FAQ

Other software

Log in  

   
     

Document support

JXDocument provides the basic abstraction of a collection of data that needs to be saved. Derived classes must implement the pure virtual function OKToClose().

JXFileDocument provides support for a collection of data that is stored in a single file. It provides functions for implementing all the standard File menu items:

  • New
  • Open
  • Save (including automatic backup files with no extra work by derived classes)
  • Save as
  • Save a copy as
  • Revert to saved (including when the file on disk has changed)

  • Menu of currently open documents

Derived classes only need to implement the pure virtual function WriteTextFile() if they write plain text data or WriteFile() if they write binary data.

JXFileDocument also provides the following useful features:

  • Safety save as protection against program and X server crashes.
  • Extra safety save to protect against assert() crashes. (These require no extra work by derived classes!)
  • CheckForSafetySaveFiles() provides a simple way to let the user automatically open newer versions of safety saved files.

  • Option to always save the data when the document is closed. This is usually a good idea because data files should store things like window positions, scrollbar setup, etc., which shouldn't bother the user with a "Save before closing?" message, but should still be updated when the document is closed. If the user made significant changes, so that DataModified() was called, the "Save before closing?" message does appear since the file system doesn't provide version control.

  • (NEW) Allows user to attempt to save even if the file is write protected.
JXDocumentManager keeps track of the files that are open, to help prevent opening the same file twice. A derived class is the ideal way to centralize the interactions between documents.

Copyright © 2008 New Planet Software