lib/rbcurse/rscrollpane.rb in rbcurse-1.2.0 vs lib/rbcurse/rscrollpane.rb in rbcurse-1.3.0
- old
+ new
@@ -29,16 +29,16 @@
* License:
Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
=end
#require 'rubygems'
-require 'ncurses'
+#require 'ncurses'
require 'logger'
require 'rbcurse'
require 'rbcurse/rviewport'
-include Ncurses
+#include Ncurses # FFI 2011-09-8
include RubyCurses
module RubyCurses
extend self
##
@@ -447,14 +447,14 @@
# # the problem with next 2 lines is that attributes of border could be overwritten
# draw horiz line
r = @row #+ @ext_row_offset # 2010-02-11 11:57 RFED16
c = @col #+ @ext_col_offset # 2010-02-11 11:57 RFED16
$log.debug " h_scroll_bar start #{start}, r #{r} c #{c} h:#{@height} "
- @graphic.rb_mvwhline(r+@height-1, c+1, ACS_HLINE, @width-2)
+ @graphic.rb_mvwhline(r+@height-1, c+1, FFI::NCurses::ACS_HLINE, @width-2)
# draw scroll bar
- #sz.times{ |i| @graphic.mvaddch(r+@height-1, c+start+1+i, ACS_CKBOARD) }
- sz.times{ |i| @graphic.rb_mvaddch(r+@height-1, c+start+1+i, ACS_CKBOARD) }
+ #sz.times{ |i| @graphic.mvaddch(r+@height-1, c+start+1+i, FFI::NCurses::ACS_CKBOARD) }
+ sz.times{ |i| @graphic.rb_mvaddch(r+@height-1, c+start+1+i, FFI::NCurses::ACS_CKBOARD) }
end
def v_scroll_bar
return if @viewport.nil?
sz = (@viewport.height*1.00/@viewport.child().height)*@viewport.height
#$log.debug " v_scroll_bar sz #{sz}, #{@viewport.width} #{@viewport.child().width}"
@@ -468,14 +468,14 @@
$log.debug " v_scroll_bar start #{start}, col:#{@col} w:#{@width}, r #{r}+1 c #{c}+w-1 "
start = start.ceil
# # the problem with next 2 lines is that attributes of border could be overwritten
# draw verti line
# this is needed to erase previous bar when shrinking
- #@graphic.mvwvline(r+1,c+@width-1, ACS_VLINE, @height-2)
- @graphic.rb_mvwvline(r+1,c+@width-1, ACS_VLINE, @height-2)
+ #@graphic.mvwvline(r+1,c+@width-1, FFI::NCurses::ACS_VLINE, @height-2)
+ @graphic.rb_mvwvline(r+1,c+@width-1, FFI::NCurses::ACS_VLINE, @height-2)
# draw scroll bar
- #sz.times{ |i| @graphic.mvaddch(r+start+1+i, c+@width-1, ACS_CKBOARD) }
- sz.times{ |i| @graphic.rb_mvaddch(r+start+1+i, c+@width-1, ACS_CKBOARD) }
+ #sz.times{ |i| @graphic.mvaddch(r+start+1+i, c+@width-1, FFI::NCurses::ACS_CKBOARD) }
+ sz.times{ |i| @graphic.rb_mvaddch(r+start+1+i, c+@width-1, FFI::NCurses::ACS_CKBOARD) }
end
# set height
# a container must pass down changes in size to it's children
# 2010-02-04 18:06 - i am not sure about this. When viewport is set then it passes down
# changes to child which user did not intend. Maybe in splitpane it is okay but other cases?