- Timestamp:
- 01/29/09 19:19:58 (4 years ago)
- Location:
- lang/ruby/ruwin
- Files:
-
- 2 modified
-
lib/ruwin/component.rb (modified) (2 diffs)
-
test/ruwin/test_component.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/ruwin/lib/ruwin/component.rb
r29230 r29236 2 2 class Component < SWin::Window 3 3 autoload :Scrollable, "ruwin/component/scrollable" 4 ClientToScreen = Win32API.new "USER32.DLL", "ClientToScreen", %{L P}, "I" 4 5 5 6 include Ruwin … … 82 83 83 84 85 def get_screen_position x, y 86 point = [x, y].pack("LL") 87 ClientToScreen.call hWnd, point 88 point.unpack("LL") 89 end 90 84 91 private 85 92 def send_message_with_error_code message, wparam, lparam, error_code = self.class::ERR, &alternate -
lang/ruby/ruwin/test/ruwin/test_component.rb
r29151 r29236 196 196 assert_equal [[WM_SETREDRAW, 0, 0], [:inter], [WM_SETREDRAW, 1, 0]], instance.messages 197 197 end 198 199 200 def test_getscreenposition 201 instance = Ruwin::Component.new do |component| 202 component.move 10, 10, 10, 10 203 end 204 205 # BORDERやWindowの関連か。定数っぽい 206 assert_equal [10+4, 10+23], instance.get_screen_position(0, 0) 207 end 198 208 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)