itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString m_symbolCtrlStrings;
- m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
+ m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxT(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
m_symbolCtrl->SetHelpText(_("The bullet character."));
if (wxRichTextBulletsPage::ShowToolTips())
m_symbolCtrl->SetToolTip(_("The bullet character."));
itemBoxSizer18->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_symbolFontCtrlStrings;
- m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
+ m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
m_symbolFontCtrl->SetHelpText(_("Available fonts."));
if (wxRichTextBulletsPage::ShowToolTips())
m_symbolFontCtrl->SetToolTip(_("Available fonts."));
itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_bulletNameCtrlStrings;
- m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
+ m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
if (wxRichTextBulletsPage::ShowToolTips())
m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
+ m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxT("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
m_numberCtrl->SetHelpText(_("The list item number."));
if (wxRichTextBulletsPage::ShowToolTips())
m_numberCtrl->SetToolTip(_("The list item number."));
if (wxRichTextBuffer::GetRenderer())
wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
- m_bulletNameCtrl->Append(standardBulletNames);
+ size_t i;
+ for (i = 0; i < standardBulletNames.GetCount(); i++)
+ m_bulletNameCtrl->Append(wxGetTranslation(standardBulletNames[i]));
wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
facenames.Sort();
{
wxPanel::TransferDataFromWindow();
- wxTextAttr* attr = GetAttributes();
+ wxRichTextAttr* attr = GetAttributes();
if (m_hasBulletStyle)
{
else if (index == wxRICHTEXT_BULLETINDEX_STANDARD)
{
bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD;
- attr->SetBulletName(m_bulletNameCtrl->GetValue());
+ wxArrayString standardBulletNames;
+ if (wxRichTextBuffer::GetRenderer() && m_bulletNameCtrl->GetSelection() != wxNOT_FOUND)
+ {
+ int sel = m_bulletNameCtrl->GetSelection();
+ wxString selName = m_bulletNameCtrl->GetString(sel);
+
+ // Try to get the untranslated name using the current selection index of the combobox.
+ // into account.
+ wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
+ if (sel < (int) standardBulletNames.GetCount() && m_bulletNameCtrl->GetValue() == selName)
+ attr->SetBulletName(standardBulletNames[sel]);
+ else
+ attr->SetBulletName(m_bulletNameCtrl->GetValue());
+ }
+ else
+ attr->SetBulletName(m_bulletNameCtrl->GetValue());
}
if (m_parenthesesCtrl->GetValue())
wxPanel::TransferDataToWindow();
- wxTextAttr* attr = GetAttributes();
+ wxRichTextAttr* attr = GetAttributes();
if (attr->HasBulletStyle())
{
m_numberCtrl->SetValue(0);
if (attr->HasBulletName())
- m_bulletNameCtrl->SetValue(attr->GetBulletName());
+ {
+ wxArrayString standardBulletNames;
+ if (wxRichTextBuffer::GetRenderer())
+ {
+ // Try to set the control by index in order to take translated combo control strings
+ // into account.
+ wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
+ int idx = standardBulletNames.Index(attr->GetBulletName());
+ if (idx != -1 && idx < (int) m_bulletNameCtrl->GetCount())
+ m_bulletNameCtrl->SetSelection(idx);
+ else
+ m_bulletNameCtrl->SetValue(attr->GetBulletName());
+ }
+ else
+ m_bulletNameCtrl->SetValue(attr->GetBulletName());
+ }
else
m_bulletNameCtrl->SetValue(wxEmptyString);
iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
TransferDataFromWindow();
- wxTextAttr attr(*GetAttributes());
+ wxRichTextAttr attr(*GetAttributes());
attr.SetFlags(attr.GetFlags() &
(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|
wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|
font.SetPointSize(9);
m_previewCtrl->SetFont(font);
- wxTextAttr normalParaAttr;
+ wxRichTextAttr normalParaAttr;
normalParaAttr.SetFont(font);
normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY")));
m_previewCtrl->Thaw();
}
-wxTextAttr* wxRichTextBulletsPage::GetAttributes()
+wxRichTextAttr* wxRichTextBulletsPage::GetAttributes()
{
return wxRichTextFormattingDialog::GetDialogAttributes(this);
}