News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

wxSmith assert in wx30 builds due to rev 10392

Started by oBFusCATed, May 07, 2016, 11:57:51 AM

Previous topic - Next topic

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

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.

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

Happens with wx2.8, too. And also the properties are duplicated and visible in both 2.8 and 3.0.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

I see it now, too.

Can you test this patch ?

Code (diff) Select

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.next.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);
}

Jenna

Quote from: jens on May 07, 2016, 11:02:13 PM
I see it now, too.

Can you test this patch ?

Any updates ?

If there are no objections I will commit later the day.

MortenMacFly

Quote from: jens on June 12, 2016, 09:27:08 AM
Can you test this patch ?
I had tested it on Windows - no issues so far and I worked with that option a lot.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: 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?
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 ?

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna