// ------ Cell text drawing functions
//
void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&,
- int horizontalAlignment = wxLEFT,
- int verticalAlignment = wxTOP );
+ int horizontalAlignment = wxALIGN_LEFT,
+ int verticalAlignment = wxALIGN_TOP );
// Split a string containing newline chararcters into an array of
// strings and return the number of lines
void SetEditInPlace(bool WXUNUSED(edit) = TRUE) { }
void SetCellAlignment( int align, int row, int col)
- { SetCellAlignment(row, col, align, wxCENTER); }
+ { SetCellAlignment(row, col, align, wxALIGN_CENTER); }
void SetCellAlignment( int WXUNUSED(align) ) {}
void SetCellBitmap(wxBitmap *WXUNUSED(bitmap), int WXUNUSED(row), int WXUNUSED(col))
{ }
// draw the text right aligned by default
int hAlign, vAlign;
attr.GetAlignment(&hAlign, &vAlign);
- hAlign = wxRIGHT;
+ hAlign = wxALIGN_RIGHT;
wxRect rect = rectCell;
rect.Inflate(-1);
// draw the text right aligned by default
int hAlign, vAlign;
attr.GetAlignment(&hAlign, &vAlign);
- hAlign = wxRIGHT;
+ hAlign = wxALIGN_RIGHT;
wxRect rect = rectCell;
rect.Inflate(-1);
// Set default cell attributes
m_defaultCellAttr->SetFont(GetFont());
- m_defaultCellAttr->SetAlignment(wxLEFT, wxTOP);
+ m_defaultCellAttr->SetAlignment(wxALIGN_LEFT, wxALIGN_TOP);
m_defaultCellAttr->SetTextColour(
wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT));
m_defaultCellAttr->SetBackgroundColour(
m_labelFont = this->GetFont();
m_labelFont.SetWeight( m_labelFont.GetWeight() + 2 );
- m_rowLabelHorizAlign = wxLEFT;
- m_rowLabelVertAlign = wxCENTRE;
+ m_rowLabelHorizAlign = wxALIGN_LEFT;
+ m_rowLabelVertAlign = wxALIGN_CENTRE;
- m_colLabelHorizAlign = wxCENTRE;
- m_colLabelVertAlign = wxTOP;
+ m_colLabelHorizAlign = wxALIGN_CENTRE;
+ m_colLabelVertAlign = wxALIGN_TOP;
m_defaultColWidth = WXGRID_DEFAULT_COL_WIDTH;
m_defaultRowHeight = m_gridWin->GetCharHeight();
float x, y;
switch ( horizAlign )
{
- case wxRIGHT:
+ case wxALIGN_RIGHT:
x = rect.x + (rect.width - textWidth - 1);
break;
- case wxCENTRE:
+ case wxALIGN_CENTRE:
x = rect.x + ((rect.width - textWidth)/2);
break;
- case wxLEFT:
+ case wxALIGN_LEFT:
default:
x = rect.x + 1;
break;
switch ( vertAlign )
{
- case wxBOTTOM:
+ case wxALIGN_BOTTOM:
y = rect.y + (rect.height - textHeight - 1);
break;
- case wxCENTRE:
+ case wxALIGN_CENTRE:
y = rect.y + ((rect.height - textHeight)/2);
break;
- case wxTOP:
+ case wxALIGN_TOP:
default:
y = rect.y + 1;
break;
void wxGrid::SetRowLabelAlignment( int horiz, int vert )
{
- if ( horiz == wxLEFT || horiz == wxCENTRE || horiz == wxRIGHT )
+ // allow old (incorrect) defs to be used
+ switch ( horiz )
+ {
+ case wxLEFT: horiz = wxALIGN_LEFT; break;
+ case wxRIGHT: horiz = wxALIGN_RIGHT; break;
+ case wxCENTRE: horiz = wxALIGN_CENTRE; break;
+ }
+
+ switch ( vert )
+ {
+ case wxTOP: vert = wxALIGN_TOP; break;
+ case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
+ case wxCENTRE: vert = wxALIGN_CENTRE; break;
+ }
+
+ if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
{
m_rowLabelHorizAlign = horiz;
}
- if ( vert == wxTOP || vert == wxCENTRE || vert == wxBOTTOM )
+ if ( vert == wxALIGN_TOP || vert == wxALIGN_CENTRE || vert == wxALIGN_BOTTOM )
{
m_rowLabelVertAlign = vert;
}
void wxGrid::SetColLabelAlignment( int horiz, int vert )
{
- if ( horiz == wxLEFT || horiz == wxCENTRE || horiz == wxRIGHT )
+ // allow old (incorrect) defs to be used
+ switch ( horiz )
+ {
+ case wxLEFT: horiz = wxALIGN_LEFT; break;
+ case wxRIGHT: horiz = wxALIGN_RIGHT; break;
+ case wxCENTRE: horiz = wxALIGN_CENTRE; break;
+ }
+
+ switch ( vert )
+ {
+ case wxTOP: vert = wxALIGN_TOP; break;
+ case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
+ case wxCENTRE: vert = wxALIGN_CENTRE; break;
+ }
+
+ if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
{
m_colLabelHorizAlign = horiz;
}
- if ( vert == wxTOP || vert == wxCENTRE || vert == wxBOTTOM )
+ if ( vert == wxALIGN_TOP || vert == wxALIGN_CENTRE || vert == wxALIGN_BOTTOM )
{
m_colLabelVertAlign = vert;
}