Class: Glimmer::Wx::ControlProxy::SliderProxy

Inherits:
Glimmer::Wx::ControlProxy show all
Includes:
Wx::IDHelper
Defined in:
lib/glimmer/wx/control_proxy/slider_proxy.rb

Overview

Proxy for Wx slider double objects

Follows the Proxy Design Pattern

Instance Attribute Summary

Attributes inherited from Glimmer::Wx::ControlProxy

#args, #block, #content_added, #keyword, #parent_proxy, #wx

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Glimmer::Wx::ControlProxy

#can_handle_listener?, constant_symbol, #content, #control_proxy, control_proxy_class, create, #custom_listener_name_aliases, #custom_listener_names, #deregister_all_custom_listeners, #deregister_custom_listeners, descendant_keyword_constant_map, exists?, #frame_proxy, #handle_custom_listener, #handle_listener, #has_custom_listener?, #initialize, keyword, #listeners, #listeners_for, map_descendant_keyword_constants_for, #method_missing, #notify_custom_listeners, #options, #post_add_content, #post_initialize_child, reset_descendant_keyword_constant_map, #respond_to?, wx_constant_symbol

Methods included from DataBindable

#data_bind, #data_bind_read, #data_binding_model_attribute_observer_registrations

Constructor Details

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

Dynamic Method Handling

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

Class Method Details

.new_control(keyword, parent, args) ⇒ Object



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

def new_control(keyword, parent, args)
  args = args.clone || []
  if args.last.is_a?(Hash)
    args[-1] = args[-1].clone
  end
  value = 0
  min = 0
  max = 100
  style = 0
  ::Wx.const_get(wx_constant_symbol(keyword)).new(parent, next_id, value, min, max, style: style)
end

Instance Method Details

#data_bind_write(property, model_binding) ⇒ Object



47
48
49
# File 'lib/glimmer/wx/control_proxy/slider_proxy.rb', line 47

def data_bind_write(property, model_binding)
  handle_listener('on_slider') { model_binding.call(value) } if property == 'value'
end