Class: Fidgit::ScrollWindow

Inherits:
Composite show all
Defined in:
lib/fidgit/elements/scroll_window.rb

Constant Summary

Constant Summary

Constants inherited from Composite

Composite::DEBUG_BORDER_COLOR

Constants inherited from Element

Element::DEFAULT_SCHEMA_FILE, Element::VALID_ALIGN_H, Element::VALID_ALIGN_V

Instance Attribute Summary

Attributes inherited from Packer

#spacing_h, #spacing_v

Attributes inherited from Element

#align_h, #align_v, #background_color, #border_thickness, #font, #padding_bottom, #padding_left, #padding_right, #padding_top, #parent, #tip, #z

Instance Method Summary collapse

Methods inherited from Container

#add, #button, #clear, #color_picker, #color_well, #combo_box, #file_browser, #grid, #group, #hit_element, #horizontal, #image_frame, #insert, #label, #list, #radio_button, #remove, #scroll_area, #scroll_window, #slider, #text_area, #to_s, #toggle_button, #update, #vertical, #write_tree, #x=, #y=

Methods inherited from Element

#default, #drag?, #draw, #draw_frame, #draw_rect, #enabled=, #enabled?, #height, #hit?, #max_height, #max_width, #min_height, #min_width, new, original_new, #outer_height, #outer_width, #recalc, schema, #to_s, #update, #width, #with, #x, #x=, #y, #y=

Methods included from Event

#events, included, new_event_handlers, #publish, #subscribe, #unsubscribe

Constructor Details

#initialize(options = {}) ⇒ ScrollWindow



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fidgit/elements/scroll_window.rb', line 18

def initialize(options = {})
  options = {
    scroll_bar_thickness: default(:scroll_bar_thickness),
  }.merge! options

  super(options)

  @grid = grid num_columns: 2, padding: 0, spacing: 0 do
    @view = scroll_area(owner: self, width: options[:width], height: options[:height])
    @spacer = label '', padding: 0, width: 0, height: 0
  end

  @scroll_bar_v = VerticalScrollBar.new(owner: self, width: options[:scroll_bar_thickness], align_v: :fill)
  @scroll_bar_h = HorizontalScrollBar.new(owner: self, height: options[:scroll_bar_thickness], align_h: :fill)
end

Instance Method Details

#contentObject



5
# File 'lib/fidgit/elements/scroll_window.rb', line 5

def content; @view.content; end

#content_heightObject



14
# File 'lib/fidgit/elements/scroll_window.rb', line 14

def content_height; @view.content.height; end

#content_widthObject



13
# File 'lib/fidgit/elements/scroll_window.rb', line 13

def content_width; @view.content.width; end

#height=(value) ⇒ Object



16
# File 'lib/fidgit/elements/scroll_window.rb', line 16

def height=(value); super(value); end

#offset_xObject



6
# File 'lib/fidgit/elements/scroll_window.rb', line 6

def offset_x; @view.offset_x; end

#offset_x=(value) ⇒ Object



7
# File 'lib/fidgit/elements/scroll_window.rb', line 7

def offset_x=(value); @view.offset_x = value; end

#offset_yObject



8
# File 'lib/fidgit/elements/scroll_window.rb', line 8

def offset_y; @view.offset_y; end

#offset_y=(value) ⇒ Object



9
# File 'lib/fidgit/elements/scroll_window.rb', line 9

def offset_y=(value); @view.offset_y = value; end

#view_heightObject



12
# File 'lib/fidgit/elements/scroll_window.rb', line 12

def view_height; @view.height; end

#view_widthObject



11
# File 'lib/fidgit/elements/scroll_window.rb', line 11

def view_width; @view.width; end

#width=(value) ⇒ Object



15
# File 'lib/fidgit/elements/scroll_window.rb', line 15

def width=(value); super(value); end