Implement wxDataViewCtrl::SetFont() on OS X

wxDataViewCtrl now behaves consistently with other ports on OS X:
calling SetFont() sets the default font used by renderers and adjusts
row height to fit.
This commit is contained in:
Václav Slavík
2016-10-09 16:09:24 +02:00
parent 8a6a20b1e3
commit 29d310c6f0
2 changed files with 23 additions and 1 deletions

View File

@@ -204,6 +204,10 @@ public:
// Set the line break mode for the given cell using our m_ellipsizeMode
void ApplyLineBreakMode(NSCell *cell);
// Does the rendered use a font that the control can't override?
void SetHasCustomFont(bool has) { m_hasCustomFont = has; }
bool HasCustomFont() const { return m_hasCustomFont; }
private:
// common part of all ctors
void Init();
@@ -224,6 +228,8 @@ private:
NSColor *m_origTextColour;
wxEllipsizeMode m_ellipsizeMode;
bool m_hasCustomFont;
};
// ============================================================================
@@ -519,6 +525,8 @@ public:
// Cocoa-specific helpers
id GetItemAtRow(int row) const;
virtual void SetFont(const wxFont& font, const wxColour& foreground, long windowStyle, bool ignoreBlack = true);
private:
void InitOutlineView(long style);
int GetDefaultRowHeight() const;