Hi Class, many thanks!! Got it back to work.
Am Freitag, 25. April 2008 schrieb Klaas Holwerda: > All wrong, this is what you should do if you want to use the docview system > underneath. But if you just want to program it, you not need to do it via a > commandprocessor, templates etc. > But that means saving the drawing etc. is also not that easy. > > sample_editor_tuto shows you how to just create a canvas > > m_canvas = new a2dCanvas( this, -1 , wxPoint(0,0), wxSize(wx,wy), > wxHSCROLL|wxVSCROLL); > > ....... > a2dCanvasDocument* root = m_canvas->GetCanvasDocument(); Did it like this, but slightly modified: target = new (Target); // this is my canvasdocument target->init(); //adds graphical objects to its root mCanvas = new a2dCanvas( mLGpanel->mPanel, -1 , wxPoint(0,0), wxSize(800,600), wxHSCROLL|wxVSCROLL); mCanvas->SetMappingUpp(-1,-1,0.1,0.1); mCanvas->SetYaxis( false ); mCanvas->SetScrollMaximum(-5,-4,85,65); mCanvas->SetScrollStepX(1); mCanvas->SetScrollStepY(1); //mCanvas->FixScrollMaximum(true); //mLGpanel->mViewSizer->Add(mLGpanel, 1, wxGROW|wxALL, 5); mCanvas->SetCanvasDocument(target); target->UpdateAllViews(); The graphics is now shown and can be changed dynamically by just changing the underlying "target" document. It works like charme :). I think, a2dCanvas is a wxScrolledWindow. Is that right? Thanks again! now i can play around further ... Regards, Thomas > > sample_editor_tuto > sample_editor_single > sample_editor_single2 > > Actually this last simple demos both ways. Look at the #define SIMPLE > If you outcomment it you get the > > a2dDocviewGlobals->GetDocviewCommandProcessor()->AddCreatedDocument( > document ); > > way of doing things ( look at the a2dDocumentTemplate and a2dViewTemplate > defined in single2.cpp) > > And with #define SIMPLE defined you get the simple case. > But a2dCanvasSim should very like be a2dCanvas in your case. > > Anyway study the above samples first, try to a a notebook in there, and > work your way up :-) > > Klaas > > Unclassified -- Dipl.-Ing. Thomas Zehbe Kuhweide 6 31552 Apelern ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Wxart2d-users_dev mailing list Wxart2d-users_dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev