canis 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +10 -0
- data/README.md +99 -4
- data/examples/common/devel.rb +84 -1
- data/examples/dbdemo.rb +356 -30
- data/lib/canis/core/include/appmethods.rb +13 -4
- data/lib/canis/core/include/colorparser.rb +31 -10
- data/lib/canis/core/include/listselectionmodel.rb +2 -2
- data/lib/canis/core/include/rhistory.rb +2 -2
- data/lib/canis/core/system/colormap.rb +3 -3
- data/lib/canis/core/system/window.rb +8 -3
- data/lib/canis/core/util/app.rb +94 -93
- data/lib/canis/core/util/defaultcolorparser.rb +7 -3
- data/lib/canis/core/util/rdialogs.rb +325 -5
- data/lib/canis/core/util/viewer.rb +1 -1
- data/lib/canis/core/util/widgetshortcuts.rb +3 -3
- data/lib/canis/core/widgets/applicationheader.rb +2 -4
- data/lib/canis/core/widgets/extras/rtextarea.rb +3 -1
- data/lib/canis/core/widgets/listbox.rb +2 -1
- data/lib/canis/core/widgets/rmenu.rb +45 -31
- data/lib/canis/core/widgets/rmessagebox.rb +51 -2
- data/lib/canis/core/widgets/rwidget.rb +23 -15
- data/lib/canis/core/widgets/statusline.rb +19 -9
- data/lib/canis/core/widgets/textpad.rb +2 -2
- data/lib/canis/version.rb +1 -1
- metadata +2 -2
@@ -13,15 +13,23 @@ module Canis
|
|
13
13
|
# @status_line.command {
|
14
14
|
# "F1 Help | F2 Menu | F3 View | F4 Shell | F5 Sh | %20s" % [message_label.text]
|
15
15
|
# }
|
16
|
+
#
|
17
|
+
# == Changes
|
18
|
+
# Earlier, the color of teh status line was REVERSED while printing which can be confusing
|
19
|
+
# and surprising. We should use normal, or use whatever attribute the user gives.
|
20
|
+
# Also, using the row as -3 is assuming that a dock is used, which may not be the case,
|
21
|
+
# so -1 should be used.
|
22
|
+
#
|
16
23
|
class StatusLine < Widget
|
24
|
+
@@negative_offset = -1 # 2014-08-31 - 12:18 earlier -3
|
17
25
|
#attr_accessor :row_relative # lets only advertise this when we've tested it out
|
18
26
|
|
19
27
|
def initialize form, config={}, &block
|
20
|
-
@row_relative =
|
28
|
+
@row_relative = @@negative_offset
|
21
29
|
if form.window.height == 0
|
22
|
-
@row = Ncurses.LINES
|
30
|
+
@row = Ncurses.LINES + @@negative_offset
|
23
31
|
else
|
24
|
-
@row = form.window.height
|
32
|
+
@row = form.window.height + @@negative_offset
|
25
33
|
end
|
26
34
|
# in root windows FIXME
|
27
35
|
@col = 0
|
@@ -65,6 +73,8 @@ module Canis
|
|
65
73
|
# rather whenever form.repaint is called.
|
66
74
|
def repaint
|
67
75
|
@color_pair ||= get_color($datacolor, @color, @bgcolor)
|
76
|
+
# earlier attrib defaulted to REVERSE which was surprising.
|
77
|
+
_attr = @attr || Ncurses::A_NORMAL
|
68
78
|
len = @form.window.getmaxx # width does not change upon resizing so useless, fix or do something
|
69
79
|
len = Ncurses.COLS if len == 0 || len > Ncurses.COLS
|
70
80
|
# this should only happen if there's a change in window
|
@@ -73,7 +83,7 @@ module Canis
|
|
73
83
|
end
|
74
84
|
|
75
85
|
# first print dashes through
|
76
|
-
@form.window.printstring @row, @col, "%s" % "-" * len, @color_pair,
|
86
|
+
@form.window.printstring @row, @col, "%s" % "-" * len, @color_pair, _attr
|
77
87
|
|
78
88
|
# now call the block to get current values
|
79
89
|
if @command
|
@@ -87,19 +97,19 @@ module Canis
|
|
87
97
|
# what if user wants to change attrib ?
|
88
98
|
if ftext =~ /#\[/
|
89
99
|
# hopefully color_pair does not clash with formatting
|
90
|
-
@form.window.printstring_formatted @row, @col, ftext, @color_pair,
|
100
|
+
@form.window.printstring_formatted @row, @col, ftext, @color_pair, _attr
|
91
101
|
else
|
92
|
-
@form.window.printstring @row, @col, ftext, @color_pair,
|
102
|
+
@form.window.printstring @row, @col, ftext, @color_pair, _attr
|
93
103
|
end
|
94
104
|
|
95
105
|
if @right_text
|
96
106
|
ftext = @right_text.call(self, @right_args)
|
97
107
|
if ftext =~ /#\[/
|
98
108
|
# hopefully color_pair does not clash with formatting
|
99
|
-
@form.window.printstring_formatted_right @row, nil, ftext, @color_pair,
|
109
|
+
@form.window.printstring_formatted_right @row, nil, ftext, @color_pair, _attr
|
100
110
|
else
|
101
111
|
c = len - ftext.length
|
102
|
-
@form.window.printstring @row, c, ftext, @color_pair,
|
112
|
+
@form.window.printstring @row, c, ftext, @color_pair, _attr
|
103
113
|
end
|
104
114
|
else
|
105
115
|
t = Time.now
|
@@ -108,7 +118,7 @@ module Canis
|
|
108
118
|
# somehow the bg defined here affects the bg in left text, if left does not define
|
109
119
|
# a bg. The bgcolor defined of statusline is ignored in left or overriden by this
|
110
120
|
#ftext = "#[fg=white,bg=blue] %-20s#[/end]" % [tt] # print a default
|
111
|
-
@form.window.printstring_formatted_right @row, nil, tt, @color_pair,
|
121
|
+
@form.window.printstring_formatted_right @row, nil, tt, @color_pair, _attr
|
112
122
|
end
|
113
123
|
|
114
124
|
@repaint_required = false
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# Author: jkepler http://github.com/mare-imbrium/mancurses/
|
11
11
|
# Date: 2011-11-09 - 16:59
|
12
12
|
# License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
|
13
|
-
# Last update: 2014-
|
13
|
+
# Last update: 2014-08-27 20:54
|
14
14
|
#
|
15
15
|
# == CHANGES
|
16
16
|
# - changed @content to @list since all multirow widgets use that and so do utils etc
|
@@ -751,7 +751,7 @@ module Canis
|
|
751
751
|
def clear
|
752
752
|
return unless @list
|
753
753
|
@list.clear
|
754
|
-
@native_text.clear
|
754
|
+
@native_text.clear if @native_text # check this line, should it be removed 2014-08-27 - 20:54
|
755
755
|
fire_dimension_changed :clear
|
756
756
|
init_vars
|
757
757
|
end
|
data/lib/canis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kepler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|