#ifndef WX_PRECOMP
#include "wx/listbox.h"
#include "wx/settings.h"
+#include "wx/brush.h"
+#include "wx/font.h"
+#include "wx/dc.h"
#endif
#include "wx/msw/private.h"
const wxValidator& validator,
const wxString& name)
{
- m_noItems = n;
+ m_noItems = 0;
m_hWnd = 0;
m_selected = 0;
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++) {
}
}
#endif
+*/
if ( (m_windowStyle & wxLB_MULTIPLE) == 0 )
SendMessage(hwnd, LB_SETCURSEL, 0, 0);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
- wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument
+ wxOwnerDrawn *pNewItem = CreateItem(index); // dummy argument
pNewItem->SetName(item);
m_aItems.Add(pNewItem);
ListBox_SetItemData(hwnd, index, pNewItem);
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;
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;
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;