Class: Glimmer::LibUI::ControlProxy::TabItemProxy

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

Overview

Proxy for LibUI tab item objects

Follows the Proxy Design Pattern

Constant Summary

Constants inherited from Glimmer::LibUI::ControlProxy

BOOLEAN_PROPERTIES, KEYWORD_ALIASES, STRING_PROPERTIES, TransformProxy

Instance Attribute Summary collapse

Attributes inherited from Glimmer::LibUI::ControlProxy

#args, #block, #content_added, #keyword, #libui, #parent_proxy

Instance Method Summary collapse

Methods inherited from Glimmer::LibUI::ControlProxy

#append_properties, #append_property, #can_handle_listener?, constant_symbol, #content, control_proxies, 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, 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, widget_proxy_class, #window_proxy

Methods included from DataBindable

#data_bind, #data_bind_read, #data_bind_write, #data_binding_model_attribute_observer_registrations

Constructor Details

#initialize(keyword, parent, args, &block) ⇒ TabItemProxy

Returns a new instance of TabItemProxy.



34
35
36
37
38
39
40
41
42
43
# File 'lib/glimmer/libui/control_proxy/tab_item_proxy.rb', line 34

def initialize(keyword, parent, args, &block)
  @keyword = keyword
  @parent_proxy = parent
  @args = args
  @block = block
  @enabled = 1
  @index = @parent_proxy.num_pages
  @content = @block&.call
  build_control
end

Dynamic Method Handling

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

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



32
33
34
# File 'lib/glimmer/libui/control_proxy/tab_item_proxy.rb', line 32

def index
  @index
end

Instance Method Details

#margined(value = nil) ⇒ Object Also known as: set_margined, margined=, margined?



49
50
51
52
53
54
55
# File 'lib/glimmer/libui/control_proxy/tab_item_proxy.rb', line 49

def margined(value = nil)
  if value.nil?
    @parent_proxy.margined(@index)
  else
    @parent_proxy.margined(@index, value)
  end
end

#nameObject



45
46
47
# File 'lib/glimmer/libui/control_proxy/tab_item_proxy.rb', line 45

def name
  @args.first
end