Made SetFont for wxCheckListBox more intelligent.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -45,6 +45,8 @@ public:
|
|||||||
virtual void Delete(int n);
|
virtual void Delete(int n);
|
||||||
virtual void InsertItems(int nItems, const wxString items[], int pos);
|
virtual void InsertItems(int nItems, const wxString items[], int pos);
|
||||||
|
|
||||||
|
virtual bool SetFont( const wxFont &font );
|
||||||
|
|
||||||
// items may be checked
|
// items may be checked
|
||||||
bool IsChecked(size_t uiIndex) const;
|
bool IsChecked(size_t uiIndex) const;
|
||||||
void Check(size_t uiIndex, bool bCheck = TRUE);
|
void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||||
|
@@ -101,7 +101,6 @@ wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
|
|||||||
// know that there will always be OnMeasure before OnDraw
|
// know that there will always be OnMeasure before OnDraw
|
||||||
|
|
||||||
// fix appearance
|
// fix appearance
|
||||||
SetFont(wxSystemSettings::GetSystemFont(wxSYS_ANSI_VAR_FONT));
|
|
||||||
SetMarginWidth(GetDefaultMarginWidth());
|
SetMarginWidth(GetDefaultMarginWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,6 +311,16 @@ void wxCheckListBox::InsertItems(int nItems, const wxString items[], int pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
// create/retrieve item
|
||||||
// --------------------
|
// --------------------
|
||||||
|
|
||||||
@@ -319,9 +328,6 @@ void wxCheckListBox::InsertItems(int nItems, const wxString items[], int pos)
|
|||||||
wxOwnerDrawn *wxCheckListBox::CreateItem(size_t nIndex)
|
wxOwnerDrawn *wxCheckListBox::CreateItem(size_t nIndex)
|
||||||
{
|
{
|
||||||
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
|
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
|
||||||
if ( m_font.Ok() )
|
|
||||||
pItem->SetFont(m_font);
|
|
||||||
|
|
||||||
return pItem;
|
return pItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user