Menu

#161 Wrong C++ code when using wxStaticBoxSizer

v1.0_(example)
closed
nobody
5
2015-08-28
2015-07-16
No

When I use a wxStaticBoxSizer the generated C++ code with current version 3.5.1-rc1 looks
like the following:

====== code snippet start ======================
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Calibration Values") ), wxVERTICAL );

wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxHORIZONTAL );

m_staticText15 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0 );
m_staticText15->Wrap( -1 );
bSizer17->Add( m_staticText15, 1, wxALL, 5 );
====== code snippet end =======================

The problem is when creating the wxStaticText (as a member of wxStaticBoxSizer) with using sbSizer1->GetStaticBox()
The application throws an error, of an not allowed parent.

The code by older wxFormBuilder use 'this' instead of sbSizer1->GetStaticBox().

I'm using Win 7, Visual Studio 2010 and wxWidgets 2.8.12

Discussion

  • Michal Bližňák

    The mentioned code is required by wxWidgets 3.x. Sorry, we do not plan to support code needed by wxWidgets 2.8 in new wxFB versions. We recommend to upgrade your build environment to wxWidgets 3.x or newer.

     
  • Michal Bližňák

    • status: open --> closed
     
MongoDB Logo MongoDB