module Iup::ScrollBarAttributes

Attributes for widgets that permit a scrollbar.

For all these attributes, the optional argument is used to set the value, else the current value is returned.

Attributes

xautohide

If set, hides horizontal scrollbar if not required. Values 'yes' / 'no'.

yautohide

If set, hides vertical scrollbar if not required. Values 'yes' / 'no'.

Public Instance Methods

dx(val=nil) click to toggle source

Defines the size of the horizontal thumbnail. Size defaults to 0.1, and must be in range 0 < value < (xmax-xmin).

# File lib/wrapped/scrollbar-attributes.rb, line 20
def dx val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'DX').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'DX', val.to_s
  end
end
dy(val=nil) click to toggle source

Defines the size of the vertical thumbnail. Size defaults to 0.1, and must be in range 0 < value < (ymax-ymin).

# File lib/wrapped/scrollbar-attributes.rb, line 31
def dy val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'DY').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'DY', val.to_s
  end
end
linex(val=nil) click to toggle source

Amount thumb moves in horizontal direction. Default is dx/10.

# File lib/wrapped/scrollbar-attributes.rb, line 103
def linex val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'LINEX').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'LINEX', val.to_s
  end
end
liney(val=nil) click to toggle source

Amount thumb moves in vertical direction. Default is dy/10.

# File lib/wrapped/scrollbar-attributes.rb, line 113
def liney val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'LINEY').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'LINEY', val.to_s
  end
end
posx(val=nil) click to toggle source

Position of horizontal thumbnail. Size starts at 0.0, and must be in range xmin < value < (xmax-dx).

# File lib/wrapped/scrollbar-attributes.rb, line 42
def posx val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'POSX').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'POSX', val.to_s
  end
end
posy(val=nil) click to toggle source

Position of vertical thumbnail. Size starts at 0.0, and must be in range ymin < value < (ymax-dy).

# File lib/wrapped/scrollbar-attributes.rb, line 53
def posy val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'POSY').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'POSY', val.to_s
  end
end
scroll_cb(callback) click to toggle source

Called when scrollbar used. Callback must take three arguments:

op

operation performed on scrollbar, see Iup

posx

x position of scroll thumb (same as posx attribute)

posy

y position of scroll thumb (same as posy attribute)

# File lib/wrapped/scrollbar-attributes.rb, line 130
def scroll_cb callback
  unless callback.arity == 3
    raise ArgumentError, 'scroll_cb callback must take 3 arguments: (op, posx, posy)'
  end
  cb = Proc.new do |ih, op, posx, posy|
    callback.call op, posx, posy
  end
  define_callback cb, 'SCROLL_CB', :iff_i
end
xmax(val=nil) click to toggle source

Maximum value of horizontal scrollbar. Defaults to 1.0.

# File lib/wrapped/scrollbar-attributes.rb, line 83
def xmax val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'XMAX').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'XMAX', val.to_s
  end
end
xmin(val=nil) click to toggle source

Minimum value of horizontal scrollbar. Starts at 0.0.

# File lib/wrapped/scrollbar-attributes.rb, line 63
def xmin val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'XMIN').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'XMIN', val.to_s
  end
end
ymax(val=nil) click to toggle source

Maximum value of vertical scrollbar. Defaults to 1.0.

# File lib/wrapped/scrollbar-attributes.rb, line 93
def ymax val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'YMAX').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'YMAX', val.to_s
  end
end
ymin(val=nil) click to toggle source

Minimum value of vertical scrollbar. Starts at 0.0.

# File lib/wrapped/scrollbar-attributes.rb, line 73
def ymin val=nil
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'YMIN').first
    result.to_f
  else
    IupLib.IupSetAttribute @handle, 'YMIN', val.to_s
  end
end