Class Fox::FXAccelTable
In: rdoc-sources/FXAccelTable.rb
Parent: FXObject

The accelerator table sends a message to a specific target object when the indicated key and modifier combination is pressed.

Methods

Public Class methods

Construct empty accelerator table.

Public Instance methods

Add an accelerator to the table. The hotKey is a code returned by the Fox.fxparseAccel method. For example, to associate the Ctrl+S keypress with sending a "save" command to a document, you might use code like this:

  hotKey = fxparseAccel("Ctrl+S")
  accelTable.addAccel(hotKey, doc, FXSEL(SEL_COMMAND, MyDocument::ID_SAVE))

Parameters:

hotKey:the hotkey associated with this accelerator [Integer]
target:message target [FXObject]
seldn:selector for the SEL_KEYPRESS event [Integer]
selup:selector for the SEL_KEYRELEASE event [Integer]

Return true if accelerator specified. Here, hotKey is a code representing an accelerator key as returned by the Fox.fxparseAccel method. For example,

  if accelTable.hasAccel?(fxparseAccel("Ctrl+S"))
    ...
  end

Remove an accelerator from the table.

Remove mapping for specified hot key. Here, hotKey is a code representing an accelerator key as returned by the Fox.fxparseAccel method. For example,

  accelTable.removeAccel(fxparseAccel("Ctrl+S"))

Return the target object of the given accelerator, or nil if the accelerator is not present in this accelerator table. Here, hotKey is a code representing an accelerator key as returned by the Fox.fxparseAccel method. For example,

  doc = accelTable.targetofAccel(fxparseAccel("Ctrl+S"))

[Validate]