]> git.saurik.com Git - wxWidgets.git/commitdiff
Set the value passed to wxComboBox ctor in wxOSX/Cocoa.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Apr 2010 18:46:09 +0000 (18:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Apr 2010 18:46:09 +0000 (18:46 +0000)
The initial value was simply ignored, do use it now if it's specified, i.e.
non empty.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/combobox_osx.cpp

index 22ae6a9256fb2153a9f8c22da8ce90d14d306715..744ad7304a1a78660ee3fc3fe72a4c91f7973b5d 100644 (file)
@@ -72,8 +72,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
 
     Append(n, choices);
 
-    // Set the first item as being selected
-    if (n > 0)
+    // Set up the initial value, by default the first item is selected.
+    if ( !value.empty() )
+        SetValue(value);
+    else if (n > 0)
         SetSelection( 0 );
 
     // Needed because it is a wxControlWithItems