Class: SKUI::Base
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Events
#add_event_handler, included, #release_events, #trigger_event
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
48
49
50
51
52
53
54
55
|
# File 'src/SKUI/base.rb', line 48
def initialize
super()
@properties = JSON.new
@properties[ :ui_id ] = "UI_#{object_id()}"
@properties[ :type ] = typename()
end
|
Instance Attribute Details
#properties ⇒ JSON
41
42
43
|
# File 'src/SKUI/base.rb', line 41
def properties
@properties
end
|
#window ⇒ Window|Nil
45
46
47
|
# File 'src/SKUI/base.rb', line 45
def window
@window
end
|
Instance Method Details
#background_color ⇒ Sketchup::Color, SystemColor
37
|
# File 'src/SKUI/base.rb', line 37
prop( :background_color, &TypeCheck::COLOR )
|
29
|
# File 'src/SKUI/base.rb', line 29
prop( :font, &TypeCheck::FONT )
|
#foreground_color ⇒ Sketchup::Color, SystemColor
33
|
# File 'src/SKUI/base.rb', line 33
prop( :foreground_color, &TypeCheck::COLOR )
|
#inspect ⇒ String
59
60
61
|
# File 'src/SKUI/base.rb', line 59
def inspect
"<#{self.class}:#{object_id_hex}>"
end
|
#release ⇒ Nil
Release all references to other objects. Setting them to nil. So that the GC can collect them.
74
75
76
77
78
79
80
|
# File 'src/SKUI/base.rb', line 74
def release
release_events()
@properties.clear
@properties = nil
@parent = nil
nil
end
|
#to_js ⇒ String
65
66
67
|
# File 'src/SKUI/base.rb', line 65
def to_js
ui_id.inspect
end
|
#typename ⇒ String
84
85
86
|
# File 'src/SKUI/base.rb', line 84
def typename
self.class.to_s.split( '::' ).last
end
|
#ui_id ⇒ String
ID string used by both Ruby and the WebDialog to keep each control in sync with each other when passing properties and events.
21
|
# File 'src/SKUI/base.rb', line 21
prop_reader( :ui_id )
|