Author Topic: wxSmith started to miss a separator between two parameters of wxFilePickerCtrl()  (Read 6342 times)

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Hello.

I was with C::B SVN 8466 on a project built against wxWidgets 2.9.3 (keeping wx_2.8 compatibility flag) under Windows 7. Yesterday, I've updated to 2.9.4 (compiling-it without 2.8 compatibility). Then I've loaded my project in C::B and rebuilt-it for checking : all sounded right !

But, today, I've gone through wxSmith to add an event handler. The handler has been well added but I suppose wxSmith rewrites everything at every change... From this point my program started to failed to compile !

It says :
Quote
no matching function for call to 'wxFilePickerCtrl::wxFilePickerCtrl(wxPanel*&, const long int&, const wxChar*&, const wchar_t [7]...

And, effectively, my code, now, looks like :
Code
pckImg = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString _("Select a file")...

As you can see, a "," is missing between the 3rd and 4th parameter. If I add it manually, it compiles successfully, but at every use of wxSmith this "," is removed again :(

So, I've updated C::B to the last nightly build (SVN 8476) and it remains the same.
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Try this patch:
Code
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfilepickerctrl.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfilepickerctrl.cpp (revision 8489)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfilepickerctrl.cpp (working copy)
@@ -75,7 +75,7 @@
         case wxsCPP:
         {
             AddHeader(_T("<wx/filepicker.h>"),GetInfo().ClassName,0);
-            Codef(_T("%C(%W, %I, %n %t, %n, %P, %S, %T, %V, %N);\n"), m_sPath.wx_str(), m_sMessage.wx_str(), m_sWildcard.wx_str());
+            Codef(_T("%C(%W, %I, %n, %t, %n, %P, %S, %T, %V, %N);\n"), m_sPath.wx_str(), m_sMessage.wx_str(), m_sWildcard.wx_str());
             BuildSetupWindowCode();
             return;
         }

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Code
pckImg = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString _("Select a file")...
As you can see, a "," is missing between the 3rd and 4th parameter.
Strange nobody noticed before.

Try this patch:
Good catch, Alpha - applied in SVN.

The next nightly should have that fixed. Thanks for reporting.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Strange, effectively, Morten, but there's always a first one ;D Thanks for pointing responsible line of code, Alpha ;) On my side I'll wait for next nightly build ; no time to apply patch then build by myself, since I'm on two projects with deadline at the end of the year (to code/write, to eat, to sleep is my current life) :-\
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]