/**
Submits a command to insert paragraphs.
*/
- bool InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertParagraphsWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given text.
*/
- bool InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertTextWithUndo(wxRichTextBuffer* buffer, long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given text.
*/
- bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertNewlineWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given image.
*/
- bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock,
- wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags,
- const wxRichTextAttr& textAttr);
+ bool InsertImageWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextImageBlock& imageBlock,
+ wxRichTextCtrl* ctrl, int flags, const wxRichTextAttr& textAttr);
/**
Returns the style that is appropriate for a new paragraph at this position.
/**
Inserts an object.
*/
- wxRichTextObject* InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ wxRichTextObject* InsertObjectWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to delete this range.
/**
Submits a command to insert paragraphs.
*/
- bool InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertParagraphsWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given text.
*/
- bool InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertTextWithUndo(wxRichTextBuffer* buffer, long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given text.
*/
- bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ bool InsertNewlineWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to insert the given image.
*/
- bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock,
- wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags,
+ bool InsertImageWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextImageBlock& imageBlock,
+ wxRichTextCtrl* ctrl, int flags,
const wxRichTextAttr& textAttr);
/**
/**
Inserts an object.
*/
- wxRichTextObject* InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags = 0);
+ wxRichTextObject* InsertObjectWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags = 0);
/**
Submits a command to delete this range.
/**
Submits a command to insert paragraphs.
*/
- bool InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0);
+ bool InsertParagraphsWithUndo(wxRichTextCtrl* ctrl, long pos, const wxRichTextParagraphLayoutBox& paragraphs, int flags = 0);
/**
Submits a command to insert the given text.
/// Submit command to insert paragraphs
bool wxRichTextBuffer::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags)
{
- return ctrl->GetFocusObject()->InsertParagraphsWithUndo(pos, paragraphs, ctrl, this, flags);
+ return ctrl->GetFocusObject()->InsertParagraphsWithUndo(this, pos, paragraphs, ctrl, flags);
}
/// Submit command to insert paragraphs
-bool wxRichTextParagraphLayoutBox::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int WXUNUSED(flags))
+bool wxRichTextParagraphLayoutBox::InsertParagraphsWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int WXUNUSED(flags))
{
wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, buffer, this, ctrl, false);
/// Submit command to insert the given text
bool wxRichTextBuffer::InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags)
{
- return ctrl->GetFocusObject()->InsertTextWithUndo(pos, text, ctrl, this, flags);
+ return ctrl->GetFocusObject()->InsertTextWithUndo(this, pos, text, ctrl, flags);
}
/// Submit command to insert the given text
-bool wxRichTextParagraphLayoutBox::InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags)
+bool wxRichTextParagraphLayoutBox::InsertTextWithUndo(wxRichTextBuffer* buffer, long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags)
{
wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, buffer, this, ctrl, false);
/// Submit command to insert the given text
bool wxRichTextBuffer::InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags)
{
- return ctrl->GetFocusObject()->InsertNewlineWithUndo(pos, ctrl, this, flags);
+ return ctrl->GetFocusObject()->InsertNewlineWithUndo(this, pos, ctrl, flags);
}
/// Submit command to insert the given text
-bool wxRichTextParagraphLayoutBox::InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags)
+bool wxRichTextParagraphLayoutBox::InsertNewlineWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextCtrl* ctrl, int flags)
{
wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, buffer, this, ctrl, false);
bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags,
const wxRichTextAttr& textAttr)
{
- return ctrl->GetFocusObject()->InsertImageWithUndo(pos, imageBlock, ctrl, this, flags, textAttr);
+ return ctrl->GetFocusObject()->InsertImageWithUndo(this, pos, imageBlock, ctrl, flags, textAttr);
}
/// Submit command to insert the given image
-bool wxRichTextParagraphLayoutBox::InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock,
- wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags,
+bool wxRichTextParagraphLayoutBox::InsertImageWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextImageBlock& imageBlock,
+ wxRichTextCtrl* ctrl, int flags,
const wxRichTextAttr& textAttr)
{
wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Image"), wxRICHTEXT_INSERT, buffer, this, ctrl, false);
// Insert an object with no change of it
wxRichTextObject* wxRichTextBuffer::InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags)
{
- return ctrl->GetFocusObject()->InsertObjectWithUndo(pos, object, ctrl, this, flags);
+ return ctrl->GetFocusObject()->InsertObjectWithUndo(this, pos, object, ctrl, flags);
}
// Insert an object with no change of it
-wxRichTextObject* wxRichTextParagraphLayoutBox::InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer, int flags)
+wxRichTextObject* wxRichTextParagraphLayoutBox::InsertObjectWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags)
{
wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Object"), wxRICHTEXT_INSERT, buffer, this, ctrl, false);
wxRichTextBuffer* richTextBuffer = data.GetRichTextBuffer();
if (richTextBuffer)
{
- container->InsertParagraphsWithUndo(position+1, *richTextBuffer, GetRichTextCtrl(), this, 0);
+ container->InsertParagraphsWithUndo(this, position+1, *richTextBuffer, GetRichTextCtrl(), 0);
if (GetRichTextCtrl())
GetRichTextCtrl()->ShowPosition(position + richTextBuffer->GetOwnRange().GetEnd());
delete richTextBuffer;
#else
wxString text2 = text;
#endif
- container->InsertTextWithUndo(position+1, text2, GetRichTextCtrl(), this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ container->InsertTextWithUndo(this, position+1, text2, GetRichTextCtrl(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
if (GetRichTextCtrl())
GetRichTextCtrl()->ShowPosition(position + text2.Length());
{
wxString text;
text = wxRichTextLineBreakChar;
- GetFocusObject()->InsertTextWithUndo(newPos+1, text, this, & GetBuffer());
+ GetFocusObject()->InsertTextWithUndo(& GetBuffer(), newPos+1, text, this);
m_caretAtLineStart = true;
PositionCaret();
}
else
- GetFocusObject()->InsertNewlineWithUndo(newPos+1, this, & GetBuffer(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE|wxRICHTEXT_INSERT_INTERACTIVE);
+ GetFocusObject()->InsertNewlineWithUndo(& GetBuffer(), newPos+1, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE|wxRICHTEXT_INSERT_INTERACTIVE);
EndBatchUndo();
SetDefaultStyleToCursorStyle();
#else
wxString str = (wxChar) event.GetKeyCode();
#endif
- GetFocusObject()->InsertTextWithUndo(newPos+1, str, this, & GetBuffer(), 0);
+ GetFocusObject()->InsertTextWithUndo(& GetBuffer(), newPos+1, str, this, 0);
EndBatchUndo();
{
wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix);
- GetFocusObject()->InsertTextWithUndo(m_caretPosition+1, valueUnix, this, & GetBuffer(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ GetFocusObject()->InsertTextWithUndo(& GetBuffer(), m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
if ( flags & SetValue_SendEvent )
wxTextCtrl::SendTextUpdatedEvent(this);
bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock, const wxRichTextAttr& textAttr)
{
- return GetFocusObject()->InsertImageWithUndo(m_caretPosition+1, imageBlock, this, & GetBuffer(), 0, textAttr);
+ return GetFocusObject()->InsertImageWithUndo(& GetBuffer(), m_caretPosition+1, imageBlock, this, 0, textAttr);
}
bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType, const wxRichTextAttr& textAttr)
// The object returned is the one actually inserted into the buffer,
// while the original one is deleted.
- wxRichTextObject* obj = GetFocusObject()->InsertObjectWithUndo(m_caretPosition+1, textBox, this, & GetBuffer(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ wxRichTextObject* obj = GetFocusObject()->InsertObjectWithUndo(& GetBuffer(), m_caretPosition+1, textBox, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
wxRichTextBox* box = wxDynamicCast(obj, wxRichTextBox);
return box;
}
// The object returned is the one actually inserted into the buffer,
// while the original one is deleted.
- wxRichTextObject* obj = GetFocusObject()->InsertObjectWithUndo(m_caretPosition+1, table, this, & GetBuffer(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ wxRichTextObject* obj = GetFocusObject()->InsertObjectWithUndo(& GetBuffer(), m_caretPosition+1, table, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
wxRichTextTable* tableResult = wxDynamicCast(obj, wxRichTextTable);
return tableResult;
}
/// Insert a newline (actually paragraph) at the current insertion point.
bool wxRichTextCtrl::Newline()
{
- return GetFocusObject()->InsertNewlineWithUndo(m_caretPosition+1, this, & GetBuffer(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ return GetFocusObject()->InsertNewlineWithUndo(& GetBuffer(), m_caretPosition+1, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
}
/// Insert a line break at the current insertion point.
{
wxString text;
text = wxRichTextLineBreakChar;
- return GetFocusObject()->InsertTextWithUndo(m_caretPosition+1, text, this, & GetBuffer());
+ return GetFocusObject()->InsertTextWithUndo(& GetBuffer(), m_caretPosition+1, text, this);
}
// ----------------------------------------------------------------------------
originContainer->DeleteRangeWithUndo(selectionrange, this, &GetBuffer());
}
- destContainer->InsertParagraphsWithUndo(position+1, *richTextBuffer, this, &GetBuffer(), 0);
+ destContainer->InsertParagraphsWithUndo(&GetBuffer(), position+1, *richTextBuffer, this, 0);
ShowPosition(position + richTextBuffer->GetOwnRange().GetEnd());
delete richTextBuffer;
/////////////////////////////////////////////////////////////////////////////
// Name: src/richtext/richtextsizepage.cpp
-// Purpose:
+// Purpose:
// Author: Julian Smart
-// Modified by:
+// Modified by:
// Created: 20/10/2010 10:23:24
-// RCS-ID:
+// RCS-ID:
// Copyright: (c) Julian Smart
-// Licence:
+// Licence:
/////////////////////////////////////////////////////////////////////////////
#include "wx/richtext/richtextsizepage.h"
*/
void wxRichTextSizePage::CreateControls()
-{
+{
////@begin wxRichTextSizePage content construction
wxRichTextSizePage* itemRichTextDialogPage1 = this;
wxRichTextFormattingDialog* dialog = wxRichTextFormattingDialog::GetDialog(this);
if (!dialog || !dialog->GetObject())
return;
-
+
// Make sure object attributes are up-to-date
dialog->TransferDataFromWindow();
-
+
wxRichTextBuffer* buffer = dialog->GetObject()->GetBuffer();
wxRichTextParagraphLayoutBox* container = dialog->GetObject()->GetParentContainer();
wxRichTextObject* parent = dialog->GetObject()->GetParent();
container->DeleteRangeWithUndo(range, buffer->GetRichTextCtrl(), buffer);
- wxRichTextObject* obj2 = container->InsertObjectWithUndo(rg.GetStart(), tempObj, buffer->GetRichTextCtrl(), buffer, 0);
+ wxRichTextObject* obj2 = container->InsertObjectWithUndo(buffer, rg.GetStart(), tempObj, buffer->GetRichTextCtrl(), 0);
dialog->SetObject(obj2);
}
wxRichTextFormattingDialog* dialog = wxRichTextFormattingDialog::GetDialog(this);
if (!dialog || !dialog->GetObject())
return;
-
+
// Make sure object attributes are up-to-date
dialog->TransferDataFromWindow();
-
+
wxRichTextBuffer* buffer = dialog->GetObject()->GetBuffer();
wxRichTextParagraphLayoutBox* container = dialog->GetObject()->GetParentContainer();
wxRichTextObject* parent = dialog->GetObject()->GetParent();
container->DeleteRangeWithUndo(range, buffer->GetRichTextCtrl(), buffer);
// Minus one because we deleted an object
- wxRichTextObject* obj2 = container->InsertObjectWithUndo(rg.GetStart()-1, tempObj, buffer->GetRichTextCtrl(), buffer, 0);
+ wxRichTextObject* obj2 = container->InsertObjectWithUndo(buffer, rg.GetStart()-1, tempObj, buffer->GetRichTextCtrl(), 0);
dialog->SetObject(obj2);
}