Well i'am trying to work from samples, I tried to make a mix between my app
and the samples with the aui frame managment and with a sample with canvas
Now I am making a new test project I have copied the aui sample project and
files and i have make several modifications
=>
scrolledwindow become a2dCanvasSim
my frame no longer derive from editor frame but from a2dDocumentFrame
myframe now has two member copied from EditorFrame :
- a2dCanvasSim* m_canvas; (which was a scrolled window in EditorFrame)
- a2dSmrtPtr<a2dScrolledWindowViewConnector> m_singleconnector;
I have created my own view and my own document
they just derive from a2dCanvasView and a2dCanvasDocument
I have modified the template to associate
it compiles but it fails in the same way that before
code of the initialisation
m_notebookconnector = connector;
m_notebook = new MyNotebook(this);
m_notebookconnector->Init( m_notebook );
MyView* view1 = new MyView();
//make a new document and add it to the document manager and view.
MyDoc* doc = new MyDoc();
doc->SetFilename( wxFileName(wxT(" dummy.drw")) );
doc->CreateCommandProcessor();
view1->SetDocument( doc );
a2dDocviewGlobals->GetDocviewCommandProcessor()->AddCreatedDocument( doc
); //=> commandprocessor pointer is put at NULL !!!!!
m_canvas = new a2dCanvasSim(m_notebook, -1 , wxPoint(0, 0), size,
wxNO_FULL_REPAINT_ON_RESIZE);
m_canvas->SetView(view1);
m_canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
m_notebook->AddPage( m_canvas, wxT("window1"), true );
// Give it scrollbars
m_canvas->SetScrollbars(20, 20, 50, 50);
m_canvas->SetBackgroundColour(*wxWHITE);
m_canvas->ClearBackground();
//for the in editor templates ( see EditFrame )
m_singleconnector->SetDisplayWindow( m_canvas );
// Make sure the document manager knows that this is the
// current view.
view1->Activate(true);
doc->GetCommandProcessor()->Initialize(); // fails cause try to acces to
command processor => NULL pointer error :(
Perhaps i need somthing from EditorFram like an event handler ???
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wxart2d-users_dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev