X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2fce6547622ff5f9e4ec31372b0f6172e87edefa..683df83d51c0f080e2e5210dc8115be0cb30d1ad:/src/richtext/richtextbulletspage.cpp diff --git a/src/richtext/richtextbulletspage.cpp b/src/richtext/richtextbulletspage.cpp index 58cb7f52dd..a43b9ada3c 100644 --- a/src/richtext/richtextbulletspage.cpp +++ b/src/richtext/richtextbulletspage.cpp @@ -11,21 +11,22 @@ #if wxUSE_RICHTEXT +#include "wx/spinctrl.h" +#include "wx/utils.h" #include "wx/richtext/richtextbulletspage.h" - #include "wx/richtext/richtextsymboldlg.h" /*! * wxRichTextBulletsPage type definition */ -IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage, wxPanel ) +IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage, wxRichTextDialogPage ) /*! * wxRichTextBulletsPage event table definition */ -BEGIN_EVENT_TABLE( wxRichTextBulletsPage, wxPanel ) +BEGIN_EVENT_TABLE( wxRichTextBulletsPage, wxRichTextDialogPage ) ////@begin wxRichTextBulletsPage event table entries EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxRichTextBulletsPage::OnStylelistboxSelected ) @@ -72,6 +73,8 @@ BEGIN_EVENT_TABLE( wxRichTextBulletsPage, wxPanel ) END_EVENT_TABLE() +IMPLEMENT_HELP_PROVISION(wxRichTextBulletsPage) + /*! * wxRichTextBulletsPage constructors */ @@ -119,7 +122,7 @@ void wxRichTextBulletsPage::Init() bool wxRichTextBulletsPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) { ////@begin wxRichTextBulletsPage creation - wxPanel::Create( parent, id, pos, size, style ); + wxRichTextDialogPage::Create( parent, id, pos, size, style ); CreateControls(); if (GetSizer()) @@ -137,11 +140,13 @@ bool wxRichTextBulletsPage::Create( wxWindow* parent, wxWindowID id, const wxPoi void wxRichTextBulletsPage::CreateControls() { + m_dontUpdate = true; + ////@begin wxRichTextBulletsPage content construction - wxRichTextBulletsPage* itemPanel1 = this; + wxRichTextBulletsPage* itemRichTextDialogPage1 = this; wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); + itemRichTextDialogPage1->SetSizer(itemBoxSizer2); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); @@ -152,11 +157,11 @@ void wxRichTextBulletsPage::CreateControls() wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5); - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText6 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_styleListBoxStrings; - m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE ); + m_styleListBox = new wxListBox( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE ); m_styleListBox->SetHelpText(_("The available bullet styles.")); if (wxRichTextBulletsPage::ShowToolTips()) m_styleListBox->SetToolTip(_("The available bullet styles.")); @@ -165,21 +170,21 @@ void wxRichTextBulletsPage::CreateControls() wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer5->Add(itemBoxSizer8, 0, wxGROW, 5); - m_periodCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 ); + m_periodCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 ); m_periodCtrl->SetValue(false); m_periodCtrl->SetHelpText(_("Check to add a period after the bullet.")); if (wxRichTextBulletsPage::ShowToolTips()) m_periodCtrl->SetToolTip(_("Check to add a period after the bullet.")); itemBoxSizer8->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_parenthesesCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_parenthesesCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 ); m_parenthesesCtrl->SetValue(false); m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses.")); if (wxRichTextBulletsPage::ShowToolTips()) m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses.")); itemBoxSizer8->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_rightParenthesisCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rightParenthesisCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 ); m_rightParenthesisCtrl->SetValue(false); m_rightParenthesisCtrl->SetHelpText(_("Check to add a right parenthesis.")); if (wxRichTextBulletsPage::ShowToolTips()) @@ -188,14 +193,14 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - wxStaticText* itemStaticText13 = new wxStaticText( itemPanel1, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText13 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_bulletAlignmentCtrlStrings; m_bulletAlignmentCtrlStrings.Add(_("Left")); m_bulletAlignmentCtrlStrings.Add(_("Centre")); m_bulletAlignmentCtrlStrings.Add(_("Right")); - m_bulletAlignmentCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY ); + m_bulletAlignmentCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY ); m_bulletAlignmentCtrl->SetStringSelection(_("Left")); m_bulletAlignmentCtrl->SetHelpText(_("The bullet character.")); if (wxRichTextBulletsPage::ShowToolTips()) @@ -204,7 +209,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - wxStaticLine* itemStaticLine16 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + wxStaticLine* itemStaticLine16 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); itemBoxSizer4->Add(itemStaticLine16, 0, wxGROW|wxLEFT|wxRIGHT, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); @@ -212,32 +217,32 @@ void wxRichTextBulletsPage::CreateControls() wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer18, 0, wxGROW, 5); - wxStaticText* itemStaticText19 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer18->Add(itemBoxSizer19, 0, wxGROW, 5); - wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer18->Add(itemBoxSizer20, 0, wxGROW, 5); + wxStaticText* itemStaticText20 = new wxStaticText( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); + 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( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxEmptyString, wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); m_symbolCtrl->SetHelpText(_("The bullet character.")); if (wxRichTextBulletsPage::ShowToolTips()) m_symbolCtrl->SetToolTip(_("The bullet character.")); - itemBoxSizer20->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5); + itemBoxSizer19->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5); - wxButton* itemButton22 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton22 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 ); itemButton22->SetHelpText(_("Click to browse for a symbol.")); if (wxRichTextBulletsPage::ShowToolTips()) itemButton22->SetToolTip(_("Click to browse for a symbol.")); - itemBoxSizer20->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer19->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer18->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - wxStaticText* itemStaticText24 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText24 = new wxStaticText( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 ); 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( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); m_symbolFontCtrl->SetHelpText(_("Available fonts.")); if (wxRichTextBulletsPage::ShowToolTips()) m_symbolFontCtrl->SetToolTip(_("Available fonts.")); @@ -245,11 +250,11 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); - wxStaticText* itemStaticText27 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText27 = new wxStaticText( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 ); 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( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); m_bulletNameCtrl->SetHelpText(_("A standard bullet name.")); if (wxRichTextBulletsPage::ShowToolTips()) m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); @@ -257,10 +262,10 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); - wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText30 = new wxStaticText( itemRichTextDialogPage1, 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( itemRichTextDialogPage1, 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.")); @@ -268,7 +273,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); + m_previewCtrl = new wxRichTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxBORDER_THEME|wxVSCROLL|wxTE_READONLY ); m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings.")); if (wxRichTextBulletsPage::ShowToolTips()) m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings.")); @@ -276,6 +281,9 @@ void wxRichTextBulletsPage::CreateControls() ////@end wxRichTextBulletsPage content construction + if (wxGetDisplaySize().y < 600) + m_previewCtrl->SetMinSize(wxSize(350, 50)); + m_styleListBox->Append(_("(None)")); m_styleListBox->Append(_("Arabic")); m_styleListBox->Append(_("Upper case letters")); @@ -297,12 +305,16 @@ void wxRichTextBulletsPage::CreateControls() 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(); m_symbolFontCtrl->Append(facenames); + + m_dontUpdate = false; } /// Transfer data from/to window @@ -310,13 +322,26 @@ bool wxRichTextBulletsPage::TransferDataFromWindow() { wxPanel::TransferDataFromWindow(); - wxTextAttr* attr = GetAttributes(); + wxRichTextAttr* attr = GetAttributes(); + + int index = m_styleListBox->GetSelection(); + if (index < 1) + { + m_hasBulletStyle = false; + m_hasBulletNumber = false; + m_hasBulletSymbol = false; + attr->SetBulletStyle(wxTEXT_ATTR_BULLET_STYLE_NONE); + attr->SetFlags(attr->GetFlags() & ~(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME)); + } + else + { + m_hasBulletStyle = true; + } if (m_hasBulletStyle) { long bulletStyle = wxRICHTEXT_BULLETINDEX_NONE; - int index = m_styleListBox->GetSelection(); if (index == wxRICHTEXT_BULLETINDEX_ARABIC) bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ARABIC; @@ -339,12 +364,33 @@ bool wxRichTextBulletsPage::TransferDataFromWindow() bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL; else if (index == wxRICHTEXT_BULLETINDEX_BITMAP) + { bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP; + if (m_bulletNameCtrl->GetValue().IsEmpty()) + attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BULLET_NAME); + else + attr->SetBulletName(m_bulletNameCtrl->GetValue()); + } 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()) @@ -383,7 +429,7 @@ bool wxRichTextBulletsPage::TransferDataToWindow() wxPanel::TransferDataToWindow(); - wxTextAttr* attr = GetAttributes(); + wxRichTextAttr* attr = GetAttributes(); if (attr->HasBulletStyle()) { @@ -462,7 +508,22 @@ bool wxRichTextBulletsPage::TransferDataToWindow() 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); @@ -477,16 +538,16 @@ bool wxRichTextBulletsPage::TransferDataToWindow() void wxRichTextBulletsPage::UpdatePreview() { static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ -Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus."); +Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n"); - static const wxChar* s_para2 = wxT("\nDuis pharetra consequat dui. Cum sociis natoque penatibus \ -et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum."); + static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Cum sociis natoque penatibus \ +et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.\n"); - static const wxChar* s_para3 = wxT("\nInteger convallis dolor at augue \ + static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \ 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| @@ -496,7 +557,7 @@ iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); font.SetPointSize(9); m_previewCtrl->SetFont(font); - wxTextAttr normalParaAttr; + wxRichTextAttr normalParaAttr; normalParaAttr.SetFont(font); normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY"))); @@ -520,7 +581,7 @@ iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); m_previewCtrl->Thaw(); } -wxTextAttr* wxRichTextBulletsPage::GetAttributes() +wxRichTextAttr* wxRichTextBulletsPage::GetAttributes() { return wxRichTextFormattingDialog::GetDialogAttributes(this); } @@ -561,7 +622,7 @@ wxIcon wxRichTextBulletsPage::GetIconResource( const wxString& name ) } /*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX + * wxEVT_LISTBOX event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX */ void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(event) ) @@ -578,7 +639,7 @@ void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(eve } /*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL + * wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL */ void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event) ) @@ -591,7 +652,7 @@ void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event } /*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL + * wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL */ void wxRichTextBulletsPage::OnSymbolctrlUpdated( wxCommandEvent& WXUNUSED(event) ) @@ -613,7 +674,7 @@ void wxRichTextBulletsPage::OnSymbolctrlUpdate( wxUpdateUIEvent& event ) } /*! - * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL + * wxEVT_SPINCTRL event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL */ void wxRichTextBulletsPage::OnNumberctrlUpdated( wxSpinEvent& WXUNUSED(event) ) @@ -652,7 +713,7 @@ void wxRichTextBulletsPage::OnNumberctrlDown( wxSpinEvent& WXUNUSED(event) ) } /*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL + * wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL */ void wxRichTextBulletsPage::OnNumberctrlTextUpdated( wxCommandEvent& WXUNUSED(event) ) @@ -674,7 +735,7 @@ void wxRichTextBulletsPage::OnNumberctrlUpdate( wxUpdateUIEvent& event ) } /*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL + * wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL */ void wxRichTextBulletsPage::OnParenthesesctrlClick( wxCommandEvent& WXUNUSED(event) ) @@ -699,7 +760,7 @@ void wxRichTextBulletsPage::OnParenthesesctrlUpdate( wxUpdateUIEvent& event ) } /*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL + * wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL */ void wxRichTextBulletsPage::OnPeriodctrlClick( wxCommandEvent& WXUNUSED(event) ) @@ -724,7 +785,7 @@ void wxRichTextBulletsPage::OnPeriodctrlUpdate( wxUpdateUIEvent& event ) } /*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL + * wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL */ void wxRichTextBulletsPage::OnChooseSymbolClick( wxCommandEvent& WXUNUSED(event) ) @@ -759,7 +820,7 @@ void wxRichTextBulletsPage::OnChooseSymbolUpdate( wxUpdateUIEvent& event ) OnSymbolUpdate(event); } /*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL + * wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL */ void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(event) ) @@ -770,7 +831,7 @@ void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(e } /*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL + * wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL */ void wxRichTextBulletsPage::OnSymbolfontctrlUpdated( wxCommandEvent& WXUNUSED(event) ) @@ -811,7 +872,7 @@ void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent& event ) void wxRichTextBulletsPage::OnStandardBulletUpdate( wxUpdateUIEvent& event ) { int sel = m_styleListBox->GetSelection(); - event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD ); + event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD || sel == wxRICHTEXT_BULLETINDEX_BITMAP ); } @@ -845,7 +906,7 @@ void wxRichTextBulletsPage::OnNamestaticUpdate( wxUpdateUIEvent& event ) /*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL + * wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL */ void wxRichTextBulletsPage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) ) @@ -856,7 +917,7 @@ void wxRichTextBulletsPage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) } /*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL + * wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL */ void wxRichTextBulletsPage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) ) @@ -877,7 +938,7 @@ void wxRichTextBulletsPage::OnNamectrlUIUpdate( wxUpdateUIEvent& event ) #endif // wxUSE_RICHTEXT /*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL + * wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL */ void wxRichTextBulletsPage::OnRightParenthesisCtrlClick( wxCommandEvent& WXUNUSED(event) ) @@ -902,7 +963,7 @@ void wxRichTextBulletsPage::OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event } /*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX + * wxEVT_COMBOBOX event handler for ID_COMBOBOX */ void wxRichTextBulletsPage::OnBulletAlignmentCtrlSelected( wxCommandEvent& WXUNUSED(event) )