Class: XRC2Ruby::ObjectTypes::SizerItem
- Inherits:
-
Object
- Object
- XRC2Ruby::ObjectTypes::SizerItem
- 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
-
#border ⇒ Object
Returns the value of attribute border.
-
#flag ⇒ Object
Returns the value of attribute flag.
-
#option ⇒ Object
Returns the value of attribute option.
-
#sizer ⇒ Object
Returns the value of attribute sizer.
-
#window ⇒ Object
Returns the value of attribute window.
Instance Method Summary collapse
-
#initialize(sizer) ⇒ SizerItem
constructor
Create a new sizer item contained within the sizer
sizer
, set up default sizer options. -
#output ⇒ Object
Output a Sizer#add statement, adding
window
tosizer
.
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
#border ⇒ Object
Returns the value of attribute border.
7 8 9 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7 def border @border end |
#flag ⇒ Object
Returns the value of attribute flag.
6 7 8 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 6 def flag @flag end |
#option ⇒ Object
Returns the value of attribute option.
7 8 9 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7 def option @option end |
#sizer ⇒ Object
Returns the value of attribute sizer.
7 8 9 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/sizers.rb', line 7 def sizer @sizer end |
#window ⇒ Object
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
#output ⇒ Object
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 |