Author Topic: Creating a Custom Button  (Read 6676 times)

Offline hibbity

  • Multiple posting newcomer
  • *
  • Posts: 41
Creating a Custom Button
« on: June 09, 2011, 12:18:03 am »
Following the tutorial:
http://wiki.codeblocks.org/index.php?title=Creating_a_plugin_which_adds_new_item_into_wxSmith

The constructor for a CustomButton looks like this:
Code
wxsCustomButton::wxsCustomButton(wxsItemResData* Data):
    wxsWidget(
        Data,               // Data passed to constructor
        &Reg.Info,          // Info taken from Registering object previously created
        wxsCustomButtonEvents,    // Structure describing events
        NULL)     // Structure describing styles
{
}

Here is what the compiler is saying:

Code
../wx_test/wx_testMain.cpp||In constructor 'wx_testFrame::wx_testFrame(wxWindow*, wxWindowID)':|
../wx_test/wx_testMain.cpp|621|error: no matching function for call to 'wxsCustomButton::wxsCustomButton(wxPanel*&, const long int&, const wxChar*, wxPoint, const wxSize&, int, const wxValidator&, const wchar_t [12])'|
../wxthings/wxscustombutton.h|34|note: candidates are: wxsCustomButton::wxsCustomButton(wxsItemResData*)|
../wxthings/wxscustombutton.h|31|note:                 wxsCustomButton::wxsCustomButton(const wxsCustomButton&)|
||=== Build finished: 3 errors, 0 warnings ===|

What is the proper way to instantiate the "wxscustombutton" widget defined in ../codeblocks-10.05/src/plugins/contrib/wxSmithContribItems/wxthings
Looking at the parent classes for wxsWidget did not help.

Offline hibbity

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Creating a Custom Button
« Reply #1 on: June 09, 2011, 05:36:39 pm »
Constructor should be for wxCustomButton, not wxscustombutton.   Problem solved.