rbcurse 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/README.markdown +3 -2
  2. data/VERSION +1 -1
  3. metadata +6 -103
  4. data/examples/README.txt +0 -67
  5. data/examples/abasiclist.rb +0 -33
  6. data/examples/alpmenu.rb +0 -42
  7. data/examples/app.rb +0 -859
  8. data/examples/app.sample +0 -17
  9. data/examples/appdirtree.rb +0 -74
  10. data/examples/appemail.rb +0 -191
  11. data/examples/appemaillb.rb +0 -308
  12. data/examples/appgcompose.rb +0 -315
  13. data/examples/atree.rb +0 -64
  14. data/examples/common/file.rb +0 -40
  15. data/examples/common/rmail.rb +0 -257
  16. data/examples/data.txt +0 -683
  17. data/examples/data/README.markdown +0 -9
  18. data/examples/data/brew.txt +0 -38
  19. data/examples/data/color.2 +0 -37
  20. data/examples/data/gemlist.txt +0 -60
  21. data/examples/data/lotr.txt +0 -12
  22. data/examples/data/ports.txt +0 -136
  23. data/examples/data/tasks.txt +0 -27
  24. data/examples/data/todocsv.csv +0 -28
  25. data/examples/data/unix1.txt +0 -21
  26. data/examples/data/unix2.txt +0 -11
  27. data/examples/dbdemo.rb +0 -495
  28. data/examples/deprecated/appgmail.rb +0 -952
  29. data/examples/deprecated/splitp.rb +0 -56
  30. data/examples/deprecated/testscrolllb.rb +0 -86
  31. data/examples/deprecated/testscrollp.rb +0 -88
  32. data/examples/deprecated/testscrollta.rb +0 -80
  33. data/examples/deprecated/testscrolltable.rb +0 -165
  34. data/examples/deprecated/testsplit.rb +0 -87
  35. data/examples/deprecated/testsplit2.rb +0 -123
  36. data/examples/deprecated/testsplit3.rb +0 -215
  37. data/examples/deprecated/testsplit3_1.rb +0 -244
  38. data/examples/deprecated/testsplit3a.rb +0 -215
  39. data/examples/deprecated/testsplit3b.rb +0 -237
  40. data/examples/deprecated/testsplitta.rb +0 -148
  41. data/examples/deprecated/testsplittv.rb +0 -142
  42. data/examples/deprecated/testsplittvv.rb +0 -144
  43. data/examples/deprecated/testtpane.rb +0 -215
  44. data/examples/deprecated/testtpane2.rb +0 -145
  45. data/examples/deprecated/testtpanetable.rb +0 -203
  46. data/examples/dirtree.rb +0 -88
  47. data/examples/experimental/resultsetdemo.rb +0 -280
  48. data/examples/experimental/testmform.rb +0 -35
  49. data/examples/experimental/testscroller.rb +0 -117
  50. data/examples/experimental/teststackflow.rb +0 -111
  51. data/examples/menu1.rb +0 -112
  52. data/examples/multispl.rb +0 -86
  53. data/examples/newmessagebox.rb +0 -131
  54. data/examples/newtabbedwindow.rb +0 -100
  55. data/examples/newtesttabp.rb +0 -121
  56. data/examples/qdfilechooser.rb +0 -68
  57. data/examples/rfe.rb +0 -1239
  58. data/examples/rfe_renderer.rb +0 -121
  59. data/examples/sqlc.rb +0 -454
  60. data/examples/sqlm.rb +0 -437
  61. data/examples/sqlt.rb +0 -408
  62. data/examples/status.txt +0 -68
  63. data/examples/table1.rb +0 -24
  64. data/examples/term2.rb +0 -84
  65. data/examples/test1.rb +0 -239
  66. data/examples/test2.rb +0 -674
  67. data/examples/testapp.rb +0 -44
  68. data/examples/testapp2.rb +0 -58
  69. data/examples/testchars.rb +0 -137
  70. data/examples/testcombo.rb +0 -91
  71. data/examples/testkeypress.rb +0 -66
  72. data/examples/testlistbox.rb +0 -113
  73. data/examples/testmenu.rb +0 -101
  74. data/examples/testmulticomp.rb +0 -70
  75. data/examples/testmulticontainer.rb +0 -94
  76. data/examples/testmultispl.rb +0 -199
  77. data/examples/testree.rb +0 -106
  78. data/examples/testtable.rb +0 -264
  79. data/examples/testtabp.rb +0 -107
  80. data/examples/testtodo.rb +0 -584
  81. data/examples/testvimsplit.rb +0 -112
  82. data/examples/testwsshortcuts.rb +0 -64
  83. data/examples/testwsshortcuts2.rb +0 -126
  84. data/examples/todo.db +0 -0
  85. data/examples/todo.yml +0 -191
  86. data/examples/viewtodo.rb +0 -574
  87. data/lib/rbcurse.rb +0 -8
  88. data/lib/rbcurse/deprecated/README.markdown +0 -12
  89. data/lib/rbcurse/deprecated/rpad.rb +0 -375
  90. data/lib/rbcurse/deprecated/rscrollpane.rb +0 -512
  91. data/lib/rbcurse/deprecated/rsplitpane.rb +0 -894
  92. data/lib/rbcurse/deprecated/rsplitpane2.rb +0 -1009
  93. data/lib/rbcurse/deprecated/rviewport.rb +0 -204
  94. data/lib/rbcurse/deprecated/widgets/mapper.rb +0 -130
  95. data/lib/rbcurse/deprecated/widgets/rmessagebox.rb +0 -348
  96. data/lib/rbcurse/deprecated/widgets/rtabbedpane.rb +0 -1158
  97. data/lib/rbcurse/deprecated/widgets/rtabbedwindow.rb +0 -167
  98. data/lib/rbcurse/deprecated/widgets/scrollable.rb +0 -301
  99. data/lib/rbcurse/deprecated/widgets/stdscrwindow.rb +0 -309
  100. data/lib/ver/keyboard2.rb +0 -170
@@ -1,112 +0,0 @@
1
- # This is a new kind of splitpane, inspired by the vim editor.
2
- # I was deeply frustrated with the Java kind of splitpane,
3
- # which requires splitpanes within splitpanes to get several split.
4
- # This is an attempt at getting many splits, keeping them at one level
5
- # and keeping the interface as simple as possible, with minimal input
6
- # from user.
7
- # It usually takes a listbox or textview or textarea.
8
- # It can also take an array, or string or hash.
9
- # It supports moving the split, and increasing or decreasing the current box to some extent.
10
- # Typically if the split is vertical, add stacks the components, one below the other.
11
- # If horizontal, if will flow the components, to the right of previous. This can be overriden by passing
12
- # type as :STACK or :FLOW.
13
- #
14
- # This does not support changing the orientation at run time, that's nice for demos, but a pain
15
- # to get right, and results in a lot of extra code, meaning more bugs.
16
- # TODO: create a class that contains component array and a pointer so it can give next/prev
17
- # i am tired of maintaining this everywhere.
18
- require 'rbcurse'
19
- require 'rbcurse/extras/widgets/rlistbox'
20
- require 'rbcurse/core/widgets/rtextview'
21
- require 'rbcurse/extras/widgets/rvimsplit'
22
-
23
- if $0 == __FILE__
24
- class Tester
25
- def initialize
26
- acolor = $reversecolor
27
- end
28
- def run
29
- @window = VER::Window.root_window
30
- @form = Form.new @window
31
-
32
- h = 20; w = 75; t = 3; l = 4
33
-
34
- vf = :H
35
- @vim = VimSplit.new @form, {:row => 2, :col => 5, :width => :EXPAND, :height => 25, :orientation => vf, :weight => 0.6}
36
- lb = Listbox.new nil, :list => ["ruby","perl","lisp","java", "scala"] , :name => "mylist"
37
- lb1 = Listbox.new nil, :list => ["roger","borg","laver","edberg", "sampras","ashe"] , :name => "mylist1"
38
-
39
- lb2 = Listbox.new nil, :list => `gem list --local`.split("\n") , :name => "mylist2"
40
-
41
- alist = %w[ ruby perl python java jruby macruby rubinius rails rack sinatra gawk zsh bash groovy]
42
- str = "Hello people of this world.\nThis is a textbox.\nUse arrow keys, j/k/h/l/gg/G/C-a/C-e/C-d/C-b\n"
43
- str << alist.join("\n")
44
- stfl = vf == :V ? :FLOW : :STACK
45
- @vim.add lb, :FIRST, :AUTO
46
- @vim.add lb1, :FIRST, :AUTO #nil #0.7:AUTO
47
- @vim.add ["mercury","venus","earth","mars","jupiter", "saturn"], :FIRST, :AUTO
48
- @vim.add alist, :FIRST, 0.4, stfl
49
- #@vim.add alist, :FIRST, nil, stfl
50
- @vim.add alist.shuffle, :FIRST, 0.6, stfl
51
- @vim.add lb2, :SECOND, :AUTO
52
- @vim.add str, :SECOND, :AUTO
53
- ok_button = Button.new @form do
54
- text "+"
55
- name "+"
56
- row 27
57
- col 10
58
- end
59
- #ok_button.command { |form| @vim.weight(@vim.weight + 0.1) }
60
- ok_button.command { @vim.increase_weight }
61
-
62
-
63
- k_button = Button.new @form do
64
- text "-"
65
- name "-"
66
- row 27
67
- col 17
68
- end
69
- #k_button.command { |form| @vim.weight( @vim.weight - 0.1) }
70
- k_button.command { |form| @vim.decrease_weight }
71
-
72
- #
73
- @help = "F10 to quit. "
74
- RubyCurses::Label.new @form, {'text' => @help, "row" => 1, "col" => 2, "color" => "yellow"}
75
- @form.repaint
76
- @window.wrefresh
77
- Ncurses::Panel.update_panels
78
- ctr = 0
79
- row = 2
80
- while((ch = @window.getchar()) != Ncurses::KEY_F10 )
81
- ret = @form.handle_key(ch)
82
- @window.wrefresh
83
- #ret = @vim.handle_key ch
84
- if ret == :UNHANDLED
85
- str = keycode_tos ch
86
- $log.debug " UNHANDLED #{str} by Vim #{ret} "
87
- end
88
- end
89
-
90
- @window.destroy
91
-
92
- end
93
- end
94
- include RubyCurses
95
- include RubyCurses::Utils
96
- # Initialize curses
97
- begin
98
- # XXX update with new color and kb
99
- VER::start_ncurses # this is initializing colors via ColorMap.setup
100
- $log = Logger.new("rbc13.log")
101
- $log.level = Logger::DEBUG
102
- n = Tester.new
103
- n.run
104
- rescue => ex
105
- ensure
106
- VER::stop_ncurses
107
- p ex if ex
108
- puts(ex.backtrace.join("\n")) if ex
109
- $log.debug( ex) if ex
110
- $log.debug(ex.backtrace.join("\n")) if ex
111
- end
112
- end
@@ -1,64 +0,0 @@
1
- # this is a test program, tests out tabbed panes. type F1 to exit
2
- #
3
- require 'rbcurse'
4
- require 'rbcurse/core/util/widgetshortcuts'
5
-
6
- include RubyCurses
7
-
8
- class SetupMessagebox
9
- include RubyCurses::WidgetShortcuts
10
- def initialize config={}, &block
11
- @window = VER::Window.root_window
12
- @form = Form.new @window
13
- end
14
- def run
15
- _create_form
16
- @form.repaint
17
- @window.wrefresh
18
- while ((ch = @window.getchar()) != 999)
19
- break if ch == ?\C-q.getbyte(0)
20
- @form.handle_key ch
21
- @window.wrefresh
22
- end
23
- end
24
- def _create_form
25
- widget_shortcuts_init
26
- stack :margin_top => 2, :margin_left => 3, :width => 50 , :color => :cyan, :bgcolor => :black do
27
- label :text => " Details ", :color => :blue, :attr => :reverse, :width => :expand, :justify => :center
28
- blank
29
- field :text => "john", :attr => :reverse, :label => "%15s" % ["Name: "]
30
- field :label => "%15s" % ["Address: "], :width => 15, :attr => :reverse
31
- check :text => "Using version control", :value => true, :onvalue => "yes", :offvalue => "no"
32
- check :text => "Upgraded to Lion", :value => false, :onvalue => "yes", :offvalue => "no"
33
- blank
34
- radio :text => "Linux", :value => "LIN", :group => :os
35
- radio :text => "OSX", :value => "OSX", :group => :os
36
- radio :text => "Window", :value => "Win", :group => :os
37
- flow :margin_top => 2, :margin_left => 4, :item_width => 15 do
38
- button :text => "Ok"
39
- button :text => "Cancel"
40
- button :text => "Apply"
41
- end
42
- end
43
- end
44
-
45
- end
46
- if $0 == __FILE__
47
- # Initialize curses
48
- begin
49
- # XXX update with new color and kb
50
- VER::start_ncurses # this is initializing colors via ColorMap.setup
51
- $log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"rbc13.log")))
52
- $log.level = Logger::DEBUG
53
- tp = SetupMessagebox.new()
54
- buttonindex = tp.run
55
- $log.debug "XXX: MESSAGEBOX retirned #{buttonindex} "
56
- rescue => ex
57
- ensure
58
- VER::stop_ncurses
59
- p ex if ex
60
- p(ex.backtrace.join("\n")) if ex
61
- $log.debug( ex) if ex
62
- $log.debug(ex.backtrace.join("\n")) if ex
63
- end
64
- end
@@ -1,126 +0,0 @@
1
- # this is a test program, tests out widget shortcuts. type C-q to exit
2
- #
3
- require 'rbcurse'
4
- require 'rbcurse/core/util/widgetshortcuts'
5
-
6
- include RubyCurses
7
- include RubyCurses::Utils
8
-
9
- class SetupMessagebox
10
- include RubyCurses::WidgetShortcuts
11
- def initialize config={}, &block
12
- @window = VER::Window.root_window
13
- @form = Form.new @window
14
- end
15
- def run
16
- _create_form
17
- @form.repaint
18
- @window.wrefresh
19
- catch(:close) do
20
- while ((ch = @window.getchar()) != 999)
21
- break if ch == ?\C-q.getbyte(0)
22
- @form.handle_key ch
23
- @window.wrefresh
24
- end
25
- end # catch
26
- end
27
- def _create_form
28
- widget_shortcuts_init
29
- stack :margin_top => 1, :width => :expand do
30
- label :text => " Details ", :color => :cyan, :attr => :reverse, :width => :expand, :justify => :center
31
- flow :margin_top => 1, :margin_left => 4, :item_width => 50 do
32
- stack :margin_top => 0, :margin_left => 3, :width => 50 , :color => :cyan, :bgcolor => :black do
33
- box do
34
- field :text => "steve", :attr => :reverse, :label => "%15s" % ["Name: "]
35
- field :label => "%15s" % ["Address: "], :width => 15, :attr => :reverse
36
- blank
37
- check :text => "Using version control", :value => true, :onvalue => "yes", :offvalue => "no" do |eve|
38
- unless eve.item.value
39
- alert "NO VC! We need to talk"
40
- end
41
- end
42
- check :text => "Upgraded to Lion", :value => false, :onvalue => "yes", :offvalue => "no" do |eve|
43
- unless eve.item.value
44
- alert "You goin back to Snow Leopard?"
45
- end
46
- end
47
- end # box
48
- end
49
- stack :margin_top => 0, :margin_left => 3, :width => 50 , :color => :cyan, :bgcolor => :black do
50
- box :title => "OS Maintenance", :margin_left => 2 do
51
- radio :text => "Linux", :value => "LIN", :group => :os
52
- radio :text => "OSX", :value => "OSX", :group => :os
53
- radio :text => "Window", :value => "Win", :group => :os
54
- blank
55
- flow :item_width => 15 do
56
- button :text => "Install" do
57
- # you can avoid this by giving the radio buttons your own Variable (see test2.rb)
58
- choice = @variables[:os].value
59
- case choice
60
- when ""
61
- alert "Select an OS"
62
- when "OSX", "LIN"
63
- alert "Good choice"
64
- else
65
- alert "Pfft !"
66
- end
67
- end
68
- button :text => "Uninstall"
69
- button :text => "Delete"
70
- end
71
- end # box
72
- end
73
- end # flow
74
- #button :text => "Execute"
75
- text = [" #[reverse]Unix Philosophy #[end] ",
76
- "#[fg=green, underline]Eric Raymond#[end] in his book, #[fg=green, underline]The Art of Unix Programming#[end] summarized the Unix philosophy.",
77
- " ",
78
- "Rule of #[fg=yellow]Modularity#[end]: Write simple parts connected by clean interfaces.",
79
- "Rule of #[fg=blue]Clarity#[end]: #[bold]Clarity#[end] is better than cleverness.",
80
- "Rule of #[fg=red]Separation#[end]: Separate #[bold]policy#[end] from mechanism; separate interfaces from engines.",
81
- "Rule of #[fg=green]Simplicity#[end]: Design for #[bold]simplicity;#[end] add complexity only where you must.",
82
- "Rule of #[fg=magenta]Parsimony#[end]: Write a big program only when it is clear by demonstration that nothing else will do.",
83
- "Rule of #[fg=cyan]Representation#[end]: Fold knowledge into #[bold]data#[end] so program logic can be stupid and robust"]
84
- text << "For more check: #[underline]http://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond#[end]"
85
- formatted = []
86
- #text.each { |line| formatted << @window.convert_to_chunk(line) }
87
-
88
- #textview :text => formatted
89
- #textview do |t| t.formatted_text(text, :tmux) end
90
- t = textview :title => 'tmux format'
91
- t.formatted_text(text, :tmux)
92
- t1 = textview :title => 'ansi formatted document'
93
- text = File.open("data/color.2","r").readlines
94
- t1.formatted_text(text, :ansi)
95
-
96
- flow do
97
- #box do
98
- button :text => " Ok " do alert "Pressed okay" end
99
- button :text => "Cancel" do confirm "Do you wish to Quit?" ; throw :close; end
100
- button :text => "Apply "
101
- #end
102
- end
103
-
104
- end
105
-
106
- end
107
- end
108
- if $0 == __FILE__
109
- # Initialize curses
110
- begin
111
- # XXX update with new color and kb
112
- VER::start_ncurses # this is initializing colors via ColorMap.setup
113
- $log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"rbc13.log")))
114
- $log.level = Logger::DEBUG
115
- tp = SetupMessagebox.new()
116
- buttonindex = tp.run
117
- $log.debug "XXX: MESSAGEBOX retirned #{buttonindex} "
118
- rescue => ex
119
- ensure
120
- VER::stop_ncurses
121
- p ex if ex
122
- p(ex.backtrace.join("\n")) if ex
123
- $log.debug( ex) if ex
124
- $log.debug(ex.backtrace.join("\n")) if ex
125
- end
126
- end
Binary file
@@ -1,191 +0,0 @@
1
- ---
2
- - - FIXME
3
- - MSGBOX
4
- - 5
5
- - "Confirm dialog: box vertical line overwritten in 2 spots"
6
- - TODO
7
- - - FIXME
8
- - MSGBOX
9
- - 5
10
- - "Confirm dialog: use normal key as hotkey also"
11
- - TODO
12
- - 2009-01-20 11:44:49.753534 +05:30
13
- - - FIXME
14
- - MSGBOX
15
- - 5
16
- - "Confirm dialog: arrow keys not navigating anylonger"
17
- - TODO
18
- - 2009-01-20 11:45:27.031136 +05:30
19
- - - FIXME
20
- - GEN
21
- - 9
22
- - Message Box sizing
23
- - TODO
24
- - 2009-01-22 20:39:21.220964 +05:30
25
- - - DONE
26
- - LIST
27
- - 5
28
- - case insensitive char search in list and combo
29
- - TESTED
30
- - 2009-02-21 20:43:05.662213 +05:30
31
- - - DONE
32
- - LIST
33
- - 5
34
- - case insensitive char search in list and combo
35
- - TESTED
36
- - 2009-02-21 20:44:29.277384 +05:30
37
- - - DONE
38
- - TABLE
39
- - 5
40
- - increase the maxlen of this field please. Let us see how it goes.
41
- - TESTED
42
- - - DONE
43
- - TABLE
44
- - 5
45
- - Can we disable down arrow in Chkbox in table?
46
- - TESTED
47
- - 2009-01-19 00:00:00.242912 +05:30
48
- - - DONE
49
- - TABLE
50
- - 0
51
- - editing on enter
52
- - TESTED
53
- - 2009-01-19 01:37:00.242912 +05:30
54
- - - DONE
55
- - TABLE
56
- - 5
57
- - cell editors pcol is not being reset each time
58
- - TESTED
59
- - 2009-01-19 17:47:00.419937 +05:30
60
- - - DONE
61
- - TABLE
62
- - 5
63
- - Use TAB for intercell navig. use M-TAB for next f
64
- - TESTED
65
- - 2009-01-20 00:38:19.606544 +05:30
66
- - - DONE
67
- - TABLE
68
- - 5
69
- - Searching
70
- - TESTED
71
- - 2009-02-21 20:42:10.140948 +05:30
72
- - - DONE
73
- - TABLE
74
- - 3
75
- - Columns editable or not
76
- - TESTED
77
- - 2009-02-21 20:43:10.386261 +05:30
78
- - - DONE
79
- - TABLE
80
- - 1
81
- - Any way to start a table with no data and pop late
82
- - TODO
83
- - 2009-02-21 20:43:33.172668 +05:30
84
- - - DONE
85
- - TABLE
86
- - 3
87
- - Columns editable or not
88
- - TESTED
89
- - 2009-02-21 20:44:33.451462 +05:30
90
- - - DONE
91
- - TABLE
92
- - 1
93
- - Any way to start a table with no data and pop late
94
- - TODO
95
- - 2009-02-21 20:44:48.137930 +05:30
96
- - - DONE
97
- - GEN
98
- - 5
99
- - Make widget of Keylabelprinter
100
- - TESTED
101
- - 2009-01-20 00:38:43.052790 +05:30
102
- - - DONE
103
- - GEN
104
- - 5
105
- - "Added Action class shared by Button Menuitem "
106
- - TESTED
107
- - 2009-01-22 18:08:28.026892 +05:30
108
- - - DONE
109
- - GEN
110
- - 5
111
- - "Added PopupMenu 2009-01-22 18:09 "
112
- - TESTED
113
- - 2009-01-22 18:09:34.437147 +05:30
114
- - - TODO
115
- - LIST
116
- - 0
117
- - call on_enter and on_leave of component
118
- - TOTEST
119
- - 2009-01-19 15:38:27.091120 +05:30
120
- - - TODO
121
- - LIST
122
- - 5
123
- - case insensitive char search in list and combo
124
- - TESTED
125
- - - TODO
126
- - TABLE
127
- - 3
128
- - Columns editable or not
129
- - TESTED
130
- - - TODO
131
- - TABLE
132
- - 1
133
- - Any way to start a table with no data and pop late
134
- - TODO
135
- - - TODO
136
- - TABLE
137
- - 1
138
- - table.set_data should check if models already created.
139
- - TODO
140
- - - TODO
141
- - TABLE
142
- - 5
143
- - Set column_class in TableColumn, to avoid hassles
144
- - TODO
145
- - - TODO
146
- - TABLE
147
- - 2
148
- - Table sorting and filtering is required - using VIEW
149
- - TODO
150
- - - TODO
151
- - TABLE
152
- - 5
153
- - Table height and col widths auto sizing or FILLING extra space.
154
- - TODO
155
- - - TODO
156
- - TEXTAREA
157
- - 9
158
- - "Textarea: wrap options NONE, COLUMN"
159
- - TODO
160
- - 2009-01-20 01:04:15.084400 +05:30
161
- - - TODO
162
- - GEN
163
- - 5
164
- - Modified should check if value changed, not UP etc
165
- - TOTEST
166
- - - TODO
167
- - GEN
168
- - 5
169
- - Give a decent FileChooser and FileSaver
170
- - TODO
171
- - - TODO
172
- - GEN
173
- - 5
174
- - Focus Traversable vs focusable
175
- - TODO
176
- - - TODO
177
- - GEN
178
- - 5
179
- - "Action class: fire event for listeners"
180
- - TODO
181
- - 2009-01-22 20:09:50.624075 +05:30
182
- - - TODO
183
- - FIELD
184
- - 5
185
- - "Field: OVERWRITE Mode"
186
- - TODO
187
- - - TODO
188
- - FIELD
189
- - 5
190
- - "Field: Auto-skip when reaching end of maxlen"
191
- - TODO