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:
Julian Smart
2000-09-11 12:37:44 +00:00
parent afb02ca57c
commit 129caaddf1
5 changed files with 66 additions and 6 deletions

View File

@@ -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