Class: Cliptic::Menus::Select_Date
- Inherits:
-
Interface::Menu_With_Stats
- Object
- Curses::Window
- Windows::Window
- Interface::Menu_Box
- Interface::Menu
- Interface::Menu_With_Stats
- Cliptic::Menus::Select_Date
- Defined in:
- lib/cliptic/menus.rb
Constant Summary
Constants included from Chars
Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX
Instance Attribute Summary collapse
-
#earliest_date ⇒ Object
readonly
Returns the value of attribute earliest_date.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Attributes inherited from Interface::Menu_With_Stats
Attributes inherited from Interface::Menu
Attributes inherited from Interface::Menu_Box
#bot_b, #draw_bars, #logo, #top_b
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
- #ctrls ⇒ Object
-
#initialize ⇒ Select_Date
constructor
A new instance of Select_Date.
- #stat_date ⇒ Object
- #title ⇒ Object
Methods inherited from Interface::Menu_With_Stats
#enter, #hide, #reset_pos, #update_stats
Methods inherited from Interface::Menu
#back, #choose_opt, #enter, #hide, #redraw, #reset_pos, #show
Methods inherited from Interface::Menu_Box
#add_title, #draw, #line, #reset_pos
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #draw, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize ⇒ Select_Date
Returns a new instance of Select_Date.
20 21 22 23 24 |
# File 'lib/cliptic/menus.rb', line 20 def initialize @earliest_date = (Date.today << 9) + 1 set_date(date:Date.today) super(height:7, sel:Interface::Date_Selector) end |
Instance Attribute Details
#earliest_date ⇒ Object (readonly)
Returns the value of attribute earliest_date.
19 20 21 |
# File 'lib/cliptic/menus.rb', line 19 def earliest_date @earliest_date end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
19 20 21 |
# File 'lib/cliptic/menus.rb', line 19 def opts @opts end |
Instance Method Details
#ctrls ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cliptic/menus.rb', line 28 def ctrls super.merge({ ?h => ->{selector.cursor -= 1}, ?l => ->{selector.cursor += 1}, ?j => ->{inc_date(1)}, ?k => ->{inc_date(-1)}, 258 => ->{inc_date(1)}, 259 => ->{inc_date(-1)}, 260 => ->{selector.cursor -= 1}, 261 => ->{selector.cursor += 1} }) end |
#stat_date ⇒ Object
40 41 42 |
# File 'lib/cliptic/menus.rb', line 40 def stat_date Date.new(*@opts.reverse) end |
#title ⇒ Object
25 26 27 |
# File 'lib/cliptic/menus.rb', line 25 def title "Select Date" end |