font.SetPointSize( static_cast<int>(size) );
}
- if ( font.Ok() )
+ if ( font.IsOk() )
{
dc.SetFont(font);
// Calculate vertical and horizontal centre
void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox)
{
int unitsIdx = 0;
-
+
if (!dim.IsValid())
{
checkBox->SetValue(false);
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;
{
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);
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("\"");
*/