From 3bb084c427932e54dddee186e580683b6d420881 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 18 Mar 2013 20:21:11 +0000 Subject: [PATCH] Fixed help for symbol picker and style manager dialogs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/richtext/richtextstyledlg.h | 3 +++ include/wx/richtext/richtextsymboldlg.h | 14 ++++++++--- src/richtext/richtextdialogs.pjd | 33 +++++++++++-------------- src/richtext/richtextstyledlg.cpp | 19 ++++++++------ src/richtext/richtextsymboldlg.cpp | 26 ++++++++++++++++--- 5 files changed, 61 insertions(+), 34 deletions(-) diff --git a/include/wx/richtext/richtextstyledlg.h b/include/wx/richtext/richtextstyledlg.h index ad21c024b1..9ca4c994e1 100644 --- a/include/wx/richtext/richtextstyledlg.h +++ b/include/wx/richtext/richtextstyledlg.h @@ -191,6 +191,9 @@ public: /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE void OnDeleteUpdate( wxUpdateUIEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_HELP + void OnHelpClick( wxCommandEvent& event ); + ////@end wxRichTextStyleOrganiserDialog event handler declarations ////@begin wxRichTextStyleOrganiserDialog member function declarations diff --git a/include/wx/richtext/richtextsymboldlg.h b/include/wx/richtext/richtextsymboldlg.h index c77884dc06..61526ad827 100644 --- a/include/wx/richtext/richtextsymboldlg.h +++ b/include/wx/richtext/richtextsymboldlg.h @@ -127,6 +127,12 @@ public: /// wxEVT_UPDATE_UI event handler for wxID_OK void OnOkUpdate( wxUpdateUIEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_HELP + void OnHelpClick( wxCommandEvent& event ); + + /// wxEVT_UPDATE_UI event handler for wxID_HELP + void OnHelpUpdate( wxUpdateUIEvent& event ); + ////@end wxSymbolPickerDialog event handler declarations ////@begin wxSymbolPickerDialog member function declarations @@ -134,15 +140,15 @@ public: wxString GetFontName() const { return m_fontName ; } void SetFontName(wxString value) { m_fontName = value ; } - wxString GetSymbol() const { return m_symbol ; } - void SetSymbol(wxString value) { m_symbol = value ; } - bool GetFromUnicode() const { return m_fromUnicode ; } void SetFromUnicode(bool value) { m_fromUnicode = value ; } wxString GetNormalTextFontName() const { return m_normalTextFontName ; } void SetNormalTextFontName(wxString value) { m_normalTextFontName = value ; } + wxString GetSymbol() const { return m_symbol ; } + void SetSymbol(wxString value) { m_symbol = value ; } + /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); @@ -163,9 +169,9 @@ public: #endif wxStdDialogButtonSizer* m_stdButtonSizer; wxString m_fontName; - wxString m_symbol; bool m_fromUnicode; wxString m_normalTextFontName; + wxString m_symbol; /// Control identifiers enum { ID_SYMBOLPICKERDIALOG = 10600, diff --git a/src/richtext/richtextdialogs.pjd b/src/richtext/richtextdialogs.pjd index 66c1a918a5..858e619281 100644 --- a/src/richtext/richtextdialogs.pjd +++ b/src/richtext/richtextdialogs.pjd @@ -8023,9 +8023,9 @@ 0 0 "m_fontName|wxString|FontName||0" - "m_symbol|wxString|Symbol||0" - "m_fromUnicode|bool|FromUnicode|true|0" - "m_normalTextFontName|wxString|NormalTextFontName|" + "m_fromUnicode|bool|FromUnicode|true|0" + "m_normalTextFontName|wxString|NormalTextFontName|" + "m_symbol|wxString|Symbol||0" "ID_SYMBOLPICKERDIALOG" 10600 "wxSymbolPickerDialog" @@ -8100,14 +8100,6 @@ "wbBoxSizerProxy" "Vertical" "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 0 0 0 @@ -9195,6 +9187,8 @@ 0 1 "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnHelpClick|NONE||wxSymbolPickerDialog" + "wxEVT_UPDATE_UI|OnHelpUpdate|NONE||" "wxID_HELP" 5009 "" @@ -9347,14 +9341,6 @@ "wbBoxSizerProxy" "Vertical" "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 0 0 0 @@ -10791,6 +10777,7 @@ 0 1 "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnHelpClick|NONE||wxRichTextStyleOrganiserDialog" "wxID_HELP" 5009 "" @@ -15158,6 +15145,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 diff --git a/src/richtext/richtextstyledlg.cpp b/src/richtext/richtextstyledlg.cpp index 40705cff21..dc29f844a5 100644 --- a/src/richtext/richtextstyledlg.cpp +++ b/src/richtext/richtextstyledlg.cpp @@ -44,28 +44,21 @@ BEGIN_EVENT_TABLE( wxRichTextStyleOrganiserDialog, wxDialog ) ////@begin wxRichTextStyleOrganiserDialog event table entries EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR, wxRichTextStyleOrganiserDialog::OnNewCharClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR, wxRichTextStyleOrganiserDialog::OnNewCharUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA, wxRichTextStyleOrganiserDialog::OnNewParaClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA, wxRichTextStyleOrganiserDialog::OnNewParaUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST, wxRichTextStyleOrganiserDialog::OnNewListClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST, wxRichTextStyleOrganiserDialog::OnNewListUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_BOX, wxRichTextStyleOrganiserDialog::OnNewBoxClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_BOX, wxRichTextStyleOrganiserDialog::OnNewBoxUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY, wxRichTextStyleOrganiserDialog::OnApplyClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY, wxRichTextStyleOrganiserDialog::OnApplyUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME, wxRichTextStyleOrganiserDialog::OnRenameClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME, wxRichTextStyleOrganiserDialog::OnRenameUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT, wxRichTextStyleOrganiserDialog::OnEditClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT, wxRichTextStyleOrganiserDialog::OnEditUpdate ) - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE, wxRichTextStyleOrganiserDialog::OnDeleteClick ) EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE, wxRichTextStyleOrganiserDialog::OnDeleteUpdate ) - + EVT_BUTTON( wxID_HELP, wxRichTextStyleOrganiserDialog::OnHelpClick ) ////@end wxRichTextStyleOrganiserDialog event table entries END_EVENT_TABLE() @@ -977,5 +970,15 @@ void wxRichTextStyleOrganiserDialog::OnNewBoxUpdate( wxUpdateUIEvent& event ) event.Enable((GetFlags() & wxRICHTEXT_ORGANISER_CREATE_STYLES) != 0); } +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_HELP + */ + +void wxRichTextStyleOrganiserDialog::OnHelpClick( wxCommandEvent& WXUNUSED(event) ) +{ + if ((GetHelpId() != -1) && GetUICustomization()) + ShowHelp(this); +} + #endif // wxUSE_RICHTEXT diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index 36d529fe46..85c07f0592 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -293,7 +293,6 @@ BEGIN_EVENT_TABLE( wxSymbolPickerDialog, wxDialog ) ////@begin wxSymbolPickerDialog event table entries EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_FONT, wxSymbolPickerDialog::OnFontCtrlSelected ) - #if defined(__UNICODE__) EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_SUBSET, wxSymbolPickerDialog::OnSubsetSelected ) EVT_UPDATE_UI( ID_SYMBOLPICKERDIALOG_SUBSET, wxSymbolPickerDialog::OnSymbolpickerdialogSubsetUpdate ) @@ -304,7 +303,8 @@ BEGIN_EVENT_TABLE( wxSymbolPickerDialog, wxDialog ) #endif EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) - + EVT_BUTTON( wxID_HELP, wxSymbolPickerDialog::OnHelpClick ) + EVT_UPDATE_UI( wxID_HELP, wxSymbolPickerDialog::OnHelpUpdate ) ////@end wxSymbolPickerDialog event table entries END_EVENT_TABLE() @@ -1292,4 +1292,24 @@ wxSymbolListCtrl::GetClassDefaultAttributes(wxWindowVariant variant) return wxListBox::GetClassDefaultAttributes(variant); } -#endif // wxUSE_RICHTEXT +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_HELP + */ + +void wxSymbolPickerDialog::OnHelpClick( wxCommandEvent& WXUNUSED(event) ) +{ + if ((GetHelpInfo().GetHelpId() != -1) && GetHelpInfo().GetUICustomization()) + ShowHelp(this); +} + +/*! + * wxEVT_UPDATE_UI event handler for wxID_HELP + */ + +void wxSymbolPickerDialog::OnHelpUpdate( wxUpdateUIEvent& event ) +{ + event.Enable((GetHelpInfo().GetHelpId() != -1) && GetHelpInfo().GetUICustomization()); +} + +#endif + // wxUSE_RICHTEXT -- 2.45.2