The lockup happens as soon as the selection is changed from any of the radio's to the other, and then you have to close the application forcefully.
below is the code that shows this problem, it happens whether it is compiled with wx 2.6.2, 2.6.3, or even 2.8, I noticed that as soon as the wxEditableListBox is removed, the bug disappears, but I'm almost sure that it's not a problem with wxEditableListBox itself because I used it on a previous project and it worked fine.
you can comment the 2 marked lines to remove the bug.
here's main.cpp
Code: Select all
// -*- C++ -*- generated by wxGlade 0.4 on Fri Mar 10 03:29:47 2006
#include <wx/wx.h>
#include <wx/image.h>
#include "RegistrationDialog.h"
class MyApp: public wxApp
{
public:
bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxInitAllImageHandlers();
RegistrationDialog dlg;
dlg.ShowModal();
return false;
}
Code: Select all
// -*- C++ -*- generated by wxGlade 0.4.1 on Sun Apr 23 13:59:08 2006
#include <wx/wx.h>
#include <wx/gizmos/editlbox.h>
class RegistrationDialog: public wxDialog
{
public:
RegistrationDialog();
private:
// begin wxGlade: RegistrationDialog::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: RegistrationDialog::attributes
wxEditableListBox* _fixedPhonesEditableLBox;
wxRadioButton* _noTransferRadioButton;
wxRadioButton* _transferedFromCenterToAgent;
// end wxGlade
}; // wxGlade: end class
// -*- C++ -*- generated by wxGlade 0.4.1 on Sun Apr 23 13:59:08 2006
RegistrationDialog::RegistrationDialog():
wxDialog(NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxCLOSE_BOX|wxCLIP_CHILDREN)
{
// begin wxGlade: RegistrationDialog::RegistrationDialog
_fixedPhonesEditableLBox = new wxEditableListBox(this, -1, wxT("Fixed Phones")); // comment this line to remove bug
_noTransferRadioButton = new wxRadioButton(this, -1, _("No transfers"));
_transferedFromCenterToAgent = new wxRadioButton(this, -1, _("Transfered from center to agent"));
set_properties();
do_layout();
// end wxGlade
}
void RegistrationDialog::set_properties()
{
// begin wxGlade: RegistrationDialog::set_properties
SetTitle(_("Register Donor"));
_noTransferRadioButton->SetValue(1);
// end wxGlade
}
void RegistrationDialog::do_layout()
{
// begin wxGlade: RegistrationDialog::do_layout
wxBoxSizer* _mainSizer = new wxBoxSizer(wxVERTICAL);
wxGridSizer* grid_sizer_1 = new wxGridSizer(4, 1, 0, 0);
_mainSizer->Add(_fixedPhonesEditableLBox, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0); // comment this line to remove bug
grid_sizer_1->Add(_noTransferRadioButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4);
grid_sizer_1->Add(_transferedFromCenterToAgent, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4);
_mainSizer->Add(grid_sizer_1, 0, wxEXPAND, 0);
SetAutoLayout(true);
SetSizer(_mainSizer);
_mainSizer->Fit(this);
_mainSizer->SetSizeHints(this);
Layout();
Centre();
// end wxGlade
}
here are the binaries, with and without the wxEditableListBox, so you can try them immediately, and here's the sourceif you'd like to compile
thanks in advance
notes:
- I did some last minute edits to the source to make it shorter and more readable, so if you find any so-obvious mistakes, then they weren't there.
- All of this code was generated by wxGlade 4.1, which makes me assume there's no problem with the code.
- wxEditableListBox is part of contrib/gizmos, to compile the above sourcecode, you must have contrib/gizmos compiled(which needs wxUSE_MDI set, in setup.h).