Michael Stratmann wrote: > Hi, I discovered, OnPostCreateView() did not get called at all, because I > created the document not by GetDocviewCommandProcessor()->CreateDocuments() > but manually (like auiframe demo). > The right way is from document templates. Which is use from CreateDocuments(). All else is possible, but more complicated, since of course the frame work does not understand what you want, if you do thing manually. You must somehow create the right events, by adding documents to the framework. > But when I use GetDocviewCommandProcessor()->CreateDocuments(), I get an > assert in canvas.cpp, line 738. The existing OnPostCreateView() is really not > usable with a2dCanvasView. > It very suitable, it will tell how YOU want a new ""a2dCanvasView"" created via a document template from viewTemplate, needs to be CONNECTED to your GUI. A view is always a child of a window. But a view can results in new windows, reuse of existing windows, or even new frames with a window. So you decide in your application how new views are attached to you windows.
File->Open->DocumentTemplate->Created a2dDocument->ViewTemplate->Creates view->Connector attaches to window. So for canvas module: File->Open->DocumentTemplate->Created a2dCanvasDocument->ViewTemplate->Creates a2dCanvasView->Connector attaches to a2dCanvas. > Looks like I have to write my own notebook connector, based on > a2dWindowConnector. The need for this is somehow written in > http://www.wxart2d.org/moin/DocviewModule. But I had hoped, I could use the > wxNotebookConnector. > > Or I continue to create my docs manually and use a2dWindowConnector only. > There are two samples using it (tabframe and auiframe ) and they show a template. wxNoteBookConnector<MyNoteBook, a2dCanvas> is what you need i think, so the template for the window handled by the connector becomes a a2dCanvas. And next derive and redefine OnPostCreateView and cast the view to the a2dCanvasView to create your new a2dCanvas taking a a2dCanavsView as input. I could add one extra template parameter, to also define the view for belonging to such windows. But that would only work if each type of Twindow has such a constructor. So maybe a bit to much to ask. Better derive i think. Still something to consider. Klaas ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Wxart2d-users_dev mailing list Wxart2d-users_dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev