Changeset 28914

Show
Ignore:
Timestamp:
01/23/09 16:53:23 (4 years ago)
Author:
isaisstillalive
Message:
  • Controlにfontプロパティを定義。
Location:
lang/ruby/ruwin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ruwin/lib/ruwin/control.rb

    r28911 r28914  
    1010      :bottom     => nil, 
    1111      :width      => nil, 
    12       :height     => nil 
     12      :height     => nil, 
     13      :font       => nil 
    1314     
    1415    def initialize 
     
    1617        move @proparty[:left]||0, @proparty[:top]||0, @proparty[:width]||0, @proparty[:height]||0 
    1718      end 
     19      self.font = @proparty[:font] if @proparty[:font] 
    1820    end 
    1921     
  • lang/ruby/ruwin/test/ruwin/test_control.rb

    r28911 r28914  
    7575   
    7676   
    77   %w{left top right bottom width height}.each do |property| 
     77  %w{left top right bottom width height font}.each do |property| 
    7878    class_eval <<-"END" 
    7979      def test_#{property} 
     
    115115    assert_equal font, instance.font 
    116116  end 
     117   
     118  def test_font_property 
     119    klass = Class.new(Ruwin::Control) 
     120    klass.class_eval %{CLASS_NAME = "EDIT"} 
     121     
     122    expected_font = Ruwin::Font.new "MS GOTHIC", 13 
     123    klass.class_eval do 
     124      font expected_font 
     125    end 
     126     
     127    window = HiddenWindow.new 
     128    instance = klass.new(window) 
     129     
     130    assert_equal expected_font.params, instance.font.params 
     131  end 
    117132end