}
/// Set the attributes and optionally update the display
-bool wxRichTextFormattingDialog::SetStyle(const wxTextAttr& style, bool update)
+bool wxRichTextFormattingDialog::SetStyle(const wxRichTextAttr& style, bool update)
{
m_attributes = style;
if (update)
wxSize size = GetSize();
wxFont font = GetFont();
+ if ((GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) || (GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT))
+ {
+ double size = static_cast<double>(font.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
+ font.SetPointSize( static_cast<int>(size) );
+ }
+
if ( font.Ok() )
{
dc.SetFont(font);
int cx = wxMax(2, (size.x/2) - (w/2));
int cy = wxMax(2, (size.y/2) - (h/2));
+ if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT )
+ cy -= h/2;
+ if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT )
+ cy += h/2;
+
dc.SetTextForeground(GetForegroundColour());
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
dc.DrawText(text, cx, cy);
// Helper for pages to get the attributes
-wxTextAttr* wxRichTextFormattingDialog::GetDialogAttributes(wxWindow* win)
+wxRichTextAttr* wxRichTextFormattingDialog::GetDialogAttributes(wxWindow* win)
{
wxRichTextFormattingDialog* dialog = GetDialog(win);
if (dialog)
wxControl::Create(parent, id, pos, size, style);
SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
- SetBackgroundStyle(wxBG_STYLE_COLOUR);
}
wxRichTextColourSwatchCtrl::~wxRichTextColourSwatchCtrl()