wxHelpProvider Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
wxHelpProvider Class Referenceabstract
Class List by Category » Help

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/cshelp.h>`

Inheritance diagram for wxHelpProvider:
[legend]

## Detailed Description

wxHelpProvider is an abstract class used by a program implementing context-sensitive help to show the help text for the given window.

The current help provider must be explicitly set by the application using Set().

##

Library: wxCore
Category: Help

See also
  wxContextHelp, wxContextHelpButton, wxSimpleHelpProvider, wxHelpControllerHelpProvider, wxWindow::SetHelpText(), wxWindow::GetHelpTextAtPoint()

## Public Member Functions
virtual | ~wxHelpProvider ()
| Virtual destructor for any base class.
virtual void | AddHelp (wxWindow *window, const wxString &text)
| Associates the text with the given window.
virtual void | AddHelp (wxWindowID id, const wxString &text)
| Associates the text with the given ID.
virtual wxString | GetHelp (const wxWindow *window)=0
| This version associates the given text with all windows with this id.
virtual void | RemoveHelp (wxWindow *window)
| Removes the association between the window pointer and the help text.
virtual bool | ShowHelp (wxWindow *window)
| Shows help for the given window.
virtual bool | ShowHelpAtPoint (wxWindow *window, const wxPoint &point, wxHelpEvent::Origin origin)
| This function may be overridden to show help for the window when it should depend on the position inside the window, By default this method forwards to ShowHelp(), so it is enough to only implement the latter if the help doesn't depend on the position.

## Static Public Member Functions
static wxHelpProvider * | Get ()
| Returns pointer to help provider instance.
static wxHelpProvider * | Set (wxHelpProvider *helpProvider)
| Set the current, application-wide help provider.

## Constructor & Destructor Documentation

## ◆ ~wxHelpProvider()

virtual wxHelpProvider::~wxHelpProvider | ( |  | ) |
| virtual

Virtual destructor for any base class.

## Member Function Documentation

## ◆ AddHelp() [1/2]

virtual void wxHelpProvider::AddHelp | ( | wxWindow * | window,
|  | const wxString & | text )
| virtual

Associates the text with the given window.

Remarks
  Although all help providers have these functions to allow making wxWindow::SetHelpText() work, not all of them implement the functions.

## ◆ AddHelp() [2/2]

virtual void wxHelpProvider::AddHelp | ( | wxWindowID | id,
|  | const wxString & | text )
| virtual

Associates the text with the given ID.

This help text will be shown for all windows with ID id, unless they have more specific help text associated using the other AddHelp() prototype. May be used to set the same help string for all Cancel buttons in the application, for example.

Remarks
  Although all help providers have these functions to allow making wxWindow::SetHelpText() work, not all of them implement the functions.

## ◆ Get()

wxHelpProvider * wxHelpProvider::Get | ( |  | ) |
| static

Returns pointer to help provider instance.

Unlike some other classes, the help provider is not created on demand. This must be explicitly done by the application using Set().

## ◆ GetHelp()

virtual wxString wxHelpProvider::GetHelp | ( | const wxWindow * | window | ) |
| pure virtual

This version associates the given text with all windows with this id.

May be used to set the same help string for all Cancel buttons in the application, for example.

## ◆ RemoveHelp()

virtual void wxHelpProvider::RemoveHelp | ( | wxWindow * | window | ) |
| virtual

Removes the association between the window pointer and the help text.

This is called by the wxWindow destructor. Without this, the table of help strings will fill up and when window pointers are reused, the wrong help string will be found.

## ◆ Set()

wxHelpProvider * wxHelpProvider::Set | ( | wxHelpProvider * | helpProvider | ) |
| static

Set the current, application-wide help provider.

Returns
  Pointer to previous help provider or NULL if there wasn't any.

## ◆ ShowHelp()

virtual bool wxHelpProvider::ShowHelp | ( | wxWindow * | window | ) |
| virtual

Shows help for the given window.

Override this function if the help doesn't depend on the exact position inside the window, otherwise you need to override ShowHelpAtPoint(). Returns true if help was shown, or false if no help was available for this window.

## ◆ ShowHelpAtPoint()

virtual bool wxHelpProvider::ShowHelpAtPoint | ( | wxWindow * | window,
|  | const wxPoint & | point,
|  | wxHelpEvent::Origin | origin )
| virtual

This function may be overridden to show help for the window when it should depend on the position inside the window, By default this method forwards to ShowHelp(), so it is enough to only implement the latter if the help doesn't depend on the position.

Parameters

  window | Window to show help text for.
  point | Coordinates of the mouse at the moment of help event emission.
  origin | Help event origin, see wxHelpEvent::GetOrigin.

Returns
  true if help was shown, or false if no help was available for this window.

Since
  2.7.0