Removed GetId/GetId and changed span storage to be compatible with 3.0. Fixed border control style.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2013-11-17 12:43:58 +00:00
parent 9c4f2cd1ca
commit c6de30bf70
6 changed files with 74 additions and 95 deletions

View File

@ -2746,16 +2746,6 @@ public:
*/
bool IsShown() const { return m_show; }
/**
Returns the object's unique identifier, if any.
*/
const wxString& GetId() const { return m_id; }
/**
Sets the object's unique identifier.
*/
void SetId(const wxString& id) { m_id = id; }
// Operations
/**
@ -2854,7 +2844,6 @@ protected:
int m_descent; // Descent for this object (if any)
int m_refCount;
bool m_show;
wxString m_id;
wxRichTextObject* m_parent;
// The range of this object (start position to end position)
@ -5704,7 +5693,7 @@ public:
/**
Returns the column span. The default is 1.
*/
int GetColSpan() const { return m_colSpan; }
int GetColSpan() const;
/**
Sets the column span.
@ -5714,7 +5703,7 @@ public:
/**
Returns the row span. The default is 1.
*/
int GetRowSpan() const { return m_rowSpan; }
int GetRowSpan() const;
/**
Sets the row span.
@ -5728,8 +5717,6 @@ public:
void Copy(const wxRichTextCell& obj);
protected:
int m_colSpan;
int m_rowSpan;
};
/**

View File

@ -2588,16 +2588,6 @@ public:
*/
bool IsShown() const;
/**
Returns the object's unique identifier, if any.
*/
const wxString& GetId() const;
/**
Sets the object's unique identifier.
*/
void SetId(const wxString& id);
// Operations
/**

View File

@ -605,7 +605,7 @@ void wxRichTextBordersPage::CreateControls()
itemBoxSizer3->Add(itemNotebook4, 0, wxGROW|wxALL, 5);
m_borderPreviewCtrl = new wxRichTextBorderPreviewCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BORDER_PREVIEW, wxDefaultPosition, wxSize(60, 60), wxBORDER_THEME );
m_borderPreviewCtrl = new wxRichTextBorderPreviewCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BORDER_PREVIEW, wxDefaultPosition, wxSize(60, 60), wxBORDER_THEME|wxFULL_REPAINT_ON_RESIZE );
itemBoxSizer3->Add(m_borderPreviewCtrl, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
////@end wxRichTextBordersPage content construction

View File

@ -531,7 +531,6 @@ void wxRichTextObject::Copy(const wxRichTextObject& obj)
m_properties = obj.m_properties;
m_descent = obj.m_descent;
m_show = obj.m_show;
m_id = obj.m_id;
}
// Get/set the top-level container of this object.
@ -7184,9 +7183,6 @@ bool wxRichTextPlainText::CanMerge(wxRichTextObject* object, wxRichTextDrawingCo
if (!wxTextAttrEq(GetAttributes(), object->GetAttributes()) || !(m_properties == object->GetProperties()))
return false;
if (!otherObj->GetId().IsEmpty() && GetId() != otherObj->GetId())
return false;
// Check if differing virtual attributes makes it impossible to merge
// these strings.
@ -9393,8 +9389,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRichTextCell, wxRichTextBox)
wxRichTextCell::wxRichTextCell(wxRichTextObject* parent):
wxRichTextBox(parent)
{
m_colSpan = 1;
m_rowSpan = 1;
}
/// Draw the item
@ -9567,23 +9561,6 @@ bool wxRichTextCell::AdjustAttributes(wxRichTextAttr& attr, wxRichTextDrawingCon
void wxRichTextCell::Copy(const wxRichTextCell& obj)
{
wxRichTextBox::Copy(obj);
m_colSpan = obj.m_colSpan;
m_rowSpan = obj.m_rowSpan;
}
void wxRichTextCell::SetColSpan(int span)
{
wxASSERT(span >= 1);
if (span >= 1)
m_colSpan = span;
}
void wxRichTextCell::SetRowSpan(int span)
{
wxASSERT(span >= 1);
if (span >= 1)
m_rowSpan = span;
}
// Edit properties via a GUI
@ -9666,6 +9643,43 @@ bool wxRichTextCell::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer)
return false;
}
void wxRichTextCell::SetColSpan(int span)
{
wxASSERT(span >= 1);
if (span >= 1)
GetProperties().SetProperty(wxT("colspan"), (long) span);
}
void wxRichTextCell::SetRowSpan(int span)
{
wxASSERT(span >= 1);
if (span >= 1)
GetProperties().SetProperty(wxT("rowspan"), (long) span);
}
// The next 2 methods return span values. Note that the default is 1, not 0
int wxRichTextCell::GetColSpan() const
{
int span = 1;
if (GetProperties().HasProperty(wxT("colspan")))
{
span = GetProperties().GetPropertyLong(wxT("colspan"));
}
return span;
}
int wxRichTextCell::GetRowSpan() const
{
int span = 1;
if (GetProperties().HasProperty(wxT("rowspan")))
{
span = GetProperties().GetPropertyLong(wxT("rowspan"));
}
return span;
}
WX_DEFINE_OBJARRAY(wxRichTextObjectPtrArrayArray)
IMPLEMENT_DYNAMIC_CLASS(wxRichTextTable, wxRichTextBox)

View File

@ -308,6 +308,14 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -2648,6 +2656,14 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -5109,6 +5125,14 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -5856,6 +5880,14 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -15176,14 +15208,6 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -22764,14 +22788,6 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -27850,8 +27866,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">1</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">1</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxHSCROLL">0</bool>
<bool name="proxy-wxVSCROLL">0</bool>

View File

@ -352,7 +352,6 @@ bool wxRichTextObject::ImportFromXML(wxRichTextBuffer* WXUNUSED(buffer), wxXmlNo
wxString value = node->GetAttribute(wxT("show"), wxEmptyString);
if (!value.IsEmpty())
Show(value == wxT("1"));
SetId(node->GetAttribute(wxT("id"), wxEmptyString));
*recurse = true;
@ -837,15 +836,6 @@ bool wxRichTextParagraphLayoutBox::ImportFromXML(wxRichTextBuffer* buffer, wxXml
if (partial == wxT("true"))
SetPartialParagraph(true);
wxRichTextCell* cell = wxDynamicCast(this, wxRichTextCell);
if (cell)
{
if (node->HasAttribute(wxT("colspan")))
cell->SetColSpan(wxAtoi(node->GetAttribute(wxT("colspan"), wxEmptyString)));
if (node->HasAttribute(wxT("rowspan")))
cell->SetRowSpan(wxAtoi(node->GetAttribute(wxT("rowspan"), wxEmptyString)));
}
wxXmlNode* child = handler->GetHelper().FindNode(node, wxT("stylesheet"));
if (child && (handler->GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET))
{
@ -886,13 +876,6 @@ bool wxRichTextParagraphLayoutBox::ExportXML(wxOutputStream& stream, int indent,
if (GetPartialParagraph())
style << wxT(" partialparagraph=\"true\"");
wxRichTextCell* cell = wxDynamicCast(this, wxRichTextCell);
if (cell)
{
style << wxT(" colspan=\"") << wxString::Format(wxT("%d"), cell->GetColSpan()) << wxT("\"");
style << wxT(" rowspan=\"") << wxString::Format(wxT("%d"), cell->GetRowSpan()) << wxT("\"");
}
handler->GetHelper().OutputString(stream, style + wxT(">"));
if (GetProperties().GetCount() > 0)
@ -925,13 +908,6 @@ bool wxRichTextParagraphLayoutBox::ExportXML(wxXmlNode* parent, wxRichTextXMLHan
if (GetPartialParagraph())
elementNode->AddAttribute(wxT("partialparagraph"), wxT("true"));
wxRichTextCell* cell = wxDynamicCast(this, wxRichTextCell);
if (cell)
{
elementNode->AddAttribute(wxT("colspan"), wxString::Format(wxT("%d"), cell->GetColSpan()));
elementNode->AddAttribute(wxT("rowspan"), wxString::Format(wxT("%d"), cell->GetRowSpan()));
}
size_t i;
for (i = 0; i < GetChildCount(); i++)
{
@ -2266,8 +2242,6 @@ wxString wxRichTextXMLHelper::AddAttributes(wxRichTextObject* obj, bool isPara)
wxString style = AddAttributes(obj->GetAttributes(), isPara);
if (!obj->IsShown())
style << wxT(" show=\"0\"");
if (!obj->GetId().IsEmpty())
style << wxT(" id=\"") << AttributeToXML(obj->GetId()) << wxT("\"");
return style;
}
@ -2758,8 +2732,6 @@ bool wxRichTextXMLHelper::AddAttributes(wxXmlNode* node, wxRichTextObject* obj,
{
if (!obj->IsShown())
node->AddAttribute(wxT("show"), wxT("0"));
if (!obj->GetId().IsEmpty())
node->AddAttribute(wxT("id"), obj->GetId());
}
return AddAttributes(node, obj->GetAttributes(), isPara);