]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
VC++ warning suppressed
[wxWidgets.git] / src / msw / listbox.cpp
index 3971e400ee46b56530f14e3e65a5146bdc2aea27..883e416c2390899022591d1cc3089e296279aab0 100644 (file)
@@ -184,13 +184,10 @@ bool wxListBox::Create(wxWindow *parent, const wxWindowID id,
       // we don't support LBS_OWNERDRAWVARIABLE yet
       wstyle |= LBS_OWNERDRAWFIXED;
     }
-#else
-  // Change from previous versions of wxWin: JACS Nov. 1995
-  // Not sure whether to have integral, or no integral
-  // style. With the latter we may get partial items showing.
-  // VZ: also it makes life more difficult for owner-drawn controls
-    wstyle |= LBS_NOINTEGRALHEIGHT;
 #endif
+  // Without this style, you get unexpected heights, so e.g. constraint layout
+  // doesn't work properly
+  wstyle |= LBS_NOINTEGRALHEIGHT;
 
   bool want3D;
   WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
@@ -646,10 +643,11 @@ void wxListBox::SetString(const int N, const wxString& s)
   if (sel >= 0)
     SetSelection(sel);
 
-  #if       USE_OWNER_DRAWN
-    // update item's text
-    m_aItems[N]->SetName(s);
-  #endif  //USE_OWNER_DRAWN
+#if       USE_OWNER_DRAWN
+  if ( m_windowStyle & wxLB_OWNERDRAW )
+         // update item's text
+         m_aItems[N]->SetName(s);
+#endif  //USE_OWNER_DRAWN
 }
 
 int wxListBox::Number (void) const