Thomas Zehbe wrote:
I meanwhile tried a lot of different things to get it work, but nothing
worked. Looked at the tabframe vdrawas samples, looked into the the class doc
etc., but it didn't enlight me.
What I currently try to do is the following:
- create a wxFrame with a tab control on it, the tab control having one tab
with a wxPanel containing a wxScrolled window.
- after that i want to create a canvasdoc and a view, do a
view->SetDisplayWindow(scrolledwin) and want to see some graphics
For Example with this code:
Target* target = new (Target); //the canvas document
a2dDocviewGlobals->GetDocviewCommandProcessor()->AddCreatedDocument(
target, false);
a2dView* view =
a2dDocviewGlobals->GetDocviewCommandProcessor()->CreateView( target, wxT(""),
a2dREFDOC_NON, a2dREFTEMPLATE_VISIBLE );
view->SetDisplayWindow(mLGpanel->mCanvas);
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();
And add a drawing to it.
This can be done with tabs also the same way.
But this leads to an assert:
ASSERT INFO:
/misc/wxArt2D/modules/docview/src/doccom.cpp(951): assert "foundtemplate"
failed in AddCreatedDocument():
a2dDocumentCommandProcessor::AddCreatedDocument Document could not find
template for document type name
This is because you did not setup templates. And you do not need them, but in
that case you can not create a document that way, because that requires a template.
You must see the whole docview framework as a layer on top of the a2dCanvas
a2dDocument etc. Still those last classes can be used standalone also.
As in:
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
begin:vcard
fn:Klaas Holwerda
n:Holwerda;Klaas
note:Unclassified
version:2.1
end:vcard
-------------------------------------------------------------------------
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