Changed wxGridCellAttr::HasAlignment to treat values of -1 as no

alignment because wxALIGN_LEFT and wxALIGN_TOP are 0.

Updated griddemo.cpp to use correct alignment defs.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Michael Bedward
2000-07-27 04:09:21 +00:00
parent 4c7277db42
commit 0767cb6f44
2 changed files with 28 additions and 27 deletions

View File

@@ -229,7 +229,7 @@ GridFrame::GridFrame()
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
grid->SetCellValue(4, 4, "a weird looking cell");
grid->SetCellAlignment(4, 4, wxCENTRE, wxCENTRE);
grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE);
grid->SetCellRenderer(4, 4, new MyGridCellRenderer);
grid->SetCellValue(3, 0, "1");
@@ -398,16 +398,16 @@ void GridFrame::SetRowLabelHorizAlignment( wxCommandEvent& WXUNUSED(ev) )
switch ( horiz )
{
case wxLEFT:
horiz = wxCENTRE;
case wxALIGN_LEFT:
horiz = wxALIGN_CENTRE;
break;
case wxCENTRE:
horiz = wxRIGHT;
case wxALIGN_CENTRE:
horiz = wxALIGN_RIGHT;
break;
case wxRIGHT:
horiz = wxLEFT;
case wxALIGN_RIGHT:
horiz = wxALIGN_LEFT;
break;
}
@@ -421,16 +421,16 @@ void GridFrame::SetRowLabelVertAlignment( wxCommandEvent& WXUNUSED(ev) )
switch ( vert )
{
case wxTOP:
vert = wxCENTRE;
case wxALIGN_TOP:
vert = wxALIGN_CENTRE;
break;
case wxCENTRE:
vert = wxBOTTOM;
case wxALIGN_CENTRE:
vert = wxALIGN_BOTTOM;
break;
case wxBOTTOM:
vert = wxTOP;
case wxALIGN_BOTTOM:
vert = wxALIGN_TOP;
break;
}
@@ -445,16 +445,16 @@ void GridFrame::SetColLabelHorizAlignment( wxCommandEvent& WXUNUSED(ev) )
switch ( horiz )
{
case wxLEFT:
horiz = wxCENTRE;
case wxALIGN_LEFT:
horiz = wxALIGN_CENTRE;
break;
case wxCENTRE:
horiz = wxRIGHT;
case wxALIGN_CENTRE:
horiz = wxALIGN_RIGHT;
break;
case wxRIGHT:
horiz = wxLEFT;
case wxALIGN_RIGHT:
horiz = wxALIGN_LEFT;
break;
}
@@ -469,16 +469,16 @@ void GridFrame::SetColLabelVertAlignment( wxCommandEvent& WXUNUSED(ev) )
switch ( vert )
{
case wxTOP:
vert = wxCENTRE;
case wxALIGN_TOP:
vert = wxALIGN_CENTRE;
break;
case wxCENTRE:
vert = wxBOTTOM;
case wxALIGN_CENTRE:
vert = wxALIGN_BOTTOM;
break;
case wxBOTTOM:
vert = wxTOP;
case wxALIGN_BOTTOM:
vert = wxALIGN_TOP;
break;
}