Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: oBFusCATed on May 07, 2016, 11:57:51 am

Title: wxSmith assert in wx30 builds due to rev 10392
Post by: oBFusCATed on May 07, 2016, 11:57:51 am
This commit makes cb emit wx warnings for duplicate properties added to wxpropgrid. And indeed the "default min size" is added twice. The assert triggers even in a minimal wxsmith based project when I click on the static text or any of the buttons.

@Jens: Do you remember why this commit is needed? If not I'll just revert it.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: Jenna on May 07, 2016, 05:33:21 pm
I only have it once, as far as I know.
it was added because it was just no there, but is sometimes needed.

I will try to look into it later this evening.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: oBFusCATed on May 07, 2016, 07:04:50 pm
I have it twice in a minimal wxsmith project, but this is a codeblocks built with wx3.0. I'm not sure if it will happen with wx2.8 built one.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: oBFusCATed on May 07, 2016, 07:28:49 pm
Happens with wx2.8, too. And also the properties are duplicated and visible in both 2.8 and 3.0.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: Jenna on May 07, 2016, 11:02:13 pm
I see it now, too.

Can you test this patch ?

Code: diff
From bcce2c3accacf9f4fc28ec4277dfd5c7ae9e3161 Mon Sep 17 00:00:00 2001
From: Jens Lody <jens@codeblocks.org>
Date: Sat, 7 May 2016 22:57:19 +0200
Subject: * wxSmith: fix assert with wx3.0, due to doubled properties in some
 sizeritems. See:
 http://forums.codeblocks.org/index.php/topic,21168.msg144517.html#msg144517


Index: src/plugins/contrib/wxSmith/wxwidgets/wxssizer.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxssizer.cpp
+++ src/plugins/contrib/wxSmith/wxwidgets/wxssizer.cpp
@@ -56,12 +56,15 @@
     };
 }
 
-void wxsSizerExtra::OnEnumProperties(cb_unused long _Flags)
+void wxsSizerExtra::OnEnumProperties(long _Flags)
 {
     static const int Priority = 20;
     WXS_SIZERFLAGS_P(wxsSizerExtra,Flags,Priority);
     WXS_DIMENSION_P(wxsSizerExtra,Border,_("Border width"),_("  Dialog Units"),_T("border"),0,false,Priority);
-    WXS_SIZE_P(wxsSizerExtra,MinSize,_("Default Min size"),_("Min Width"),_("Min Height"),_("Min size in dialog units"), _T("minsize"),Priority);
+    // We only need to add "Default Min Size", if flMinMaxSize is not set.
+    // If it is set, it should already be there.
+    if ( !( _Flags & flMinMaxSize ) )
+        WXS_SIZE_P(wxsSizerExtra,MinSize,_("Default Min size"),_("Min Width"),_("Min Height"),_("Min size in dialog units"), _T("minsize"),Priority);
     WXS_LONG_P(wxsSizerExtra,Proportion,_("Proportion"),_T("option"),0,Priority);
 }
 
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: Jenna on June 12, 2016, 09:27:08 am
I see it now, too.

Can you test this patch ?

Any updates ?

If there are no objections I will commit later the day.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: MortenMacFly on June 12, 2016, 01:07:24 pm
Can you test this patch ?
I had tested it on Windows - no issues so far and I worked with that option a lot.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: oBFusCATed on June 12, 2016, 09:33:26 pm
I've tested it and it didn't fix the problem. Since then I have had no time to investigate further.
Morten are you using wx3.0 built cb?
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: Jenna on June 12, 2016, 10:22:16 pm
I've tested it and it didn't fix the problem. Since then I have had no time to investigate further.
Morten are you using wx3.0 built cb?
I just tested it again with and without the patch, latest revision of C::B and wxWidgets and it works for me.
I just created a wxWidgets-projecet with the wizard, added a static text and a static text inside a sizer.
Without the patch I get the assert and have the doubled property, with the patch everything is okay.

Can you please give the exact steps to reproduce the issue with the patch ?
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: oBFusCATed on June 13, 2016, 09:32:32 pm
Seems to be issue with the rebuild. Building from the Contribs workspace fails to build correctly for some reason. The problem is fixed after I did a clean build using the autotools build system.
Title: Re: wxSmith assert in wx30 builds due to rev 10392
Post by: Jenna on June 14, 2016, 07:46:11 am
committed