Added pixel size capability to wxTextAttr and wxRichTextCtrl.

Fixed composite object positioning in centred and right-aligned
paragraphs.
Added field example to sample, and enabled pixel font size selection.
Added custom text and dimension scaling.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-05-20 12:25:22 +00:00
parent c564ca3c97
commit 32423dd824
20 changed files with 1421 additions and 525 deletions

View File

@@ -264,7 +264,6 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va
attributes.SetLineSpacing(10);
attributes.SetParagraphSpacingAfter(10);
attributes.SetParagraphSpacingBefore(0);
SetBasicStyle(attributes);
int margin = 5;
@@ -2931,6 +2930,7 @@ void wxRichTextCtrl::DoWriteText(const wxString& value, int flags)
wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix);
GetFocusObject()->InsertTextWithUndo(& GetBuffer(), m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
GetBuffer().Defragment();
if ( flags & SetValue_SendEvent )
wxTextCtrl::SendTextUpdatedEvent(this);
@@ -4580,6 +4580,26 @@ void wxRichTextCtrl::EnableVerticalScrollbar(bool enable)
SetupScrollbars();
}
void wxRichTextCtrl::SetFontScale(double fontScale, bool refresh)
{
GetBuffer().SetFontScale(fontScale);
if (refresh)
{
GetBuffer().Invalidate(wxRICHTEXT_ALL);
Refresh();
}
}
void wxRichTextCtrl::SetDimensionScale(double dimScale, bool refresh)
{
GetBuffer().SetDimensionScale(dimScale);
if (refresh)
{
GetBuffer().Invalidate(wxRICHTEXT_ALL);
Refresh();
}
}
#if wxRICHTEXT_USE_OWN_CARET
// ----------------------------------------------------------------------------