commit f111201a469fd1c1dccb143e089cc623ce35025d
parent 7e2bb889e617302c82e28d04cb2e0db5d35fbb08
Author: Hamish Downer <dmishd@gmail.com>
Date: Tue, 8 Feb 2011 23:53:13 +0000
added @changed_by_user to HorizontalSelector
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/sup/horizontal-selector.rb b/lib/sup/horizontal-selector.rb
@@ -1,7 +1,7 @@
module Redwood
class HorizontalSelector
- attr_accessor :label
+ attr_accessor :label, :changed_by_user
def initialize label, vals, labels, base_color=:horizontal_selector_unselected_color, selected_color=:horizontal_selector_selected_color
@label = label
@@ -10,6 +10,7 @@ class HorizontalSelector
@base_color = base_color
@selected_color = selected_color
@selection = 0
+ @changed_by_user = false
end
def set_to val; @selection = @vals.index(val) end
@@ -37,10 +38,12 @@ class HorizontalSelector
def roll_left
@selection = (@selection - 1) % @labels.length
+ @changed_by_user = true
end
def roll_right
@selection = (@selection + 1) % @labels.length
+ @changed_by_user = true
end
end