rbcurse 0.1.3 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +126 -0
- data/Manifest.txt +53 -20
- data/README.markdown +423 -0
- data/Rakefile +3 -1
- data/examples/keytest.rb +177 -0
- data/examples/mpad2.rb +156 -0
- data/examples/newtesttabp.rb +121 -0
- data/examples/rfe.rb +48 -10
- data/examples/rfe_renderer.rb +4 -4
- data/examples/rvimsplit.rb +376 -0
- data/examples/sqlc.rb +97 -106
- data/examples/sqlm.rb +446 -0
- data/examples/test1.rb +4 -4
- data/examples/test2.rb +12 -12
- data/examples/testchars.rb +140 -0
- data/examples/testkeypress.rb +9 -4
- data/examples/testmulticomp.rb +72 -0
- data/examples/testscroller.rb +136 -0
- data/examples/testscrolllb.rb +86 -0
- data/examples/testscrollp.rb +87 -0
- data/examples/testscrollta.rb +80 -0
- data/examples/testscrolltable.rb +166 -0
- data/examples/testsplit.rb +87 -0
- data/examples/testsplit2.rb +123 -0
- data/examples/testsplit3.rb +215 -0
- data/examples/testsplit3_1.rb +244 -0
- data/examples/testsplit3a.rb +215 -0
- data/examples/testsplit3b.rb +237 -0
- data/examples/testsplitta.rb +148 -0
- data/examples/testsplittv.rb +142 -0
- data/examples/testsplittvv.rb +144 -0
- data/examples/testtable.rb +1 -1
- data/examples/testtabp.rb +3 -2
- data/examples/testtestw.rb +69 -0
- data/examples/testtodo.rb +5 -3
- data/examples/testtpane.rb +203 -0
- data/examples/testtpane2.rb +145 -0
- data/examples/testtpanetable.rb +199 -0
- data/examples/viewtodo.rb +5 -3
- data/lib/rbcurse.rb +1 -1
- data/lib/rbcurse/celleditor.rb +2 -2
- data/lib/rbcurse/colormap.rb +5 -5
- data/lib/rbcurse/defaultlistselectionmodel.rb +3 -3
- data/lib/rbcurse/io.rb +663 -0
- data/lib/rbcurse/listeditable.rb +306 -0
- data/lib/rbcurse/listkeys.rb +15 -15
- data/lib/rbcurse/listscrollable.rb +168 -27
- data/lib/rbcurse/mapper.rb +35 -13
- data/lib/rbcurse/rchangeevent.rb +28 -0
- data/lib/rbcurse/rform.rb +845 -0
- data/lib/rbcurse/rlistbox.rb +144 -34
- data/lib/rbcurse/rmessagebox.rb +10 -5
- data/lib/rbcurse/rmulticontainer.rb +325 -0
- data/lib/rbcurse/rmultitextview.rb +306 -0
- data/lib/rbcurse/rscrollform.rb +369 -0
- data/lib/rbcurse/rscrollpane.rb +511 -0
- data/lib/rbcurse/rsplitpane.rb +820 -0
- data/lib/rbcurse/rtabbedpane.rb +737 -109
- data/lib/rbcurse/rtabbedwindow.rb +326 -0
- data/lib/rbcurse/rtable.rb +220 -64
- data/lib/rbcurse/rtextarea.rb +340 -181
- data/lib/rbcurse/rtextview.rb +237 -101
- data/lib/rbcurse/rviewport.rb +203 -0
- data/lib/rbcurse/rwidget.rb +919 -95
- data/lib/rbcurse/scrollable.rb +7 -7
- data/lib/rbcurse/selectable.rb +4 -4
- data/lib/rbcurse/table/tablecellrenderer.rb +3 -0
- data/lib/rbcurse/undomanager.rb +181 -0
- data/lib/rbcurse/vieditable.rb +100 -0
- data/lib/ver/window.rb +471 -21
- metadata +66 -22
- data/README.txt +0 -312
- data/examples/testd.db +0 -0
- data/examples/todocsv.csv +0 -28
@@ -0,0 +1,215 @@
|
|
1
|
+
#$LOAD_PATH << "/Users/rahul/work/projects/rbcurse/"
|
2
|
+
#*******************************************************#
|
3
|
+
# testsplit3a.rb #
|
4
|
+
# written by Rahul Kumar #
|
5
|
+
# January 16, 2010 #
|
6
|
+
# #
|
7
|
+
# Test textview, split and textarea inside splitpane #
|
8
|
+
# This wraps a textview inside a scrollpane, and #
|
9
|
+
# puts the SCRP inside a SPLP #
|
10
|
+
#
|
11
|
+
# /----+---------------\
|
12
|
+
# | V| V|
|
13
|
+
# | 1 V| V|
|
14
|
+
# | >>V| V|
|
15
|
+
# +----+ 3 V|
|
16
|
+
# | V| V|
|
17
|
+
# | 2 V| V|
|
18
|
+
# |>>>V|>>>>>> |
|
19
|
+
# \----+---------------/
|
20
|
+
#
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# Released under ruby license. See #
|
24
|
+
# http://www.ruby-lang.org/en/LICENSE.txt #
|
25
|
+
# Copyright 2010, Rahul Kumar #
|
26
|
+
#*******************************************************#
|
27
|
+
require 'rubygems'
|
28
|
+
require 'ncurses'
|
29
|
+
require 'logger'
|
30
|
+
require 'rbcurse'
|
31
|
+
require 'rbcurse/rsplitpane'
|
32
|
+
require 'rbcurse/rscrollpane'
|
33
|
+
require 'rbcurse/rtextarea'
|
34
|
+
require 'rbcurse/rtextview'
|
35
|
+
require 'rbcurse/rlistbox'
|
36
|
+
if $0 == __FILE__
|
37
|
+
include RubyCurses
|
38
|
+
include RubyCurses::Utils
|
39
|
+
|
40
|
+
begin
|
41
|
+
# Initialize curses
|
42
|
+
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
43
|
+
$log = Logger.new("v#{$0}.log")
|
44
|
+
$log.level = Logger::DEBUG
|
45
|
+
|
46
|
+
@window = VER::Window.root_window
|
47
|
+
|
48
|
+
catch(:close) do
|
49
|
+
colors = Ncurses.COLORS
|
50
|
+
@form = Form.new @window
|
51
|
+
$log.debug " MAIN FORM #{@form} "
|
52
|
+
r = 1; c = 3; ht = 18; w = 70
|
53
|
+
r = 3; c = 7; ht = 24; w = 100
|
54
|
+
|
55
|
+
|
56
|
+
@help = "F1 to quit. To resize split: M-, M+, M=. TAB, M-w, M-n, M-p, M-l, M-h, C-n/p : #{$0}"
|
57
|
+
RubyCurses::Label.new @form, {'text' => @help, "row" => ht+r, "col" => 2, "color" => "yellow"}
|
58
|
+
|
59
|
+
outer = SplitPane.new @form do
|
60
|
+
name "mainpane"
|
61
|
+
row r
|
62
|
+
col c
|
63
|
+
width w
|
64
|
+
height ht
|
65
|
+
orientation :VERTICAL_SPLIT
|
66
|
+
end
|
67
|
+
# note that splitleft has no form. so focus has to be managed XXX
|
68
|
+
splitleft = SplitPane.new nil do
|
69
|
+
name "splitleft-outer"
|
70
|
+
|
71
|
+
#width w/3 # 30
|
72
|
+
#height ht-0 #/2-1
|
73
|
+
|
74
|
+
orientation :HORIZONTAL_SPLIT
|
75
|
+
border_color $promptcolor
|
76
|
+
border_attrib Ncurses::A_NORMAL
|
77
|
+
end
|
78
|
+
taoutrt = TextArea.new nil do
|
79
|
+
name "myTextArea-outrt"
|
80
|
+
#row 0
|
81
|
+
#col 0
|
82
|
+
width w # this is ofcourse large, full width
|
83
|
+
#height (ht/2)-1
|
84
|
+
height ht
|
85
|
+
title "README.md"
|
86
|
+
title_attrib 'bold'
|
87
|
+
print_footer true
|
88
|
+
footer_attrib 'bold'
|
89
|
+
end
|
90
|
+
# taoutrt.show_caret=true
|
91
|
+
|
92
|
+
tvleft1 = TextView.new nil do
|
93
|
+
name "myviewleft1"
|
94
|
+
#row 0
|
95
|
+
#col 0
|
96
|
+
#width w-2
|
97
|
+
height ht
|
98
|
+
#height (ht/2)-1
|
99
|
+
width w/2-1
|
100
|
+
title "README.md"
|
101
|
+
title_attrib 'bold'
|
102
|
+
print_footer true
|
103
|
+
footer_attrib 'bold'
|
104
|
+
end
|
105
|
+
tvleft1.show_caret=true
|
106
|
+
content = File.open("../README.markdown","r").readlines
|
107
|
+
tvleft1.set_content content #, :WRAP_WORD
|
108
|
+
|
109
|
+
# to see lower border i need to set height to ht/2 -2 in both cases, but that
|
110
|
+
# crashes ruby when i reduce height by 1.
|
111
|
+
tvleft2 = TextView.new nil do
|
112
|
+
name "myviewleft2"
|
113
|
+
#row 0
|
114
|
+
#col 0
|
115
|
+
width w/2-1
|
116
|
+
#height ht
|
117
|
+
height (ht/2)-1
|
118
|
+
title "NOTES"
|
119
|
+
title_attrib 'bold'
|
120
|
+
print_footer true
|
121
|
+
footer_attrib 'bold'
|
122
|
+
end
|
123
|
+
tvleft2.show_caret=true
|
124
|
+
content = File.open("../NOTES","r").readlines
|
125
|
+
tvleft2.set_content content #, :WRAP_WORD
|
126
|
+
|
127
|
+
leftscroll1 = ScrollPane.new nil do
|
128
|
+
name "myScrollLeftTop"
|
129
|
+
end
|
130
|
+
leftscroll2 = ScrollPane.new nil do
|
131
|
+
name "myScrollLeftBot"
|
132
|
+
end
|
133
|
+
scroutrt = ScrollPane.new nil do
|
134
|
+
name "myScroll3-outer-right"
|
135
|
+
#width 46
|
136
|
+
end
|
137
|
+
leftscroll1.cascade_changes = true
|
138
|
+
leftscroll2.cascade_changes = true
|
139
|
+
#leftscroll1.preferred_width w/2 #/2 ## should pertain more to horizontal orientation
|
140
|
+
leftscroll1.preferred_height (ht/2)-4 ## this messes things up when we change orientation
|
141
|
+
# the outer compo needs child set first else cursor does not reach up from
|
142
|
+
# lower levels. Is the connection broken ?
|
143
|
+
outer.first_component(splitleft)
|
144
|
+
outer.second_component(scroutrt)
|
145
|
+
#leftscroll2.preferred_height ht/2-2
|
146
|
+
scroutrt.child(taoutrt)
|
147
|
+
splitleft.first_component(leftscroll1)
|
148
|
+
leftscroll1.child(tvleft1)
|
149
|
+
splitleft.second_component(leftscroll2)
|
150
|
+
leftscroll2.child(tvleft2)
|
151
|
+
#tvleft1.preferred_width w/2 #/2 ## should pertain more to horizontal orientation
|
152
|
+
#tvleft1.preferred_height (ht/2)-1 ## this messes things up when we change orientation
|
153
|
+
#tvleft1.set_resize_weight 0.50
|
154
|
+
ret = splitleft.reset_to_preferred_sizes
|
155
|
+
splitleft.set_resize_weight(0.50) if ret == :ERROR
|
156
|
+
|
157
|
+
splitleft.preferred_width w/2 #w/3
|
158
|
+
splitleft.preferred_height ht/2-2
|
159
|
+
#splitleft.set_resize_weight 0.50
|
160
|
+
#taoutrt.min_width 10
|
161
|
+
#taoutrt.min_height 5
|
162
|
+
#splitleft.min_width 12
|
163
|
+
#splitleft.min_height 6
|
164
|
+
ret = outer.reset_to_preferred_sizes
|
165
|
+
outer.set_resize_weight(0.50) if ret == :ERROR
|
166
|
+
|
167
|
+
File.open("../README.markdown","r") do |file|
|
168
|
+
while (line = file.gets)
|
169
|
+
taoutrt << line.chomp
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
@form.repaint
|
174
|
+
@window.wrefresh
|
175
|
+
Ncurses::Panel.update_panels
|
176
|
+
while((ch = @window.getchar()) != KEY_F1 )
|
177
|
+
str = keycode_tos ch
|
178
|
+
case ch
|
179
|
+
#when ?v.getbyte(0)
|
180
|
+
#$log.debug " ORIENTATION VERTICAL"
|
181
|
+
#outer.orientation(:VERTICAL_SPLIT)
|
182
|
+
#outer.reset_to_preferred_sizes
|
183
|
+
#when ?h.getbyte(0)
|
184
|
+
#$log.debug " ORIENTATION HORIZ"
|
185
|
+
#outer.orientation(:HORIZONTAL_SPLIT)
|
186
|
+
#outer.reset_to_preferred_sizes
|
187
|
+
when ?-.getbyte(0)
|
188
|
+
$log.debug " KEY PRESS -"
|
189
|
+
outer.set_divider_location(outer.divider_location-1)
|
190
|
+
when ?+.getbyte(0)
|
191
|
+
$log.debug " KEY PRESS +"
|
192
|
+
outer.set_divider_location(outer.divider_location+1)
|
193
|
+
when ?=.getbyte(0)
|
194
|
+
$log.debug " KEY PRESS ="
|
195
|
+
outer.set_resize_weight(0.50)
|
196
|
+
end
|
197
|
+
#outer.get_buffer().wclear
|
198
|
+
#outer << "#{ch} got (#{str})"
|
199
|
+
# outer.repaint
|
200
|
+
# outer.buffer_to_screen
|
201
|
+
@form.repaint
|
202
|
+
@form.handle_key(ch)
|
203
|
+
@window.wrefresh
|
204
|
+
end
|
205
|
+
end
|
206
|
+
rescue => ex
|
207
|
+
ensure
|
208
|
+
@window.destroy if !@window.nil?
|
209
|
+
VER::stop_ncurses
|
210
|
+
p ex if ex
|
211
|
+
p(ex.backtrace.join("\n")) if ex
|
212
|
+
$log.debug( ex) if ex
|
213
|
+
$log.debug(ex.backtrace.join("\n")) if ex
|
214
|
+
end
|
215
|
+
end
|
@@ -0,0 +1,237 @@
|
|
1
|
+
#$LOAD_PATH << "/Users/rahul/work/projects/rbcurse/"
|
2
|
+
#*******************************************************#
|
3
|
+
# testsplit3b.rb #
|
4
|
+
# written by Rahul Kumar #
|
5
|
+
# January 17, 2010 #
|
6
|
+
# #
|
7
|
+
# Test textview, split and textarea inside splitpane #
|
8
|
+
# This wraps a textview inside a scrollpane, and #
|
9
|
+
# puts the SCRP inside a SPLP #
|
10
|
+
# Adds a listbox to the menagerie of objects. #
|
11
|
+
#
|
12
|
+
# /----+---------------\
|
13
|
+
# | V| V|
|
14
|
+
# | 1 V| V|
|
15
|
+
# | >>V| V|
|
16
|
+
# +----+ 3 V|
|
17
|
+
# | V| V|
|
18
|
+
# | 2 V| V|
|
19
|
+
# |>>>V|>>>>>> |
|
20
|
+
# \----+---------------/
|
21
|
+
#
|
22
|
+
#
|
23
|
+
#
|
24
|
+
# Released under ruby license. See #
|
25
|
+
# http://www.ruby-lang.org/en/LICENSE.txt #
|
26
|
+
# Copyright 2010, Rahul Kumar #
|
27
|
+
#*******************************************************#
|
28
|
+
require 'rubygems'
|
29
|
+
require 'ncurses'
|
30
|
+
require 'logger'
|
31
|
+
require 'rbcurse'
|
32
|
+
require 'rbcurse/rsplitpane'
|
33
|
+
require 'rbcurse/rscrollpane'
|
34
|
+
require 'rbcurse/rtextarea'
|
35
|
+
require 'rbcurse/rtextview'
|
36
|
+
require 'rbcurse/rlistbox'
|
37
|
+
if $0 == __FILE__
|
38
|
+
include RubyCurses
|
39
|
+
include RubyCurses::Utils
|
40
|
+
|
41
|
+
begin
|
42
|
+
# Initialize curses
|
43
|
+
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
44
|
+
$log = Logger.new("v#{$0}.log")
|
45
|
+
$log.level = Logger::DEBUG
|
46
|
+
show_caret_flag = false #true
|
47
|
+
|
48
|
+
@window = VER::Window.root_window
|
49
|
+
|
50
|
+
catch(:close) do
|
51
|
+
colors = Ncurses.COLORS
|
52
|
+
@form = Form.new @window
|
53
|
+
$log.debug " MAIN FORM #{@form} "
|
54
|
+
r = 1; c = 3; ht = 18; w = 70
|
55
|
+
r = 3; c = 7; ht = 24; w = 100
|
56
|
+
|
57
|
+
|
58
|
+
@help = "F1 to quit. To resize split: M-, M+, M=. TAB, M-w, M-n, M-p, M-l, M-h, C-n/p : #{$0}"
|
59
|
+
RubyCurses::Label.new @form, {'text' => @help, "row" => ht+r, "col" => 2, "color" => "yellow"}
|
60
|
+
|
61
|
+
outer = SplitPane.new @form do
|
62
|
+
name "mainpane"
|
63
|
+
row r
|
64
|
+
col c
|
65
|
+
width w
|
66
|
+
height ht
|
67
|
+
orientation :VERTICAL_SPLIT
|
68
|
+
end
|
69
|
+
# note that splitleft has no form. so focus has to be managed XXX
|
70
|
+
splitleft = SplitPane.new nil do
|
71
|
+
name "splitleft"
|
72
|
+
|
73
|
+
#width w/3 # 30
|
74
|
+
#height ht-0 #/2-1
|
75
|
+
|
76
|
+
orientation :HORIZONTAL_SPLIT
|
77
|
+
border_color $promptcolor
|
78
|
+
border_attrib Ncurses::A_NORMAL
|
79
|
+
end
|
80
|
+
ta1 = TextArea.new nil do
|
81
|
+
name "myTextArea"
|
82
|
+
#row 0
|
83
|
+
#col 0
|
84
|
+
width w # this is ofcourse large, full width
|
85
|
+
#height (ht/2)-1
|
86
|
+
height ht
|
87
|
+
title "README.md"
|
88
|
+
title_attrib 'bold'
|
89
|
+
print_footer true
|
90
|
+
footer_attrib 'bold'
|
91
|
+
end
|
92
|
+
ta1.show_caret = show_caret_flag
|
93
|
+
|
94
|
+
t1 = TextView.new nil do
|
95
|
+
name "myView"
|
96
|
+
#row 0
|
97
|
+
#col 0
|
98
|
+
#width w-2
|
99
|
+
height ht
|
100
|
+
#height (ht/2)-1
|
101
|
+
width w/2-1
|
102
|
+
title "README.md"
|
103
|
+
title_attrib 'bold'
|
104
|
+
print_footer true
|
105
|
+
footer_attrib 'bold'
|
106
|
+
end
|
107
|
+
t1.show_caret = show_caret_flag
|
108
|
+
content = File.open("../README.markdown","r").readlines
|
109
|
+
t1.set_content content #, :WRAP_WORD
|
110
|
+
|
111
|
+
mylist = []
|
112
|
+
0.upto(50) { |v| mylist << "#{v} scrollable data" }
|
113
|
+
$listdata = Variable.new mylist
|
114
|
+
listb = Listbox.new nil do
|
115
|
+
name "mylist"
|
116
|
+
row 0
|
117
|
+
col 0
|
118
|
+
width w/2
|
119
|
+
height ht/2+5
|
120
|
+
list_variable $listdata
|
121
|
+
#selection_mode :SINGLE
|
122
|
+
show_selector true
|
123
|
+
row_selected_symbol "[X] "
|
124
|
+
row_unselected_symbol "[ ] "
|
125
|
+
title "A long list"
|
126
|
+
title_attrib 'reverse'
|
127
|
+
cell_editing_allowed true
|
128
|
+
end
|
129
|
+
## The next 2 are not advised since they don't trigger events
|
130
|
+
#listb.insert 55, "hello ruby", "so long python", "farewell java", "RIP .Net"
|
131
|
+
#$listdata.value.insert 55, "hello ruby", "so long python", "farewell java", "RIP .Net"
|
132
|
+
listb.list_data_model.insert 25, "hello ruby", "so long python", "farewell java", "RIP .Net", "hi lisp", "hi cloJure", "git Go"
|
133
|
+
# to see lower border i need to set height to ht/2 -2 in both cases, but that
|
134
|
+
# crashes ruby when i reduce height by 1.
|
135
|
+
#t2 = TextView.new nil do
|
136
|
+
#name "myView2"
|
137
|
+
##row 0
|
138
|
+
##col 0
|
139
|
+
#width w/2-1
|
140
|
+
##height ht
|
141
|
+
#height (ht/2)-1
|
142
|
+
#title "NOTES"
|
143
|
+
#title_attrib 'bold'
|
144
|
+
#print_footer true
|
145
|
+
#footer_attrib 'bold'
|
146
|
+
#end
|
147
|
+
#content = File.open("../NOTES","r").readlines
|
148
|
+
#t2.set_content content #, :WRAP_WORD
|
149
|
+
|
150
|
+
scroll1 = ScrollPane.new nil do
|
151
|
+
name "myScroll1"
|
152
|
+
end
|
153
|
+
scroll2 = ScrollPane.new nil do
|
154
|
+
name "myScroll2"
|
155
|
+
end
|
156
|
+
scroll3 = ScrollPane.new nil do
|
157
|
+
name "myScroll3"
|
158
|
+
#width 46
|
159
|
+
end
|
160
|
+
#scroll1.preferred_width w/2 #/2 ## should pertain more to horizontal orientation
|
161
|
+
scroll1.preferred_height (ht/2)-4 ## this messes things up when we change orientation
|
162
|
+
# the outer compo needs child set first else cursor does not reach up from
|
163
|
+
# lower levels. Is the connection broken ?
|
164
|
+
outer.first_component(splitleft)
|
165
|
+
outer.second_component(scroll3)
|
166
|
+
#scroll2.preferred_height ht/2-2
|
167
|
+
scroll3.child(ta1)
|
168
|
+
splitleft.first_component(scroll1)
|
169
|
+
scroll1.child(t1)
|
170
|
+
splitleft.second_component(scroll2)
|
171
|
+
scroll2.child(listb)
|
172
|
+
#scroll2.cascade_changes = true
|
173
|
+
#t1.preferred_width w/2 #/2 ## should pertain more to horizontal orientation
|
174
|
+
#t1.preferred_height (ht/2)-1 ## this messes things up when we change orientation
|
175
|
+
#t1.set_resize_weight 0.50
|
176
|
+
ret = splitleft.reset_to_preferred_sizes
|
177
|
+
splitleft.set_resize_weight(0.50) if ret == :ERROR
|
178
|
+
|
179
|
+
splitleft.preferred_width w/2 #w/3
|
180
|
+
splitleft.preferred_height ht/2-2
|
181
|
+
#splitleft.set_resize_weight 0.50
|
182
|
+
#ta1.min_width 10
|
183
|
+
#ta1.min_height 5
|
184
|
+
#splitleft.min_width 12
|
185
|
+
#splitleft.min_height 6
|
186
|
+
ret = outer.reset_to_preferred_sizes
|
187
|
+
outer.set_resize_weight(0.50) if ret == :ERROR
|
188
|
+
|
189
|
+
File.open("../README.markdown","r") do |file|
|
190
|
+
while (line = file.gets)
|
191
|
+
ta1 << line.chomp
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
@form.repaint
|
196
|
+
@window.wrefresh
|
197
|
+
Ncurses::Panel.update_panels
|
198
|
+
while((ch = @window.getchar()) != KEY_F1 )
|
199
|
+
str = keycode_tos ch
|
200
|
+
case ch
|
201
|
+
#when ?v.getbyte(0)
|
202
|
+
#$log.debug " ORIENTATION VERTICAL"
|
203
|
+
#outer.orientation(:VERTICAL_SPLIT)
|
204
|
+
#outer.reset_to_preferred_sizes
|
205
|
+
#when ?h.getbyte(0)
|
206
|
+
#$log.debug " ORIENTATION HORIZ"
|
207
|
+
#outer.orientation(:HORIZONTAL_SPLIT)
|
208
|
+
#outer.reset_to_preferred_sizes
|
209
|
+
when ?-.getbyte(0)
|
210
|
+
$log.debug " KEY PRESS -"
|
211
|
+
outer.set_divider_location(outer.divider_location-1)
|
212
|
+
when ?+.getbyte(0)
|
213
|
+
$log.debug " KEY PRESS +"
|
214
|
+
outer.set_divider_location(outer.divider_location+1)
|
215
|
+
when ?=.getbyte(0)
|
216
|
+
$log.debug " KEY PRESS ="
|
217
|
+
outer.set_resize_weight(0.50)
|
218
|
+
end
|
219
|
+
#outer.get_buffer().wclear
|
220
|
+
#outer << "#{ch} got (#{str})"
|
221
|
+
# outer.repaint
|
222
|
+
# outer.buffer_to_screen
|
223
|
+
@form.repaint
|
224
|
+
@form.handle_key(ch)
|
225
|
+
@window.wrefresh
|
226
|
+
end
|
227
|
+
end
|
228
|
+
rescue => ex
|
229
|
+
ensure
|
230
|
+
@window.destroy if !@window.nil?
|
231
|
+
VER::stop_ncurses
|
232
|
+
p ex if ex
|
233
|
+
p(ex.backtrace.join("\n")) if ex
|
234
|
+
$log.debug( ex) if ex
|
235
|
+
$log.debug(ex.backtrace.join("\n")) if ex
|
236
|
+
end
|
237
|
+
end
|