July 28th Tuesday (七月 二十八日 火曜日)

wxDocument

  The wxDocument class can be used to model an application's file-based data. It is part of the document/view framework supported by wxWidgets,
and cooperates with the wxView, wxDocTemplate and wxDocManager classes.

  Using this framework can save a lot of routine user-interface programming, since a range of menu commands -- such as open, save, save as --
are supported automatically. The programmer just needs to define a minimal set of classes and member functions for the framework to call when
necessary.  Data, and the means to view and edit the data, are explicitly separated out in this model, and the concept of multiple views onto
the same data is supported.

  Note that the document/view model will suit many but not all styles of application. For example, it would be overkill for a simple file conversion
utility, where there may be no call for views on documents or the ability to open, edit and save files. But probably the majority of applications
are document-based.

  To use the abstract wxDocument class, you need to derive a new class and override at least the member functions SaveObject and LoadObject.
SaveObject and LoadObject will be called by the framework when the document needs to be saved or loaded.

  Use the macros DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS in order to allow the framework to create document objects on demand. When
you create a wxDocTemplate object on application initialization, you should pass CLASSINFO(YourDocumentClass) to the wxDocTemplate constructor
so that it knows how to create an instance of this class.

  If you do not wish to use the wxWidgets method of creating document objects dynamically, you must override wxDocTemplate::CreateDocument to
return an instance of the appropriate class.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值