summaryrefslogtreecommitdiff
path: root/wx+/grid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wx+/grid.cpp')
-rw-r--r--wx+/grid.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/wx+/grid.cpp b/wx+/grid.cpp
index 5d2adc1a..0ffee3a7 100644
--- a/wx+/grid.cpp
+++ b/wx+/grid.cpp
@@ -615,12 +615,11 @@ private:
class Grid::ColLabelWin : public SubWindow
{
public:
- explicit ColLabelWin(Grid& parent) : SubWindow(parent)
+ explicit ColLabelWin(Grid& parent) : SubWindow(parent),
+ labelFont_(GetFont().Bold())
{
//coordinate with ColLabelWin::render():
- wxFont labelFont = GetFont();
- labelFont.MakeBold();
- colLabelHeight_ = fastFromDIP(2 * DEFAULT_COL_LABEL_BORDER_DIP) + labelFont.GetPixelSize().GetHeight();
+ colLabelHeight_ = fastFromDIP(2 * DEFAULT_COL_LABEL_BORDER_DIP) + labelFont_.GetPixelSize().GetHeight();
}
int getColumnLabelHeight() const { return colLabelHeight_; }
@@ -637,9 +636,7 @@ private:
const bool enabled = renderAsEnabled(*this);
//coordinate with "colLabelHeight" in Grid constructor:
- wxFont labelFont = GetFont();
- labelFont.MakeBold();
- dc.SetFont(labelFont);
+ dc.SetFont(labelFont_);
wxDCTextColourChanger textColor(dc, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); //use user setting for labels
@@ -944,6 +941,7 @@ private:
bool freezeMouseHighlight_ = false;
int colLabelHeight_ = 0;
+ const wxFont labelFont_;
};
//----------------------------------------------------------------------------------------------------------------
bgstack15