wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post here wxCrafter related issues / features / bugs
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post by coder99 »

In trying to convert one of my projects to compile under MSVC 2015 Express and wWidgets 3.1.0 (only wxWidgets 3.1.0 seems to be set up for MSVC 2015 ), I have run into some issues with a wxCrafter 2.5 coded base code using a slider.
The lines which starts this issue:

Code: Select all

m_sliderOptLogVerbosity = new wxSlider(m_panelLog, wxID_ANY, 0, 0, 5, wxDefaultPosition, wxSize(-1,-1), wxSL_BOTTOM|wxSL_LABELS|wxSL_HORIZONTAL);
At this early stage I am mostly curious to find out if wxCrafter can handle the changes in wxWidgets 3.1.0 or if there are some work-arounds if not.
The code compiles without complaints, but fails when I run code to execute the above statement.

TIA
Arnold

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post by eranif »

Can you be more specific?
According to wxSlider constructor documentation the generated code is OK
So what is the problem with it?

Eran
Make sure you have read the HOW TO POST thread
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

Re: wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post by coder99 »

In the debug version it bombs with the assertion in the attached screenshot at

Code: Select all

wxSizerItem *wxBoxSizer::DoInsert(size_t index, wxSizerItem *item)
{
    const int flags = item->GetFlag();
    if ( IsVertical() )
    {
        wxASSERT_MSG
        (
            !(flags & wxALIGN_BOTTOM),
            wxS("Vertical alignment flags are ignored in vertical sizers")
        );

        // We need to accept wxALIGN_CENTRE_VERTICAL when it is combined with
        // wxALIGN_CENTRE_HORIZONTAL because this is known as wxALIGN_CENTRE
        // and we accept it historically in wxSizer API.
        if ( !(flags & wxALIGN_CENTRE_HORIZONTAL) )
        {
            wxASSERT_MSG
            (
                !(flags & wxALIGN_CENTRE_VERTICAL),
                wxS("Vertical alignment flags are ignored in vertical sizers")
            );
        }

        if ( flags & wxEXPAND )
        {
            wxASSERT_MSG   <<<<<<<<<<<<<<<<<<<<<<
The code is taken directly from a project which under MSVC 2010 & wxWidgets 3.02 compiles and runs without issue.

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post by eranif »

Its not really a wxCrafter issue...
Your UI contains an invalid combination of flags (there is a discussion about this in the wx-dev mailing list to remove this assertion since it is quite annoying)
Just remove the one that the assertion complains about - you can't expect wxCrafter to fix the code for you... (which was _not_ broken in the first place, only now wxWidgets decided that it is broken...)



Eran
Make sure you have read the HOW TO POST thread
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

Re: wxCrafter Stand-alone 2.5, wxWidgets 3.1.0 ^ MSVC 2015

Post by coder99 »

First off, thank you for explaining the issue.
After fixing the flag, I can now open the dialog without a crash.
Normally I don't follow the wx-devl list ansd so I am not up-to-date on the reasons,
but I had noticed there are a couple of other functions which disappeared from 3.1.
Unfortunately, it always is a challenged to move along with the newer versions ;-)

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

Post Reply