]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Renamed a couple more samples/controls files; fixed wxSplitterWindow cursors
[wxWidgets.git] / src / msw / listbox.cpp
index 0ffc6ec3c85bafb28013c3b1be100a2a11e63d72..074548dcc70386e545148c88fa7901299fb3bb23 100644 (file)
@@ -539,7 +539,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
     HDC dc = GetWindowDC(hwnd);
     HFONT oldFont = 0;
     if (GetFont() && GetFont()->GetResourceHandle())
-      oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
+      oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
 
     GetTextMetrics(dc, &lpTextMetric);
     SIZE extentXY;
@@ -560,7 +560,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
     HDC dc = GetWindowDC(hwnd);
     HFONT oldFont = 0;
     if (GetFont() && GetFont()->GetResourceHandle())
-      oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
+      oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
 
     GetTextMetrics(dc, &lpTextMetric);
     int i;
@@ -606,7 +606,9 @@ wxListBox::InsertItems(int nItems, const wxString items[], int pos)
 
 void wxListBox::SetString(int N, const wxString& s)
 {
-  int sel = GetSelection();
+  int sel = -1;
+  if (!(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED))
+    sel = GetSelection();
   
   char *oldData = (char *)wxListBox::GetClientData(N);