Author Topic: Rev 6104 breaks build with wx-2.9  (Read 7949 times)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Rev 6104 breaks build with wx-2.9
« on: January 29, 2010, 05:20:40 pm »
As the title suggests, due to revision 6104 trunk can't be built with wx-2.9. Reason is the inclusion of following two files in trunk - include\scrollingdialog.h and sdk\scrollingdialog.cpp

These files are part of wx-2.9 and should not be used in C::B code just by copying it (even with modified code) from wx source to C::B trunk.

As a solution, please subclass it, if it's really necessary to use it, so that there is no conflict in class names and file name used. Otherwise please revert the portion of patch that uses wxScrollingDialog class.

Regards,

Biplab
Be a part of the solution, not a part of the problem.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #1 on: January 29, 2010, 08:06:24 pm »
The sources are not copied from wxWidgets, they are taken from this site: http://www.anthemion.co.uk/code.htm.

Use of the classes has been discussed in some(?) threads, and it was added to the scintilla (and debugger) test-branch for quite a long time.

The best way to fix the conflicts should be discussed, because just renaming and subclassing would most likely also break the wxSmith (and xrc) support for wxscrollingdialog.

I start downloading wx2.9 to see what can be done, will take some time due to ISDN.
I hope I find the time this weekend to work on this issue.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9504
Re: Rev 6104 breaks build with wx-2.9
« Reply #2 on: January 29, 2010, 09:11:40 pm »
As the title suggests, due to revision 6104 trunk can't be built with wx-2.9. Reason is the inclusion of following two files in trunk - include\scrollingdialog.h and sdk\scrollingdialog.cpp

These files are part of wx-2.9 [...]
I don't see them in the SVN tree of wx 2.9???
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #3 on: January 29, 2010, 09:46:02 pm »
As the title suggests, due to revision 6104 trunk can't be built with wx-2.9. Reason is the inclusion of following two files in trunk - include\scrollingdialog.h and sdk\scrollingdialog.cpp

These files are part of wx-2.9 [...]
I don't see them in the SVN tree of wx 2.9???
I just downloaded the 2.9 tarball and did not find wxScrollingDialog either, it's also not in actual trunk ( http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk ).

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6661
    • My Best Post
Re: Rev 6104 breaks build with wx-2.9
« Reply #4 on: January 29, 2010, 10:21:27 pm »
IIRC, it is wxDialogLayoutAdapter that is the problem.

See wx/dialog.h and src/common/dlgcmn.cpp and for possible name clash with the name wxDialogLayoutAdapter used in C::B scrollingdialog.h.

I tried to create a patch but was not able to because of wx2.9.x changes to wxDialog made the fix to complex for me to do. The problem was class inheritance was changed too much for me to fix; I do NOT know C++ well enough to fix the issue.

IIRC, The below code was a problem, both wxDialogHelper and wxDialog had a common base class; where the right method was hard to determine which should be done.

Code: [Select]
wxScrollingDialog: public wxDialog, public wxDialogHelper

Tim S.




« Last Edit: January 29, 2010, 10:30:29 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #5 on: January 29, 2010, 11:37:17 pm »
IIRC, it is wxDialogLayoutAdapter that is the problem.

See wx/dialog.h and src/common/dlgcmn.cpp and for possible name clash with the name wxDialogLayoutAdapter used in C::B scrollingdialog.h.

I tried to create a patch but was not able to because of wx2.9.x changes to wxDialog made the fix to complex for me to do. The problem was class inheritance was changed too much for me to fix; I do NOT know C++ well enough to fix the issue.

IIRC, The below code was a problem, both wxDialogHelper and wxDialog had a common base class; where the right method was hard to determine which should be done.

Code: [Select]
wxScrollingDialog: public wxDialog, public wxDialogHelper

Tim S.

That should be easy to fix.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Rev 6104 breaks build with wx-2.9
« Reply #6 on: January 30, 2010, 03:04:27 am »
The sources are not copied from wxWidgets, they are taken from this site: http://www.anthemion.co.uk/code.htm.
As the title suggests, due to revision 6104 trunk can't be built with wx-2.9. Reason is the inclusion of following two files in trunk - include\scrollingdialog.h and sdk\scrollingdialog.cpp

These files are part of wx-2.9 [...]
I don't see them in the SVN tree of wx 2.9???

Yes. Both of you are right. Sorry for not investigating it in detail (it was mid-night here).

IIRC, it is wxDialogLayoutAdapter that is the problem.

Yes, this is the issue.
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6661
    • My Best Post
Re: Rev 6104 breaks build with wx-2.9
« Reply #7 on: January 30, 2010, 06:22:44 am »
I still have to apply this wx2.9.1 patch before I can test building against wxWidgets trunk.

Note: I gave up over a month ago on fixing the wxDialogLayoutAdapter problem; will let a C++ expert work on it.

I have decided to just use wxWidgets 2.9 without STC in it; till someone else fixes the issue.
(This assumes I can get that method to work.)

Edit: I forgot I stopped working on Code::Blocks trunk and started just using wxProp/Debug branch a few months back. My Code::Blocks trunk was many months old.

Tim S.

« Last Edit: January 30, 2010, 07:43:51 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline roxlu

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Rev 6104 breaks build with wx-2.9
« Reply #8 on: January 30, 2010, 10:39:43 am »
Just a little note, I've tried to compile C::B against wxWidgets 2.9 on Mac 10.6 as well and it did not compile either... But I heard C::B does not intend to compile to 2.8

roxlu

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6661
    • My Best Post
Re: Rev 6104 breaks build with wx-2.9
« Reply #9 on: January 30, 2010, 08:13:08 pm »
Possible patch hand edited so might not apply right.

Tim S.

Code: [Select]
Index: src/sdk/scrollingdialog.cpp
===================================================================
--- src/sdk/scrollingdialog.cpp (revision 6119)
+++ src/sdk/scrollingdialog.cpp (working copy)
@@ -23,6 +23,7 @@
 #define wxEXTRA_DIALOG_HEIGHT 0
 #endif
 
+#if (!wxCHECK_VERSION(2, 9, 0))
 IMPLEMENT_CLASS(wxDialogLayoutAdapter, wxObject)
 
 /*!
@@ -402,6 +403,8 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxDialogLayoutAdapterModule, wxModule)
 
+#endif
+
 /*!
  * wxScrollingDialog
  */
@@ -410,7 +413,9 @@
 
 void wxScrollingDialog::Init()
 {
+#if (!wxCHECK_VERSION(2, 9, 0))
     wxDialogHelper::SetDialog(this);
+#endif
 }
 
 bool wxScrollingDialog::Create(wxWindow *parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name)
@@ -444,7 +449,9 @@
 
 void wxScrollingPropertySheetDialog::Init()
 {
+#if (!wxCHECK_VERSION(2, 9, 0))
     wxDialogHelper::SetDialog(this);
+#endif
 }
 
 /// Returns the content window
Index: src/include/scrollingdialog.h
===================================================================
--- src/include/scrollingdialog.h (revision 6119)
+++ src/include/scrollingdialog.h (working copy)
@@ -23,12 +23,15 @@
  */
 
 class wxScrollingDialog;
+#if (!wxCHECK_VERSION(2, 9, 0))
 class wxDialogHelper;
+#endif
 
 class wxBoxSizer;
 class wxButton;
 class wxScrolledWindow;
 
+#if (!wxCHECK_VERSION(2, 9, 0))
 class wxDialogLayoutAdapter: public wxObject
 {
     DECLARE_CLASS(wxDialogLayoutAdapter)
@@ -153,11 +157,16 @@
     static bool                         sm_layoutAdaptation;
 };
 
+#endif
+
 /*!
  * A class that makes its content scroll if necessary
  */
 
-class wxScrollingDialog: public wxDialog, public wxDialogHelper
+class wxScrollingDialog: public wxDialog
+#if (!wxCHECK_VERSION(2, 9, 0))
+    , public wxDialogHelper
+#endif
 {
     DECLARE_CLASS(wxScrollingDialog)
 public:
@@ -195,7 +204,10 @@
  * A wxPropertySheetDialog class that makes its content scroll if necessary.
  */
 
-class wxScrollingPropertySheetDialog : public wxPropertySheetDialog, public wxDialogHelper
+class wxScrollingPropertySheetDialog : public wxPropertySheetDialog
+#if (!wxCHECK_VERSION(2, 9, 0))
+    , public wxDialogHelper
+#endif
 {
 public:
     wxScrollingPropertySheetDialog() : wxPropertySheetDialog() { Init(); }
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #10 on: January 31, 2010, 12:02:21 am »
I attach a patch that works for me on debian 64-bit with self-compiled wx2.9.

There are some more fixes, I needed to make it compile the sources.

I did not (yet) change anything in contrib-plugins workspace.

wx2.9 has the whole scrollingdialog-abilities in wxDialogBase, but it is disbaled by default.

The patch only subclasses wxDialog (as suggested by Biplab) and switches layout adaptation on.

I do not get the id of e.g. wxCheckBoxes with XRCID and therfore any attempt to open for example the editor configuration dialog leads to a crash.
Is that a problem with my build of wxWidgets 2.9 or does that also happen to you (on windows).

Nevertheless please test the patch and post your feedback.


[attachment deleted by admin]

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Rev 6104 breaks build with wx-2.9
« Reply #11 on: January 31, 2010, 05:10:44 am »
I attach a patch that works for me on debian 64-bit with self-compiled wx2.9.

There are some more fixes, I needed to make it compile the sources.

I did not (yet) change anything in contrib-plugins workspace.

wx2.9 has the whole scrollingdialog-abilities in wxDialogBase, but it is disbaled by default.

The patch only subclasses wxDialog (as suggested by Biplab) and switches layout adaptation on.

The patch works well. Thanks for the patch. Please commit it to trunk.

I do not get the id of e.g. wxCheckBoxes with XRCID and therfore any attempt to open for example the editor configuration dialog leads to a crash.
Is that a problem with my build of wxWidgets 2.9 or does that also happen to you (on windows).

Nevertheless please test the patch and post your feedback.

Same here. It crashes on Windows, too. If you follow my Win-64-bit thread, I've mentioned about this crash.
Be a part of the solution, not a part of the problem.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #12 on: January 31, 2010, 11:08:14 am »
Same here. It crashes on Windows, too. If you follow my Win-64-bit thread, I've mentioned about this crash.

Good to hear (that it's not my error).
If I do not find a sloution in the docu or the web I will create a debug-build of wx2.9 and look into it.

The funny thing is, that it does not happen with all classes, the ID of the wxStaticText at the beginning of the editor configuration dialog seems to be determined correctly.

I will commit it after I tested it with wx2.8.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Rev 6104 breaks build with wx-2.9
« Reply #13 on: February 05, 2010, 02:08:45 pm »
I found two causes for the crash, one can simply be fixed, the other one is definitely a wxWidgets bug.

If a dimension of wxFledgridSizer is not set correctly (too large or too small) it (or it's contents will not be read correctly by the xrc-loader.
changing all dynamic dimensions to 0 (or the correct value) makes it work again.
I personally prefer 0, because it's used by wxWidgets for dynamically dimensions. So we will not get trouble if components are added or removed.

The other crash is cause by a bug in wxListbook.
I filed a bug-report (with a simple patch) to the wxWidgets bug-tracker:
http://trac.wxwidgets.org/ticket/11698 .

EDIT:

I just committed a corrected version of the editorconf-xrc.

For the second crash-cause you have to patch wxWidgets or wait for an upstream fix.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Rev 6104 breaks build with wx-2.9
« Reply #14 on: February 07, 2010, 05:18:56 pm »
I found two causes for the crash, one can simply be fixed, the other one is definitely a wxWidgets bug.

If a dimension of wxFledgridSizer is not set correctly (too large or too small) it (or it's contents will not be read correctly by the xrc-loader.
changing all dynamic dimensions to 0 (or the correct value) makes it work again.
I personally prefer 0, because it's used by wxWidgets for dynamically dimensions. So we will not get trouble if components are added or removed.

The other crash is cause by a bug in wxListbook.
I filed a bug-report (with a simple patch) to the wxWidgets bug-tracker:
http://trac.wxwidgets.org/ticket/11698 .

EDIT:

I just committed a corrected version of the editorconf-xrc.

For the second crash-cause you have to patch wxWidgets or wait for an upstream fix.

I've not got time to check it. However thanks for the fix. :)
Be a part of the solution, not a part of the problem.