If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
in the wx2.8 API is it not documented but in the wx3.0:
bool wxItemContainerImmutable::SetStringSelection ( const wxString & string )
Selects the item with the specified string in the control.
This method doesn't cause any command events to be emitted.
Notice that this method is case-insensitive, i.e. the string is compared with all the elements of the control case-insensitively and the first matching entry is selected, even if it doesn't have exactly the same case as this string and there is an exact match afterwards.
Parameters
string The string to select.
Returns
true if the specified string has been selected, false if it wasn't found in the control.
Why is this behaviour so implemented. Looking in the source this is only true in case the ComboBox is not sorted....
No I have to replace all SetStringSelection calls with SetValue, but this is not possible with wxChoices...
As far as I can see is this bCase flag not able to set by the wxWidgets API.
Internally this flag is set when the control is sorted automatically, which is in my case not possible.
IMHO compare strings should be always case sensitive...
As far as I can see is this bCase flag not able to set by the wxWidgets API.
Yes, you can't change the behavior of SetStringSelection(), but you can call FindString() yourself with caseSensitive/bCase = true and then call SetSelection() and select the item by index.
this Work-Around is OK in case you have only a few Combos and or choices, but in case of many dialogs with many combos this is not the way to go.
The Combos I could solve with using SetValue instead of SetStringSelection, but with Choices and Listboxes this is not possible.
But it's unlikely that the default behavior will be changed, as this could silently break existing code. Maybe a "caseSensitive" parameter could be added to SetStringSelection(). If you could confirm that it's possible to implement that on all platforms and if you could even provide a patch, then there is a good chance, it could find its way into wxWidgets.