Changed the capitalisation of 'span' of Set/GetRow/Colspan to be less jarring
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5595,13 +5595,13 @@ public:
|
||||
|
||||
// Accessors
|
||||
|
||||
int GetColspan() const;
|
||||
int GetColSpan() const;
|
||||
|
||||
void SetColspan(long span) { GetProperties().SetProperty(wxT("colspan"), span); }
|
||||
void SetColSpan(long span) { GetProperties().SetProperty(wxT("colspan"), span); }
|
||||
|
||||
int GetRowspan() const;
|
||||
int GetRowSpan() const;
|
||||
|
||||
void SetRowspan(long span) { GetProperties().SetProperty(wxT("rowspan"), span); }
|
||||
void SetRowSpan(long span) { GetProperties().SetProperty(wxT("rowspan"), span); }
|
||||
|
||||
// Operations
|
||||
|
||||
|
@@ -5388,7 +5388,7 @@ protected:
|
||||
A cell's appearance can be changed via its associated wxRichTextAttr; for example
|
||||
its size altered or its background colour set. It also has the properties of
|
||||
column- and row-span. By default these are 1, meaning that the cell only spans
|
||||
itself, but can be increased using the SetColspan() and SetRowspan() methods.
|
||||
itself, but can be increased using the SetColSpan() and SetRowSpan() methods.
|
||||
Attempts to set too large a span are silently truncated to the table edge.
|
||||
*/
|
||||
|
||||
@@ -5432,9 +5432,9 @@ public:
|
||||
|
||||
@since 2.9.5
|
||||
|
||||
@see SetColspan(), GetRowspan()
|
||||
@see SetColSpan(), GetRowSpan()
|
||||
*/
|
||||
int GetColspan() const;
|
||||
int GetColSpan() const;
|
||||
|
||||
/**
|
||||
Set the number of columns spanned by the cell.
|
||||
@@ -5444,9 +5444,9 @@ public:
|
||||
|
||||
@since 2.9.5
|
||||
|
||||
@see GetColspan(), SetRowspan()
|
||||
@see GetColSpan(), SetRowSpan()
|
||||
*/
|
||||
void SetColspan(long span);
|
||||
void SetColSpan(long span);
|
||||
|
||||
/**
|
||||
Returns the number of rows spanned by the cell.
|
||||
@@ -5455,9 +5455,9 @@ public:
|
||||
|
||||
@since 2.9.5
|
||||
|
||||
@see SetRowspan(), GetColspan()
|
||||
@see SetRowSpan(), GetColSpan()
|
||||
*/
|
||||
int GetRowspan() const;
|
||||
int GetRowSpan() const;
|
||||
|
||||
/**
|
||||
Set the number of rows spanned by the cell.
|
||||
@@ -5467,9 +5467,9 @@ public:
|
||||
|
||||
@since 2.9.5
|
||||
|
||||
@see GetRowspan(), SetColspan()
|
||||
@see GetRowSpan(), SetColSpan()
|
||||
*/
|
||||
void SetRowspan(long span);
|
||||
void SetRowSpan(long span);
|
||||
|
||||
// Operations
|
||||
|
||||
|
@@ -919,7 +919,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
|
||||
wxFont boldFont = wxFont(12, wxROMAN, wxNORMAL, wxBOLD);
|
||||
wxFont italicFont = wxFont(12, wxROMAN, wxITALIC, wxNORMAL);
|
||||
|
||||
m_richTextCtrl = new MyRichTextCtrl(splitter, ID_RICHTEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL|wxWANTS_CHARS);
|
||||
m_richTextCtrl = new MyRichTextCtrl(splitter, ID_RICHTEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL/*|wxWANTS_CHARS*/);
|
||||
wxASSERT(!m_richTextCtrl->GetBuffer().GetAttributes().HasFontPixelSize());
|
||||
|
||||
wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL);
|
||||
@@ -1236,20 +1236,20 @@ void MyFrame::WriteInitialText()
|
||||
|
||||
// Demonstrate colspan and rowspan
|
||||
wxRichTextCell* cell = table->GetCell(1, 0);
|
||||
cell->SetColspan(2);
|
||||
cell->SetColSpan(2);
|
||||
r.SetFocusObject(cell);
|
||||
cell->Clear();
|
||||
r.WriteText("This cell spans 2 columns");
|
||||
|
||||
cell = table->GetCell(1, 3);
|
||||
cell->SetRowspan(2);
|
||||
cell->SetRowSpan(2);
|
||||
r.SetFocusObject(cell);
|
||||
cell->Clear();
|
||||
r.WriteText("This cell spans 2 rows");
|
||||
|
||||
cell = table->GetCell(2, 1);
|
||||
cell->SetColspan(2);
|
||||
cell->SetRowspan(3);
|
||||
cell->SetColSpan(2);
|
||||
cell->SetRowSpan(3);
|
||||
r.SetFocusObject(cell);
|
||||
cell->Clear();
|
||||
r.WriteText("This cell spans 2 columns and 3 rows");
|
||||
|
@@ -9462,7 +9462,7 @@ bool wxRichTextCell::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer)
|
||||
}
|
||||
|
||||
// The next 2 methods return span values. Note that the default is 1, not 0
|
||||
int wxRichTextCell::GetColspan() const
|
||||
int wxRichTextCell::GetColSpan() const
|
||||
{
|
||||
int span = 1;
|
||||
if (GetProperties().HasProperty(wxT("colspan")))
|
||||
@@ -9473,7 +9473,7 @@ int wxRichTextCell::GetColspan() const
|
||||
return span;
|
||||
}
|
||||
|
||||
int wxRichTextCell::GetRowspan() const
|
||||
int wxRichTextCell::GetRowSpan() const
|
||||
{
|
||||
int span = 1;
|
||||
if (GetProperties().HasProperty(wxT("rowspan")))
|
||||
@@ -9571,13 +9571,13 @@ int GetRowspanDisplacement(const wxRichTextTable* table, int row, int col, int p
|
||||
wxRichTextCell* cell = table->GetCell(prevrow, prevcol);
|
||||
if (cell && cell->IsShown())
|
||||
{
|
||||
int rowSpan = cell->GetRowspan();
|
||||
int rowSpan = cell->GetRowSpan();
|
||||
if (rowSpan > 1 && rowSpan > (row-prevrow))
|
||||
{
|
||||
// There is a rowspanning cell above above the hidden one, so we need
|
||||
// to right-shift the index cell by this column's width. Furthermore,
|
||||
// if the cell also colspans, we need to shift by all affected columns
|
||||
for (int colSpan = 0; colSpan < cell->GetColspan(); ++colSpan)
|
||||
for (int colSpan = 0; colSpan < cell->GetColSpan(); ++colSpan)
|
||||
deltaX += (colWidths[prevcol+colSpan] + paddingX);
|
||||
break;
|
||||
}
|
||||
@@ -9624,7 +9624,7 @@ void ExpandCellsWithRowspan(const wxRichTextTable* table, int paddingY, int& bot
|
||||
wxRichTextCell* cell = table->GetCell(row, col);
|
||||
if (cell && cell->IsShown())
|
||||
{
|
||||
int span = cell->GetRowspan();
|
||||
int span = cell->GetRowSpan();
|
||||
if (span > 1)
|
||||
{
|
||||
span = wxMin(span, rowCount-row); // Don't try to span below the table!
|
||||
@@ -9684,7 +9684,7 @@ void ExpandCellsWithRowspan(const wxRichTextTable* table, int paddingY, int& bot
|
||||
wxPoint position(cell->GetPosition().x, rowTops[row]);
|
||||
|
||||
// GetRowspan() will usually return 1, but may be greater
|
||||
wxSize size(cell->GetCachedSize().GetWidth(), rowTops[row + cell->GetRowspan()] - rowTops[row] - paddingY);
|
||||
wxSize size(cell->GetCachedSize().GetWidth(), rowTops[row + cell->GetRowSpan()] - rowTops[row] - paddingY);
|
||||
|
||||
wxRect availableCellSpace = wxRect(position, size);
|
||||
cell->Invalidate(wxRICHTEXT_ALL);
|
||||
@@ -9829,8 +9829,8 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
for (i = 0; i < m_colCount; i++)
|
||||
{
|
||||
wxRichTextCell* cell = GetCell(j, i);
|
||||
int colSpan = cell->GetColspan();
|
||||
int rowSpan = cell->GetRowspan();
|
||||
int colSpan = cell->GetColSpan();
|
||||
int rowSpan = cell->GetRowSpan();
|
||||
if (colSpan > 1 || rowSpan > 1)
|
||||
{
|
||||
rectArray.Add(wxRect(i, j, colSpan, rowSpan));
|
||||
@@ -9849,8 +9849,8 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
}
|
||||
else
|
||||
{
|
||||
int colSpan = cell->GetColspan();
|
||||
int rowSpan = cell->GetRowspan();
|
||||
int colSpan = cell->GetColSpan();
|
||||
int rowSpan = cell->GetRowSpan();
|
||||
|
||||
if (colSpan > 1 || rowSpan > 1)
|
||||
{
|
||||
@@ -9919,7 +9919,7 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
wxRichTextCell* cell = GetCell(j, i);
|
||||
if (cell->IsShown())
|
||||
{
|
||||
int colSpan = cell->GetColspan();
|
||||
int colSpan = cell->GetColSpan();
|
||||
|
||||
// Lay out cell to find min/max widths
|
||||
cell->Invalidate(wxRICHTEXT_ALL);
|
||||
@@ -10046,7 +10046,7 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
wxRichTextCell* cell = GetCell(j, i);
|
||||
if (cell->IsShown())
|
||||
{
|
||||
int colSpan = cell->GetColspan();
|
||||
int colSpan = cell->GetColSpan();
|
||||
if (colSpan > 1)
|
||||
{
|
||||
int spans = wxMin(colSpan, m_colCount - i);
|
||||
@@ -10236,7 +10236,7 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
|
||||
if (colWidths[i] > 0) // absolute or proportional width has been specified
|
||||
{
|
||||
int colSpan = cell->GetColspan();
|
||||
int colSpan = cell->GetColSpan();
|
||||
wxRect availableCellSpace;
|
||||
|
||||
// Take into account spans
|
||||
@@ -10270,7 +10270,7 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const
|
||||
// TODO: use GetCachedSize().x to compute 'natural' size
|
||||
|
||||
x += (availableCellSpace.GetWidth() + paddingX);
|
||||
if ((cell->GetCachedSize().y > maxCellHeight) && (cell->GetRowspan() < 2))
|
||||
if ((cell->GetCachedSize().y > maxCellHeight) && (cell->GetRowSpan() < 2))
|
||||
maxCellHeight = cell->GetCachedSize().y;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user