wxView overview

See Document/view framework overview.

Class: wxView

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

See the example application in samples/docview.

To use the abstract wxView class, you need to derive a new class and override at least the member functions OnCreate, OnDraw, OnUpdate and OnClose. You will probably want to override OnMenuCommand to respond to menu commands from the frame containing the view.

Use the macros DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS in order to allow the framework to create view objects on demand. When you create a wxDocTemplate object on application initialization, you should pass CLASSINFO(YourViewClass) 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 view objects dynamically, you must override wxDocTemplate::CreateView to return an instance of the appropriate class.

ymasuda 平成17年11月19日