Class: Wx::AcceleratorTable

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

Overview

An accelerator table allows the application to specify a table of keyboard shortcuts for menu or button commands.

The object NULL_ACCELERATOR_TABLE is defined to be a table with no data, and is the initial accelerator table for a window. Example:

entries = [
      Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'N', ID_NEW_WINDOW),
      Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'X', Wx::ID_EXIT),
      Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'A', Wx::ID_ABOUT),
      Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'N', Wx::ID_CUT)
    ]
  frame.accelerator_table = Wx::AcceleratorTable[entries]
Remark:

An accelerator takes precedence over normal processing and can be a convenient way to program some event handling. For example, you can use an accelerator table to enable a dialog with a multi-line text control to accept CTRL-Enter as meaning 'OK'.

Category: Data Structures Predefined objects/pointers: NULL_ACCELERATOR_TABLE

See Also:

Requires:

  • USE_ACCEL

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initializeWx::AcceleratorTable #initialize(entries) ⇒ Wx::AcceleratorTable #initialize(resource) ⇒ Wx::AcceleratorTable

Returns a new instance of AcceleratorTable.

Overloads:



171
# File 'lib/wx/doc/gen/accelerator.rb', line 171

def initialize(*args) end

Instance Method Details

#is_okBoolean Also known as: ok?

Returns true if the accelerator table is valid.

Returns:

  • (Boolean)


175
# File 'lib/wx/doc/gen/accelerator.rb', line 175

def is_ok; end