Class: Glimmer::LibUI::ControlProxy::AreaProxy::ScrollingAreaProxy

Inherits:
Glimmer::LibUI::ControlProxy::AreaProxy show all
Defined in:
lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb

Overview

Proxy for LibUI scrolling area objects

Follows the Proxy Design Pattern

Constant Summary

Constants inherited from Glimmer::LibUI::ControlProxy::AreaProxy

CUSTOM_LISTENER_NAMES, CUSTOM_LISTENER_NAME_ALIASES, SHIFTED_KEY_CODE_CHARS

Constants inherited from Glimmer::LibUI::ControlProxy

BOOLEAN_PROPERTIES, KEYWORD_ALIASES, STRING_PROPERTIES, TransformProxy

Instance Attribute Summary

Attributes inherited from Glimmer::LibUI::ControlProxy::AreaProxy

#area_handler

Attributes inherited from Glimmer::LibUI::ControlProxy

#args, #block, #content_added, #custom_control, #keyword, #libui, #options, #parent_custom_control, #parent_proxy, #slot

Instance Method Summary collapse

Methods inherited from Glimmer::LibUI::ControlProxy::AreaProxy

#auto_redraw_enabled, #draw, #libui_api_keyword, #pause_auto_redraw, #post_add_content, #redraw, #request_auto_redraw, #resume_auto_redraw

Methods included from Parent

#children, #post_initialize_child

Methods included from FiddleConsumer

#fiddle_closure_block_caller

Methods included from Transformable

#apply_transform, #draw, #post_initialize_child, #transform, #undo_transform

Methods inherited from Glimmer::LibUI::ControlProxy

#append_properties, #append_property, #bind_content, #can_handle_listener?, constant_symbol, #content, control_proxies, control_proxy_class, create, #custom_listener_name_aliases, #custom_listener_names, #default_destroy, #deregister_all_custom_listeners, #deregister_custom_listeners, descendant_keyword_constant_map, #destroy, #destroy_child, #enabled, exists?, #handle_custom_listener, #handle_listener, #has_custom_listener?, image_proxies, #initialize, keyword, #libui_api_keyword, #listeners, #listeners_for, main_window_proxy, map_descendant_keyword_constants_for, menu_proxies, #method_missing, new_control, #notify_custom_listeners, #post_add_content, #post_initialize_child, reset_descendant_keyword_constant_map, #respond_to?, #respond_to_libui?, #send_to_libui, #visible, #window_proxy

Methods included from DataBindable

#data_bind, #data_bind_read, #data_bind_write, #data_binding_model_attribute_observer_registrations

Constructor Details

This class inherits a constructor from Glimmer::LibUI::ControlProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::LibUI::ControlProxy

Instance Method Details

#build_controlObject



32
33
34
35
36
37
# File 'lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb', line 32

def build_control
  @area_handler = ::LibUI::FFI::AreaHandler.malloc
  @args[0] ||= Glimmer::LibUI::ControlProxy.main_window_proxy.width
  @args[1] ||= Glimmer::LibUI::ControlProxy.main_window_proxy.height
  @libui    = ::LibUI.new_scrolling_area(@area_handler, *@args)
end

#height(value = nil) ⇒ Object Also known as: height=, set_height



50
51
52
53
54
55
56
57
# File 'lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb', line 50

def height(value = nil)
  if value.nil?
    @args[1]
  else
    @args[1] = value
    set_size(width, height)
  end
end

#scroll_to(scroll_x, scroll_y, scroll_width = nil, scroll_height = nil) ⇒ Object



67
68
69
70
# File 'lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb', line 67

def scroll_to(scroll_x, scroll_y, scroll_width = nil, scroll_height = nil)
  scroll_width, scroll_height = Glimmer::LibUI::ControlProxy.main_window_proxy.content_size
  super(scroll_x, scroll_y, scroll_width, scroll_height)
end

#set_size(width, height) ⇒ Object



61
62
63
64
65
# File 'lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb', line 61

def set_size(width, height)
  @args[0] = width
  @args[1] = height
  super(width, height)
end

#width(value = nil) ⇒ Object Also known as: width=, set_width



39
40
41
42
43
44
45
46
# File 'lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb', line 39

def width(value = nil)
  if value.nil?
    @args[0]
  else
    @args[0] = value
    set_size(width, height)
  end
end