rbcurse 1.1.5 → 1.2.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/CHANGELOG +45 -0
  2. data/Makefile +1 -1
  3. data/Manifest.txt +91 -0
  4. data/NOTES +349 -2
  5. data/README.markdown +12 -0
  6. data/VERSION +1 -1
  7. data/examples/abasiclist.rb +25 -0
  8. data/examples/alpmenu.rb +42 -0
  9. data/examples/app.rb +883 -0
  10. data/examples/appcombo.rb +17 -0
  11. data/examples/appdirtree.rb +73 -0
  12. data/examples/appemail.rb +164 -0
  13. data/examples/appemaillb.rb +308 -0
  14. data/examples/appgcompose.rb +303 -0
  15. data/examples/appgmail.rb +951 -0
  16. data/examples/atree.rb +56 -0
  17. data/examples/dirtree.rb +78 -0
  18. data/examples/focusmanager.rb +31 -0
  19. data/examples/imap.rb +48 -0
  20. data/examples/menu1.rb +79 -0
  21. data/examples/multispl.rb +86 -0
  22. data/examples/rfe.rb +3 -4
  23. data/examples/rmail.rb +188 -0
  24. data/examples/s.rb +10 -0
  25. data/examples/scrollbar.rb +104 -0
  26. data/examples/splitp.rb +56 -0
  27. data/examples/table1.rb +30 -0
  28. data/examples/term.rb +48 -0
  29. data/examples/term2.rb +54 -0
  30. data/examples/test1.rb +4 -2
  31. data/examples/test2.rb +9 -9
  32. data/examples/testapp.rb +44 -0
  33. data/examples/testapp2.rb +51 -0
  34. data/examples/testcombo.rb +2 -2
  35. data/examples/testgmail.rb +46 -0
  36. data/examples/testlistbox.rb +0 -1
  37. data/examples/testmultispl.rb +199 -0
  38. data/examples/testree.rb +127 -0
  39. data/examples/testscroller.rb +0 -1
  40. data/examples/testscrolllb.rb +1 -1
  41. data/examples/testscrollp.rb +2 -1
  42. data/examples/testscrollta.rb +1 -1
  43. data/examples/testscrolltable.rb +1 -2
  44. data/examples/testsplit.rb +1 -1
  45. data/examples/testsplit2.rb +1 -1
  46. data/examples/testsplit3.rb +1 -1
  47. data/examples/testsplit3_1.rb +1 -1
  48. data/examples/testsplit3a.rb +1 -1
  49. data/examples/testsplit3b.rb +1 -1
  50. data/examples/testsplitta.rb +1 -1
  51. data/examples/testsplittv.rb +1 -1
  52. data/examples/testsplittvv.rb +1 -1
  53. data/examples/testtodo.rb +491 -488
  54. data/examples/testvimsplit.rb +111 -0
  55. data/examples/todo.db +0 -0
  56. data/examples/todocsv.csv +28 -0
  57. data/examples/viewtodo.rb +408 -403
  58. data/lib/rbcurse/action.rb +1 -0
  59. data/lib/rbcurse/app.rb +1294 -0
  60. data/lib/rbcurse/applicationheader.rb +7 -2
  61. data/lib/rbcurse/checkboxcellrenderer.rb +0 -12
  62. data/lib/rbcurse/colormap.rb +34 -8
  63. data/lib/rbcurse/comboboxcellrenderer.rb +0 -11
  64. data/lib/rbcurse/defaultlistselectionmodel.rb +23 -7
  65. data/lib/rbcurse/extras/bottomline.rb +1681 -0
  66. data/lib/rbcurse/extras/directorylist.rb +445 -0
  67. data/lib/rbcurse/extras/directorytree.rb +69 -0
  68. data/lib/rbcurse/extras/divider.rb +310 -0
  69. data/lib/rbcurse/extras/focusmanager.rb +31 -0
  70. data/lib/rbcurse/extras/listselectable.rb +222 -0
  71. data/lib/rbcurse/extras/masterdetail.rb +164 -0
  72. data/lib/rbcurse/extras/menutree.rb +63 -0
  73. data/lib/rbcurse/extras/rlink.rb +27 -0
  74. data/lib/rbcurse/extras/rmenulink.rb +21 -0
  75. data/lib/rbcurse/extras/scrollbar.rb +134 -0
  76. data/lib/rbcurse/extras/stdscrwindow.rb +247 -0
  77. data/lib/rbcurse/extras/tabular.rb +258 -0
  78. data/lib/rbcurse/extras/tabularwidget.rb +1070 -0
  79. data/lib/rbcurse/extras/viewer.rb +106 -0
  80. data/lib/rbcurse/io.rb +137 -80
  81. data/lib/rbcurse/keylabelprinter.rb +4 -0
  82. data/lib/rbcurse/listcellrenderer.rb +91 -59
  83. data/lib/rbcurse/listscrollable.rb +93 -95
  84. data/lib/rbcurse/listselectable.rb +60 -7
  85. data/lib/rbcurse/ractionevent.rb +67 -0
  86. data/lib/rbcurse/rbasiclistbox.rb +688 -0
  87. data/lib/rbcurse/rcombo.rb +5 -5
  88. data/lib/rbcurse/rcommandwindow.rb +555 -0
  89. data/lib/rbcurse/rinputdataevent.rb +12 -0
  90. data/lib/rbcurse/rlistbox.rb +305 -124
  91. data/lib/rbcurse/rmenu.rb +99 -46
  92. data/lib/rbcurse/rmessagebox.rb +13 -6
  93. data/lib/rbcurse/rmulticontainer.rb +54 -93
  94. data/lib/rbcurse/rmultisplit.rb +731 -0
  95. data/lib/rbcurse/rmultitextview.rb +3 -2
  96. data/lib/rbcurse/rpopupmenu.rb +0 -1
  97. data/lib/rbcurse/rprogress.rb +117 -0
  98. data/lib/rbcurse/rscrollpane.rb +2 -1
  99. data/lib/rbcurse/rsplitpane.rb +94 -20
  100. data/lib/rbcurse/rsplitpane2.rb +1009 -0
  101. data/lib/rbcurse/rtabbedpane.rb +3 -2
  102. data/lib/rbcurse/rtabbedwindow.rb +0 -1
  103. data/lib/rbcurse/rtable.rb +92 -64
  104. data/lib/rbcurse/rtextarea.rb +91 -57
  105. data/lib/rbcurse/rtextview.rb +223 -70
  106. data/lib/rbcurse/rtree.rb +723 -0
  107. data/lib/rbcurse/rviewport.rb +2 -1
  108. data/lib/rbcurse/rvimsplit.rb +768 -0
  109. data/lib/rbcurse/rwidget.rb +524 -325
  110. data/lib/rbcurse/table/tablecellrenderer.rb +1 -1
  111. data/lib/rbcurse/table/tabledatecellrenderer.rb +0 -1
  112. data/lib/rbcurse/tree/treecellrenderer.rb +137 -0
  113. data/lib/rbcurse/tree/treemodel.rb +428 -0
  114. data/lib/rbcurse/vieditable.rb +14 -13
  115. data/lib/ver/ncurses.rb +6 -0
  116. data/lib/ver/window.rb +67 -32
  117. metadata +99 -23
  118. data/bin/rbcurse +0 -0
  119. data/examples/rvimsplit.rb +0 -376
  120. data/examples/todo.rb +0 -1
  121. data/lib/rbcurse/rform.rb +0 -845
  122. data/lib/rbcurse/selectable.rb +0 -94
  123. data/rbcurse.gemspec +0 -188
@@ -1,94 +0,0 @@
1
- ##
2
- # give the ability to a list, to allow for selection of rows.
3
- #
4
- module Selectable
5
- SELECT_CHAR = '>'
6
- # @param index of row in list, offset 0
7
- # This puts an > character on the first col of the selected row
8
- def do_select arow=@prow
9
- @implements_selectable = true
10
- win = get_window
11
- visual_index = row_visual_index arow
12
- sel = " "; r = arow+1;
13
- @selected ||= []
14
- if @selected.include? arow
15
- @selected.delete arow
16
- @list_attribs[arow] = {:status=> " ", :bgcolor => nil}
17
- sel = " "; color = $datacolor
18
- else
19
- $log.debug("Adding #{arow} #{@select_mode}")
20
- do_clear_selection if @select_mode != 'multiple'
21
- @selected << arow
22
- # 2008-11-25 21:00 added this just to see if it make things better
23
- @list_attribs[arow] = {:status=> SELECT_CHAR, :bgcolor => $selectedcolor}
24
- sel = SELECT_CHAR; color = $selectedcolor
25
- end
26
- # remember to erase these skidmarks when the user scrolls
27
- win.printstring @row+1+visual_index, @col+@left_margin-1, sel, color unless visual_index.nil?
28
- # fire ListComboSelect event, added TODO to test out.
29
- fire_handler :LIST_COMBO_SELECT, arow
30
- end
31
- ## is the row in view, if so, return index, else nil
32
- def row_visual_index arow
33
- if arow >= @toprow and arow <= @toprow+@scrollatrow
34
- $log.debug "return visual #{arow-@toprow} "
35
- return arow-@toprow
36
- end
37
- $log.debug "return visual NIL #{arow-@toprow} "
38
- nil
39
- end
40
- def do_next_selection
41
- return if @selected.length == 0
42
- row = @selected.sort.find { |i| i > @prow }
43
- row ||= @prow
44
- @prow = row
45
- end
46
- def do_prev_selection
47
- return if @selected.length == 0
48
- row = @selected.sort{|a,b| b <=> a}.find { |i| i < @prow }
49
- row ||= @prow
50
- @prow = row
51
- end
52
- # FIXME not clearing properly
53
- def do_clear_selection
54
- $log.debug " CALLED clear_sel "
55
- @selected.each {|sel|
56
- $log.debug " CLAER for #{sel}"
57
- do_select(sel)}
58
- end
59
- def get_selected_data
60
- return nil if @selected.nil?
61
- ret = []
62
- list = get_content
63
- @selected.each { |sel| ret << list[sel] }
64
- return ret
65
- end
66
- alias :get_selected_items :get_selected_data # data should be deprecated
67
- ##
68
- # XXX in case of single selection popup, only ENTER selects and it closes too firing PRESS.
69
- # in case of multiple selection and popup, space selects and fires COMBO_SELECT, but enter closes and fires
70
- # a different event, PRESS. This needs to be regularized.
71
- def selectable_handle_key ch
72
- begin
73
- case ch
74
- when ?;.getbyte(0), 32 # x no more selecting since we now jump to row matching char 2008-12-18 13:13
75
- return if is_popup and @select_mode == 'single' # not allowing select this way since there will be a difference
76
- # between pressing ENTER and space. Enter is trapped by Listbox!
77
- do_select
78
- when ?'.getbyte(0)
79
- $log.debug "insdie next selection"
80
- do_next_selection if @select_mode == 'multiple'
81
- when ?".getbyte(0)
82
- $log.debug "insdie prev selection"
83
- do_prev_selection if @select_mode == 'multiple'
84
- when ?\C-e.getbyte(0)
85
- do_clear_selection if @select_mode == 'multiple'
86
- else
87
- return :UNHANDLED
88
- end
89
- ensure
90
- #### post_key 2009-01-07 13:43
91
- end
92
- 0
93
- end
94
- end
data/rbcurse.gemspec DELETED
@@ -1,188 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{rbcurse}
8
- s.version = "1.1.5"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Rahul Kumar"]
12
- s.date = %q{2010-09-04}
13
- s.default_executable = %q{rbcurse}
14
- s.description = %q{Ruby curses widgets for easy application development on text terminals (ruby 1.9, 1.8)}
15
- s.email = %q{sentinel.2001@gmx.com}
16
- s.executables = ["rbcurse"]
17
- s.extra_rdoc_files = [
18
- "README.markdown",
19
- "TODO"
20
- ]
21
- s.files = [
22
- ".gitignore",
23
- "CHANGELOG",
24
- "History.txt",
25
- "Makefile",
26
- "Manifest.txt",
27
- "NOTES",
28
- "README.markdown",
29
- "TODO",
30
- "TODO2.txt",
31
- "VERSION",
32
- "bin/rbcurse",
33
- "examples/README.txt",
34
- "examples/data.txt",
35
- "examples/keytest.rb",
36
- "examples/mpad2.rb",
37
- "examples/newtesttabp.rb",
38
- "examples/qdfilechooser.rb",
39
- "examples/rfe.rb",
40
- "examples/rfe_renderer.rb",
41
- "examples/rvimsplit.rb",
42
- "examples/sqlc.rb",
43
- "examples/sqlm.rb",
44
- "examples/status.txt",
45
- "examples/test1.rb",
46
- "examples/test2.rb",
47
- "examples/testchars.rb",
48
- "examples/testcombo.rb",
49
- "examples/testkeypress.rb",
50
- "examples/testlistbox.rb",
51
- "examples/testmenu.rb",
52
- "examples/testmulticomp.rb",
53
- "examples/testscroller.rb",
54
- "examples/testscrolllb.rb",
55
- "examples/testscrollp.rb",
56
- "examples/testscrollta.rb",
57
- "examples/testscrolltable.rb",
58
- "examples/testsplit.rb",
59
- "examples/testsplit2.rb",
60
- "examples/testsplit3.rb",
61
- "examples/testsplit3_1.rb",
62
- "examples/testsplit3a.rb",
63
- "examples/testsplit3b.rb",
64
- "examples/testsplitta.rb",
65
- "examples/testsplittv.rb",
66
- "examples/testsplittvv.rb",
67
- "examples/testtable.rb",
68
- "examples/testtabp.rb",
69
- "examples/testtodo.rb",
70
- "examples/testtpane.rb",
71
- "examples/testtpane2.rb",
72
- "examples/testtpanetable.rb",
73
- "examples/todo.db",
74
- "examples/todo.yml",
75
- "examples/todocsv.csv",
76
- "examples/viewtodo.rb",
77
- "lib/rbcurse.rb",
78
- "lib/rbcurse/action.rb",
79
- "lib/rbcurse/applicationheader.rb",
80
- "lib/rbcurse/celleditor.rb",
81
- "lib/rbcurse/checkboxcellrenderer.rb",
82
- "lib/rbcurse/colormap.rb",
83
- "lib/rbcurse/comboboxcellrenderer.rb",
84
- "lib/rbcurse/defaultlistselectionmodel.rb",
85
- "lib/rbcurse/extras/tableextended.rb",
86
- "lib/rbcurse/io.rb",
87
- "lib/rbcurse/keylabelprinter.rb",
88
- "lib/rbcurse/listcellrenderer.rb",
89
- "lib/rbcurse/listeditable.rb",
90
- "lib/rbcurse/listkeys.rb",
91
- "lib/rbcurse/listscrollable.rb",
92
- "lib/rbcurse/listselectable.rb",
93
- "lib/rbcurse/mapper.rb",
94
- "lib/rbcurse/orderedhash.rb",
95
- "lib/rbcurse/rchangeevent.rb",
96
- "lib/rbcurse/rcombo.rb",
97
- "lib/rbcurse/rdialogs.rb",
98
- "lib/rbcurse/rform.rb",
99
- "lib/rbcurse/rinputdataevent.rb",
100
- "lib/rbcurse/rlistbox.rb",
101
- "lib/rbcurse/rmenu.rb",
102
- "lib/rbcurse/rmessagebox.rb",
103
- "lib/rbcurse/rmulticontainer.rb",
104
- "lib/rbcurse/rmultitextview.rb",
105
- "lib/rbcurse/rpopupmenu.rb",
106
- "lib/rbcurse/rscrollform.rb",
107
- "lib/rbcurse/rscrollpane.rb",
108
- "lib/rbcurse/rsplitpane.rb",
109
- "lib/rbcurse/rtabbedpane.rb",
110
- "lib/rbcurse/rtabbedwindow.rb",
111
- "lib/rbcurse/rtable.rb",
112
- "lib/rbcurse/rtextarea.rb",
113
- "lib/rbcurse/rtextview.rb",
114
- "lib/rbcurse/rviewport.rb",
115
- "lib/rbcurse/rwidget.rb",
116
- "lib/rbcurse/scrollable.rb",
117
- "lib/rbcurse/selectable.rb",
118
- "lib/rbcurse/table/tablecellrenderer.rb",
119
- "lib/rbcurse/table/tabledatecellrenderer.rb",
120
- "lib/rbcurse/undomanager.rb",
121
- "lib/rbcurse/vieditable.rb",
122
- "lib/ver/keyboard.rb",
123
- "lib/ver/keyboard2.rb",
124
- "lib/ver/ncurses.rb",
125
- "lib/ver/window.rb",
126
- "rbcurse.gemspec",
127
- "test/test_rbcurse.rb"
128
- ]
129
- s.homepage = %q{http://rbcurse.rubyforge.org/}
130
- s.rdoc_options = ["--charset=UTF-8"]
131
- s.require_paths = ["lib"]
132
- s.rubygems_version = %q{1.3.7}
133
- s.summary = %q{Ruby Curses Toolkit}
134
- s.test_files = [
135
- "test/test_rbcurse.rb",
136
- "examples/cdir/testmultispl.rb",
137
- "examples/keytest.rb",
138
- "examples/mpad2.rb",
139
- "examples/newtesttabp.rb",
140
- "examples/qdfilechooser.rb",
141
- "examples/rfe.rb",
142
- "examples/rfe_renderer.rb",
143
- "examples/rvimsplit.rb",
144
- "examples/sqlc.rb",
145
- "examples/sqlm.rb",
146
- "examples/test1.rb",
147
- "examples/test2.rb",
148
- "examples/testchars.rb",
149
- "examples/testcombo.rb",
150
- "examples/testkeypress.rb",
151
- "examples/testlistbox.rb",
152
- "examples/testmenu.rb",
153
- "examples/testmulticomp.rb",
154
- "examples/testscroller.rb",
155
- "examples/testscrolllb.rb",
156
- "examples/testscrollp.rb",
157
- "examples/testscrollta.rb",
158
- "examples/testscrolltable.rb",
159
- "examples/testsplit.rb",
160
- "examples/testsplit2.rb",
161
- "examples/testsplit3.rb",
162
- "examples/testsplit3_1.rb",
163
- "examples/testsplit3a.rb",
164
- "examples/testsplit3b.rb",
165
- "examples/testsplitta.rb",
166
- "examples/testsplittv.rb",
167
- "examples/testsplittvv.rb",
168
- "examples/testtable.rb",
169
- "examples/testtabp.rb",
170
- "examples/testtodo.rb",
171
- "examples/testtpane.rb",
172
- "examples/testtpane2.rb",
173
- "examples/testtpanetable.rb",
174
- "examples/todo.rb",
175
- "examples/viewtodo.rb"
176
- ]
177
-
178
- if s.respond_to? :specification_version then
179
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
180
- s.specification_version = 3
181
-
182
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
183
- else
184
- end
185
- else
186
- end
187
- end
188
-