X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/603f702b4a0e19ffa27cffc52872efaac1aa8c54..113e0a926f3bc7994ca911d238da35c9be798232:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index c440a7736b..d85249f47f 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -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);