Class: Wx::ContextHelp

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/context_help_button.rb

Overview

This class changes the cursor to a query and puts the application into a ‘context-sensitive help mode’.

When the user left-clicks on a window within the specified window, a EVT_HELP event is sent to that control, and the application may respond to it by popping up some help. For example:

# puts the application into a 'context-sensitive help mode' for my_window
  context_help = Wx::ContextHelp.new(my_window)
  ...
  ...
  # ends the 'context-sensitive help mode' for my_window
  context_help.end_context_help

There are a couple of ways to invoke this behaviour implicitly:

  • Use the DIALOG_EX_CONTEXTHELP style for a dialog (Windows only). This will put a question mark in the titlebar, and Windows will put the application into context-sensitive help mode automatically, with further programming.

  • Create a ContextHelpButton, whose predefined behaviour is to create a context help object. Normally you will write your application so that this button is only added to a dialog for non-Windows platforms (use DIALOG_EX_CONTEXTHELP on Windows).

Note that on macOS, the cursor does not change when in context-sensitive help mode.

Category: HELP

See Also:

Requires:

  • USE_HELP

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(window = nil, doNow = true) ⇒ Wx::ContextHelp

Constructs a context help object, calling #begin_context_help if doNow is true (the default).

If window is NULL, the top window is used.

Parameters:

  • window (Wx::Window) (defaults to: nil)
  • doNow (Boolean) (defaults to: true)


74
# File 'lib/wx/doc/gen/context_help_button.rb', line 74

def initialize(window=nil, doNow=true) end

Instance Method Details

#begin_context_help(window) ⇒ Boolean

Puts the application into context-sensitive help mode.

window is the window which will be used to catch events; if NULL, the top window will be used. Returns true if the application was successfully put into context-sensitive help mode. This function only returns when the event loop has finished.

Parameters:

Returns:

  • (Boolean)


82
# File 'lib/wx/doc/gen/context_help_button.rb', line 82

def begin_context_help(window) end

#end_context_helpBoolean

Ends context-sensitive help mode.

Not normally called by the application.

Returns:

  • (Boolean)


88
# File 'lib/wx/doc/gen/context_help_button.rb', line 88

def end_context_help; end