Make wxGenericDataViewCtrl::SetFont() really work.
Do use the new font for the items display. Closes #15056. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -622,6 +622,7 @@ All (GUI):
|
|||||||
- Add wxCheckListBox::GetCheckedItems() (hartwigw).
|
- Add wxCheckListBox::GetCheckedItems() (hartwigw).
|
||||||
- Add wxAUI_TB_PLAIN_BACKGROUND wxAuiToolBar style (Allann Jones).
|
- Add wxAUI_TB_PLAIN_BACKGROUND wxAuiToolBar style (Allann Jones).
|
||||||
- Fix off by 1 error in wxGenericListCtrl::HitTest() (Daniel Hyams).
|
- Fix off by 1 error in wxGenericListCtrl::HitTest() (Daniel Hyams).
|
||||||
|
- Make wxGenericDataViewCtrl::SetFont() really work (Laurent Poujoulat).
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -182,6 +182,8 @@ public:
|
|||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
|
||||||
|
virtual bool SetFont(const wxFont & font);
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
virtual bool EnableDragSource( const wxDataFormat &format );
|
virtual bool EnableDragSource( const wxDataFormat &format );
|
||||||
virtual bool EnableDropTarget( const wxDataFormat &format );
|
virtual bool EnableDropTarget( const wxDataFormat &format );
|
||||||
|
@@ -678,6 +678,7 @@ public:
|
|||||||
|
|
||||||
void SetRowHeight( int lineHeight ) { m_lineHeight = lineHeight; }
|
void SetRowHeight( int lineHeight ) { m_lineHeight = lineHeight; }
|
||||||
int GetRowHeight() const { return m_lineHeight; }
|
int GetRowHeight() const { return m_lineHeight; }
|
||||||
|
int GetDefaultRowHeight() const;
|
||||||
|
|
||||||
// Some useful functions for row and item mapping
|
// Some useful functions for row and item mapping
|
||||||
wxDataViewItem GetItemByRow( unsigned int row ) const;
|
wxDataViewItem GetItemByRow( unsigned int row ) const;
|
||||||
@@ -1398,15 +1399,7 @@ wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID i
|
|||||||
m_currentColSetByKeyboard = false;
|
m_currentColSetByKeyboard = false;
|
||||||
m_useCellFocus = false;
|
m_useCellFocus = false;
|
||||||
m_currentRow = (unsigned)-1;
|
m_currentRow = (unsigned)-1;
|
||||||
|
m_lineHeight = GetDefaultRowHeight();
|
||||||
#ifdef __WXMSW__
|
|
||||||
// We would like to use the same line height that Explorer uses. This is
|
|
||||||
// different from standard ListView control since Vista.
|
|
||||||
if ( wxGetWinVersion() >= wxWinVersion_Vista )
|
|
||||||
m_lineHeight = wxMax(16, GetCharHeight()) + 6; // 16 = mini icon height
|
|
||||||
else
|
|
||||||
#endif // __WXMSW__
|
|
||||||
m_lineHeight = wxMax(16, GetCharHeight()) + 1; // 16 = mini icon height
|
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragCount = 0;
|
m_dragCount = 0;
|
||||||
@@ -1449,6 +1442,20 @@ wxDataViewMainWindow::~wxDataViewMainWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int wxDataViewMainWindow::GetDefaultRowHeight() const
|
||||||
|
{
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
// We would like to use the same line height that Explorer uses. This is
|
||||||
|
// different from standard ListView control since Vista.
|
||||||
|
if ( wxGetWinVersion() >= wxWinVersion_Vista )
|
||||||
|
return wxMax(16, GetCharHeight()) + 6; // 16 = mini icon height
|
||||||
|
else
|
||||||
|
#endif // __WXMSW__
|
||||||
|
return wxMax(16, GetCharHeight()) + 1; // 16 = mini icon height
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool wxDataViewMainWindow::EnableDragSource( const wxDataFormat &format )
|
bool wxDataViewMainWindow::EnableDragSource( const wxDataFormat &format )
|
||||||
{
|
{
|
||||||
@@ -4543,6 +4550,31 @@ void wxDataViewCtrl::SetFocus()
|
|||||||
m_clientArea->SetFocus();
|
m_clientArea->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxDataViewCtrl::SetFont(const wxFont & font)
|
||||||
|
{
|
||||||
|
if (!wxControl::SetFont(font))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (m_headerArea)
|
||||||
|
m_headerArea->SetFont(font);
|
||||||
|
|
||||||
|
if (m_clientArea)
|
||||||
|
{
|
||||||
|
m_clientArea->SetFont(font);
|
||||||
|
m_clientArea->SetRowHeight(m_clientArea->GetDefaultRowHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_headerArea || m_clientArea)
|
||||||
|
{
|
||||||
|
InvalidateColBestWidths();
|
||||||
|
Layout();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
|
bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
|
||||||
{
|
{
|
||||||
if (!wxDataViewCtrlBase::AssociateModel( model ))
|
if (!wxDataViewCtrlBase::AssociateModel( model ))
|
||||||
|
Reference in New Issue
Block a user