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:
@@ -564,7 +564,8 @@ public:
|
|||||||
wxGridCellAttr()
|
wxGridCellAttr()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
SetAlignment(0, 0);
|
// MB: args used to be 0,0 here but wxALIGN_LEFT is 0
|
||||||
|
SetAlignment(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// VZ: considering the number of members wxGridCellAttr has now, this ctor
|
// VZ: considering the number of members wxGridCellAttr has now, this ctor
|
||||||
@@ -610,7 +611,7 @@ public:
|
|||||||
bool HasTextColour() const { return m_colText.Ok(); }
|
bool HasTextColour() const { return m_colText.Ok(); }
|
||||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||||
bool HasFont() const { return m_font.Ok(); }
|
bool HasFont() const { return m_font.Ok(); }
|
||||||
bool HasAlignment() const { return m_hAlign || m_vAlign; }
|
bool HasAlignment() const { return (m_hAlign != -1 || m_vAlign != -1); }
|
||||||
bool HasRenderer() const { return m_renderer != NULL; }
|
bool HasRenderer() const { return m_renderer != NULL; }
|
||||||
bool HasEditor() const { return m_editor != NULL; }
|
bool HasEditor() const { return m_editor != NULL; }
|
||||||
|
|
||||||
|
@@ -229,7 +229,7 @@ GridFrame::GridFrame()
|
|||||||
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
|
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
|
||||||
|
|
||||||
grid->SetCellValue(4, 4, "a weird looking cell");
|
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->SetCellRenderer(4, 4, new MyGridCellRenderer);
|
||||||
|
|
||||||
grid->SetCellValue(3, 0, "1");
|
grid->SetCellValue(3, 0, "1");
|
||||||
@@ -398,16 +398,16 @@ void GridFrame::SetRowLabelHorizAlignment( wxCommandEvent& WXUNUSED(ev) )
|
|||||||
|
|
||||||
switch ( horiz )
|
switch ( horiz )
|
||||||
{
|
{
|
||||||
case wxLEFT:
|
case wxALIGN_LEFT:
|
||||||
horiz = wxCENTRE;
|
horiz = wxALIGN_CENTRE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxCENTRE:
|
case wxALIGN_CENTRE:
|
||||||
horiz = wxRIGHT;
|
horiz = wxALIGN_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxRIGHT:
|
case wxALIGN_RIGHT:
|
||||||
horiz = wxLEFT;
|
horiz = wxALIGN_LEFT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,16 +421,16 @@ void GridFrame::SetRowLabelVertAlignment( wxCommandEvent& WXUNUSED(ev) )
|
|||||||
|
|
||||||
switch ( vert )
|
switch ( vert )
|
||||||
{
|
{
|
||||||
case wxTOP:
|
case wxALIGN_TOP:
|
||||||
vert = wxCENTRE;
|
vert = wxALIGN_CENTRE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxCENTRE:
|
case wxALIGN_CENTRE:
|
||||||
vert = wxBOTTOM;
|
vert = wxALIGN_BOTTOM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxBOTTOM:
|
case wxALIGN_BOTTOM:
|
||||||
vert = wxTOP;
|
vert = wxALIGN_TOP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,16 +445,16 @@ void GridFrame::SetColLabelHorizAlignment( wxCommandEvent& WXUNUSED(ev) )
|
|||||||
|
|
||||||
switch ( horiz )
|
switch ( horiz )
|
||||||
{
|
{
|
||||||
case wxLEFT:
|
case wxALIGN_LEFT:
|
||||||
horiz = wxCENTRE;
|
horiz = wxALIGN_CENTRE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxCENTRE:
|
case wxALIGN_CENTRE:
|
||||||
horiz = wxRIGHT;
|
horiz = wxALIGN_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxRIGHT:
|
case wxALIGN_RIGHT:
|
||||||
horiz = wxLEFT;
|
horiz = wxALIGN_LEFT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,16 +469,16 @@ void GridFrame::SetColLabelVertAlignment( wxCommandEvent& WXUNUSED(ev) )
|
|||||||
|
|
||||||
switch ( vert )
|
switch ( vert )
|
||||||
{
|
{
|
||||||
case wxTOP:
|
case wxALIGN_TOP:
|
||||||
vert = wxCENTRE;
|
vert = wxALIGN_CENTRE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxCENTRE:
|
case wxALIGN_CENTRE:
|
||||||
vert = wxBOTTOM;
|
vert = wxALIGN_BOTTOM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxBOTTOM:
|
case wxALIGN_BOTTOM:
|
||||||
vert = wxTOP;
|
vert = wxALIGN_TOP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user