// know that there will always be OnMeasure before OnDraw
// fix appearance
- SetFont(wxSystemSettings::GetSystemFont(wxSYS_ANSI_VAR_FONT));
SetMarginWidth(GetDefaultMarginWidth());
}
#ifdef __WIN32__
RECT rcUpdate;
-
+
if ( ::SendMessage(hwndListbox, LB_GETITEMRECT,
m_nIndex, (LPARAM)&rcUpdate) == LB_ERR )
{
#endif // Win32/16
InvalidateRect(hwndListbox, &rcUpdate, FALSE);
-
+
wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, m_pParent->GetId());
event.SetInt(m_nIndex);
event.SetEventObject(m_pParent);
}
}
+
+bool wxCheckListBox::SetFont( const wxFont &font )
+{
+ size_t i;
+ for (i=0; i < m_aItems.GetCount(); i++)
+ m_aItems[i]->SetFont(font);
+ wxListBox::SetFont(font);
+ return TRUE;
+}
+
// create/retrieve item
// --------------------
wxOwnerDrawn *wxCheckListBox::CreateItem(size_t nIndex)
{
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
- if ( m_windowFont.Ok() )
- pItem->SetFont(m_windowFont);
-
return pItem;
}
if ( event.KeyCode() == WXK_SPACE )
GetItem(GetSelection())->Toggle();
else
- wxListBox::OnChar(event);
+ event.Skip();
}
void wxCheckListBox::OnLeftClick(wxMouseEvent& event)