User forums > Help

override fuctions


In the wxwidgets 2.6.0 document on the cunstructor it sayes

During the construction of the frame, the client window will be created. To use a different class from wxMDIClientWindow, override wxMDIParentFrame::OnCreateClient.
I thought that since codeblock did not overide OnCreateClient and was using editorbase a derived calss of mdiclient,   It might be causeing probblems.  I was going to try and correct it buy putting this in main.h

virtual EditorBase * OnCreateClient(void);

and this in main.cpp

EditorBase * MainFrame::OnCreateClient()
EditorBase *m_pClientWindow =new EditorBase();
return m_pClientWindow;
I created a cunstror for EditorBase();
and compiled.

It gives me the following in compiler log

In file included from src\/app.h:33,
                 from src\main.cpp:26:
src\/main.h:25: error: invalid covariant return type for `virtual EditorBase* MainFrame::OnCreateClient()'
../../wxMSW-2.6.0/include/wx/msw/mdi.h:67: error:   overriding `virtual wxMDIClientWindow* wxMDIParentFrame::OnCreateClient()'
Process terminated with status 1 (0 minutes, 6 seconds)
Can SomeOne tell me how to fix this problem?
I  have no experiance at overriding fuction and i am all self taught.

According to the wxWidgets manual, The Client window is _NOT_ an MDI child frame, but the placeholder for these. It's transparent.

Thanks i don't know how I done that.
I cunfused wxMDIChildFrame with wxMDIClientWindow;  There two simmalar but different classes


[0] Message Index

Go to full version