Fix to avoid an assert. It's a bad idea to add 2 to the font weight
if it's already bold. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1203,14 +1203,14 @@ void wxGridCellBoolEditor::SetSize(const wxRect& r)
|
||||
int vAlign = wxALIGN_CENTRE;
|
||||
if (GetCellAttr())
|
||||
GetCellAttr()->GetAlignment(& hAlign, & vAlign);
|
||||
|
||||
|
||||
int x = 0, y = 0;
|
||||
if (hAlign == wxALIGN_LEFT)
|
||||
{
|
||||
x = r.x + 2;
|
||||
#ifdef __WXMSW__
|
||||
x += 2;
|
||||
#endif
|
||||
#endif
|
||||
y = r.y + r.height/2 - size.y/2;
|
||||
}
|
||||
else if (hAlign == wxALIGN_RIGHT)
|
||||
@@ -1526,7 +1526,7 @@ void wxGridCellRenderer::Draw(wxGrid& grid,
|
||||
{
|
||||
dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetBrush(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
|
||||
@@ -1937,7 +1937,7 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
|
||||
// draw a border around checkmark
|
||||
int vAlign, hAlign;
|
||||
attr.GetAlignment(& hAlign, &vAlign);
|
||||
|
||||
|
||||
wxRect rectBorder;
|
||||
if (hAlign == wxALIGN_CENTRE)
|
||||
{
|
||||
@@ -1951,14 +1951,14 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
|
||||
rectBorder.x = rect.x + 2;
|
||||
rectBorder.y = rect.y + rect.height/2 - size.y/2;
|
||||
rectBorder.width = size.x;
|
||||
rectBorder.height = size.y;
|
||||
rectBorder.height = size.y;
|
||||
}
|
||||
else if (hAlign == wxALIGN_RIGHT)
|
||||
{
|
||||
rectBorder.x = rect.x + rect.width - size.x - 2;
|
||||
rectBorder.y = rect.y + rect.height/2 - size.y/2;
|
||||
rectBorder.width = size.x;
|
||||
rectBorder.height = size.y;
|
||||
rectBorder.height = size.y;
|
||||
}
|
||||
|
||||
bool value;
|
||||
@@ -3899,7 +3899,7 @@ void wxGrid::Init()
|
||||
// TODO: something better than this ?
|
||||
//
|
||||
m_labelFont = this->GetFont();
|
||||
m_labelFont.SetWeight( m_labelFont.GetWeight() + 2 );
|
||||
m_labelFont.SetWeight( wxBOLD );
|
||||
|
||||
m_rowLabelHorizAlign = wxALIGN_LEFT;
|
||||
m_rowLabelVertAlign = wxALIGN_CENTRE;
|
||||
|
Reference in New Issue
Block a user