Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25000/win32/Demos
Modified Files:
win32gui_dialog.py win32gui_menu.py
Log Message:
dict upgrades and // for int division
Index: win32gui_dialog.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_dialog.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** win32gui_dialog.py 27 Nov 2008 09:42:42 -0000 1.11
--- win32gui_dialog.py 27 Nov 2008 11:11:11 -0000 1.12
***************
*** 44,48 ****
else:
full_fmt += fmt
! for name, val in kw.items():
if name not in self.__dict__:
raise ValueError("LVITEM structures do not have an item '%s'" % (name,))
--- 44,48 ----
else:
full_fmt += fmt
! for name, val in kw.iteritems():
if name not in self.__dict__:
raise ValueError("LVITEM structures do not have an item '%s'" % (name,))
***************
*** 248,253 ****
l,t,r,b = win32gui.GetWindowRect(self.hwnd)
dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
! centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) )
! win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0)
self._SetupList()
l,t,r,b = win32gui.GetClientRect(self.hwnd)
--- 248,253 ----
l,t,r,b = win32gui.GetWindowRect(self.hwnd)
dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
! centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)//2, (dt_b-dt_t)//2) )
! win32gui.MoveWindow(hwnd, centre_x-(r//2), centre_y-(b//2), r-l, b-t, 0)
self._SetupList()
l,t,r,b = win32gui.GetClientRect(self.hwnd)
Index: win32gui_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** win32gui_menu.py 1 Oct 2008 14:44:53 -0000 1.9
--- win32gui_menu.py 27 Nov 2008 11:11:11 -0000 1.10
***************
*** 315,319 ****
crBkgnd = SetBkColor(hDC, GetSysColor(win32con.COLOR_HIGHLIGHT))
! each_pad = self.icon_x_pad / 2
x_icon = left + GetSystemMetrics(win32con.SM_CXMENUCHECK) + each_pad
x_text = x_icon + self.menu_icon_width + each_pad
--- 315,319 ----
crBkgnd = SetBkColor(hDC, GetSysColor(win32con.COLOR_HIGHLIGHT))
! each_pad = self.icon_x_pad // 2
x_icon = left + GetSystemMetrics(win32con.SM_CXMENUCHECK) + each_pad
x_text = x_icon + self.menu_icon_width + each_pad
|