Class: XRC2Ruby::ObjectTypes::Object
- Inherits:
-
Object
- Object
- XRC2Ruby::ObjectTypes::Object
- Defined in:
- lib/wx_sugar/xrc/xrc2ruby_types/object.rb
Overview
Anything deriving from Wx::Object
Instance Attribute Summary collapse
-
#centered ⇒ Object
Returns the value of attribute centered.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#sub_class ⇒ Object
readonly
Returns the value of attribute sub_class.
-
#win_class ⇒ Object
readonly
Returns the value of attribute win_class.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parent, win_class, sub_class = nil, var_name = nil) ⇒ Object
constructor
A new instance of Object.
- #inspect ⇒ Object
- #output ⇒ Object
- #var_name ⇒ Object
Constructor Details
#initialize(parent, win_class, sub_class = nil, var_name = nil) ⇒ Object
Returns a new instance of Object.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 15 def initialize(parent, win_class, sub_class = nil, var_name = nil) @parent = parent @win_class = win_class.gsub(/^wx/, "Wx::") @sub_class = sub_class # A named and externally accessible item if var_name and not var_name.empty? and var_name !~ /^ID_/ and var_name !~ /^wx/ @name = "@#{var_name.downcase}" # Or just a local name else @local_id = Object.next_id end end |
Instance Attribute Details
#centered ⇒ Object
Returns the value of attribute centered.
4 5 6 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 4 def centered @centered end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 14 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
14 15 16 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 14 def parent @parent end |
#sub_class ⇒ Object (readonly)
Returns the value of attribute sub_class.
14 15 16 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 14 def sub_class @sub_class end |
#win_class ⇒ Object (readonly)
Returns the value of attribute win_class.
14 15 16 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 14 def win_class @win_class end |
Class Method Details
.next_id ⇒ Object
9 10 11 12 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 9 def self.next_id @id_counter ||= 0 @id_counter += 1 end |
Instance Method Details
#inspect ⇒ Object
6 7 8 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 6 def inspect "<#{self.class}>" end |
#output ⇒ Object
34 35 36 37 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 34 def output # Should be defined in subclasses Kernel.raise "Shouldn't be called" end |
#var_name ⇒ Object
30 31 32 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/object.rb', line 30 def var_name @name || "#{self.class.name[/\w+$/].downcase}_#{@local_id}" end |