Class: Rabbit::SearchWindow
- Inherits:
-
Object
- Object
- Rabbit::SearchWindow
- Defined in:
- lib/rabbit/search-window.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#entry ⇒ Object
Returns the value of attribute entry.
-
#window ⇒ Object
Returns the value of attribute window.
Instance Method Summary collapse
- #destroy ⇒ Object
- #empty? ⇒ Boolean
- #forward=(forward) ⇒ Object
- #forward? ⇒ Boolean
-
#initialize(canvas) ⇒ SearchWindow
constructor
A new instance of SearchWindow.
- #regexp ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(canvas) ⇒ SearchWindow
Returns a new instance of SearchWindow.
9 10 11 12 13 |
# File 'lib/rabbit/search-window.rb', line 9 def initialize(canvas) @canvas = canvas @searcher = Searcher.new(canvas) init_window end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
8 9 10 |
# File 'lib/rabbit/search-window.rb', line 8 def direction @direction end |
#entry ⇒ Object
Returns the value of attribute entry.
8 9 10 |
# File 'lib/rabbit/search-window.rb', line 8 def entry @entry end |
#window ⇒ Object
Returns the value of attribute window.
8 9 10 |
# File 'lib/rabbit/search-window.rb', line 8 def window @window end |
Instance Method Details
#destroy ⇒ Object
20 21 22 23 |
# File 'lib/rabbit/search-window.rb', line 20 def destroy send_focus_change(false) @window.destroy end |
#empty? ⇒ Boolean
33 34 35 |
# File 'lib/rabbit/search-window.rb', line 33 def empty? /\A\s*\z/ =~ @entry.text end |
#forward=(forward) ⇒ Object
25 26 27 |
# File 'lib/rabbit/search-window.rb', line 25 def forward=(forward) @direction.active = forward end |
#forward? ⇒ Boolean
29 30 31 |
# File 'lib/rabbit/search-window.rb', line 29 def forward? @direction.active? end |
#regexp ⇒ Object
37 38 39 |
# File 'lib/rabbit/search-window.rb', line 37 def regexp @searcher.regexp(@entry.text) end |
#show ⇒ Object
15 16 17 18 |
# File 'lib/rabbit/search-window.rb', line 15 def show send_focus_change(true) @window.show end |