rcurses 2.5 → 2.6.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/lib/rcurses/pane.rb +14 -0
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d761408b4f05dc23d8ce7bbccee6e205f197a7121755ecda26a12f07cf1c3270
4
- data.tar.gz: 0abd1a9a7b67cb96a9a00c537d17c414f8ceb78e78747627cd49305bf22bf57f
3
+ metadata.gz: aed95a107616226e2f90aaf5db3dbfd3cddfbb905254e31115857d882741fa61
4
+ data.tar.gz: ba178a044ed384e5bc3c2c53af77cc654eb96977316e1464f3b0be3e8c35694f
5
5
  SHA512:
6
- metadata.gz: 641587c5622dee1f388f027a3bbec71f5072a74cdbe0ed7dc26fcc33e17fc112a22422d81785f32ca3d46398130809d44cd6f6f3f831819fd005bee791735b77
7
- data.tar.gz: e6b7d6ccb2024490326d3a2452a361b8886b5518f0c9a2d8015f79345911cbc7898b64ecf228333dd6099631c9214aa09a56ea9a8d089fa30d02494f802a85fa
6
+ metadata.gz: 1af985cfb5ecb496bcf321a4429c8b038528c8ba46191eae4e4304746e0ca61a517268342dbf4293f004553e57222f95e96fc67c78710d605ad33a57a0cfcb14
7
+ data.tar.gz: 3e8232f1023544530e6728a5a1be196764e0296765eb5d3639b63b34fd645b592a49a3efcc0109dcda6597a35e5f280337a6c6e08d3602cfd588e90c39938de0
data/README.md CHANGED
@@ -81,6 +81,8 @@ edit | An editor for the Pane. When this is invoked, all existing font
81
81
  editline | Used for one-line Panes. It will print the content of the property `prompt` and then the property `text` that can then be edited by the user. Hitting `ESC` will disregard the edits, while `ENTER` will save the edited text
82
82
  puts(text) | Short form for setting panel.text, then doing a refresh of that panel
83
83
  ask(prompt,text) | Short form of setting panel.prompt, then panel.text, doing a panel.editline and then returning panel.text
84
+ pagedown | Go down one page height in the text (minus one line), but not longer than the length of the text
85
+ pageup | Go up one page height in the text (minus one line)
84
86
 
85
87
  # class String extensions
86
88
  Method extensions provided for the class String:
data/lib/rcurses/pane.rb CHANGED
@@ -35,6 +35,19 @@ module Rcurses
35
35
 
36
36
  def puts(text)
37
37
  @text = text
38
+ @ix = 0
39
+ refresh
40
+ end
41
+
42
+ def pageup
43
+ @ix = @ix - @h + 1
44
+ @ix = 0 if @ix < 0
45
+ refresh
46
+ end
47
+
48
+ def pagedown
49
+ @ix = @ix + @h - 1
50
+ @ix = @text.length - 1 if @ix > @text.length - 1
38
51
  refresh
39
52
  end
40
53
 
@@ -411,6 +424,7 @@ module Rcurses
411
424
  @y = [[@y, 1].max, @max_h - @h + 1].min
412
425
 
413
426
  @scroll = false
427
+ @ix = 0
414
428
  row(@y)
415
429
 
416
430
  fmt = [@fg, @bg].compact.join(',')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.5'
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -29,8 +29,9 @@ description: 'Create curses applications for the terminal easier than ever. Crea
29
29
  up text (in panes or anywhere in the terminal) in bold, italic, underline, reverse
30
30
  color, blink and in any 256 terminal colors for foreground and background. Use a
31
31
  simple editor to let users edit text in panes. Left, right or center align text
32
- in panes. Cursor movement around the terminal. New in 2.5: Simplified the over-engineering,
33
- removing startx, starty, width and height of pane creation.'
32
+ in panes. Cursor movement around the terminal. New in 2.6: Added methods ''pagedown''
33
+ and ''pageup'' to panes enabling text scrolling. 2.6.1: Resetting index ''ix'' to
34
+ 0 on pane methods ''puts'' and ''editline''.'
34
35
  email: g@isene.com
35
36
  executables: []
36
37
  extensions: []