Custom wxControl for use with SFML Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
Haikarainen
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Sep 13, 2011 4:52 pm

Custom wxControl for use with SFML

Post by Haikarainen »

I'm trying to create a custom wxControl to create a "SFML-Canvas" to draw on, but I'm running into trouble. I use the official SFML1.6 tutorials for this found on their site http://www.sfml-dev.org/tutorials/1.6/g ... idgets.php , with 1 small modification since I use the newest Git-version of SFML2.0, that modification is inrelevant to this problem though.

Canvas_MapViewer is derived from wxSFMLCanvas as follows: http://www.sfmluploads.org/code/94
wxSFMLCanvas is derived from wxControl and sf::RenderWindow as follows: http://www.sfmluploads.org/code/95
nnmeFrame is derived from wxFrame as follows: http://www.sfmluploads.org/code/96

The problem is in the nnmeFrame-constructor: http://www.sfmluploads.org/code/97
Compiler whines about:

Code: Select all

In constructor 'nnmeFrame::nnmeFrame(wxFrame*, const wxString&)':|
error: no matching function for call to 'Canvas_MapViewer::Canvas_MapViewer(nnmeFrame* const, <anonymous enum>, wxPoint, wxSize)'|
note: candidates are: Canvas_MapViewer::Canvas_MapViewer(wxWindow*, wxWindowID, wxPoint&, wxSize&, long int)|
note:                 Canvas_MapViewer::Canvas_MapViewer(const Canvas_MapViewer&)|
||=== Build finished: 1 errors, 1 warnings ===|
I'm pretty experienced when it comes to C++ in general, as well as the SFML-library, but totally new to wxWidgets.


EDIT; You might want to know my configuration; SFML2.0, wxWidgets 2.8, Windows XP SP3, Codeblocks w/ MinGW-GCC

All help appreciated, Cheers
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Custom wxControl for use with SFML

Post by catalin »

You are probably trying to instantiate a const nnmeFrame, or to do it from a const object. See the first argument in the erroneous call.
Haikarainen
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Sep 13, 2011 4:52 pm

Re: Custom wxControl for use with SFML

Post by Haikarainen »

The problem was I passed unnamed nonconst's as Size and Position. Fixed
Post Reply