Changeset 28884
- Timestamp:
- 01/23/09 11:12:58 (4 years ago)
- Location:
- lang/ruby/ruwin
- Files:
-
- 5 modified
-
lib/ruwin/component.rb (modified) (1 diff)
-
lib/ruwin/control.rb (modified) (1 diff)
-
lib/ruwin/window.rb (modified) (2 diffs)
-
test/ruwin/test_component.rb (modified) (7 diffs)
-
test/ruwin/test_control.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/ruwin/lib/ruwin/component.rb
r28882 r28884 22 22 23 23 class << self 24 def factoryparent = nil24 def new parent = nil 25 25 Factory.newwindow(parent, self) 26 26 end -
lang/ruby/ruwin/lib/ruwin/control.rb
r28879 r28884 6 6 class << self 7 7 def new parent 8 factory parent8 super 9 9 end 10 10 -
lang/ruby/ruwin/lib/ruwin/window.rb
r28883 r28884 17 17 18 18 self.class.instance_variable_get(:@controls).each do |name, klass| 19 control = klass. factoryself19 control = klass.new self 20 20 @controls[control.hWnd] = [name, control] 21 21 instance_variable_set :"@#{name}", control … … 27 27 @controls = {} 28 28 class << self 29 def new30 factory31 end32 33 29 def add_control klass, name, *args, &block 34 30 @controls[name] = klass.inherit(name, *args, &block) -
lang/ruby/ruwin/test/ruwin/test_component.rb
r28878 r28884 15 15 assert_equal 2, klass.test_pro 16 16 17 instance = klass. factory17 instance = klass.new 18 18 assert_equal 2, instance.instance_variable_get(:@proparty)[:test_pro] 19 19 assert_respond_to instance, :test_pro … … 88 88 89 89 90 def test_ factory90 def test_new 91 91 klass = Class.new(Ruwin::Component) 92 instance = klass. factory92 instance = klass.new 93 93 assert_equal WS_CLIPSIBLINGS, instance.style&WS_CLIPSIBLINGS 94 94 assert_equal WS_OVERLAPPEDWINDOW, instance.style&WS_OVERLAPPEDWINDOW 95 95 end 96 96 97 def test_ factory_defined_const97 def test_new_defined_const 98 98 klass = Class.new(Ruwin::Component) 99 99 klass.class_eval <<-'END' … … 102 102 EXSTYLE = 2 103 103 END 104 instance = klass. factory104 instance = klass.new 105 105 assert_equal "BUTTON", instance.classname 106 106 assert_equal 1, instance.style&1 … … 117 117 exstyle 8 118 118 END 119 instance = klass. factory119 instance = klass.new 120 120 assert_equal "caption", instance.caption 121 121 assert_equal 4, instance.style&4 … … 126 126 127 127 def test_send_message_with_error_code 128 instance = Ruwin::Component. factory128 instance = Ruwin::Component.new 129 129 def instance.sendMessage *args 130 130 :returned … … 134 134 135 135 def test_send_message_with_error_code_returned_error_code 136 instance = Ruwin::Component. factory136 instance = Ruwin::Component.new 137 137 def instance.sendMessage *args 138 138 :error_code … … 142 142 143 143 def test_draw_bundling 144 instance = Ruwin::Component. factory144 instance = Ruwin::Component.new 145 145 instance.instance_variable_set :@messages, [] 146 146 class << instance -
lang/ruby/ruwin/test/ruwin/test_control.rb
r28880 r28884 16 16 def test_new 17 17 klass = Class.new(Ruwin::Control) 18 window = Ruwin::Component. factory18 window = Ruwin::Component.new 19 19 instance = klass.new(window) 20 20 assert_equal 0, instance.style&WS_CLIPSIBLINGS
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)