Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions qt4c/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import winerror
import time

from . import util

class MouseFlag(object):
'''鼠标按键枚举类
'''
Expand Down Expand Up @@ -65,12 +63,6 @@ class Mouse(object):

_last_click_time = time.time()

@staticmethod
def handle_position(x, y):
"""坐标转换"""
scale = util.getDpi()
return int(x / scale), int(y / scale)

@staticmethod
def click(x, y, flag=MouseFlag.LeftButton,
clicktype=MouseClickType.SingleClick):
Expand All @@ -85,7 +77,6 @@ def click(x, y, flag=MouseFlag.LeftButton,
:param clickType: 鼠标动作,如双击还是单击
:type clickType: qt4c.mouse.MouseClickType
"""
x, y = Mouse.handle_position(x, y)
win32api.SetCursorPos((x,y))
win32api.mouse_event(_mouse_msg[flag][0] | _mouse_msg[flag][1],0,0,0,0)
if clicktype != MouseClickType.SingleClick:
Expand Down
8 changes: 7 additions & 1 deletion qt4c/uiacontrols.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,13 @@ def HasKeyboardFocus(self):
def ClassName(self):
"""返回ClassName
"""
return self._uiaobj.CurrentClassName
return self._uiaobj.CurrentClassName

@property
def AutomationId(self):
"""返回AutomationId
"""
return self._uiaobj.CurrentAutomationId



Expand Down
5 changes: 1 addition & 4 deletions qt4c/wincontrols.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@ def BoundingRect(self):
:rtype: util.Rectangle
:return: util.Rectangle实例
"""
scale = util.getDpi()
rect = win32gui.GetWindowRect(self.HWnd)
rect = [it * scale for it in rect]
return util.Rectangle(rect)
return util.Rectangle(win32gui.GetWindowRect(self.HWnd))

@property
def Caption(self):
Expand Down