Class: Canis::ItemEvent
Overview
an event fired when an item that can be selected is toggled/selected
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
the item pressed such as toggle button.
-
#item_first ⇒ Object
readonly
if from a list.
- #item_last ⇒ Object readonly
-
#item_selectable ⇒ Object
readonly
item originating event such as list or collection.
-
#param_string ⇒ Object
readonly
for debugging etc.
- #state ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(item, item_selectable) ⇒ ItemEvent
constructor
i think only one is needed per object, so create once only.
- #set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
Constructor Details
#initialize(item, item_selectable) ⇒ ItemEvent
i think only one is needed per object, so create once only
3351 3352 3353 3354 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3351 def initialize item, item_selectable @item, @item_selectable = item, item_selectable end |
Instance Attribute Details
#item ⇒ Object (readonly)
the item pressed such as toggle button
3338 3339 3340 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3338 def item @item end |
#item_first ⇒ Object (readonly)
if from a list
3340 3341 3342 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3340 def item_first @item_first end |
#item_last ⇒ Object (readonly)
3341 3342 3343 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3341 def item_last @item_last end |
#item_selectable ⇒ Object (readonly)
item originating event such as list or collection
3339 3340 3341 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3339 def item_selectable @item_selectable end |
#param_string ⇒ Object (readonly)
for debugging etc
3342 3343 3344 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3342 def param_string @param_string end |
#state ⇒ Object (readonly)
3337 3338 3339 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3337 def state @state end |
Instance Method Details
#set(state, item_first = -1,, item_last = -1,, param_string = nil) ⇒ Object
3355 3356 3357 3358 3359 |
# File 'lib/canis/core/widgets/rwidget.rb', line 3355 def set state, item_first=-1, item_last=-1, param_string=nil @state, @item_first, @item_last, @param_string = state, item_first, item_last, param_string @param_string = "Item event fired: #{item}, #{state}" if param_string.nil? end |