itemBoxSizer4->Add(itemBoxSizer5, 1, wxGROW, 5);
wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
m_faceTextCtrl->SetHelpText(_("Type a font name."));
itemBoxSizer4->Add(itemBoxSizer9, 0, wxGROW, 5);
wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_sizeTextCtrl->SetHelpText(_("Type a size in points."));
itemBoxSizer13->Add(itemBoxSizer14, 1, wxGROW, 5);
wxStaticText* itemStaticText15 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font st&yle:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxString* m_styleCtrlStrings = NULL;
m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_styleCtrlStrings, wxCB_READONLY );
itemBoxSizer13->Add(itemBoxSizer17, 1, wxGROW, 5);
wxStaticText* itemStaticText18 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font &weight:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxString* m_weightCtrlStrings = NULL;
m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_weightCtrlStrings, wxCB_READONLY );
itemBoxSizer13->Add(itemBoxSizer20, 1, wxGROW, 5);
wxStaticText* itemStaticText21 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Underlining:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxString* m_underliningCtrlStrings = NULL;
m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_underliningCtrlStrings, wxCB_READONLY );
itemBoxSizer13->Add(itemBoxSizer23, 0, wxGROW, 5);
wxStaticText* itemStaticText24 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Colour:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer23->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+ itemBoxSizer23->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
m_colourCtrl = new wxRichTextColourSwatchCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_COLOURCTRL, wxDefaultPosition, wxSize(40, 20), wxSIMPLE_BORDER );
m_colourCtrl->SetHelpText(_("Click to change the text colour."));
{
wxPanel::TransferDataFromWindow();
- wxTextAttrEx* attr = GetAttributes();
+ wxTextAttr* attr = GetAttributes();
if (m_faceListBox->GetSelection() != wxNOT_FOUND)
{
wxString faceName = m_faceListBox->GetFaceName(m_faceListBox->GetSelection());
if (!faceName.IsEmpty())
{
- wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT);
- font.SetFaceName(faceName);
- wxSetFontPreservingStyles(*attr, font);
- attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_FACE);
+ attr->SetFontFaceName(faceName);
}
}
else
int sz = wxAtoi(strSize);
if (sz > 0)
{
- wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT);
- font.SetPointSize(sz);
- wxSetFontPreservingStyles(*attr, font);
- attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_SIZE);
+ attr->SetFontSize(sz);
}
}
else
else
style = wxNORMAL;
- wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT);
- font.SetStyle(style);
- wxSetFontPreservingStyles(*attr, font);
- attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_ITALIC);
+ attr->SetFontStyle(style);
}
else
attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_ITALIC));
else
weight = wxNORMAL;
- wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT);
- font.SetWeight(weight);
- wxSetFontPreservingStyles(*attr, font);
- attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_WEIGHT);
+ attr->SetFontWeight(weight);
}
else
attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_WEIGHT));
else
underlined = false;
- wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT);
- font.SetUnderlined(underlined);
- wxSetFontPreservingStyles(*attr, font);
- attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE);
+ attr->SetFontUnderlined(underlined);
}
else
attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_UNDERLINE));
}
else
attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR));
-
+
if (m_strikethroughCtrl->Get3StateValue() != wxCHK_UNDETERMINED)
{
attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH);
if (m_capitalsCtrl->Get3StateValue() != wxCHK_UNDETERMINED)
{
attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_CAPITALS);
-
+
if (m_capitalsCtrl->Get3StateValue() == wxCHK_CHECKED)
attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_CAPITALS);
else
wxPanel::TransferDataToWindow();
m_dontUpdate = true;
- wxTextAttrEx* attr = GetAttributes();
+ wxTextAttr* attr = GetAttributes();
- if (attr->HasFont() && attr->HasFaceName())
+ if (attr->HasFontFaceName())
{
- m_faceTextCtrl->SetValue(attr->GetFont().GetFaceName());
+ m_faceTextCtrl->SetValue(attr->GetFontFaceName());
m_faceListBox->SetFaceNameSelection(attr->GetFont().GetFaceName());
}
else
m_faceListBox->SetFaceNameSelection(wxEmptyString);
}
- if (attr->HasFont() && attr->HasSize())
+ if (attr->HasFontSize())
{
- wxString strSize = wxString::Format(wxT("%d"), attr->GetFont().GetPointSize());
+ wxString strSize = wxString::Format(wxT("%d"), attr->GetFontSize());
m_sizeTextCtrl->SetValue(strSize);
if (m_sizeListBox->FindString(strSize) != wxNOT_FOUND)
m_sizeListBox->SetStringSelection(strSize);
m_sizeListBox->SetSelection(wxNOT_FOUND);
}
- if (attr->HasFont() && attr->HasWeight())
+ if (attr->HasFontWeight())
{
- if (attr->GetFont().GetWeight() == wxBOLD)
+ if (attr->GetFontWeight() == wxBOLD)
m_weightCtrl->SetSelection(1);
else
m_weightCtrl->SetSelection(0);
m_weightCtrl->SetSelection(wxNOT_FOUND);
}
- if (attr->HasFont() && attr->HasItalic())
+ if (attr->HasFontItalic())
{
- if (attr->GetFont().GetStyle() == wxITALIC)
+ if (attr->GetFontStyle() == wxITALIC)
m_styleCtrl->SetSelection(1);
else
m_styleCtrl->SetSelection(0);
m_styleCtrl->SetSelection(wxNOT_FOUND);
}
- if (attr->HasFont() && attr->HasUnderlined())
+ if (attr->HasFontUnderlined())
{
- if (attr->GetFont().GetUnderlined())
+ if (attr->GetFontUnderlined())
m_underliningCtrl->SetSelection(1);
else
m_underliningCtrl->SetSelection(0);
return true;
}
-wxTextAttrEx* wxRichTextFontPage::GetAttributes()
+wxTextAttr* wxRichTextFontPage::GetAttributes()
{
return wxRichTextFormattingDialog::GetDialogAttributes(this);
}
font.SetUnderlined(underlined);
}
-
+
int textEffects = 0;
if (m_strikethroughCtrl->Get3StateValue() == wxCHK_CHECKED)
{
if (arr[i].Mid(0, facename.Length()).Lower() == facename.Lower())
{
- m_faceListBox->ScrollToLine(i);
+ m_faceListBox->ScrollToRow(i);
break;
}
}