]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Added missing include.
[wxWidgets.git] / src / msw / listbox.cpp
index 8535e241e2d536cb304d226c085a4f27f8d17a82..6c82458ecef37de8e136736052352caf83d0dc93 100644 (file)
@@ -94,10 +94,10 @@ wxBEGIN_PROPERTIES_TABLE(wxListBox)
        wxEVENT_PROPERTY( Select , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent )
        wxEVENT_PROPERTY( DoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent )
 
        wxEVENT_PROPERTY( Select , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent )
        wxEVENT_PROPERTY( DoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent )
 
-    wxPROPERTY( Font , wxFont , SetFont , GetFont  , , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+    wxPROPERTY( Font , wxFont , SetFont , GetFont  , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
     wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
     wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
-       wxPROPERTY( Selection ,int, SetSelection, GetSelection,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
-    wxPROPERTY_FLAGS( WindowStyle , wxListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+       wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+    wxPROPERTY_FLAGS( WindowStyle , wxListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
 wxEND_PROPERTIES_TABLE()
 
 wxBEGIN_HANDLERS_TABLE(wxListBox)
 wxEND_PROPERTIES_TABLE()
 
 wxBEGIN_HANDLERS_TABLE(wxListBox)
@@ -161,7 +161,7 @@ bool wxListBox::Create(wxWindow *parent,
                        const wxSize& size,
                        int n, const wxString choices[],
                        long style,
                        const wxSize& size,
                        int n, const wxString choices[],
                        long style,
-                       const wxValidator& wxVALIDATOR_PARAM(validator),
+                       const wxValidator& validator,
                        const wxString& name)
 {
     m_noItems = 0;
                        const wxString& name)
 {
     m_noItems = 0;
@@ -210,6 +210,10 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const
 {
     WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
 
 {
     WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
 
+    // always show the vertical scrollbar if necessary -- otherwise it is
+    // impossible to use the control with the mouse
+    msStyle |= WS_VSCROLL;
+
     // we always want to get the notifications
     msStyle |= LBS_NOTIFY;
 
     // we always want to get the notifications
     msStyle |= LBS_NOTIFY;
 
@@ -568,10 +572,6 @@ void wxListBox::SetString(int N, const wxString& s)
     else if ( oldObjData )
         SetClientObject(N, oldObjData);
 
     else if ( oldObjData )
         SetClientObject(N, oldObjData);
 
-    // we may have lost the selection
-    if ( wasSelected )
-        Select(N);
-
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW )
     {
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW )
     {
@@ -582,6 +582,10 @@ void wxListBox::SetString(int N, const wxString& s)
         ListBox_SetItemData(GetHwnd(), N, m_aItems[N]);
     }
 #endif  //USE_OWNER_DRAWN
         ListBox_SetItemData(GetHwnd(), N, m_aItems[N]);
     }
 #endif  //USE_OWNER_DRAWN
+
+    // we may have lost the selection
+    if ( wasSelected )
+        Select(N);
 }
 
 int wxListBox::GetCount() const
 }
 
 int wxListBox::GetCount() const