Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

wxSmith assert in wx30 builds due to rev 10392

(1/3) > >>

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.

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.

oBFusCATed:
Happens with wx2.8, too. And also the properties are duplicated and visible in both 2.8 and 3.0.

Jenna:
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);
 }
 
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version