attributes.SetLineSpacing(10);
attributes.SetParagraphSpacingAfter(10);
attributes.SetParagraphSpacingBefore(0);
- attributes.SetTextEffects(0);
- attributes.SetTextEffectFlags(wxTEXT_ATTR_EFFECT_STRIKETHROUGH|wxTEXT_ATTR_EFFECT_CAPITALS);
SetBasicStyle(attributes);
long oldCaretPos = m_caretPosition;
MoveCaret(position, caretAtLineStart);
+ SetDefaultStyleToCursorStyle();
if (event.ShiftDown())
{
ExtendSelection(m_caretPosition, position, wxRICHTEXT_SHIFT_DOWN);
MoveCaret(position, caretAtLineStart);
+ SetDefaultStyleToCursorStyle();
}
}
}
if (event.GetKeyCode() == WXK_RETURN)
{
- SetDefaultStyleToCursorStyle();
BeginBatchUndo(_("Insert Text"));
long newPos = m_caretPosition;
GetBuffer().InsertNewlineWithUndo(newPos+1, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE|wxRICHTEXT_INSERT_INTERACTIVE);
EndBatchUndo();
+ SetDefaultStyleToCursorStyle();
ScrollIntoView(m_caretPosition, WXK_RIGHT);
m_caretPosition = -1;
PositionCaret();
+ SetDefaultStyleToCursorStyle();
}
ScrollIntoView(m_caretPosition, WXK_LEFT);
m_caretPosition = -1;
PositionCaret();
+ SetDefaultStyleToCursorStyle();
}
wxRichTextEvent cmdEvent(
}
}
- SetDefaultStyleToCursorStyle();
BeginBatchUndo(_("Insert Text"));
long newPos = m_caretPosition;
EndBatchUndo();
+ SetDefaultStyleToCursorStyle();
ScrollIntoView(m_caretPosition, WXK_RIGHT);
GetEventHandler()->ProcessEvent(cmdEvent);
if (success)
{
ScrollIntoView(m_caretPosition, keyCode);
+ SetDefaultStyleToCursorStyle();
}
return success;
m_caretPosition = oldPosition;
m_caretAtLineStart = true;
}
+ SetDefaultStyleToCursorStyle();
return;
}
}
}
m_caretPosition ++;
+ SetDefaultStyleToCursorStyle();
}
/// Move caret one visual step backward: this may mean setting a flag
// to the previous character position.
m_caretPosition = oldPosition - 1;
}
+ SetDefaultStyleToCursorStyle();
return;
}
}
}
m_caretPosition --;
+ SetDefaultStyleToCursorStyle();
}
/// Move right
SetCaretPosition(newPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos, caretLineStart);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(newPos, para->GetRange().GetStart() != lineRange.GetStart());
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(-1);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(endPos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(pos, para->GetRange().GetStart() != lineRange.GetStart());
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(pos, para->GetRange().GetStart() != pos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
SetCaretPosition(pos, para->GetRange().GetStart() != pos);
PositionCaret();
+ SetDefaultStyleToCursorStyle();
return true;
}
bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType)
{
- bool success = GetBuffer().LoadFile(filename, fileType);
+ bool success = GetBuffer().LoadFile(filename, (wxRichTextFileType)fileType);
if (success)
m_filename = filename;
bool wxRichTextCtrl::DoSaveFile(const wxString& filename, int fileType)
{
- if (GetBuffer().SaveFile(filename, fileType))
+ if (GetBuffer().SaveFile(filename, (wxRichTextFileType)fileType))
{
m_filename = filename;
if (positionStart >= 0)
{
MoveCaret(positionStart-1, true);
+ SetDefaultStyleToCursorStyle();
}
return true;
{
wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix);
- SetDefaultStyleToCursorStyle();
GetBuffer().InsertTextWithUndo(m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
if ( flags & SetValue_SendEvent )
}
/// Write an image at the current insertion point
-bool wxRichTextCtrl::WriteImage(const wxImage& image, int bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxImage& image, wxBitmapType bitmapType)
{
wxRichTextImageBlock imageBlock;
return false;
}
-bool wxRichTextCtrl::WriteImage(const wxString& filename, int bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxString& filename, wxBitmapType bitmapType)
{
wxRichTextImageBlock imageBlock;
return GetBuffer().InsertImageWithUndo(m_caretPosition+1, imageBlock, this);
}
-bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, int bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType)
{
if (bitmap.Ok())
{
{
if (CanPaste())
{
- SetDefaultStyleToCursorStyle();
BeginBatchUndo(_("Paste"));
long newPos = m_caretPosition;