]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
Added MSWPositionForWxMenu() method which is used to translate wxWindows
[wxWidgets.git] / src / msw / combobox.cpp
index a01a5d9d2496df15fbeecb325fcc4e49271d5a7f..2e18557cbab15d08275ebae2ef2c0fcba0154738 100644 (file)
@@ -237,6 +237,24 @@ WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSE
 // wxComboBox
 // ----------------------------------------------------------------------------
 
+wxComboBox::wxComboBox()
+{
+}
+
+wxComboBox::wxComboBox(wxWindow *parent, 
+                       wxWindowID id,
+                       const wxString& value,
+                       const wxPoint& pos,
+                       const wxSize& size,
+                       int n,
+                       const wxString choices[],
+                       long style,
+                       const wxValidator& validator,
+                       const wxString& name)
+{
+    Create(parent, id, value, pos, size, n, choices, style, validator, name);
+}
+
 bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
 {
     switch ( msg )
@@ -311,6 +329,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
                 }
                 else // we're synthesizing text updated event from sel change
                 {
+                    // We need to retrieve the current selection because the user
+                    // may have changed it in the previous handler (for CBN_SELCHANGE
+                    // above).
+                    sel = GetSelection();
+                    if ( sel > -1 )
+                    {
+                        value = GetString(sel);
+                    }
                     // we need to do this because the user code expects
                     // wxComboBox::GetValue() to return the new value from
                     // "text updated" handler but it hadn't been updated yet