Hi, I create m_canvas like you do. 

>From the aui-example I believe I should use the notebook connector. The 
>compiler gives the wrong error (in the right place). I do not understand 
>enough about the different connector classes, only the a2dViewConnector is 
>documented well. Don't you use a connector? 

template<class NoteBook, class Twindow>
void wxNotebookConnector<NoteBook,Twindow>::OnPostCreateView( a2dTemplateEvent& 
event )
{
    //next to what is done in base class, set the view to the display.
    a2dView* view = event.GetView();

    Twindow* outputwindow;
    outputwindow = new Twindow(view, m_notebook, -1, wxDefaultPosition, 
wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE );
    m_notebook->AddPage( outputwindow, view->GetDocument()->GetPrintableName(), 
true );    

    outputwindow->SetCursor( wxCURSOR_PENCIL );
    outputwindow->SetScrollbars(20, 20, 50, 50);
    outputwindow->SetBackgroundColour( wxColour( 0,235, 235 ) );
    outputwindow->ClearBackground();

    view->Update();
}

This code fails (compiler does not know which constructor to use), it clearly 
demands a view. When I replace paramter "view" by "dynamic_cast<a2dCanvasView 
*>(view)" things work.

Honestly, I am confused. There appear to be many ways to get it working. But I 
do not see one.

Viele Grüße, Michael

Bionic Badger schrieb:
> On Sun, Jul 19, 2009 at 9:34 AM, Michael Stratmann<stratm...@micst.de> wrote:
>> Hello, thanks for all the comments, I am getting a better idea, but seem to 
>> have more work ahead. I replaced a2dDocumentViewScrolledWindow by a2dCanvas  
>> and use a2dCanvasView. No derived own classes for now.
>>
>> Then I got error
>> 1>D:\wxArt2D\modules\docview/include/docviewref.h(3269) : error C2664: 
>> 'a2dCanvas::a2dCanvas(wxWindow *,wxWindowID,const wxPoint &,const wxSize 
>> &,long,a2dDrawer2D *)' : cannot convert parameter 1 from 'a2dView *' to 
>> 'wxWindow *'
>>
>> because
>> a2dCanvas (a2dCanvasView *view, wxWindow *parent, wxWindowID id=-1, const 
>> wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long 
>> style=wxScrolledWindowStyle)
>> requires a2dCanvasView * as first param, but gets only a2dView*, a type cast 
>> is missing.
> 
> Are you sure you're using the correct constructor?  The constructor,
> the one the compiler is expecting above, doesn't require a view as a
> parameter:
> 
> a2dCanvas (wxWindow *parent, wxWindowID id=-1, const wxPoint
> &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long
> style=wxScrolledWindowStyle, a2dDrawer2D *drawer2D=0)
> 
> I'm not sure what you're using as parameters, but I set up my canvases
> like this:
> 
>    m_canvas = new a2dCanvas
>    (
>        m_panel,
>        -1,
>        wxDefaultPosition,
>        wxDefaultSize,
>        wxHSCROLL | wxVSCROLL | wxSUNKEN_BORDER | wxALWAYS_SHOW_SB
>    );

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