Class: Wx::SF::ShapeEvent

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

Overview

Class encapsulates generic Wx::SF shape’s event.

Instance Method Summary collapse

Constructor Details

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

Constructor

Parameters:

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


11
12
13
14
15
# File 'lib/wx/shapes/events.rb', line 11

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

Instance Method Details

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

Get a shape object from the event object.

Returns:



26
27
28
# File 'lib/wx/shapes/events.rb', line 26

def get_shape
  @shape
end

#is_vetoedBoolean Also known as: vetoed?

Check if the event has been vetoed or not.

Returns:

  • (Boolean)

    true if the event has been vetoed.



33
34
35
# File 'lib/wx/shapes/events.rb', line 33

def is_vetoed
  @vetoed
end

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

Insert a shape object to the event object.

Parameters:



19
20
21
# File 'lib/wx/shapes/events.rb', line 19

def set_shape(shape)
  @shape = shape
end

#vetoObject

Set the veto flag to true.



39
40
41
# File 'lib/wx/shapes/events.rb', line 39

def veto
  @vetoed = true
end