Class: Wx::AcceleratorEntry

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

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

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:



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

def initialize(*args) end

Instance Method Details

#==(entry) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


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

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)


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

def from_string(str) end

#get_commandInteger Also known as: command

Returns the command identifier for the accelerator table entry.

Returns:

  • (Integer)


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

def get_command; end

#get_flagsInteger Also known as: flags

Returns the flags for the accelerator table entry.

Returns:

  • (Integer)


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

def get_flags; end

#get_key_codeInteger Also known as: key_code

Returns the keycode for the accelerator table entry.

Returns:

  • (Integer)


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

def get_key_code; end

#get_menu_itemWx::MenuItem Also known as: menu_item

Returns the menu item associated with this accelerator entry.

Returns:



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

def get_menu_item; end

#is_okBoolean Also known as: ok?

Returns true if this object is correctly initialized.

Returns:

  • (Boolean)


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

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.



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

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)


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

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)


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

def to_string; end