X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/603f702b4a0e19ffa27cffc52872efaac1aa8c54..43c42c18d36c703a88b1b7b697bac27fe5608eca:/include/wx/richtext/richtextuicustomization.h diff --git a/include/wx/richtext/richtextuicustomization.h b/include/wx/richtext/richtextuicustomization.h index ea20a60d69..428d7dc4fd 100644 --- a/include/wx/richtext/richtextuicustomization.h +++ b/include/wx/richtext/richtextuicustomization.h @@ -14,6 +14,8 @@ #if wxUSE_RICHTEXT +#include "wx/window.h" + /** @class wxRichTextUICustomization The base class for functionality to plug in to various rich text control dialogs, @@ -22,9 +24,9 @@ The application will typically have calls like this in its initialisation: - wxRichTextFormattingDialog::SetHelpId(ID_HELP_FORMATTINGDIALOG); - wxRichTextFormattingDialog::SetUICustomization(& wxGetApp().GetRichTextUICustomization()); - wxRichTextBordersPage::SetHelpId(ID_HELP_BORDERSPAGE); + wxRichTextFormattingDialog::GetHelpInfo().SetHelpId(ID_HELP_FORMATTINGDIALOG); + wxRichTextFormattingDialog::GetHelpInfo().SetUICustomization(& wxGetApp().GetRichTextUICustomization()); + wxRichTextBordersPage::GetHelpInfo().SetHelpId(ID_HELP_BORDERSPAGE); Only the wxRichTextFormattingDialog class needs to have its customization object and help id set, though the application set them for individual pages if it wants. @@ -58,10 +60,10 @@ public: virtual bool ShowHelp(wxWindow* win) { - if (m_uiCustomization && m_helpTopic != -1) - return m_uiCustomization->ShowHelp(win, m_helpTopic); - else + if ( !m_uiCustomization || m_helpTopic == -1 ) return false; + + return m_uiCustomization->ShowHelp(win, m_helpTopic); } /// Get the help topic identifier. @@ -107,6 +109,8 @@ protected: virtual wxRichTextUICustomization* GetUICustomization() const { return sm_helpInfo.GetUICustomization(); } \ virtual void SetUICustomization(wxRichTextUICustomization* customization) { sm_helpInfo.SetUICustomization(customization); } \ virtual bool ShowHelp(wxWindow* win) { return sm_helpInfo.ShowHelp(win); } \ +public: \ + static wxRichTextHelpInfo& GetHelpInfo() { return sm_helpInfo; }\ protected: \ static wxRichTextHelpInfo sm_helpInfo; \ public: