Class: XRC2Ruby::ObjectTypes::SizerItem

Inherits:
Object
  • Object
show all
Defined in:
lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb

Overview

Represents the settings for a particular Window added to a container’s sizer; corresponds to the <object class=“sizeritem”> tag in XRC.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sizer) ⇒ SizerItem

Create a new sizer item contained within the sizer sizer, set up default sizer options



11
12
13
14
15
16
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 11

def initialize(sizer)
  @sizer  = sizer
  @option = 0
  @flag   = 0
  @border = 0
end

Instance Attribute Details

#borderObject

Returns the value of attribute border.



7
8
9
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7

def border
  @border
end

#flagObject

Returns the value of attribute flag.



6
7
8
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 6

def flag
  @flag
end

#optionObject

Returns the value of attribute option.



7
8
9
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7

def option
  @option
end

#sizerObject

Returns the value of attribute sizer.



7
8
9
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7

def sizer
  @sizer
end

#windowObject

Returns the value of attribute window.



7
8
9
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7

def window
  @window
end

Instance Method Details

#outputObject

Output a Sizer#add statement, adding window to sizer



23
24
25
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 23

def output
  "#{sizer.var_name}.add(#{window.var_name}, #{option}, #{flag}, #{border})\n"
end