1. added wxHelpProvider and (unfinished) wxSimpleHelpProvider

2. added wxStringHashTable which wxStringHashTable uses


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-09-10 12:43:37 +00:00
parent 6b6267d320
commit bd83cb56d2
8 changed files with 449 additions and 58 deletions

View File

@@ -53,6 +53,10 @@
#include "wx/dnd.h"
#endif // wxUSE_DRAG_AND_DROP
#if wxUSE_HELP
#include "wx/cshelp.h"
#endif // wxUSE_HELP
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
#endif // wxUSE_TOOLTIPS
@@ -77,6 +81,11 @@ BEGIN_EVENT_TABLE(wxWindowBase, wxEvtHandler)
EVT_SYS_COLOUR_CHANGED(wxWindowBase::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindowBase::OnInitDialog)
EVT_MIDDLE_DOWN(wxWindowBase::OnMiddleClick)
#if wxUSE_HELP
EVT_HELP(-1, wxWindowBase::OnHelp)
#endif // wxUSE_HELP
END_EVENT_TABLE()
// ============================================================================
@@ -838,6 +847,64 @@ void wxWindowBase::InitDialog()
GetEventHandler()->ProcessEvent(event);
}
// ----------------------------------------------------------------------------
// context-sensitive help support
// ----------------------------------------------------------------------------
#if wxUSE_HELP
// associate this help text with this window
void wxWindowBase::SetHelpText(const wxString& text)
{
wxHelpProvider *helpProvider = wxHelpProvider::Get();
if ( helpProvider )
{
helpProvider->AddHelp(this, text);
}
}
// associate this help text with all windows with the same id as this
// one
void wxWindowBase::SetHelpTextForId(const wxString& text)
{
wxHelpProvider *helpProvider = wxHelpProvider::Get();
if ( helpProvider )
{
helpProvider->AddHelp(GetId(), text);
}
}
// get the help string associated with this window (may be empty)
wxString wxWindowBase::GetHelpText() const
{
wxString text;
wxHelpProvider *helpProvider = wxHelpProvider::Get();
if ( helpProvider )
{
text = helpProvider->GetHelp(this);
}
return text;
}
// show help for this window
void wxWindowBase::OnHelp(wxHelpEvent& event)
{
wxHelpProvider *helpProvider = wxHelpProvider::Get();
if ( helpProvider )
{
if ( helpProvider->ShowHelp(this) )
{
// skip the event.Skip() below
return;
}
}
event.Skip();
}
#endif // wxUSE_HELP
// ----------------------------------------------------------------------------
// tooltips
// ----------------------------------------------------------------------------