[Wnd-commit] wnd/wnd/controls/menu methods.py,1.1.1.1,1.2 popup.py,1.2,1.3
Status: Alpha
Brought to you by:
jurner
|
From: jürgen u. <cer...@us...> - 2005-05-17 20:13:48
|
Update of /cvsroot/wnd/wnd/wnd/controls/menu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11888 Modified Files: methods.py popup.py Log Message: bit of this and a bit of that Index: methods.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/menu/methods.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** methods.py 29 Apr 2005 15:22:22 -0000 1.1.1.1 --- methods.py 17 May 2005 20:13:39 -0000 1.2 *************** *** 167,183 **** # menu iterators - - def ListItems(self, hMenu=None): - if not hMenu: - hMenu=self.handle - n = user32.GetMenuItemCount(hMenu) - mi= MENUITEMINFO() - out= [] - for i in range(n): - mi.fMask = 2 # MIIM_ID - user32.GetMenuItemInfoA(hMenu, i, 1, byref(mi)) - out.append(mi.wID) - return out - def Walk(self, hMenu=None): if not hMenu: --- 167,170 ---- *************** *** 190,195 **** handle = user32.GetSubMenu(hMenu, i) if handle: ! yield handle, self.ListMenu(handle) ! for i in self.MenuWalk(handle): yield i --- 177,182 ---- handle = user32.GetSubMenu(hMenu, i) if handle: ! yield handle, self.ListItems(handle) ! for i in self.Walk(handle): yield i Index: popup.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/menu/popup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** popup.py 15 May 2005 09:35:35 -0000 1.2 --- popup.py 17 May 2005 20:13:39 -0000 1.3 *************** *** 124,126 **** if not user32.SetMenuDefaultItem(self.handle, -1, 0): raise RuntimeError("could not set default item") ! return True \ No newline at end of file --- 124,139 ---- if not user32.SetMenuDefaultItem(self.handle, -1, 0): raise RuntimeError("could not set default item") ! return True ! ! ! def ListItems(self, hMenu=None): ! if not hMenu: ! hMenu=self.handle ! n = user32.GetMenuItemCount(hMenu) ! mi= MENUITEMINFO() ! out= [] ! for i in range(n): ! mi.fMask = 2 # MIIM_ID ! user32.GetMenuItemInfoA(hMenu, i, 1, byref(mi)) ! out.append(mi.wID) ! return out \ No newline at end of file |