X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/603f702b4a0e19ffa27cffc52872efaac1aa8c54..74a8f67d96591cec101def2a7d47c64072aff7fd:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index c440a7736b..768ef405b0 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -516,7 +516,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) font.SetPointSize( static_cast(size) ); } - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); // Calculate vertical and horizontal centre @@ -594,7 +594,7 @@ wxRichTextStyleDefinition* wxRichTextFormattingDialog::GetDialogStyleDefinition( void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox) { int unitsIdx = 0; - + if (!dim.IsValid()) { checkBox->SetValue(false); @@ -611,9 +611,14 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT if (dim.GetUnits() == wxTEXT_ATTR_UNITS_TENTHS_MM) { unitsIdx = 1; - float value = float(dim.GetValue()) / 10.0; + float value = float(dim.GetValue()) / 100.0; valueCtrl->SetValue(wxString::Format(wxT("%.2f"), value)); } + else if (dim.GetUnits() == wxTEXT_ATTR_UNITS_PERCENTAGE) + { + unitsIdx = 2; + valueCtrl->SetValue(wxString::Format(wxT("%d"), (int) dim.GetValue())); + } else { unitsIdx = 0; @@ -634,6 +639,8 @@ void wxRichTextFormattingDialog::GetDimensionValue(wxTextAttrDimension& dim, wxT { if (unitsCtrl->GetSelection() == 1) dim.SetUnits(wxTEXT_ATTR_UNITS_TENTHS_MM); + else if (unitsCtrl->GetSelection() == 2) + dim.SetUnits(wxTEXT_ATTR_UNITS_PERCENTAGE); else dim.SetUnits(wxTEXT_ATTR_UNITS_PIXELS); @@ -821,7 +828,7 @@ wxString wxRichTextFontListBox::CreateHTML(const wxString& facename) const if (!facename.IsEmpty() && facename != _("(none)")) str << wxT(" face=\"") << facename << wxT("\""); /* - if (def->GetStyle().GetTextColour().Ok()) + if (def->GetStyle().GetTextColour().IsOk()) str << wxT(" color=\"#") << ColourToHexString(def->GetStyle().GetTextColour()) << wxT("\""); */