On Sun, Jul 19, 2009 at 2:36 PM, Michael Stratmann<stratm...@micst.de> wrote:
> Hi, no connector? Are the CommandProcessor features still usable? I need to 
> implement some event handlers like load and save myself, because my drawings 
> are organised in projects, and there exist non-drawing files. But event 
> handlers like printing I would like to reuse.

Yes, they work just fine.  I just create the command processor in the
constructor:


    //First line of constructor:
    a2dDocviewGlobals->GetEventDistributer()->Register( this );

    // Other stuff:
    a2dCanvasDocument* root = m_canvas->GetCanvasDocument();
    //root->SetDocumentTemplate( documentTemplate );
    root->CreateCommandProcessor();
    //root->SetDocumentTypeName( documentTemplate->GetDocumentTypeName() );
    root->SetTitle( wxT("wire document") );
    root->SetCanvasDocumentRecursive();

    a2dDocviewGlobals->GetDocviewCommandProcessor()->AddDocument( root );
    m_rootObject = root->GetRootObject();
    m_canvas->SetShowObject( m_rootObject );

All my event handlers are just normal wxWidgets varieties, with no other setup.

> My app frame needs to use AUI. The AUInotebook with the canvas is not the 
> only one, to the left is another AUInotebook, containing a treecontrol (with 
> project files) and a panel very similar to the wires example, a tree/list 
> with parts and a preview (will be a a2dcanvas) of the chosen part. Drawing 
> tools are located on top and left toolbars of the app frame, outside the two 
> notebooks.

But are you using the wxAUI features like the docking and other stuff,
or just using the Notebooks?  Using the whole wxAUI frame system will
need some hacking, but with just the AUI notebooks you can stuff as
many of them as you need into the frames and it'll work just fine.
All you need to do is have your top-level frame be an
a2dDocumentFrame.

> Right now, my app frame is derived from a2dDocumentFrame, and I get two 
> canvas pages in my notebook. So far so good. But I want a proper solution 
> now. Not hacked and randomly working code, otherwise I have the trouble later 
> again.

Well what I'm using now with that isn't hacky code; however, I'm not
using a full wxAUI frame -- only the AUI notebook.  Some work will
need to be done to get wxArt2D to work from a wxAUI frame though,
since it doesn't have the necessary hooks.

------------------------------------------------------------------------------
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

Reply via email to