wnd-commit Mailing List for wnd (Page 10)
Status: Alpha
Brought to you by:
jurner
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(125) |
Jun
|
Jul
(138) |
Aug
(13) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: jürgen u. <cer...@us...> - 2005-05-15 09:38:39
|
Update of /cvsroot/wnd/wnd/wnd/controls/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3299 Modified Files: methods.py Log Message: bugfixes + new message + no longer compatible to 0.1 release Index: methods.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/treeview/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:48 -0000 1.1.1.1 --- methods.py 15 May 2005 09:38:30 -0000 1.2 *************** *** 5,19 **** #*********************************************** ! # Not implemented ! # ! # TVM_CREATEDRAGIMAGE ! # TVM_GETISEARCHSTRING ! # TVM_GETSCROLLTIME ! # TVM_GETTOOLTIPS ! # TVM_GETUNICODEFORMAT ! # TVM_SETINSERTMARK ! # TVM_SETSCROLLTIME ! # TVM_SETTOOLTIPS ! # TVM_SETUNICODEFORMAT --- 5,9 ---- #*********************************************** ! from ctypes import * *************** *** 36,40 **** if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text return addressof(self._client_buffer) --- 26,30 ---- if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text +'\x00' return addressof(self._client_buffer) *************** *** 68,75 **** def Item(self, hParent, text, iImage=None, iSelectedImage=None, iStateImage=None, lp=None, fInsert='last', integral=None, childinfo=False): ! if fInsert=='last': fInsert= 294901762 # TVI_LAST ! elif fInsert=='first': fInsert= 4294901761 # TVI_FIRST ! elif fInsert=='sort': fInsert= 4294901763 # TVI_SORT ! else: raise ValueError("invalid flag: %s" % fInsert) tvin = TVINSERTSTRUCT() --- 58,67 ---- def Item(self, hParent, text, iImage=None, iSelectedImage=None, iStateImage=None, lp=None, fInsert='last', integral=None, childinfo=False): ! ! if not isinstance(fInsert, (int, long)): ! if fInsert=='last': fInsert= 294901762 # TVI_LAST ! elif fInsert=='first': fInsert= 4294901761 # TVI_FIRST ! elif fInsert=='sort': fInsert= 4294901763 # TVI_SORT ! else: raise ValueError("invalid flag: %s" % fInsert) tvin = TVINSERTSTRUCT() *************** *** 79,85 **** tvin.item.mask = TVIF_TEXT if text==-1: ! tvin.item.cChildren= -1 else: tvin.item.pszText = self._client_TruncText(text) if iImage != None: tvin.item.mask |= TVIF_IMAGE --- 71,78 ---- tvin.item.mask = TVIF_TEXT if text==-1: ! tvin.item.pszText = -1 else: tvin.item.pszText = self._client_TruncText(text) + if iImage != None: tvin.item.mask |= TVIF_IMAGE *************** *** 100,106 **** if childinfo: tvin.item.mask |=TVIF_CHILDREN ! tvin.item.cHildren = -1 ! ! handle = self.SendMessage(self.Hwnd, self.Msg.TVM_INSERTITEM, 0, byref(tvin)) if handle: return handle --- 93,101 ---- if childinfo: tvin.item.mask |=TVIF_CHILDREN ! if childinfo==-1: ! tvin.item.cChildren = -1 ! else: ! tvin.item.cChildren = 1 ! handle = self.SendMessage(self.Hwnd, self.Msg.TVM_INSERTITEM, 0, byref(tvin)) if handle: return handle *************** *** 306,309 **** --- 301,317 ---- return bool(tvi.cChildren) + def SetChildInfo(self, handle, value): + tvi = TVITEMEX() + tvi.mask=TVIF_HANDLE | TVIF_CHILDREN + tvi.hItem = handle + if value ==-1: + tvi.cChildren=-1 + else: + tvi.cChildren= value and 1 or 0 + if not self.SendMessage(self.Hwnd, self.Msg.TVM_SETITEM, 0, byref(tvi)): + raise RuntimeError("could not retrieve child count") + return bool(tvi.cChildren) + + #-------------------------------------------------------------------------- *************** *** 517,520 **** --- 525,529 ---- if not handle: handle = self.GetRoot() + if not handle: return root= True *************** *** 530,535 **** for c in self.IterSiblings(handle): for d in self.Walk(c, topdown): ! yield d ! #---------------------------------------------------------------------- --- 539,544 ---- for c in self.IterSiblings(handle): for d in self.Walk(c, topdown): ! yield d ! #---------------------------------------------------------------------- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:38:16
|
Update of /cvsroot/wnd/wnd/wnd/controls/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2981 Modified Files: __init__.py Log Message: bugfixes + new message + no longer compatible to 0.1 release Index: __init__.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/treeview/__init__.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** __init__.py 29 Apr 2005 15:22:40 -0000 1.1.1.1 --- __init__.py 15 May 2005 09:37:42 -0000 1.2 *************** *** 40,43 **** --- 40,47 ---- - the path thing needs backslash escaping + - test 'getdispinfo' + - test HasChildren with 'getdispinfo' + - test new method SetChildInfo + """ |
From: jürgen u. <cer...@us...> - 2005-05-15 09:38:12
|
Update of /cvsroot/wnd/wnd/wnd/controls/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3143 Modified Files: messagehandler.py Log Message: bugfixes + new message + no longer compatible to 0.1 release Index: messagehandler.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/treeview/messagehandler.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** messagehandler.py 29 Apr 2005 15:22:54 -0000 1.1.1.1 --- messagehandler.py 15 May 2005 09:38:02 -0000 1.2 *************** *** 12,17 **** ! from wnd.controls.treeview.header import * from ctypes import cdll, c_char_p --- 12,18 ---- ! import dbg + from wnd.controls.treeview.header import * from ctypes import cdll, c_char_p *************** *** 29,51 **** msgr.fReturn= 1 nm=NMTREEVIEW.from_address(msgr.lParam) ! if nm.hdr.hwndFrom==self.Hwnd: ! ! ! # custom draw ! if nm.hdr.code == self.Msg.NM_CUSTOMDRAW: ! cd = NMTVCUSTOMDRAW.from_address(msgr.lParam) ! result= self.onMSG(hwnd, "customdraw", 0, cd) ! if result !=None: return result ! return 0 ! ! elif nm.hdr.code==self.Msg.TVN_GETDISPINFO or nm.hdr.code==self.Msg.TVN_GETDISPINFOW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! # still not quite shure how to handle this... ! # docs claim to copy the string into the buffer pointed to by ! # di.item.pszText, but is it there, and what size is it ?? ! ! result= self.onMSG(hwnd, "getdispinfo", di.item.hItem, di.item.lParam) ! if result: if len(result)==4: if di.item.mask & TVIF_TEXT: --- 30,46 ---- msgr.fReturn= 1 nm=NMTREEVIEW.from_address(msgr.lParam) ! ! ! # custom draw ! if nm.hdr.code == self.Msg.NM_CUSTOMDRAW: ! cd = NMTVCUSTOMDRAW.from_address(msgr.lParam) ! result= self.onMSG(hwnd, "customdraw", 0, cd) ! if result !=None: return result ! return 0 ! elif nm.hdr.code==self.Msg.TVN_GETDISPINFO or nm.hdr.code==self.Msg.TVN_GETDISPINFOW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! result= self.onMSG(hwnd, "getdispinfo", di.item.hItem, di.item.lParam) ! if result: if len(result)==4: if di.item.mask & TVIF_TEXT: *************** *** 57,147 **** di.item.iSelectedImage= result[2] if di.item.mask & TVIF_CHILDREN: ! di.item.cChildren= result[3] and 1 or 0 else: raise "expected 4-tuple: (%s) missing" % 4-len(result) ! return 0 ! ! elif nm.hdr.code==self.Msg.TVN_SETDISPINFO or nm.hdr.code==self.Msg.TVN_SETDISPINFOW: ! # some bug here in the SDK docs... ! # I guess, this is only send if an items text changes ! # in response to a labeledit. Other aspects changing do not seem ! # to trigger rhis message. ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.mask & TVIF_TEXT: ! text= c_char_p(di.item.pszText).value ! else: text= '' ! self.onMSG(hwnd, "setdispinfo", (di.item.hItem, text, di.item.lParam)) ! return 0 ! ! elif nm.hdr.code==self.Msg.TVN_ITEMEXPANDING: ! flag=None ! if nm.action==TVE_EXPAND: flag="expand" ! elif nm.action==TVE_EXPANDPARTIAL: ! flag="expandpartial" ! elif nm.action==TVE_TOGGLE: flag="toggle" ! elif nm.action==TVE_COLLAPSE: flag="collapse" ! elif nm.action==TVE_COLLAPSERESET: ! flag="collapsereset" ! result=self.onMSG(hwnd, "expand", flag, nm.itemNew.hItem) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_SELCHANGING or nm.hdr.code==self.Msg.TVN_SELCHANGINGW: ! result=self.onMSG(hwnd, "selchange", 0, (nm.itemOld.hItem, nm.itemNew.hItem)) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_KEYDOWN: ! nmk=NMTVKEYDOWN.from_address(msgr.lParam) ! result=self.onMSG(hwnd, "key", nmk.wVKey, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_BEGINLABELEDIT or nm.hdr.code==self.Msg.TVN_BEGINLABELEDITW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.pszText: ! text= c_char_p(di.item.pszText).value ! else: text= None ! result=self.onMSG(hwnd, "beginlabeledit", ! (di.item.hItem, di.item.lParam), text) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_ENDLABELEDIT or nm.hdr.code==self.Msg.TVN_ENDLABELEDITW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.pszText: ! text= c_char_p(di.item.pszText).value ! result=self.onMSG(hwnd, "endlabeledit", ! (di.item.hItem, di.item.lParam), text) ! if result==False: return 0 ! if text: ! if len(text) > self.GetTextMax(): ! #raise "max text exceedded" ## ?? ! return 0 ! return 1 ! elif nm.hdr.code==self.Msg.NM_CLICK: ! result=self.onMSG(hwnd, "click", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_DBLCLK : ! result=self.onMSG(hwnd, "dblclick", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_RCLICK: ! result=self.onMSG(hwnd, "rclick", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_RETURN: ! result=self.onMSG(hwnd, "return", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_BEGINDRAG: ! result=self.onMSG(hwnd, "begindrag", ! (nm.itemNew.lParam, nm.ptDrag), ! nm.itemNew.hItem) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_DELETEITEM: ! result=self.onMSG(hwnd, "removeitem", ! nm.itemOld.lParam, nm.itemOld.hItem) ! return 0 return 0 --- 52,171 ---- di.item.iSelectedImage= result[2] if di.item.mask & TVIF_CHILDREN: ! di.item.cChildren= result[2] and 1 or 0 else: raise "expected 4-tuple: (%s) missing" % 4-len(result) ! return 0 ! ! ! #dbg.debug(di) ! ! # still not quite shure how to handle this... ! # docs claim to copy the string into the buffer pointed to by ! # di.item.pszText, but is it there, and what size is it ?? ! ! result= self.onMSG(hwnd, "getdispinfo", di.item.hItem, di.item.lParam) ! if result: ! if len(result)==4: ! if di.item.mask & TVIF_TEXT: ! if result[0]: ! di.item.pszText= self._client_TruncText(result[0]) ! if di.item.mask & TVIF_IMAGE: ! di.item.iImage= result[1] ! if di.item.mask & TVIF_SELECTEDIMAGE: ! di.item.iSelectedImage= result[2] ! if di.item.mask & TVIF_CHILDREN: ! di.item.cChildren= result[3] and 1 or 0 ! else: ! raise "expected 4-tuple: (%s) missing" % 4-len(result) ! return 0 ! elif nm.hdr.code==self.Msg.TVN_SETDISPINFO or nm.hdr.code==self.Msg.TVN_SETDISPINFOW: ! # some bug here in the SDK docs... ! # I guess, this is only send if an items text changes ! # in response to a labeledit. Other aspects changing do not ! # seem to trigger ihis message. ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.mask & TVIF_TEXT: ! text= c_char_p(di.item.pszText).value ! else: text= '' ! self.onMSG(hwnd, "setdispinfo", di.item.hItem, (di.item.lParam, text)) ! ! return 0 ! ! elif nm.hdr.code==self.Msg.TVN_ITEMEXPANDING: ! flag=None ! if nm.action==TVE_EXPAND: flag="expand" ! elif nm.action==TVE_EXPANDPARTIAL: ! flag="expandpartial" ! elif nm.action==TVE_TOGGLE: flag="toggle" ! elif nm.action==TVE_COLLAPSE: flag="collapse" ! elif nm.action==TVE_COLLAPSERESET: ! flag="collapsereset" ! result=self.onMSG(hwnd, "expand", flag, nm.itemNew.hItem) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_SELCHANGING or nm.hdr.code==self.Msg.TVN_SELCHANGINGW: ! result=self.onMSG(hwnd, "selchange", nm.itemOld.hItem, nm.itemNew.hItem) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_KEYDOWN: ! nmk=NMTVKEYDOWN.from_address(msgr.lParam) ! result=self.onMSG(hwnd, "key", nmk.wVKey, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_BEGINLABELEDIT or nm.hdr.code==self.Msg.TVN_BEGINLABELEDITW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.pszText: ! text= c_char_p(di.item.pszText).value ! else: text= None ! result=self.onMSG(hwnd, "beginlabeledit", ! di.item.hItem, (di.item.lParam, text)) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_ENDLABELEDIT or nm.hdr.code==self.Msg.TVN_ENDLABELEDITW: ! di=NMTVDISPINFO.from_address(msgr.lParam) ! if di.item.pszText: ! text= c_char_p(di.item.pszText).value ! result=self.onMSG(hwnd, "endlabeledit", ! di.item.hItem, (di.item.lParam, text)) ! if result==False: return 0 ! if text: ! if len(text) > self.GetTextMax(): ! #raise "max text exceedded" ## ?? ! return 0 ! return 1 ! ! elif nm.hdr.code==self.Msg.NM_CLICK: ! result=self.onMSG(hwnd, "click", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_DBLCLK : ! result=self.onMSG(hwnd, "dblclick", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_RCLICK: ! result=self.onMSG(hwnd, "rclick", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.NM_RETURN: ! result=self.onMSG(hwnd, "return", 0, 0) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_BEGINDRAG: ! result=self.onMSG(hwnd, "begindrag", nm.itemNew.hItem, ! (nm.itemNew.lParam, nm.ptDrag)) ! if result==False: return 1 ! return 0 ! elif nm.hdr.code==self.Msg.TVN_BEGINRDRAG: ! result=self.onMSG(hwnd, "beginrdrag", nm.itemNew.hItem, ! (nm.itemNew.lParam, nm.ptDrag)) ! if result==False: return 1 ! return 0 ! ! elif nm.hdr.code==self.Msg.TVN_DELETEITEM: ! result=self.onMSG(hwnd, "removeitem", ! nm.itemOld.hItem, nm.itemOld.lParam) ! return 0 return 0 *************** *** 152,154 **** ! --- 176,180 ---- ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:36:51
|
Update of /cvsroot/wnd/wnd/wnd/controls/toolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2546 Modified Files: messagehandler.py Log Message: new message Index: messagehandler.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/toolbar/messagehandler.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** messagehandler.py 29 Apr 2005 15:22:37 -0000 1.1.1.1 --- messagehandler.py 15 May 2005 09:36:43 -0000 1.2 *************** *** 160,162 **** ! return 0 # <- do not remove !! \ No newline at end of file --- 160,167 ---- ! return 0 # <- do not remove !! ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 ! |
From: jürgen u. <cer...@us...> - 2005-05-15 09:35:48
|
Update of /cvsroot/wnd/wnd/wnd/controls/menu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118 Modified Files: popup.py Log Message: ?? Index: popup.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/menu/popup.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** popup.py 29 Apr 2005 15:22:17 -0000 1.1.1.1 --- popup.py 15 May 2005 09:35:35 -0000 1.2 *************** *** 27,31 **** if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text return addressof(self._client_buffer) --- 27,31 ---- if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text + '\x00' return addressof(self._client_buffer) |
From: jürgen u. <cer...@us...> - 2005-05-15 09:35:18
|
Update of /cvsroot/wnd/wnd/wnd/controls/listview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1885 Modified Files: methods.py Log Message: new message + bugfixes Index: methods.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/listview/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:23:14 -0000 1.1.1.1 --- methods.py 15 May 2005 09:35:09 -0000 1.2 *************** *** 28,32 **** if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text return addressof(self._client_buffer) --- 28,32 ---- if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text + '\x00' return addressof(self._client_buffer) *************** *** 207,215 **** # item methods ! def Item(self, text=None, iImage=None, lp=None, iStateImage=0): ! return self.InsertItem(self.__len__(), text, iImage, lp, iStateImage) ! def InsertItem(self, lineno, text=None, iImage=None, lp=None, iStateImage=0): lvi =LV_ITEM() --- 207,215 ---- # item methods ! def Item(self, text=None, iImage=None, lp=None, iStateImage=0, iOverlayImage= 0): ! return self.InsertItem(self.__len__(), text, iImage, lp, iStateImage, iOverlayImage) ! def InsertItem(self, lineno, text=None, iImage=None, lp=None, iStateImage=0, iOverlayImage= 0): lvi =LV_ITEM() *************** *** 225,231 **** lvi.mask |= lvi.LVIF_PARAM lvi.lParam= lp ! if iStateImage: lvi.mask |= lvi.LVIF_STATE ! lvi.state= INDEXTOSTATEIMAGEMASK(iStateImage) # # TODO item indent --- 225,232 ---- lvi.mask |= lvi.LVIF_PARAM lvi.lParam= lp ! if iStateImage or iOverlayImage: lvi.mask |= lvi.LVIF_STATE ! lvi.state= INDEXTOSTATEIMAGEMASK(iStateImage) | \ ! INDEXTOOVERLAYMASK(iOverlayImage) # # TODO item indent |
From: jürgen u. <cer...@us...> - 2005-05-15 09:34:50
|
Update of /cvsroot/wnd/wnd/wnd/controls/listview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1740 Modified Files: messagehandler.py Log Message: new message + bugfixes Index: messagehandler.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/listview/messagehandler.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** messagehandler.py 29 Apr 2005 15:23:14 -0000 1.1.1.1 --- messagehandler.py 15 May 2005 09:34:40 -0000 1.2 *************** *** 107,126 **** return 0 # default - - - - - - - - - - - def onMESSAGE2(self, hwnd, msg, wp, lp): ! ! ! # set LVS_SHAREIMAGELISTS as unchangable style ! if msg==self.Msg.WM_STYLECHANGING: if wp==(1l<<32) - 16: # GWL_STYLE LVS_SHAREIMAGELISTS = 64 --- 107,117 ---- return 0 # default ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 ! ! elif msg==self.Msg.WM_STYLECHANGING: ! # set LVS_SHAREIMAGELISTS as unchangable style if wp==(1l<<32) - 16: # GWL_STYLE LVS_SHAREIMAGELISTS = 64 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:34:25
|
Update of /cvsroot/wnd/wnd/wnd/controls/listview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1567 Modified Files: header.py Log Message: new message + bugfixes Index: header.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/listview/header.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** header.py 29 Apr 2005 15:23:00 -0000 1.1.1.1 --- header.py 15 May 2005 09:34:17 -0000 1.2 *************** *** 30,34 **** COMPAREFUNC = WINFUNCTYPE(INT, LPARAM, LPARAM, LPARAM) def INDEXTOSTATEIMAGEMASK(i): return i << 12 ! #*********************************************** --- 30,34 ---- COMPAREFUNC = WINFUNCTYPE(INT, LPARAM, LPARAM, LPARAM) def INDEXTOSTATEIMAGEMASK(i): return i << 12 ! def INDEXTOOVERLAYMASK(i): return i << 8 #*********************************************** |
From: jürgen u. <cer...@us...> - 2005-05-15 09:34:06
|
Update of /cvsroot/wnd/wnd/wnd/controls/listview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362 Modified Files: __init__.py Log Message: new message + bugfixes Index: __init__.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/listview/__init__.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** __init__.py 29 Apr 2005 15:22:55 -0000 1.1.1.1 --- __init__.py 15 May 2005 09:33:50 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- TODO + - Get/Set overlay image + - Get/Set state image + - customdraw NOTIFYITEMDRAW works |
From: jürgen u. <cer...@us...> - 2005-05-15 09:32:54
|
Update of /cvsroot/wnd/wnd/wnd/controls/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv744 Modified Files: window.py Log Message: ?? Index: window.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/base/window.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** window.py 29 Apr 2005 15:23:41 -0000 1.1.1.1 --- window.py 15 May 2005 09:32:45 -0000 1.2 *************** *** 121,125 **** #-------------------------------------------------------------------- def _base_WndProc(self, hwnd, msg, wp, lp): - try: --- 121,124 ---- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:32:31
|
Update of /cvsroot/wnd/wnd/wnd/controls/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv527 Modified Files: methods.py Log Message: ?? Index: methods.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/base/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:23:51 -0000 1.1.1.1 --- methods.py 15 May 2005 09:31:54 -0000 1.2 *************** *** 104,118 **** # #******************************************************************* - def _base_ReflectMessage(self, hwndTo, msg, wp, lp): - - fReturn = c_ushort() - msgr= fw.WND_MSGREFLECT(self.Hwnd, msg, wp, lp) - result = self.SendMessage(hwndTo, - fw.WND_WM_NOTIFY, - fw.WND_NM_MSGREFLECT, - addressof(msgr)) - if msgr.fReturn: return result - return self.DefWindowProc(self.Hwnd, msg, wp, lp) - #return result, msgr.fReturn def ChildWindows(self, flag=None): --- 104,107 ---- *************** *** 139,148 **** def DeferWindows(self, *windows): - # SWP_NOZORDER|SWP_NOACTIVATE - flag= 4|16 handle= user32.BeginDeferWindowPos(len(windows)) if handle: try: for wnd, x, y, w, h in windows: if isinstance(wnd, (int, long)): newHandle= user32.DeferWindowPos(handle, wnd, 0, x, y, w, h, flag) --- 128,140 ---- def DeferWindows(self, *windows): handle= user32.BeginDeferWindowPos(len(windows)) if handle: try: for wnd, x, y, w, h in windows: + flag= 4|16 # SWP_NOZORDER|SWP_NOACTIVATE + if x==None or y==None: + flag |= 2 # SWP_NOSIZE + if w==None or h==None: + flag |= 1 # SWP_NOMOVE if isinstance(wnd, (int, long)): newHandle= user32.DeferWindowPos(handle, wnd, 0, x, y, w, h, flag) *************** *** 151,160 **** if newHandle: handle= newHandle else: raise '' ! except: user32.EndDeferWindowPos(handle) ! raise WinError(GetLastError()) if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) def HideWindows(self, *windows): #SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_HIDEWINDOWSWP_NOCOPYBITS|WP_HIDEWINDOW --- 143,156 ---- if newHandle: handle= newHandle else: raise '' ! except Exception, d: user32.EndDeferWindowPos(handle) ! if GetLastError(): ! raise WinError(GetLastError()) ! else: ! raise RuntimeError, d if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) + def HideWindows(self, *windows): #SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_HIDEWINDOWSWP_NOCOPYBITS|WP_HIDEWINDOW *************** *** 170,176 **** if newHandle: handle= newHandle else: raise '' ! except: user32.EndDeferWindowPos(handle) ! raise WinError(GetLastError()) if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) --- 166,175 ---- if newHandle: handle= newHandle else: raise '' ! except Exception, d: user32.EndDeferWindowPos(handle) ! if GetLastError(): ! raise WinError(GetLastError()) ! else: ! raise RuntimeError, d if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) *************** *** 189,195 **** if newHandle: handle= newHandle else: raise '' ! except: user32.EndDeferWindowPos(handle) ! raise WinError(GetLastError()) if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) --- 188,197 ---- if newHandle: handle= newHandle else: raise '' ! except Exception, d: user32.EndDeferWindowPos(handle) ! if GetLastError(): ! raise WinError(GetLastError()) ! else: ! raise RuntimeError, d if user32.EndDeferWindowPos(handle): return raise WinError(GetLastError()) |
From: jürgen u. <cer...@us...> - 2005-05-15 09:31:23
|
Update of /cvsroot/wnd/wnd/wnd/controls/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv326 Modified Files: control.py Log Message: ?? Index: control.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/base/control.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** control.py 29 Apr 2005 15:23:23 -0000 1.1.1.1 --- control.py 15 May 2005 09:31:16 -0000 1.2 *************** *** 12,16 **** from wnd import fwtypes as fw #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - class BaseControl(object): --- 12,15 ---- *************** *** 20,23 **** --- 19,23 ---- def __init__(self, Parent, NameOrClass, title, x, y, w, h, *styles): + self._base_subclassable = False self._base_registeredMessages = [] |
From: jürgen u. <cer...@us...> - 2005-05-15 09:30:22
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32234 Modified Files: updown.py Log Message: new message Index: updown.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/updown.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** updown.py 29 Apr 2005 15:22:08 -0000 1.1.1.1 --- updown.py 15 May 2005 09:30:00 -0000 1.2 *************** *** 47,50 **** --- 47,53 ---- return 0 + elif msg==self.Msg.WM_DESTROY: + self.onMSG(hwnd, "destroy", 0, 0) + return 0 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:30:01
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31961 Modified Files: tooltip.py Log Message: new message Index: tooltip.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/tooltip.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tooltip.py 29 Apr 2005 15:21:48 -0000 1.1.1.1 --- tooltip.py 15 May 2005 09:29:23 -0000 1.2 *************** *** 124,127 **** --- 124,130 ---- return 0 + elif msg==self.Msg.WM_DESTROY: + self.onMSG(hwnd, "destroy", 0, 0) + return 0 #------------------------------------------------------------------ *************** *** 142,146 **** if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text return addressof(self._client_buffer) --- 145,149 ---- if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text + '\x00' return addressof(self._client_buffer) |
From: jürgen u. <cer...@us...> - 2005-05-15 09:29:03
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31780 Modified Files: textin.py Log Message: new message Index: textin.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/textin.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** textin.py 29 Apr 2005 15:21:18 -0000 1.1.1.1 --- textin.py 15 May 2005 09:28:55 -0000 1.2 *************** *** 63,67 **** self.onMSG(hwnd, "killfocus", wp, 0) return 0 ! --- 63,70 ---- self.onMSG(hwnd, "killfocus", wp, 0) return 0 ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:28:53
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31580 Modified Files: tab.py Log Message: new message Index: tab.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/tab.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tab.py 29 Apr 2005 15:21:26 -0000 1.1.1.1 --- tab.py 15 May 2005 09:28:29 -0000 1.2 *************** *** 78,82 **** self.onMSG(hwnd, "focuschange", 0, 0) return 0 ! #-------------------------------------------------------------------- --- 78,85 ---- self.onMSG(hwnd, "focuschange", 0, 0) return 0 ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 #-------------------------------------------------------------------- *************** *** 88,92 **** if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text return addressof(self._client_buffer) #------------------------------------------------------------------------- --- 91,95 ---- if n > szeof: text = '%s...\x00' % text[:szeof-3] else: text = '%s\x00' % text ! self._client_buffer.raw = text + '\x00' return addressof(self._client_buffer) #------------------------------------------------------------------------- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:28:15
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31437 Modified Files: statusbar.py Log Message: new message Index: statusbar.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/statusbar.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** statusbar.py 29 Apr 2005 15:21:37 -0000 1.1.1.1 --- statusbar.py 15 May 2005 09:28:06 -0000 1.2 *************** *** 67,70 **** --- 67,73 ---- return 0 # + elif msg==self.Msg.WM_DESTROY: + self.onMSG(hwnd, "destroy", 0, 0) + return 0 #------------------------------------------------------------------------- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:27:55
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31173 Modified Files: scrollbar.py Log Message: new message Index: scrollbar.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/scrollbar.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** scrollbar.py 29 Apr 2005 15:22:14 -0000 1.1.1.1 --- scrollbar.py 15 May 2005 09:27:25 -0000 1.2 *************** *** 159,163 **** return self._base_HandleScroll(hwnd, msgr.msg, msgr.wParam, msgr.lParam) return 0 ! def ForwardKeyMessage(self, hwnd, msg, wp, lp): --- 159,166 ---- return self._base_HandleScroll(hwnd, msgr.msg, msgr.wParam, msgr.lParam) return 0 ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 def ForwardKeyMessage(self, hwnd, msg, wp, lp): |
From: jürgen u. <cer...@us...> - 2005-05-15 09:27:11
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30964 Modified Files: radiobox.py Log Message: new message Index: radiobox.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/radiobox.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** radiobox.py 29 Apr 2005 15:21:11 -0000 1.1.1.1 --- radiobox.py 15 May 2005 09:27:00 -0000 1.2 *************** *** 36,40 **** self.onMSG(hwnd, "killfocus", wp, lp) ! #------------------------------------------------------------------------- --- 36,42 ---- self.onMSG(hwnd, "killfocus", wp, lp) ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 #------------------------------------------------------------------------- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:26:41
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30737 Modified Files: progressbar.py Log Message: new message Index: progressbar.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/progressbar.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** progressbar.py 29 Apr 2005 15:21:03 -0000 1.1.1.1 --- progressbar.py 15 May 2005 09:26:25 -0000 1.2 *************** *** 73,77 **** self.EndPaint(ps) return 0 ! #------------------------------------------------------------------------- --- 73,80 ---- self.EndPaint(ps) return 0 ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 #------------------------------------------------------------------------- |
From: jürgen u. <cer...@us...> - 2005-05-15 09:26:02
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30656 Modified Files: pager.py Log Message: new message Index: pager.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/pager.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** pager.py 29 Apr 2005 15:21:41 -0000 1.1.1.1 --- pager.py 15 May 2005 09:25:51 -0000 1.2 *************** *** 55,62 **** return 0 # Not working #elif nm.code ==self.Msg.PGN_SCROLL: # nmps=NMPGSCROLL.from_address(lp) ! --- 55,66 ---- return 0 + # Not working #elif nm.code ==self.Msg.PGN_SCROLL: # nmps=NMPGSCROLL.from_address(lp) ! ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:25:37
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30587 Modified Files: listbox.py Log Message: new message Index: listbox.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/listbox.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** listbox.py 29 Apr 2005 15:22:03 -0000 1.1.1.1 --- listbox.py 15 May 2005 09:25:28 -0000 1.2 *************** *** 25,30 **** """ - from wnd.wintypes import (byref, RECT, INT, --- 25,31 ---- """ from wnd.wintypes import (byref, + Structure, + DWORD, RECT, INT, *************** *** 44,50 **** class ListboxMethods: - #----------------------------------------------------------------- ! # message handlers def onMESSAGE(self, hwnd, msg, wp, lp): --- 45,50 ---- class ListboxMethods: #----------------------------------------------------------------- ! # message handler def onMESSAGE(self, hwnd, msg, wp, lp): *************** *** 55,68 **** msgr.fReturn= 1 if msgr.msg==self.Msg.WM_COMMAND: ! if lp==self.Hwnd: ! notify = HIWORD(wp) ! if notify == self.Msg.LBN_ERRSPACE: ! self.onMSG(hwnd, "errspace", 0, 0) ! elif notify == self.Msg.LBN_SELCHANGE: ! self.onMSG(hwnd, "change", 0, 0) ! elif notify == self.Msg.LBN_SELCANCEL: ! self.onMSG(hwnd, "cancel", 0, 0) return 0 elif msg==self.Msg.WM_SETFOCUS: self.onMSG(hwnd, "setfocus", wp, lp) --- 55,89 ---- msgr.fReturn= 1 if msgr.msg==self.Msg.WM_COMMAND: ! notify = HIWORD(msgr.wParam) ! if notify == self.Msg.LBN_ERRSPACE: ! self.onMSG(hwnd, "errspace", 0, 0) ! elif notify == self.Msg.LBN_SELCHANGE: ! self.onMSG(hwnd, "change", 0, 0) ! elif notify == self.Msg.LBN_SELCANCEL: ! self.onMSG(hwnd, "cancel", 0, 0) return 0 + elif msg==self.Msg.WM_STYLECHANGING: + # make shure LBS_MULTIPLESEL and LBS_EXTENDEDSEL + # can not be changed at runtime + # (will deadlock on some method calls) + if wp==(1l<<32) - 16: # GWL_STYLE + #LVS_SHAREIMAGELISTS = 64 + sst = STYLESTRUCT.from_address(lp) + if sst.styleOld & 8: # LBS_MULTIPLESEL + if not sst.styleNew & 8: + sst.styleNew |= 8 + elif not sst.styleOld & 8: + if sst.styleNew & 8: + sst.styleNew &= ~8 + + if sst.styleOld & 2048: # LBS_EXTENDEDSEL + if not sst.styleNew & 2048: + sst.styleNew |= 2048 + elif not sst.styleOld & 2048: + if sst.styleNew & 2048: + sst.styleNew &= ~2048 + return 0 + elif msg==self.Msg.WM_SETFOCUS: self.onMSG(hwnd, "setfocus", wp, lp) *************** *** 75,79 **** elif msg==self.Msg.WM_LBUTTONDBLCLK: self.onMSG(hwnd, "lmbdouble", wp, lp) ! #------------------------------------------------------------------------- --- 96,102 ---- elif msg==self.Msg.WM_LBUTTONDBLCLK: self.onMSG(hwnd, "lmbdouble", wp, lp) ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 #------------------------------------------------------------------------- *************** *** 96,100 **** if self.SendMessage(self.Hwnd, self.Msg.LB_SETITEMDATA, result, lp)==LB_ERR: ! raise "could not set lparam" return result --- 119,123 ---- if self.SendMessage(self.Hwnd, self.Msg.LB_SETITEMDATA, result, lp)==LB_ERR: ! raise RuntimeError, "could not set lparam" return result *************** *** 106,110 **** if self.SendMessage(self.Hwnd, self.Msg.LB_SETITEMDATA, result, lp)==LB_ERR: ! raise RuntimeError("could not setlparam") return result --- 129,133 ---- if self.SendMessage(self.Hwnd, self.Msg.LB_SETITEMDATA, result, lp)==LB_ERR: ! raise RuntimeError("could not set lparam") return result *************** *** 161,166 **** if not HIWORD(result): return LOWORD(result) ! ! def Select(self, i, stop=0): --- 184,188 ---- if not HIWORD(result): return LOWORD(result) ! def Select(self, i, stop=0): *************** *** 240,248 **** def IterSelected(self): ! if self.GetStyleL('style') & self.Style.LBS_MULTIPLESEL: n=self.SendMessage(self.Hwnd, self.Msg.LB_GETSELCOUNT, 0, 0) if n: arr = (INT * n)() ! self.SendMessage(self.Hwnd, self.Msg.LB_GETSELITEMS , len(arr), byref(arr)) for i in arr: --- 262,273 ---- def IterSelected(self): ! style= self.GetStyleL('style') ! if style & self.Style.LBS_MULTIPLESEL or \ ! style & self.Style.LBS_EXTENDEDSEL: ! n=self.SendMessage(self.Hwnd, self.Msg.LB_GETSELCOUNT, 0, 0) if n: arr = (INT * n)() ! r= self.SendMessage(self.Hwnd, self.Msg.LB_GETSELITEMS , len(arr), byref(arr)) for i in arr: *************** *** 454,457 **** } ! --- 479,484 ---- } ! class STYLESTRUCT(Structure): ! _fields_ = [("styleOld", DWORD), ! ("styleNew", DWORD)] |
From: jürgen u. <cer...@us...> - 2005-05-15 09:24:26
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30387 Modified Files: ipcontrol.py Log Message: new message Index: ipcontrol.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/ipcontrol.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ipcontrol.py 29 Apr 2005 15:22:06 -0000 1.1.1.1 --- ipcontrol.py 15 May 2005 09:24:07 -0000 1.2 *************** *** 52,55 **** --- 52,60 ---- else: raise ValueError("value out of range: %s" % result) return 0 + + + elif msg==self.Msg.WM_DESTROY: + self.onMSG(hwnd, "destroy", 0, 0) + return 0 |
From: jürgen u. <cer...@us...> - 2005-05-15 09:24:09
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30332 Modified Files: imagelist.py Log Message: new class SystemImagelist + bugfixes Index: imagelist.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/imagelist.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** imagelist.py 29 Apr 2005 15:21:34 -0000 1.1.1.1 --- imagelist.py 15 May 2005 09:23:38 -0000 1.2 *************** *** 11,22 **** --- 11,33 ---- from wnd import gdi from wnd.wintypes import (comctl32, + kernel32, + shell32, c_int, byref, + sizeof, + WINFUNCTYPE, + POINTER, memmove, POINT, + BOOL, + HANDLE, + INT, + SHFILEINFO, create_string_buffer) from wnd.fwtypes import TrackHandler from ctypes.com import COMObject from ctypes.com.storage import IStream + from wnd.api import winos + comctl32.InitCommonControls() *************** *** 89,92 **** --- 100,111 ---- "mask" : 16,"image" : 32,"rop" : 64,"overlaymask" : 3840} + FILEINFO_FLAGS={'linkoverlay' : 32768, + 'selected' : 65536, + 'largeicon' : 0, + 'smallicon' : 1, + 'openicon' : 2, + 'shelliconsize' : 4} #'sysiconindex' : 4096 + + #*********************************************** class ImagelistFromHandle(object): *************** *** 95,99 **** def __init__(self, handle): self.handle = handle ! TrackHandler.Register('imagelists', self.handle) def Write(self): --- 114,118 ---- def __init__(self, handle): self.handle = handle ! def Write(self): *************** *** 143,147 **** flag |= INDEXTOOVERLAYMASK(n) else: ! try: flag |= drawflags[n] except: raise ValueError("invalid style: %s" % n) handle = comctl32.ImageList_GetIcon(self.handle, i, flag) --- 162,166 ---- flag |= INDEXTOOVERLAYMASK(n) else: ! try: flag |= IMGL_DRAWFLAGS[n] except: raise ValueError("invalid style: %s" % n) handle = comctl32.ImageList_GetIcon(self.handle, i, flag) *************** *** 224,228 **** if not result: raise RuntimeError("could not draw image") ! def DrawEx(self, DC, i, x, y, w, h, colorBck, colorFg, *flags): CLR_NONE = 4294967295 CLR_DEFAULT = 4278190080 --- 243,247 ---- if not result: raise RuntimeError("could not draw image") ! def DrawEx(self, DC, i, x, y, w, h, colorBk, colorFg, *flags): CLR_NONE = 4294967295 CLR_DEFAULT = 4278190080 *************** *** 264,268 **** def __len__(self): return comctl32.ImageList_GetImageCount(self.handle) ! #def __del__(self): self.close() def Close(self): if self.handle: --- 283,302 ---- def __len__(self): return comctl32.ImageList_GetImageCount(self.handle) ! ! def Close(self): ! if hasattr(self, 'handle'): ! self.__delattr__('handle') ! else: ! raise RuntimeError("imagelist is closed") ! ! ! #************************************************** ! #************************************************** ! class DisposableImagelist(ImagelistFromHandle): ! ! def __init__(self, handle): ! self.handle= handle ! TrackHandler.Register('imagelists', self.handle) ! def Close(self): if self.handle: *************** *** 270,280 **** if not comctl32.ImageList_Destroy(self.handle): raise RuntimeError("could not destroy imagelist") ! self.handle = 0 ! ! #************************************************** #************************************************** ! class Imagelist(ImagelistFromHandle): def __init__(self, w, h, size, maxsize, *flags): --- 304,313 ---- if not comctl32.ImageList_Destroy(self.handle): raise RuntimeError("could not destroy imagelist") ! self.handle = 0 #************************************************** ! #************************************************** ! class Imagelist(DisposableImagelist): def __init__(self, w, h, size, maxsize, *flags): *************** *** 286,293 **** if not handle: raise RuntimeError("could not create imagelist") ! ImagelistFromHandle.__init__(self, handle) ! #************************************************ ! class ImagelistFromBytes(ImagelistFromHandle): def __init__(self, bytes): --- 319,327 ---- if not handle: raise RuntimeError("could not create imagelist") ! DisposableImagelist.__init__(self, handle) ! #************************************************** ! #************************************************** ! class ImagelistFromBytes(DisposableImagelist): def __init__(self, bytes): *************** *** 295,304 **** handle = comctl32.ImageList_Read(byref(self.stream.IStream)) if not handle: raise RuntimeError("could not create imagelist from bytes") ! ImagelistFromHandle.__init__(self, handle) del self.stream.IStream del self.stream #**************************************************** ! class ImagelistFromFile(ImagelistFromHandle): def __init__(self, path, w): --- 329,338 ---- handle = comctl32.ImageList_Read(byref(self.stream.IStream)) if not handle: raise RuntimeError("could not create imagelist from bytes") ! DisposableImagelist.__init__(self, handle) del self.stream.IStream del self.stream #**************************************************** ! class ImagelistFromFile(DisposableImagelist): def __init__(self, path, w): *************** *** 317,326 **** if not handle: raise RuntimeError("could not load imagelist from file") ! ImagelistFromHandle.__init__(self, handle) #************************************************** #************************************************** class DragImage: def __init__(self, imagelist): --- 351,459 ---- if not handle: raise RuntimeError("could not load imagelist from file") ! DisposableImagelist.__init__(self, handle) #************************************************** + #************************************************** + class SystemImagelist(object): + + def __init__(self, size='small'): + + GPA = kernel32.GetProcAddress + isNT= winos.IsNT() + if isNT: + ## ?? check what happens on successive inits + ## should be the same handle returned, at least I hope so + GPA.restype = WINFUNCTYPE(BOOL, BOOL) + try: + IconInit = GPA(shell32._handle, 660) + IconInit(1) + except: + raise RuntimeError, "could not retrieve IconInit api" + + GPA.restype = WINFUNCTYPE(INT, POINTER(HANDLE), POINTER(HANDLE)) + try: + SH_GetImageLists = GPA(shell32._handle, 71) + except: + raise RuntimeError, "could not retrieve shell_GetImageLists api" + + + small = HANDLE() + large = HANDLE() + if not SH_GetImageLists(byref(large), byref(small)): + raise RuntimeError, "could not retrieve system imagelist" + + if not (large.value and small.value): + raise RuntimeError, "could not retrieve system imagelist" + + if size=='small': + self.handle= small.value + else: + self.handle= large.value + + + + def GetIconIndex(self, path, *flags): + flag = 16384 # SHGFI_SYSICONINDEX + for i in flags: + try: flag |= FILEINFO_FLAGS[i] + except: raise ValueError("invalid flag: %s" % i) + + fileattributes = 0 + if path[0]=='*': + fileattributes = 128 # FILE_ATTRIBUTE_NORMAL + flag |= 16 # SHGFI_USEFILEATTRIBUTES + + if path=='directory': + fileattributes = 16 # FILE_ATTRIBUTE_DIRECTORY + flag |= 16 # SHGFI_USEFILEATTRIBUTES + + fi = SHFILEINFO() + if not shell32.SHGetFileInfoA(path, fileattributes, byref(fi), sizeof(SHFILEINFO), flag): + raise RuntimeError("could not retrieve icon") + return fi.iIcon + + + def Draw(self, DC, i, x, y, *flags): + flag = 0 + for n in flags: + if isinstance(n, (int, long)): flag |= INDEXTOOVERLAYMASK(n) + else: + try: flag |= IMGL_DRAWFLAGS[n] + except: raise ValueError("invalid draw flag: %s" % n) + if not comctl32.ImageList_Draw(self.handle, i, DC.handle, x, y, flag): + raise RuntimeError("could not draw image") + + def DrawEx(self, DC, i, x, y, w, h, colorBk, colorFg, *flags): + CLR_NONE = 4294967295 + CLR_DEFAULT = 4278190080 + if not colorBk: colorBk = CLR_NONE + elif colorBk=='default': colorBk = CLR_DEFAULT + else: colorBk = RGB(*colorBk) + if not colorFg: colorFg = CLR_NONE + elif colorFg=='default': colorFg = CLR_DEFAULT + else: colorFg = colorBk + flag = 0 + for n in flags: + if isinstance(n, int): flag |= INDEXTOOVERLAYMASK(n) + else: + try: flag |= IMGL_DRAWFLAGS[n] + except: raise ValueError("invalid draw flag: %s" % n) + result = comctl32.ImageList_DrawEx(self.handle, i, DC.handle, x, y, w, h, colorBk, colorFg, flag) + if not result: raise RuntimeError("could not draw image") + + def GetIconSize(self): + w = c_int() + h = c_int() + if not comctl32.ImageList_GetIconSize(self.handle, byref(w), byref(h)): + raise RuntimeError("could not retrieve icon size") + return w.value, h.value + + + def Close(self): + pass #************************************************** + #************************************************** class DragImage: def __init__(self, imagelist): |
From: jürgen u. <cer...@us...> - 2005-05-15 09:23:05
|
Update of /cvsroot/wnd/wnd/wnd/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30276 Modified Files: header.py Log Message: new message Index: header.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/controls/header.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** header.py 29 Apr 2005 15:21:57 -0000 1.1.1.1 --- header.py 15 May 2005 09:22:49 -0000 1.2 *************** *** 114,118 **** self.onMSG(hwnd, "mouseactivate", 0, 0) ! def _client_TruncText(self, text): """Truncates text to _client_buffer. Return value is --- 114,122 ---- self.onMSG(hwnd, "mouseactivate", 0, 0) ! elif msg==self.Msg.WM_DESTROY: ! self.onMSG(hwnd, "destroy", 0, 0) ! return 0 ! ! def _client_TruncText(self, text): """Truncates text to _client_buffer. Return value is |