X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49884e3e0d6e181c6be660a538211631815902b6..44c4a3348693414bace13852e50d926c1aa9f08b:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 273b9a61be..40f02d0f05 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -149,7 +149,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - m_noItems = n; + m_noItems = 0; m_hWnd = 0; m_selected = 0; @@ -227,6 +227,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Append(choices[ui]); } + /* Not needed -- done in Append #if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { for (ui = 0; ui < (size_t)n; ui++) { @@ -238,11 +239,12 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, } } #endif +*/ if ( (m_windowStyle & wxLB_MULTIPLE) == 0 ) SendMessage(hwnd, LB_SETCURSEL, 0, 0); - SetFont(* parent->GetFont()); + SetFont(parent->GetFont()); SetSize(x, y, width, height); @@ -493,7 +495,7 @@ void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags) int cx; // button font dimensions int cy; - wxGetCharSize(GetHWND(), &cx, &cy,GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, & GetFont()); float control_width, control_height, control_x, control_y; @@ -538,8 +540,8 @@ void wxListBox::SetHorizontalExtent(const wxString& s) int existingExtent = (int)SendMessage(hwnd, LB_GETHORIZONTALEXTENT, 0, 0L); HDC dc = GetWindowDC(hwnd); HFONT oldFont = 0; - if (GetFont() && GetFont()->GetResourceHandle()) - oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); + if (GetFont().Ok() && GetFont().GetResourceHandle()) + oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle()); GetTextMetrics(dc, &lpTextMetric); SIZE extentXY; @@ -559,8 +561,8 @@ void wxListBox::SetHorizontalExtent(const wxString& s) int largestExtent = 0; HDC dc = GetWindowDC(hwnd); HFONT oldFont = 0; - if (GetFont() && GetFont()->GetResourceHandle()) - oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); + if (GetFont().Ok() && GetFont().GetResourceHandle()) + oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle()); GetTextMetrics(dc, &lpTextMetric); int i;