]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Changed files to work with wxDataFormat
[wxWidgets.git] / src / msw / listbox.cpp
index 0ffc6ec3c85bafb28013c3b1be100a2a11e63d72..8eac8338fa9b1aa16ac1ac22cb26807edc546da8 100644 (file)
@@ -484,6 +484,8 @@ void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
   if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     y1 = currentY;
 
   if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     y1 = currentY;
 
+  AdjustForParentClientOrigin(x1, y1, sizeFlags);
+
   // If we're prepared to use the existing size, then...
   if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
   {
   // If we're prepared to use the existing size, then...
   if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
   {
@@ -539,7 +541,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
     HDC dc = GetWindowDC(hwnd);
     HFONT oldFont = 0;
     if (GetFont() && GetFont()->GetResourceHandle())
     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;
 
     GetTextMetrics(dc, &lpTextMetric);
     SIZE extentXY;
@@ -560,7 +562,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
     HDC dc = GetWindowDC(hwnd);
     HFONT oldFont = 0;
     if (GetFont() && GetFont()->GetResourceHandle())
     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;
 
     GetTextMetrics(dc, &lpTextMetric);
     int i;
@@ -606,7 +608,9 @@ wxListBox::InsertItems(int nItems, const wxString items[], int pos)
 
 void wxListBox::SetString(int N, const wxString& s)
 {
 
 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);
   
   
   char *oldData = (char *)wxListBox::GetClientData(N);