wxHelpProvider now cleans itself up. wxTipWindow doesn't
grab the mouse, but instead deletes itself when it's deactivated or loses the focus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "wx/tipwin.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/cshelp.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -312,4 +312,38 @@ bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxHelpProviderModule: module responsible for cleaning up help provider.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxHelpProviderModule : public wxModule
|
||||
{
|
||||
public:
|
||||
bool OnInit();
|
||||
void OnExit();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxHelpProviderModule)
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxHelpProviderModule, wxModule)
|
||||
|
||||
bool wxHelpProviderModule::OnInit()
|
||||
{
|
||||
// Probably we don't want to do anything by default,
|
||||
// since it could pull in extra code
|
||||
// wxHelpProvider::Set(new wxSimpleHelpProvider);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxHelpProviderModule::OnExit()
|
||||
{
|
||||
if (wxHelpProvider::Get())
|
||||
{
|
||||
delete wxHelpProvider::Get();
|
||||
wxHelpProvider::Set(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
|
Reference in New Issue
Block a user