cdk 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cdk.rb +7 -866
- data/lib/cdk/cdk_objs.rb +46 -423
- data/lib/cdk/components.rb +28 -0
- data/lib/cdk/{alphalist.rb → components/alphalist.rb} +9 -6
- data/lib/cdk/components/button.rb +405 -0
- data/lib/cdk/{buttonbox.rb → components/buttonbox.rb} +11 -11
- data/lib/cdk/{calendar.rb → components/calendar.rb} +13 -13
- data/lib/cdk/components/dialog.rb +343 -0
- data/lib/cdk/{dscale.rb → components/dscale.rb} +0 -0
- data/lib/cdk/{entry.rb → components/entry.rb} +18 -18
- data/lib/cdk/{fscale.rb → components/fscale.rb} +1 -1
- data/lib/cdk/{fselect.rb → components/fselect.rb} +16 -13
- data/lib/cdk/{fslider.rb → components/fslider.rb} +1 -1
- data/lib/cdk/components/graph.rb +386 -0
- data/lib/cdk/{histogram.rb → components/histogram.rb} +3 -3
- data/lib/cdk/{itemlist.rb → components/itemlist.rb} +14 -14
- data/lib/cdk/{label.rb → components/label.rb} +7 -7
- data/lib/cdk/{marquee.rb → components/marquee.rb} +7 -7
- data/lib/cdk/{matrix.rb → components/matrix.rb} +27 -27
- data/lib/cdk/{mentry.rb → components/mentry.rb} +18 -18
- data/lib/cdk/{menu.rb → components/menu.rb} +18 -18
- data/lib/cdk/{radio.rb → components/radio.rb} +12 -12
- data/lib/cdk/{scale.rb → components/scale.rb} +13 -13
- data/lib/cdk/{scroll.rb → components/scroll.rb} +23 -386
- data/lib/cdk/{scroller.rb → components/scroller.rb} +1 -1
- data/lib/cdk/{selection.rb → components/selection.rb} +14 -14
- data/lib/cdk/{slider.rb → components/slider.rb} +15 -15
- data/lib/cdk/{swindow.rb → components/swindow.rb} +14 -14
- data/lib/cdk/{template.rb → components/template.rb} +18 -18
- data/lib/cdk/{uscale.rb → components/uscale.rb} +0 -0
- data/lib/cdk/{uslider.rb → components/uslider.rb} +0 -0
- data/lib/cdk/{viewer.rb → components/viewer.rb} +88 -18
- data/lib/cdk/constants.rb +54 -0
- data/lib/cdk/display.rb +30 -35
- data/lib/cdk/draw.rb +4 -6
- data/lib/cdk/helpers/file.rb +43 -0
- data/lib/cdk/helpers/types.rb +13 -0
- data/lib/cdk/helpers/window.rb +64 -0
- data/lib/cdk/mixins/alignments.rb +55 -0
- data/lib/cdk/mixins/bindings.rb +73 -0
- data/lib/cdk/mixins/borders.rb +62 -0
- data/lib/cdk/mixins/common_controls.rb +14 -0
- data/lib/cdk/mixins/converters.rb +358 -0
- data/lib/cdk/mixins/exit_conditions.rb +31 -0
- data/lib/cdk/mixins/focusable.rb +17 -0
- data/lib/cdk/mixins/formattable.rb +15 -0
- data/lib/cdk/mixins/has_screen.rb +23 -0
- data/lib/cdk/mixins/has_title.rb +64 -0
- data/lib/cdk/mixins/justifications.rb +26 -0
- data/lib/cdk/mixins/list_support.rb +31 -0
- data/lib/cdk/mixins/movement.rb +140 -0
- data/lib/cdk/mixins/window_hooks.rb +18 -0
- data/lib/cdk/mixins/window_input.rb +61 -0
- data/lib/cdk/screen.rb +27 -3
- metadata +51 -29
- data/lib/cdk/dialog.rb +0 -727
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class HISTOGRAM < CDK::CDKOBJS
|
@@ -34,7 +34,7 @@ module CDK
|
|
34
34
|
# Rejustify the x and y positions if we need to.
|
35
35
|
xtmp = [xplace]
|
36
36
|
ytmp = [yplace]
|
37
|
-
|
37
|
+
alignxy(cdkscreen.window, xtmp, ytmp, box_width, box_height)
|
38
38
|
xpos = xtmp[0]
|
39
39
|
ypos = ytmp[0]
|
40
40
|
|
@@ -377,7 +377,7 @@ module CDK
|
|
377
377
|
end
|
378
378
|
|
379
379
|
# Refresh the window
|
380
|
-
|
380
|
+
wrefresh
|
381
381
|
end
|
382
382
|
|
383
383
|
# Destroy the widget.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class ITEMLIST < CDK::CDKOBJS
|
@@ -25,7 +25,7 @@ module CDK
|
|
25
25
|
# Translate the label string to a chtype array
|
26
26
|
if !(label.nil?) && label.size > 0
|
27
27
|
label_len = []
|
28
|
-
@label =
|
28
|
+
@label = char2Chtype(label, label_len, [])
|
29
29
|
@label_len = label_len[0]
|
30
30
|
end
|
31
31
|
|
@@ -43,7 +43,7 @@ module CDK
|
|
43
43
|
# Rejustify the x and y positions if we need to.
|
44
44
|
xtmp = [xplace]
|
45
45
|
ytmp = [yplace]
|
46
|
-
|
46
|
+
alignxy(cdkscreen.window, xtmp, ytmp, box_width, box_height)
|
47
47
|
xpos = xtmp[0]
|
48
48
|
ypos = ytmp[0]
|
49
49
|
|
@@ -145,7 +145,7 @@ module CDK
|
|
145
145
|
def inject(input)
|
146
146
|
pp_return = 1
|
147
147
|
ret = -1
|
148
|
-
complete = false
|
148
|
+
@complete = false
|
149
149
|
|
150
150
|
# Set the exit type.
|
151
151
|
self.setExitType(0)
|
@@ -163,7 +163,7 @@ module CDK
|
|
163
163
|
if pp_return != 0
|
164
164
|
# Check a predefined binding.
|
165
165
|
if self.checkBind(:ITEMLIST, input)
|
166
|
-
complete = true
|
166
|
+
@complete = true
|
167
167
|
else
|
168
168
|
case input
|
169
169
|
when Ncurses::KEY_UP, Ncurses::KEY_RIGHT, ' '.ord, '+'.ord, 'n'.ord
|
@@ -186,14 +186,14 @@ module CDK
|
|
186
186
|
@current_item = @list_size - 1
|
187
187
|
when CDK::KEY_ESC
|
188
188
|
self.setExitType(input)
|
189
|
-
complete = true
|
189
|
+
@complete = true
|
190
190
|
when Ncurses::ERR
|
191
191
|
self.setExitType(input)
|
192
|
-
complete = true
|
192
|
+
@complete = true
|
193
193
|
when CDK::KEY_TAB, CDK::KEY_RETURN, Ncurses::KEY_ENTER
|
194
194
|
self.setExitType(input)
|
195
195
|
ret = @current_item
|
196
|
-
complete = true
|
196
|
+
@complete = true
|
197
197
|
when CDK::REFRESH
|
198
198
|
@screen.erase
|
199
199
|
@screen.refresh
|
@@ -203,12 +203,12 @@ module CDK
|
|
203
203
|
end
|
204
204
|
|
205
205
|
# Should we call a post-process?
|
206
|
-
if
|
206
|
+
if !@complete && !(@post_process_func.nil?)
|
207
207
|
@post_process_func.call(:ITEMLIST, self, @post_process_data, input)
|
208
208
|
end
|
209
209
|
end
|
210
210
|
|
211
|
-
if
|
211
|
+
if !@complete
|
212
212
|
self.drawField(true)
|
213
213
|
self.setExitType(0)
|
214
214
|
end
|
@@ -244,7 +244,7 @@ module CDK
|
|
244
244
|
Draw.drawObjBox(@win, self)
|
245
245
|
end
|
246
246
|
|
247
|
-
|
247
|
+
wrefresh
|
248
248
|
|
249
249
|
# Draw in the field.
|
250
250
|
self.drawField(false)
|
@@ -282,7 +282,7 @@ module CDK
|
|
282
282
|
end
|
283
283
|
|
284
284
|
# Redraw the field window.
|
285
|
-
@field_win
|
285
|
+
wrefresh(@field_win)
|
286
286
|
end
|
287
287
|
|
288
288
|
# This function removes the widget from the screen.
|
@@ -402,7 +402,7 @@ module CDK
|
|
402
402
|
# Copy the item to the list.
|
403
403
|
lentmp = []
|
404
404
|
postmp = []
|
405
|
-
new_items <<
|
405
|
+
new_items << char2Chtype(item[x], lentmp, postmp)
|
406
406
|
new_len << lentmp[0]
|
407
407
|
new_pos << postmp[0]
|
408
408
|
if new_items[0] == 0
|
@@ -414,7 +414,7 @@ module CDK
|
|
414
414
|
|
415
415
|
# Now we need to justify the strings.
|
416
416
|
(0...count).each do |x|
|
417
|
-
new_pos[x] =
|
417
|
+
new_pos[x] = justify_string(field_width + 1,
|
418
418
|
new_len[x], new_pos[x])
|
419
419
|
end
|
420
420
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class LABEL < CDK::CDKOBJS
|
@@ -30,7 +30,7 @@ module CDK
|
|
30
30
|
#Translate the string to a chtype array
|
31
31
|
info_len = []
|
32
32
|
info_pos = []
|
33
|
-
@info <<
|
33
|
+
@info << char2Chtype(mesg[x], info_len, info_pos)
|
34
34
|
@info_len << info_len[0]
|
35
35
|
@info_pos << info_pos[0]
|
36
36
|
box_width = [box_width, @info_len[x]].max
|
@@ -39,7 +39,7 @@ module CDK
|
|
39
39
|
|
40
40
|
# Create the string alignments.
|
41
41
|
(0...rows).each do |x|
|
42
|
-
@info_pos[x] =
|
42
|
+
@info_pos[x] = justify_string(box_width - 2 * @border_size,
|
43
43
|
@info_len[x], @info_pos[x])
|
44
44
|
end
|
45
45
|
|
@@ -54,7 +54,7 @@ module CDK
|
|
54
54
|
end
|
55
55
|
|
56
56
|
# Rejustify the x and y positions if we need to
|
57
|
-
|
57
|
+
alignxy(cdkscreen.window, xpos, ypos, box_width, box_height)
|
58
58
|
@screen = cdkscreen
|
59
59
|
@parent = cdkscreen.window
|
60
60
|
@win = Ncurses::WINDOW.new(box_height, box_width, ypos[0], xpos[0])
|
@@ -114,9 +114,9 @@ module CDK
|
|
114
114
|
(0...@rows).each do |x|
|
115
115
|
info_len = []
|
116
116
|
info_pos = []
|
117
|
-
@info[x] =
|
117
|
+
@info[x] = char2Chtype(info[x], info_len, info_pos)
|
118
118
|
@info_len[x] = info_len[0]
|
119
|
-
@info_pos[x] =
|
119
|
+
@info_pos[x] = justify_string(@box_width - 2 * @border_size,
|
120
120
|
@info_len[x], info_pos[0])
|
121
121
|
end
|
122
122
|
|
@@ -163,7 +163,7 @@ module CDK
|
|
163
163
|
end
|
164
164
|
|
165
165
|
# Refresh the window
|
166
|
-
|
166
|
+
wrefresh
|
167
167
|
end
|
168
168
|
|
169
169
|
# This erases the label widget
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class MARQUEE < CDK::CDKOBJS
|
@@ -42,7 +42,7 @@ module CDK
|
|
42
42
|
padding = if mesg[-1] == ' ' then 0 else 1 end
|
43
43
|
|
44
44
|
# Translate the string to a chtype array
|
45
|
-
message =
|
45
|
+
message = char2Chtype(mesg, mesg_length, [])
|
46
46
|
|
47
47
|
# Draw in the widget.
|
48
48
|
self.draw(@box)
|
@@ -67,7 +67,7 @@ module CDK
|
|
67
67
|
@win.mvwaddch(@border_size, x, ch)
|
68
68
|
y += 1
|
69
69
|
end
|
70
|
-
|
70
|
+
wrefresh
|
71
71
|
|
72
72
|
# Set my variables
|
73
73
|
if mesg_length[0] < view_limit
|
@@ -112,7 +112,7 @@ module CDK
|
|
112
112
|
|
113
113
|
# Time to start over.
|
114
114
|
@win.mvwaddch(@border_size, @border_size, ' '.ord)
|
115
|
-
|
115
|
+
wrefresh
|
116
116
|
first_time = true
|
117
117
|
end
|
118
118
|
|
@@ -152,7 +152,7 @@ module CDK
|
|
152
152
|
end
|
153
153
|
|
154
154
|
# Refresh the window.
|
155
|
-
|
155
|
+
wrefresh
|
156
156
|
end
|
157
157
|
|
158
158
|
# This destroys the widget.
|
@@ -212,7 +212,7 @@ module CDK
|
|
212
212
|
# Rejustify the x and y positions if we need to.
|
213
213
|
xtmp = [xpos]
|
214
214
|
ytmp = [ypos]
|
215
|
-
|
215
|
+
alignxy(@screen.window, xtmp, ytmp, box_width, box_height)
|
216
216
|
window = Ncurses::WINDOW.new(box_height, box_width, ytmp[0], xtmp[0])
|
217
217
|
|
218
218
|
unless window.nil?
|
@@ -233,7 +233,7 @@ module CDK
|
|
233
233
|
def self.discardWin(winp)
|
234
234
|
unless winp.nil?
|
235
235
|
winp.werase
|
236
|
-
|
236
|
+
SCREEN.wrefresh(winp)
|
237
237
|
winp.delwin
|
238
238
|
end
|
239
239
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class MATRIX < CDK::CDKOBJS
|
@@ -82,7 +82,7 @@ module CDK
|
|
82
82
|
end
|
83
83
|
rowtitle_len = []
|
84
84
|
rowtitle_pos = []
|
85
|
-
@rowtitle[x] =
|
85
|
+
@rowtitle[x] = char2Chtype((rowtitles[x] || ''),
|
86
86
|
rowtitle_len, rowtitle_pos)
|
87
87
|
@rowtitle_len[x] = rowtitle_len[0]
|
88
88
|
@rowtitle_pos[x] = rowtitle_pos[0]
|
@@ -94,7 +94,7 @@ module CDK
|
|
94
94
|
|
95
95
|
# We need to rejustify the row title cell info.
|
96
96
|
(1..rows).each do |x|
|
97
|
-
@rowtitle_pos[x] =
|
97
|
+
@rowtitle_pos[x] = justify_string(@maxrt,
|
98
98
|
@rowtitle_len[x], @rowtitle_pos[x])
|
99
99
|
end
|
100
100
|
else
|
@@ -118,7 +118,7 @@ module CDK
|
|
118
118
|
# Rejustify the x and y positions if we need to.
|
119
119
|
xtmp = [xplace]
|
120
120
|
ytmp = [yplace]
|
121
|
-
|
121
|
+
alignxy(cdkscreen.window, xtmp, ytmp, box_width, box_height)
|
122
122
|
xpos = xtmp[0]
|
123
123
|
ypos = ytmp[0]
|
124
124
|
|
@@ -146,10 +146,10 @@ module CDK
|
|
146
146
|
end
|
147
147
|
coltitle_len = []
|
148
148
|
coltitle_pos = []
|
149
|
-
@coltitle[x] =
|
149
|
+
@coltitle[x] = char2Chtype(coltitles[x] || '',
|
150
150
|
coltitle_len, coltitle_pos)
|
151
151
|
@coltitle_len[x] = coltitle_len[0]
|
152
|
-
@coltitle_pos[x] = @border_size +
|
152
|
+
@coltitle_pos[x] = @border_size + justify_string(
|
153
153
|
colwidths[x], @coltitle_len[x], coltitle_pos[0])
|
154
154
|
@colwidths[x] = colwidths[x]
|
155
155
|
end
|
@@ -244,7 +244,7 @@ module CDK
|
|
244
244
|
then matrix.filler
|
245
245
|
else plainchar
|
246
246
|
end)
|
247
|
-
matrix.CurMatrixCell
|
247
|
+
wrefresh(matrix.CurMatrixCell)
|
248
248
|
|
249
249
|
# Update the info string
|
250
250
|
matrix.info[matrix.row][matrix.col] =
|
@@ -317,7 +317,7 @@ module CDK
|
|
317
317
|
charcount = @info[@row][@col].size
|
318
318
|
pp_return = 1
|
319
319
|
ret = -1
|
320
|
-
complete = false
|
320
|
+
@complete = false
|
321
321
|
|
322
322
|
# Set the exit type.
|
323
323
|
self.setExitType(0)
|
@@ -343,7 +343,7 @@ module CDK
|
|
343
343
|
if pp_return != 0
|
344
344
|
# Check the key bindings.
|
345
345
|
if self.checkBind(:MATRIX, input)
|
346
|
-
complete = true
|
346
|
+
@complete = true
|
347
347
|
else
|
348
348
|
case input
|
349
349
|
when CDK::TRANSPOSE
|
@@ -357,7 +357,7 @@ module CDK
|
|
357
357
|
self.CurMatrixCell.mvwdelch(1, charcount + 1)
|
358
358
|
self.CurMatrixCell.mvwinsch(1, charcount + 1, @filler)
|
359
359
|
|
360
|
-
self.CurMatrixCell
|
360
|
+
wrefresh(self.CurMatrixCell)
|
361
361
|
@info[@row][@col] = @info[@row][@col][0...charcount]
|
362
362
|
end
|
363
363
|
when Ncurses::KEY_RIGHT, CDK::KEY_TAB
|
@@ -540,13 +540,13 @@ module CDK
|
|
540
540
|
else
|
541
541
|
self.drawOldCell
|
542
542
|
end
|
543
|
-
self.CurMatrixCell
|
543
|
+
wrefresh(self.CurMatrixCell)
|
544
544
|
self.setExitType(input)
|
545
545
|
ret = 1
|
546
|
-
complete = true
|
546
|
+
@complete = true
|
547
547
|
when Ncurses::ERR
|
548
548
|
self.setExitType(input)
|
549
|
-
complete = true
|
549
|
+
@complete = true
|
550
550
|
when CDK::KEY_ESC
|
551
551
|
if !@box_cell
|
552
552
|
Draw.attrbox(@cell[@oldcrow][@oldccol], ' '.ord, ' '.ord,
|
@@ -554,9 +554,9 @@ module CDK
|
|
554
554
|
else
|
555
555
|
self.drawOldCell
|
556
556
|
end
|
557
|
-
self.CurMatrixCell
|
557
|
+
wrefresh(self.CurMatrixCell)
|
558
558
|
self.setExitType(input)
|
559
|
-
complete = true
|
559
|
+
@complete = true
|
560
560
|
when CDK::REFRESH
|
561
561
|
@screen.erase
|
562
562
|
@screen.refresh
|
@@ -565,7 +565,7 @@ module CDK
|
|
565
565
|
end
|
566
566
|
end
|
567
567
|
|
568
|
-
if
|
568
|
+
if !@complete
|
569
569
|
# Did we change cells?
|
570
570
|
if moved_cell
|
571
571
|
# un-highlight the old box
|
@@ -575,7 +575,7 @@ module CDK
|
|
575
575
|
else
|
576
576
|
self.drawOldCell
|
577
577
|
end
|
578
|
-
@cell[@oldcrow][@oldccol]
|
578
|
+
wrefresh(@cell[@oldcrow][@oldccol])
|
579
579
|
|
580
580
|
self.focusCurrent
|
581
581
|
end
|
@@ -593,7 +593,7 @@ module CDK
|
|
593
593
|
else
|
594
594
|
self.CurMatrixCell.wmove(1, self.CurMatrixInfo.size + 1)
|
595
595
|
end
|
596
|
-
self.CurMatrixCell
|
596
|
+
wrefresh(self.CurMatrixCell)
|
597
597
|
end
|
598
598
|
|
599
599
|
# Should we call a post-process?
|
@@ -603,7 +603,7 @@ module CDK
|
|
603
603
|
end
|
604
604
|
end
|
605
605
|
|
606
|
-
if
|
606
|
+
if !@complete
|
607
607
|
# Set the variables we need.
|
608
608
|
@oldcrow = @crow
|
609
609
|
@oldccol = @ccol
|
@@ -635,13 +635,13 @@ module CDK
|
|
635
635
|
# If the column is only one char.
|
636
636
|
(1..@colwidths[@ccol]).each do |x|
|
637
637
|
ch = if x <= infolen && !Display.isHiddenDisplayType(disptype)
|
638
|
-
then
|
638
|
+
then charOf(@info[@row][@col][x - 1])
|
639
639
|
else @filler
|
640
640
|
end
|
641
641
|
self.CurMatrixCell.mvwaddch(1, x, ch.ord | highlight)
|
642
642
|
end
|
643
643
|
self.CurMatrixCell.wmove(1, infolen + 1)
|
644
|
-
self.CurMatrixCell
|
644
|
+
wrefresh(self.CurMatrixCell)
|
645
645
|
end
|
646
646
|
|
647
647
|
# This moves the matrix field to the given location.
|
@@ -678,14 +678,14 @@ module CDK
|
|
678
678
|
# Draw in the cell info.
|
679
679
|
(1..@colwidths[col]).each do |x|
|
680
680
|
ch = if x <= infolen && !Display.isHiddenDisplayType(disptype)
|
681
|
-
then
|
681
|
+
then charOf(@info[vrow][vcol][x-1]).ord | highlight
|
682
682
|
else @filler
|
683
683
|
end
|
684
684
|
@cell[row][col].mvwaddch(1, x, ch.ord | highlight)
|
685
685
|
end
|
686
686
|
|
687
687
|
@cell[row][col].wmove(1, infolen + 1)
|
688
|
-
@cell[row][col]
|
688
|
+
wrefresh(@cell[row][col])
|
689
689
|
|
690
690
|
# Only draw the box iff the user asked for a box.
|
691
691
|
if !box
|
@@ -804,7 +804,7 @@ module CDK
|
|
804
804
|
@coltitle_pos[@lcol + x - 1], 0,
|
805
805
|
@coltitle[@lcol + x - 1], CDK::HORIZONTAL, 0,
|
806
806
|
@coltitle_len[@lcol + x - 1])
|
807
|
-
@cell[0][x]
|
807
|
+
wrefresh(@cell[0][x])
|
808
808
|
end
|
809
809
|
end
|
810
810
|
end
|
@@ -817,7 +817,7 @@ module CDK
|
|
817
817
|
@rowtitle_pos[@trow + x - 1], 1,
|
818
818
|
@rowtitle[@trow + x - 1], CDK::HORIZONTAL, 0,
|
819
819
|
@rowtitle_len[@trow + x - 1])
|
820
|
-
@cell[x][0]
|
820
|
+
wrefresh(@cell[x][0])
|
821
821
|
end
|
822
822
|
end
|
823
823
|
end
|
@@ -855,7 +855,7 @@ module CDK
|
|
855
855
|
|
856
856
|
self.drawTitle(@win)
|
857
857
|
|
858
|
-
|
858
|
+
wrefresh
|
859
859
|
|
860
860
|
self.drawEachColTitle
|
861
861
|
self.drawEachRowTitle
|
@@ -1134,7 +1134,7 @@ module CDK
|
|
1134
1134
|
Ncurses::ACS_URCORNER, Ncurses::ACS_LLCORNER,
|
1135
1135
|
Ncurses::ACS_LRCORNER, Ncurses::ACS_HLINE,
|
1136
1136
|
Ncurses::ACS_VLINE, Ncurses::A_BOLD)
|
1137
|
-
self.CurMatrixCell
|
1137
|
+
wrefresh(self.CurMatrixCell)
|
1138
1138
|
self.highlightCell
|
1139
1139
|
end
|
1140
1140
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative 'cdk_objs'
|
1
|
+
require_relative '../cdk_objs'
|
2
2
|
|
3
3
|
module CDK
|
4
4
|
class MENTRY < CDK::CDKOBJS
|
@@ -32,7 +32,7 @@ module CDK
|
|
32
32
|
# We need to translate the string label to a chtype array
|
33
33
|
if label.size > 0
|
34
34
|
label_len = []
|
35
|
-
@label =
|
35
|
+
@label = char2Chtype(label, label_len, [])
|
36
36
|
@label_len = label_len[0]
|
37
37
|
end
|
38
38
|
box_width = @label_len + field_width + 2
|
@@ -52,7 +52,7 @@ module CDK
|
|
52
52
|
# Rejustify the x and y positions if we need to.
|
53
53
|
xtmp = [xplace]
|
54
54
|
ytmp = [yplace]
|
55
|
-
|
55
|
+
alignxy(cdkscreen.window, xtmp, ytmp, box_width, box_height)
|
56
56
|
xpos = xtmp[0]
|
57
57
|
ypos = ytmp[0]
|
58
58
|
|
@@ -137,7 +137,7 @@ module CDK
|
|
137
137
|
mentry.drawField
|
138
138
|
end
|
139
139
|
mentry.field_win.wmove(mentry.current_row, mentry.current_col)
|
140
|
-
mentry.field_win
|
140
|
+
wrefresh(mentry.field_win)
|
141
141
|
end
|
142
142
|
end
|
143
143
|
end
|
@@ -230,7 +230,7 @@ module CDK
|
|
230
230
|
cursor_pos = self.getCursorPos
|
231
231
|
pp_return = 1
|
232
232
|
ret = -1
|
233
|
-
complete = false
|
233
|
+
@complete = false
|
234
234
|
|
235
235
|
# Set the exit type.
|
236
236
|
self.setExitType(0)
|
@@ -249,7 +249,7 @@ module CDK
|
|
249
249
|
if pp_return != 0
|
250
250
|
# Check for a key binding...
|
251
251
|
if self.checkBind(:MENTRY, input)
|
252
|
-
complete = true
|
252
|
+
@complete = true
|
253
253
|
else
|
254
254
|
moved = false
|
255
255
|
redraw = false
|
@@ -382,14 +382,14 @@ module CDK
|
|
382
382
|
else
|
383
383
|
self.setExitType(input)
|
384
384
|
ret = @info
|
385
|
-
complete = true
|
385
|
+
@complete = true
|
386
386
|
end
|
387
387
|
when Ncurses::ERR
|
388
388
|
self.setExitType(input)
|
389
|
-
complete = true
|
389
|
+
@complete = true
|
390
390
|
when CDK::KEY_ESC
|
391
391
|
self.setExitType(input)
|
392
|
-
complete = true
|
392
|
+
@complete = true
|
393
393
|
when CDK::REFRESH
|
394
394
|
@screen.erase
|
395
395
|
@screen.refresh
|
@@ -405,17 +405,17 @@ module CDK
|
|
405
405
|
self.drawField
|
406
406
|
elsif moved
|
407
407
|
@field_win.wmove(@current_row, @current_col)
|
408
|
-
@field_win
|
408
|
+
wrefresh(@field_win)
|
409
409
|
end
|
410
410
|
end
|
411
411
|
|
412
412
|
# Should we do a post-process?
|
413
|
-
if
|
413
|
+
if !@complete && !(@post_process_func.nil?)
|
414
414
|
@post_process_func.call(:MENTRY, self, @post_process_data, input)
|
415
415
|
end
|
416
416
|
end
|
417
417
|
|
418
|
-
if
|
418
|
+
if !@complete
|
419
419
|
self.setExitType(0)
|
420
420
|
end
|
421
421
|
|
@@ -435,7 +435,7 @@ module CDK
|
|
435
435
|
currchar = @field_width * @top_row
|
436
436
|
|
437
437
|
self.drawTitle(@win)
|
438
|
-
|
438
|
+
wrefresh
|
439
439
|
|
440
440
|
lastpos = @info.size
|
441
441
|
|
@@ -457,7 +457,7 @@ module CDK
|
|
457
457
|
|
458
458
|
# Refresh the screen.
|
459
459
|
@field_win.wmove(@current_row, @current_col)
|
460
|
-
@field_win
|
460
|
+
wrefresh(@field_win)
|
461
461
|
end
|
462
462
|
|
463
463
|
# This function draws the multiple line entry field.
|
@@ -465,7 +465,7 @@ module CDK
|
|
465
465
|
# Box the widget if asked.
|
466
466
|
if box
|
467
467
|
Draw.drawObjBox(@win, self)
|
468
|
-
|
468
|
+
wrefresh
|
469
469
|
end
|
470
470
|
|
471
471
|
# Do we need to draw in the shadow?
|
@@ -477,7 +477,7 @@ module CDK
|
|
477
477
|
unless @label_win.nil?
|
478
478
|
Draw.writeChtype(@label_win, 0, 0, @label, CDK::HORIZONTAL,
|
479
479
|
0, @label_len)
|
480
|
-
@label_win
|
480
|
+
wrefresh(@label_win)
|
481
481
|
end
|
482
482
|
|
483
483
|
# Draw the mentry field
|
@@ -596,11 +596,11 @@ module CDK
|
|
596
596
|
|
597
597
|
def focus
|
598
598
|
@field_win.wmove(0, @current_col)
|
599
|
-
@field_win
|
599
|
+
wrefresh(@field_win)
|
600
600
|
end
|
601
601
|
|
602
602
|
def unfocus
|
603
|
-
@field_win
|
603
|
+
wrefresh(@field_win)
|
604
604
|
end
|
605
605
|
|
606
606
|
def position
|