Class: Wx::AcceleratorEntry

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

Overview

An object used by an application wishing to create an accelerator table (see AcceleratorTable).

Category: Data Structures

See Also:

Requires:

  • USE_ACCEL

Instance Method Summary collapse

Constructor Details

#initialize(flags = 0, keyCode = 0, cmd = 0, item = nil) ⇒ Wx::AcceleratorEntry #initialize(entry) ⇒ Wx::AcceleratorEntry

Returns a new instance of AcceleratorEntry.

Overloads:

  • #initialize(flags = 0, keyCode = 0, cmd = 0, item = nil) ⇒ Wx::AcceleratorEntry

    Constructor.

    Parameters:

    • flags (Integer) (defaults to: 0)

      A combination of the Wx::AcceleratorEntryFlags values, which indicates which modifier keys are held down.

    • keyCode (Integer, String) (defaults to: 0)

      The keycode (or character) to be detected. See KeyCode for a full list of keycodes.

    • cmd (Integer) (defaults to: 0)

      The menu or control command identifier (ID).

    • item (Wx::MenuItem) (defaults to: nil)

      The menu item associated with this accelerator.

  • #initialize(entry) ⇒ Wx::AcceleratorEntry

    Copy ctor.

    Parameters:



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

def initialize(*args) end

Instance Method Details

#==(entry) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


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

def ==(entry) end

#from_string(str) ⇒ Boolean

Parses the given string and sets the accelerator accordingly.

true if the given string correctly initialized this object (i.e. if #is_ok returns true after this call)

Parameters:

  • str (String)

    This string may be either in the same format as returned by #to_string, i.e. contain the accelerator itself only, or have the format of a full menu item text with i.e. Label TAB Accelerator. In the latter case, the part of the string before the TAB is ignored. Notice that the latter format is only supported for the compatibility with the previous wxWidgets versions and the new code should pass only the accelerator string itself to this function.

Returns:

  • (Boolean)


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

def from_string(str) end

#get_commandInteger Also known as: command

Returns the command identifier for the accelerator table entry.

Returns:

  • (Integer)


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

def get_command; end

#get_flagsInteger Also known as: flags

Returns the flags for the accelerator table entry.

Returns:

  • (Integer)


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

def get_flags; end

#get_key_codeInteger Also known as: key_code

Returns the keycode for the accelerator table entry.

Returns:

  • (Integer)


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

def get_key_code; end

#get_menu_itemWx::MenuItem Also known as: menu_item

Returns the menu item associated with this accelerator entry.

Returns:



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

def get_menu_item; end

#is_okBoolean Also known as: ok?

Returns true if this object is correctly initialized.

Returns:

  • (Boolean)


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

def is_ok; end

#set(flags, keyCode, cmd, item = nil) ⇒ void

This method returns an undefined value.

Sets the accelerator entry parameters.

Parameters:

  • flags (Integer)

    A combination of the Wx::AcceleratorEntryFlags values, which indicates which modifier keys are held down.

  • keyCode (Integer, String)

    The keycode to be detected. See KeyCode for a full list of keycodes.

  • cmd (Integer)

    The menu or control command identifier (ID).

  • item (Wx::MenuItem) (defaults to: nil)

    The menu item associated with this accelerator.



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

def set(flags, keyCode, cmd, item=nil) end

#to_raw_stringString

Returns a textual representation of this accelerator which is appropriate for saving in configuration files.

Unlike the string returned by #to_string, this one is never translated so, while it’s not suitable for showing to the user, it can be used to uniquely identify the accelerator independently of the user language. The returned string can still be parsed by #from_string.

Returns:

  • (String)


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

def to_raw_string; end

#to_stringString

Returns a textual representation of this accelerator.

The returned string is of the form [Alt+][Ctrl+][RawCtrl+][Shift+]Key where the modifier keys are present only if the corresponding flag is set.

Returns:

  • (String)


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

def to_string; end