Class: Wx::SF::ShapeKeyEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/wx/shapes/events.rb

Overview

Class encapsulates Wx::SF shape’s key down event.

Instance Method Summary collapse

Constructor Details

#initialize(evt_type = Wx::EVT_NULL, id = 0) ⇒ ShapeKeyEvent

Constructor

Parameters:

  • evt_type (Integer) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)


49
50
51
52
53
# File 'lib/wx/shapes/events.rb', line 49

def initialize(evt_type = Wx::EVT_NULL, id = 0)
  super(evt_type, id.to_i)
  @shape = nil
  @key_code = 0
end

Instance Method Details

#get_key_codeObject Also known as: key_code

Get key code.

Returns:

  • Code of pressed key



78
79
80
# File 'lib/wx/shapes/events.rb', line 78

def get_key_code
  @key_code
end

#get_shapeWx::SF::Shape? Also known as: shape

Get a shape object from the event object.

Returns:



64
65
66
# File 'lib/wx/shapes/events.rb', line 64

def get_shape
  @shape
end

#set_key_code(key_code) ⇒ Object Also known as: key_code=

Set key code.

Parameters:

  • key_code (Integer)

    Code of pressed key



71
72
73
# File 'lib/wx/shapes/events.rb', line 71

def set_key_code(key_code)
  @key_code = key_code
end

#set_shape(shape) ⇒ Object Also known as: shape=

Insert a shape object to the event object.

Parameters:



57
58
59
# File 'lib/wx/shapes/events.rb', line 57

def set_shape(shape)
  @shape = shape
end