Class: XRC2Ruby::ObjectTypes::BitmapButton

Inherits:
Window show all
Defined in:
lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb

Constant Summary

Constants inherited from Window

Window::BASE_NAME

Instance Attribute Summary collapse

Attributes inherited from Window

#bg, #enabled, #exstyle, #fg, #help, #hidden, #tooltip

Attributes inherited from Object

#centered, #name, #parent, #sub_class, #win_class

Instance Method Summary collapse

Methods inherited from Window

#args, #output

Methods included from InitArgs

#inherited, #init_arg, #init_args, #translatable_string_init_arg

Methods inherited from Object

#initialize, #inspect, next_id, #output, #var_name

Constructor Details

This class inherits a constructor from XRC2Ruby::ObjectTypes::Object

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled.



15
16
17
# File 'lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb', line 15

def disabled
  @disabled
end

#focusObject

Returns the value of attribute focus.



15
16
17
# File 'lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb', line 15

def focus
  @focus
end

#hoverObject

Returns the value of attribute hover.



15
16
17
# File 'lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb', line 15

def hover
  @hover
end

#selectedObject

Returns the value of attribute selected.



15
16
17
# File 'lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb', line 15

def selected
  @selected
end

Instance Method Details

#setupObject

Call extra methods to set up images for alternate states, if these have been defined in the XRC file.



22
23
24
25
26
27
28
29
30
# File 'lib/wx_sugar/xrc/xrc2ruby_types/buttons.rb', line 22

def setup
  [ :focus, :selected, :disabled, :hover ].inject('') do | out, extra_img |
    if send(extra_img)
      out << "#{var_name}.bitmap_#{extra_img} = "
      out << " Wx::Bitmap.new('#{send(extra_img)}')\n"
    end
    out
  end
end