Problem with ComboBox in version 2.8.0 Topic is solved
Problem with ComboBox in version 2.8.0
Hi,
a simple question about the ComboBox:
I'm using the Version 2.8.0 and the ComboBox is filled with an array. This entries are sorted, but the style is without the option wxCB_SORT.
In the version 2.6.3 from wxWidgets, this sorting-problem isn't there.
Any idea to get rid of this problem?
Here's the code-fragment:
wxArrayString string;
string.Add(_T("d"));
string.Add(_T("c"));
string.Add(_T("b"));
string.Add(_T("a"));
wxComboBox* cbox = new wxComboBox(this, wxID_ANY, _T("MyBox"), wxPoint(10,10), wxDefaultSize, string, wxCB_DROPDOWN);
a simple question about the ComboBox:
I'm using the Version 2.8.0 and the ComboBox is filled with an array. This entries are sorted, but the style is without the option wxCB_SORT.
In the version 2.6.3 from wxWidgets, this sorting-problem isn't there.
Any idea to get rid of this problem?
Here's the code-fragment:
wxArrayString string;
string.Add(_T("d"));
string.Add(_T("c"));
string.Add(_T("b"));
string.Add(_T("a"));
wxComboBox* cbox = new wxComboBox(this, wxID_ANY, _T("MyBox"), wxPoint(10,10), wxDefaultSize, string, wxCB_DROPDOWN);
The same ol' bug tracking recipe applies. Check the samples in the wx2.8.0 directory, if they exhibit the same behaviour as your code and they shouldn't, you can be pretty sure it's a bug You can post the bug report at SF.net ...
Regards,
- Jorgen
Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
I'm using the Unicode Compilation of wxWidgets and I've tested this code:
the items are not sorted and they appear in the same order they are declared.
Code: Select all
wxString itemComboBox32Strings[] = {
_("d"),
_("b"),
_("c"),
_("a")
};
wxComboBox* itemComboBox32 = new wxComboBox( itemPanel6, ID_BASICCONTROLS_COMBOBOX, _("a"), wxDefaultPosition, wxSize(130, -1), 4, itemComboBox32Strings, wxCB_DROPDOWN );
itemComboBox32->SetStringSelection(_("a"));
Where is your wxCB_SORT flag ??
Regards,
- Jorgen
Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
You need to add that flag to the constructor of the wxComboBox. No need to configure wxWidgets if that is what you were referring to.
- Jorgen
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
================
I'm using the Unicode Compilation of wxWidgets and I've tested this code:
================
Hello again,
I've tested your code with an unicode-compiled wxVersion and the same error occurs. The parameter for the configure-script were:
./configure --enable-unicode --with-x11 --disable-shared --enable-log --enable-debug -without-odbc --enable-debug_cntxt
But I'm not sure if the configuration is the problem... So on, I have really no idea what it can be, because if this example is running good on your system...
Furthermore I've tested the combo-example from wxWidgets and it run's fine... But the minimal example from wxWidgets only with an ComboBox (exactly your code, see below) sorts the entries, and this in both configuration (with and without unicode)...
//something before
// frame constructor
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
// set the frame icon
//SetIcon(wxICON(sample));
//Test
wxString s[] = {
_("d"),
_("b"),
_("c"),
_("a")
};
wxComboBox* itemComboBox32 = new wxComboBox( this, wxID_ANY, _("a"), wxDefaultPosition, wxSize(130, -1), 4, s, wxCB_DROPDOWN );
itemComboBox32->SetStringSelection(_("a"));
#if wxUSE_MENUS
// create a menu bar
wxMenu *fileMenu = new wxMenu;
//something below
I'm using the Unicode Compilation of wxWidgets and I've tested this code:
================
Hello again,
I've tested your code with an unicode-compiled wxVersion and the same error occurs. The parameter for the configure-script were:
./configure --enable-unicode --with-x11 --disable-shared --enable-log --enable-debug -without-odbc --enable-debug_cntxt
But I'm not sure if the configuration is the problem... So on, I have really no idea what it can be, because if this example is running good on your system...
Furthermore I've tested the combo-example from wxWidgets and it run's fine... But the minimal example from wxWidgets only with an ComboBox (exactly your code, see below) sorts the entries, and this in both configuration (with and without unicode)...
//something before
// frame constructor
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
// set the frame icon
//SetIcon(wxICON(sample));
//Test
wxString s[] = {
_("d"),
_("b"),
_("c"),
_("a")
};
wxComboBox* itemComboBox32 = new wxComboBox( this, wxID_ANY, _("a"), wxDefaultPosition, wxSize(130, -1), 4, s, wxCB_DROPDOWN );
itemComboBox32->SetStringSelection(_("a"));
#if wxUSE_MENUS
// create a menu bar
wxMenu *fileMenu = new wxMenu;
//something below
Ok I didn't understand the problem, I thought there was no sorting, but it seemed you meant there was, without any need to. If you explicitly kill the flag with ~(wxCB_SORT) & {your other flags} ?
Once again ,sorry for misreading your post.
- Jorgen
Once again ,sorry for misreading your post.
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
I don't think it's a bug in the configuration or Linux compile because then the combo-example also would be wrong. But there the entries are in correct order.
I think it's a very stupid mistake but I'm unable to find it. And I wonder because of 4 lines I've added to the minimal example, there can't be a mistake...
I think it's a very stupid mistake but I'm unable to find it. And I wonder because of 4 lines I've added to the minimal example, there can't be a mistake...
Check if the strings you're insterting are not sorted after insertion !tigdra83 wrote:I don't think it's a bug in the configuration or Linux compile because then the combo-example also would be wrong. But there the entries are in correct order.
I think it's a very stupid mistake but I'm unable to find it. And I wonder because of 4 lines I've added to the minimal example, there can't be a mistake...