July 30th Thursday (七月 三十日 木曜日)

wxDocTemplate

  The wxDocTemplate class is used to model the relationship between a document class and a view class. The application creates a document template
object for each document/view pair. The list of document templates managed by the wxDocManager instance is used to create documents and views.
Each document template knows what file filters and default extension are appropriate for a document/view combination, and how to create a document
or view.

  For example, you might write a small doodling application that can load and save lists of line segments. If you had two views of the data -- graphical,
and a list of the segments -- then you would create one document class DoodleDocument, and two view classes (DoodleGraphicView and DoodleListView).
You would also need two document templates, one for the graphical view and another for the list view. You would pass the same document class and default
file extension to both document templates, but each would be passed a different view class. When the user clicks on the Open menu item, the file selector
is displayed with a list of possible file filters -- one for each wxDocTemplate. Selecting the filter selects the wxDocTemplate, and when a file is
selected, that template will be used for creating a document and view.

  For the case where an application has one document type and one view type, a single document template is constructed, and dialogs will be appropriately
simplified.

  wxDocTemplate is part of the document/view framework supported by wxWidgets, and cooperates with the wxView, wxDocument and wxDocManager classes.

  To use the wxDocTemplate class, you do not need to derive a new class. Just pass relevant information to the constructor including CLASSINFO(YourDocumentClass)
and CLASSINFO(YourViewClass) to allow dynamic instance creation. If you do not wish to use the wxWidgets method of creating document objects dynamically,
you must override wxDocTemplate::CreateDocument and wxDocTemplate::CreateView to return instances of the appropriate class.

  NOTE: the document template has nothing to do with the C++ template construct.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值