Add symbolic constant wxALIGN_INVALID and use it instead of -1 in wxGrid.

wxGridCellAttr was using literal -1 to indicate "no alignment" which wasn't
immediately obvious, use a new wxALIGN_INVALID (which has the same value)
instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-11-27 01:47:30 +00:00
parent 5cbf522105
commit ba0185b557
3 changed files with 22 additions and 5 deletions

View File

@@ -388,8 +388,7 @@ public:
{
Init(attrDefault);
// MB: args used to be 0,0 here but wxALIGN_LEFT is 0
SetAlignment(-1, -1);
SetAlignment(wxALIGN_INVALID, wxALIGN_INVALID);
}
// VZ: considering the number of members wxGridCellAttr has now, this ctor
@@ -436,7 +435,10 @@ public:
bool HasTextColour() const { return m_colText.Ok(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); }
bool HasFont() const { return m_font.Ok(); }
bool HasAlignment() const { return (m_hAlign != -1 || m_vAlign != -1); }
bool HasAlignment() const
{
return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;
}
bool HasRenderer() const { return m_renderer != NULL; }
bool HasEditor() const { return m_editor != NULL; }
bool HasReadWriteMode() const { return m_isReadOnly != Unset; }
@@ -1675,9 +1677,9 @@ public:
void SetLabelAlignment( int orientation, int align )
{
if ( orientation == wxHORIZONTAL )
SetColLabelAlignment( align, -1 );
SetColLabelAlignment( align, wxALIGN_INVALID );
else
SetRowLabelAlignment( align, -1 );
SetRowLabelAlignment( align, wxALIGN_INVALID );
}
int GetLabelAlignment( int orientation, int WXUNUSED(align) ) const