1
Development / Re: wxSmith use bad constructor for wxStaticBoxSizer
« Last post by LR83 on Today at 05:38:33 pm »Great, work fine 
But I suggest using a temporary variable because wxStaticBoxSizer can have many children.
So, code could be:
In wxStaticBoxSizer.cpp:
in wxSizer.cpp:

But I suggest using a temporary variable because wxStaticBoxSizer can have many children.
So, code could be:
In wxStaticBoxSizer.cpp:
Code
case wxsCPP:
{
AddHeader(_T("<wx/sizer.h>"),GetInfo().ClassName,hfInPCH);
AddHeader(_T("<wx/statbox.h>"),GetInfo().ClassName,hfInPCH);
Codef(_T("%C(%s, %W, %t);\n"),
(Orient == wxHORIZONTAL) ? _T("wxHORIZONTAL") : _T("wxVERTICAL"),
Label.wx_str());
Codef(_T("wxStaticBox *SB_%s = %s->GetStaticBox();\n"),GetVarName().wx_str(),GetVarName().wx_str());
return;
}in wxSizer.cpp:
Code
if (GetInfo().ClassName == "wxStaticBoxSizer")
{
// Use the static box as parent, as required by wxWidgets since 2.9.1
wxsCoderContext* context = GetCoderContext();
const wxString saveParent(context->m_WindowParent);
context->m_WindowParent = "SB_" + GetVarName();
Child->BuildCode(context);
context->m_WindowParent = saveParent;
}
else
{
// Using same parent as we got, sizer is not a parent window
Child->BuildCode(GetCoderContext());
}
Recent Posts