Talk:WxView
From WxWiki
I'm a little bit confused about the role of "wxView".
Seems that there is a 1:1 relationship between a wxView and a frame (typically wxDocChildFrame or something) via it's m_viewFrame member variable.
Since a wxDocument is also an event handler, and all wxView seems to be is an intermediate object between a frame and the document (which can have many views) why is a wxView simply not a subclass of a frame (or wxWindow)?
- I don't see how wxDocument being an event handler has anything to do with wxView being a subclass of wxWindow. You can have multiple views of the same document, and you would want the doc/view framework to know about this so that actions on the document while in one view are reflected in it's other views. However, none of that has anything to do with wxView not deriving from wxFrame/wxWindow. The view functionality is separated from the window functionality so it can be used in both single document interface implementations (SDI) as well as multiple document interfaces (MDI). Additionally, it's quite possible to implement your own document interface while still taking advantage of most of the doc/view framework, it's command system, and other features. None of that would be possible if the view was hard-coded to handle it's window/frame functionality as well. --Tierra 09:24, 28 June 2007 (PDT)
