wnd-commit Mailing List for wnd (Page 3)
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-07-23 19:48:39
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/button In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2527 Modified Files: button.dtpl Log Message: bit of this and a bit of that Index: button.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/button/button.dtpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** button.dtpl 15 May 2005 10:00:39 -0000 1.2 --- button.dtpl 23 Jul 2005 19:48:16 -0000 1.3 *************** *** 225,279 **** The following styles are used with Buttons:<br><br> <TABLE class="table1" BORDER="1"> ! <TR> ! <TD>'bitmap'</TD> ! <TD>the button displays an bitmap. This style can not be changed at runtime</TD> ! </TR> ! <TR> ! <TD>'center'</TD> ! <TD>Centers the text horizontally in the button</TD> ! </TR> ! <TR> ! <TD>'flat'</TD> ! <TD>Displays a flat button</TD> ! </TR> ! <TR> ! <TD>'icon'</TD> ! <TD>the button displays an icon. This style can not be changed at runtime</TD> ! </TR> ! <TR> ! <TD>'left'</TD> ! <TD>Displays text left aligned</TD> ! </TR> ! <TR> ! <TD>'multiline'</TD> ! <TD>Formats the text to be displayed using multiple lines.</TD> ! </TR> ! <TR> ! <TD>'notify'</TD> ! <TD>Not used</TD> ! </TR> ! <TR> ! <TD>'ownerdraw'</TD> ! <TD>lets you draw the button from scratch</TD> ! </TR> ! <TR> ! <TD>'right'</TD> ! <TD>Displays text right aligned</TD> ! </TR> ! <TR> ! <TD>'top'</TD> ! <TD>Displays text top aligned</TD> ! </TR> ! <TR> ! <TD>'vcenter'</TD> ! <TD>Centers the text vertically in the middle of te button</TD> ! </TR> ! <br><br> ! Some of these styles might be changable at runtime, others not, ! like can not convert a 'bitmap' button into an 'icon' button into ! a text displaying Button. ! </TABLE> --- 225,279 ---- The following styles are used with Buttons:<br><br> <TABLE class="table1" BORDER="1"> ! <TR> ! <TD>'bitmap'</TD> ! <TD>the button displays an bitmap. This style can not be changed at runtime</TD> ! </TR> ! <TR> ! <TD>'center'</TD> ! <TD>Centers the text horizontally in the button</TD> ! </TR> ! <TR> ! <TD>'flat'</TD> ! <TD>Displays a flat button</TD> ! </TR> ! <TR> ! <TD>'icon'</TD> ! <TD>the button displays an icon. This style can not be changed at runtime</TD> ! </TR> ! <TR> ! <TD>'left'</TD> ! <TD>Displays text left aligned</TD> ! </TR> ! <TR> ! <TD>'multiline'</TD> ! <TD>Formats the text to be displayed using multiple lines.</TD> ! </TR> ! <TR> ! <TD>'notify'</TD> ! <TD>Not used</TD> ! </TR> ! <TR> ! <TD>'ownerdraw'</TD> ! <TD>lets you draw the button from scratch</TD> ! </TR> ! <TR> ! <TD>'right'</TD> ! <TD>Displays text right aligned</TD> ! </TR> ! <TR> ! <TD>'top'</TD> ! <TD>Displays text top aligned</TD> ! </TR> ! <TR> ! <TD>'vcenter'</TD> ! <TD>Centers the text vertically in the middle of te button</TD> ! </TR> ! <br><br> ! Some of these styles might be changable at runtime, others not, ! like can not convert a 'bitmap' button into an 'icon' button into ! a text displaying Button. ! </TABLE> |
From: jürgen u. <cer...@us...> - 2005-07-23 19:48:02
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/trackbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2472/trackbar Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/trackbar added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:47:40
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/rebar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2396/rebar Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/rebar added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:46:04
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/propertysheet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2171/propertysheet Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/propertysheet added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:45:44
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/monthcal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2121/monthcal Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/monthcal added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:45:25
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/datepicker In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2032/datepicker Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/controls/control classes/datepicker added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:44:07
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1704 Modified Files: controls.dtpl Log Message: bit of this and a bit of that Index: controls.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/controls/controls.dtpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** controls.dtpl 2 Jul 2005 09:39:05 -0000 1.3 --- controls.dtpl 23 Jul 2005 19:43:59 -0000 1.4 *************** *** 132,135 **** --- 132,144 ---- </P> + + ::item:: ThreadWindows + <code>ThreadWindows(flag=None)</code><br> + <P>Returns a list containing the hwnds of all windows of the same thread + <br><br> + flag can be 'excludehidden' to return the hwnds of visible thread windows + only or 'excludevisible' to exclude all visible thread windows + </P> + ::item:: SetParent <code>SetParent(window)</code><br> *************** *** 1005,1010 **** </P> ! --- 1014,1038 ---- </P> + ::item:: SetGUID + <code>SetGUID(guid)</code><br> + <P>Assigns a globally unique identifier to the control or window + <br><br> + You can use this identifier to uniquely identify a control or window + cross process or network boundaries. The guid should be a string + representing the id. To make best use of it guid should be a + GUID as defined in the win32 SDK, that is a 128-bit + number you hard code in your script. Use either 'guidgen.exe' as it comes + shipped with the platform SDK to genereate such an id or the ClipGUID + function wich you will find in the 'tools' module of the framework + </P> ! ::item:: GetGUID ! <code>GetGUID()</code><br> ! <P>Returns the globally unique identifier assigned to a window or ! None. ! <br><br> ! For details see <a HREF="SetGUID.html">SetGUID</a> ! </P> ! |
From: jürgen u. <cer...@us...> - 2005-07-23 19:43:28
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1603 Modified Files: win.dtpl Log Message: bit of this and a bit of that Index: win.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/api/win/win.dtpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** win.dtpl 29 Apr 2005 15:15:44 -0000 1.1.1.1 --- win.dtpl 23 Jul 2005 19:43:20 -0000 1.2 *************** *** 21,24 **** --- 21,29 ---- <code></code>ToggleTaskBar()<br> <P>Hides the taskbar if it is visible, shows it otherwise + + <br><br> + <b>Return value<b><br> + True if the taskbar was toggled to visible state, False if it was toggled + to hidden state, None if the taskbar window could not be found. </P> |
From: jürgen u. <cer...@us...> - 2005-07-23 19:42:57
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/shell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1423 Modified Files: shell.dtpl Log Message: bit of this and a bit of that Index: shell.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/api/shell/shell.dtpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shell.dtpl 2 Jul 2005 09:32:59 -0000 1.3 --- shell.dtpl 23 Jul 2005 19:42:49 -0000 1.4 *************** *** 46,50 **** ::item:: FileOperation ! <code>FileOperation(fileaction, From, To, title='', hwnd=0, *flags)</code><br> <P> Performs a file operation.<br> --- 46,50 ---- ::item:: FileOperation ! <code>FileOperation(fileaction, From, To, *flags, **kwargs)</code><br> <P> Performs a file operation.<br> *************** *** 66,77 **** <br><br> - <DT>title - <DD>Title of the progress dialog box - <br><br> - <DT>hwnd - <DD>Not yet tested. Currently should be 0. - <br><br> - <DT>flags <DD> --- 66,70 ---- *************** *** 124,128 **** --- 117,135 ---- </DL> + + <br><br> + The following keyword arguments are recognized: + <DL> + <DT>title + <DD>Title of the progress dialog box + <br><br> + + <DT>hwnd + <DD>Not yet tested. Currently should be 0. + <br><br> + </DL> + + <br><br> If the paths specified are relative paths the current working directory is assumed to be the root of the files. |
From: jürgen u. <cer...@us...> - 2005-07-23 19:42:30
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/privleges In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1294 Modified Files: privleges.dtpl Log Message: bit of this and a bit of that Index: privleges.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/api/privleges/privleges.dtpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** privleges.dtpl 29 Apr 2005 15:15:39 -0000 1.1.1.1 --- privleges.dtpl 23 Jul 2005 19:42:22 -0000 1.2 *************** *** 123,130 **** ::item:: EnablePrivleges ! <code>EnablePrivleges(hProcess=None, *privleges)</code><br> <P>Enables the specified privleges for a process, identified by its handle. <br><br> ! If hProcess is None privleges are enabled for the current process. <br><br> For a list of privleges you can enable see --- 123,132 ---- ::item:: EnablePrivleges ! <code>EnablePrivleges(*privleges, **kwargs)</code><br> <P>Enables the specified privleges for a process, identified by its handle. <br><br> ! You can pass a keyword argument: 'hProcess' pasing the handle of a ! process to enable the privleges for a specified process. By default ! the privleges are enabled for the current process. <br><br> For a list of privleges you can enable see *************** *** 134,141 **** ::item:: DisablePrivleges ! <code>DisablePrivleges(hProcess=None, *privleges)</code><br> <P>Disables the specified privleges for a process, identified by its handle. <br><br> ! If hProcess is None privleges are disabled for the current process. <br><br> For a list of privleges you can disable see --- 136,146 ---- ::item:: DisablePrivleges ! <code>DisablePrivleges(*privleges, **kwargs)</code><br> <P>Disables the specified privleges for a process, identified by its handle. <br><br> ! You can pass a keyword argument: 'hProcess' pasing the handle of a ! process to disable the privleges for a specified process. By default ! the privleges are disabled for the current process. ! <br><br> For a list of privleges you can disable see |
From: jürgen u. <cer...@us...> - 2005-07-23 19:42:02
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/ole/dragdrop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1223 Added Files: dragdrop.dtpl Log Message: bit of this and a bit of that --- NEW FILE: dragdrop.dtpl --- ::site:: module dragdrop This module contains stuff required for drag-and-drop actions Its mostly aimed at extension writers who want to implement drag and drop capabilities into their controls or to implement custom drag and drop if supported by a control. <br><br> Use this if you want to implement a control supporting drag-and-drop or for handling custom drag-and-drop for a control who supports this <br><br> Use the <a HREF="dragdrop functions/Register.html">Register</a> to register a window as drop target. <a HREF="dragdrop functions/Revoke.html">Revoke</a> this registration when the window is closed. To drag data use the <a HREF="dragdrop functions/DoDragDrop.html">DoDragDrop</a> function. <br><br> The keyboard is used like this in drag and drop operations: <br> When the user holds down the control key the data should be copied, control and shift down should link to it, none or shift down should move it. <br><br> The sample code registers a window as drop target, and users the drag source capabilities to drag data around <pre> from wnd.api.ole import dragdrop \# setup DragDrop class and register the window as drop target self.drag= dragdrop.DragDrop(self.Hwnd) self.drag.onMSG= self.onMSG dragdrop.Register(self.Hwnd, self.drag) \# init a dataObject for draging text= dragdrop.cf.text('my sample text') self.do= dataobject.DataObject(text) def onMSG(self, hwnd, msg, wp, lp): \# trigger draging of data \# todo: check if mouse has left drag rect if msg=="lmbdown": result=dragdrop.DoDragDrop(self.do, self.drag, 'move', 'copy', 'link') print result if msg=="dragdrop": \# handle drop target side if wp=="dragenter": \# check if some interesting format is contained in DataObject \# self.SetFocus() return lp[0].HasFormat(dragdrop.cf.text) if wp=="dragover": \# move the cursor along, hilight items on the way or whatever pass elif wp=="drop": \# get the data if lp[0].HasFormat(dragdrop.cf.text): text= dragdrop.cf.text() lp[0].GetData(text) print text.value text.value= None \# check keystate if necessary if lp[1] & dragdrop.MK_LBUTTON: \# left mouse buton is down pass elif lp[1] & dragdrop.MK_RBUTTON: \# rigth mouse buton is down pass \# cleanup if msg=="destroy": try: self.do.Close() except: pass try: dragdrop.Revoke(hwnd) except: pass </pre> ::site:: DropTargetPointer <code class=import>defined in: wnd.api.ole.dragdrop</code><br><br> <code>DropTargetPointer()</code><br> Wrapper around a IDropTarget pointer ::site:: dragdrop constants DROPEFFECT_NONE = 0 <br> DROPEFFECT_COPY = 1 <br> DROPEFFECT_MOVE = 2 <br> DROPEFFECT_LINK = 4 <br> DROPEFFECT_SCROLL = -2147483648<br> <br> MK_LBUTTON = 1<br> MK_RBUTTON = 2<br> MK_SHIFT = 4<br> MK_CONTROL = 8<br> MK_MBUTTON = 16<br> MK_ALT = 32<br> ::folder:: dragdrop functions This module defines the following functions: ::item:: cf <code>cf(name)</code><br> <P>Imports a clipboard format given its name. <br><br> This is the same stub class as in <code class="import">wnd.api.clipboard</a> </P> ::item:: Register <code>Register(hwnd, DragDrop)</code><br> <P>Registers awindow as drop target. <br><br> DragDrop should be an instance of the <a HREF="../DragDrop.html">DragDrop</a> class to handle the drop target side. <br><br> <b>Return value</b><br> 0 if sucessful, an error code if not </P> ::item:: Revoke <code>Revoke(hwnd)</code><br> <P>Unregisters the window as drop target. You should make shure to call this when the window is closed <b>Return value</b><br> 0 if sucessful, an error code if not <br><br> </P> ::item:: DoDragDrop <code>DoDragDrop(DataObject, DropSource, *effects)</code><br> <P> <DL> <DT>DataObject <DD>a DataObject containing clipboard formats <br><br> <DT>DragDrop <DD>a <a HREF="../DragDrop.html">DragDrop</a> instance <br><br> <DT>*effects <DD>one or more effects allowed in the operation. <TABLE class="table1" BORDER="1"> <TR> <TD>'none'</TD> <TD>no effect</TD> </TR> <TR> <TD>'copy'</TD> <TD>the data may be copied</TD> </TR> <TR> <TD>'move'</TD> <TD>the data may be moved</TD> </TR> <TR> <TD>'link'</TD> <TD>the data may be linked to</TD> </TR> </TABLE> <br><br> The drop target decides wich effect to actually use from the allowed effects. </DL> <br><br> <b>Return value</b><br> a tuple(result, effect). <br><br> the first member of the tuple holds the result of the operation: <TABLE class="table1" BORDER="1"> <TR> <TD>'cancel'</TD> <TD>the operstion was canceled</TD> </TR> <TR> <TD>'drop'</TD> <TD>the daqta has been dropped</TD> </TR> <TR> <TD>'outofmemory'</TD> <TD>one of these error codes</TD> </TR> <TR> <TD>'unexpected'</TD> <TD>another one, but this time we are surprised. Should be sufficient to pretend as if. </TD> </TR> <TR> <TD>'unknown error'</TD> <TD>unknown</TD> </TR> <TABLE> <br><br> The second is the outcomming effect. Should be one of the effects or 'unknown'. <br><br> If the effect is 'move' you should remove the dragged data from yours. </P> ::site:: class DragDrop <code class=import>defined in: wnd.api.ole.dragdrop</code><br><br> <code>DragDrop(hwnd)</code><br> <P> Inits a class that handles the drop target and drop source side of a drag-and-drop action. <b>hwnd</b> can be be the hwnd of a window, a cookie or whatever, being passed as hwnd paramterer to the message handler <br><br> All messages during a drag-and-drop action are redirected to the the message handler of the class: <br><br> <code>onMSG(hwnd, msg, wp, lp)</code><br> <br><br> Overwrite this message handler to process the messages. The following messages are send to the message handler: <br><br> <DL> <DT>'dragdrop' <DD>the mouse has entered the window, containing drag load.<br> wp='dragenter'<br> lp= tuple(DataObject, keystate, point, pEffect) <br><br> <TABLE class="table1" BORDER="1"> <TR> <TD>DataObject</TD> <TD>the data object carried along as defined in <code class=import>wnd.api.ole.dataobject</code>. </TD> </TR> <TR> <TD>keystate</TD> <TD>a flag indicating wich keys are down by that time: can be on or more of the MK_* constants defined in the module. See <a HREF="dragdrop constants.html>dragdrop constants</a></TD> </TR> <TR> <TD>point</TD> <TD>a ||type-POINT|| containing the coordinates of the cursor</TD> </TR> <TR> <TD>pEffect</TD> <TD>pointer to a DWORD containing the drop effect</TD> </TR> </TABLE> <br><br> Most of the time it should be enough to query the DataObject passed if it contains anything of interest. Return False here to indicate that nothing you can make any use of carried along. <br><br> <DT>'dragdrop' <DD>the mouse draging over the window<br> wp='dragover'<br> lp= tuple(keystate, point, pEffect) <br><br> <TABLE class="table1" BORDER="1"> <TR> <TD>keystate</TD> <TD>a flag indicating wich keys are down by that time: can be on or more of the following: MK_SHIFT, MK_CONTROL</TD> </TR> <TR> <TD>point</TD> <TD>a ||type-POINT|| containing the coordinates of the cursor</TD> </TR> <TR> <TD>pEffect</TD> <TD>pointer to a DWORD containing the drop effect</TD> </TR> </TABLE> <br><br> Most interesting here is the ||type-POINT|| passed, so you can follow the cursor around while moving. Return False here to indicate that a drop is not allowde over the specified position. <br><br> <DT>'dragdrop' <DD>the mouse is leaving the window<br> wp='dragleave'<br> lp= allways zero <br><br> <DT>'dragdrop' <DD>the user has dropped the data<br> wp='drop'<br> lp= tuple(DataObject, keystate, point, pEffect) <br><br> <TABLE class="table1" BORDER="1"> <TR> <TD>DataObject</TD> <TD>the data object carried along as defined in <code class=import>wnd.api.ole.dataobject</code>. </TD> </TR> <TR> <TD>keystate</TD> <TD>a flag indicating wich keys are down by that time: can be on or more of the MK_* constants defined in the module. See <a HREF="dragdrop constants.html>dragdrop constants</a></TD> </TR> <TR> <TD>point</TD> <TD>a ||type-POINT|| containing the coordinates of the cursor</TD> </TR> <TR> <TD>pEffect</TD> <TD>pointer to a DWORD containing the drop effect</TD> </TR> </TABLE> <br><br> You queried the DataObject on enter alreaddy if it contains something interesting, no matter, do it again and get whatever data you are interested in from the DataObject If you do not want to acceot the drop return False here. <br><br> </DL> <br><br> <b>Notes</b><br> <UL> <LI>'feedback' is not send if the class is used to handle the drop target side only.All messages except 'feedback' are not send when the class is used to handle the drop source side only. <br><br> <LI>Its best to init the class when you init the control. Initing it through a method call at runtime runs the risk of being garbage collected. </UL> <br><br> The DragDrop class defines some additional methods: <br><br> <code>GetDropTargetPointer()</code><br> <P>Returns a pointer to the IDropTarget pointer of the class <br><br> <br><br> <code>GetDropSourcePointer()</code><br> <P>Returns a pointer to the IDropSource pointer of the class <br><br> <br><br> <code>SetDropEffect(*effects)</code><br> <P>This method is used for drop targets to adjust the drop effects the target supports. <br><br> By default all drop effects are supported, you may adjust them to your needs using this method, specifying one or more of the dropeffect flags: <TABLE class="table1" BORDER="1"> <TR> <TD>'none'</TD> <TD>no effect</TD> </TR> <TR> <TD>'copy'</TD> <TD>the data may be copied</TD> </TR> <TR> <TD>'move'</TD> <TD>the data may be moved</TD> </TR> <TR> <TD>'link'</TD> <TD>the data may be linked to</TD> </TR> </TABLE> <br><br> <br><br> <code>GetDropEffect()</code><br> <P>For drop targets, returns the supported drop effect. <br><br> Return value may be a list of one or more of the dropeffect flags </P> <br><br> |
From: jürgen u. <cer...@us...> - 2005-07-23 19:41:35
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/ole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1152 Added Files: ole.dtpl Log Message: bit of this and a bit of that --- NEW FILE: ole.dtpl --- ::site:: ole Doc here |
From: jürgen u. <cer...@us...> - 2005-07-23 19:41:06
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/copydata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1072 Added Files: copydata.dtpl Log Message: bit of this and a bit of that --- NEW FILE: copydata.dtpl --- ::site:: class CopyData <code class=import>defined in: wnd.api.copydata</code><br><br> <code>CopyData()</code><br> <P> Handles simple interprocess communication via WM_COPYDATA <br><br> </P> ::site:: interprocess communication with CopyData first of all some sample code of a simple CopyData communication: <pre> \## Assume a control in GUI no.1 waiting for input from wnd.api import copydata GUID= '{D155D440-F877-11D9-B552-00112FF53A26}' SEND_NOTE= 1 \# setup the CopyData handler ++ \# make the control recognizable throughout the system self.cd= copydata.CopyData() myControl1.SetGUID(GUID) def on_myControl(self, hwnd, msg, wp, lp): if msg=='copydata': if lp[0] == SEND_NOTE: print lp[1] >> 'return something' self.cd.CopyData(myControl1.Hwnd, wp, SEND_NOTE, 'the fox dumped in the pit') return True return False </pre> <pre> \## Assume a GUI no.2 wants to send a request for data to the control in the other GUI from wnd.api import copydata GUID_OTHER= '{D155D440-F877-11D9-B552-00112FF53A26}' SEND_NOTE= 1 self.cd= copydata.CopyData() \# send some data hwndOther= self.cd.FindGUID(myControl2.Hwnd, GUID_OTHER) if hwndOther: self.CopyData(myControl2.Hwnd, hwndOther, SEND_NOTE, 'return something') \# catch the the response from GUI1in the 'copydata' handler def on_control2(self, hwnd, msg, wp, lp): if msg=='copydata': if lp[0] == SEND_NOTE: print lp[1] >> 'the fox dumped in the pit' </pre> <br><br> If you are expecting a response from a window you may find the following sample code usefull. It uses a subclassing mechanism quite commonly used in the win32 world: replacing a procedure temporarily with a hook procedure. This eliminates the need of processing message and response in two different message handlers. <pre> self.cd= copydata.CopyData() self.button= Button(......) self.button.onMSG = self.on_bt \# default message handler for the button def on_bt(self, hwnd, msg, wp, lp): if msg=="command": \# procedure temporarily processing messages \# filters out all interesting messages and passes \# the rest to the default procedure def tmp_proc(hwnd, msg, wp, lp): if msg=="copydata": if lp[0] == 1: # or whatever print msg, wp, lp return 1 # do not pass message to default procedure return oldProc(hwnd, msg, wp, lp) \# 'subclass' the button oldProc = self.b.onMSG self.b.onMSG = tmp_proc \# copy data to some other hwnd= self.cd.FindGUID(self.button.Hwnd, GUID_OTHER) if hwnd: self.cd.CopyData(self.button.Hwnd, hwnd, 1234, 'foo text') \# restore old button procedure self.b.onMSG=oldProc elif msg=="copydata": \# other copydata messages may pass in here pass </pre> <br><br> <H3>How can I send and receive data for an application that does not have a window?</H3> The answer is pretty simple: create a window. <br><br> At any given time all kinds of hidden proxy windows are running on the system. You' ll just add another one to the crowd in the back, waiting for something to happen. A hidden window will do. Place all the processing code inside it. The most minimal approach is to process right when the window is created and emidiately close it after you' re done. <br><br> <H3>How to receive data from non-framework applications ?</H3> CopyData works for windows being recognizable as framework windows only. <br><br> To be recognized as framework window a mainwindow has to return <b>WND_MSGRESULT_TRUE</b> in response to the <b>WND_WM_NOTIFY</b> message with wParam set to <b>WND_NM_ISFWWINDOW</b> For childwindows this test is not performed. <br><br> The data in the <b>WM_COPYDATA</b> message will only be accepted if it is prefixed with the string defined as <b>SZ_GUID_COPYDATA</b>, and cbData in the <b>COPYDATASTRUCT</b> not exceeding <b>WND_COPYDATA_MAXDATA</b> bytes. Otherwise the message is ignored and will always return False. The dwData member of the <b>COPYDATASTRUCT</b> should be in range 0 - 65535. Don' t touch the <b>HIWORD</b> of dwData, if you do so, the message is considered being an internal framwork message and will not reach anyone out there. <br><br> To query a framework window for its <b>GUID</b>, you should first query the main window for its <b>GUID</b> and if not sucessful its childwindows, one by one. To do so you send a <b>WND_WM_NOTIFY</b> message to each window with wParam set to <b>WND_NM_GETGUID</b> and lParam set to the hwnd of the window calling. The window will return True if it has a GUID, False otherwise. If it has a <b>GUID</b> it will send, before returning, a <b>WM_COPYDATA</b> to the calling window. In the <b>COPYDATASTRUCT</b> the <b>LOWORD</b> of the lpData member will be set to <b>WND_CD_GUID</b>. lpData will point to a bytes array of length cbData, prefixed with <b>SZ_GUID_COPYDATA</b> and emidiately following the GUID of the window. <br><br> All the constants mentioned are defined in wnd.fwtypes.py. To use <b>WND_WM_NOTIFY</b> you have to call RegisterWindowMessage with <b>SZ_WND_NOTIFY</b> as parameter <br><br> Following the rules you should be able to setup data exchange between framework windows and any other window capable of sending <b>WM_COPYDATA</b> messages. ::folder:: CopyData methods CopyData instances support the following methods: ::item:: FindGUID <code>FindGUID(hwnd, GUID)</code><br> <P>Searches the system for a window with the specified GUID. <br><br> <b>hwnd</b> should be the valid hwnd of the window requesting the GUID <br><br> <b>Return value</b><br> The hwnd of the window with the specified GUID or None if no matching window could be found </P> ::item:: CopyData <code>CopyData(hwndSource, hwndDest, lp, data, noprefix=False)</code><br> <P>Copies data from the source window to the destination window. <DL> <DT>hwndSource <DD>hwnd of the source window <DT>hwndDest <DD>hwnd of the destination window <DT>lp <DD>parameter to pass along with the data (any int in the range 0- 65535) <DT>data <DD>The data to copy. Can be any string <DT>noprefix <DD>if True omits the framework identifier the data otherwise would be be prefixed with. <br> This flag may be usefull when sending WM_COPYDATA messages to non-framework windows. If the flag is set two things apply: <OL> <LI>the message is ignored by any window of the framework <LI>the <b>lp</b> restriction (range 0-65535) does not apply anymore </OL> </DL> <br><br> The destination window will receive a message "copydata" with wParam set to the hwnd of the sending window and lParam set to a tuple(lp, data). If you return False, False is returnd to the sender, otherwise True. <br><br> This method is intended to exchange reasonably small amounts of data accross process boundaries. The maximum amount of data you may copy is limited to 10megs, but its certainly more reasonable to keep the amount of data rather small, cos the data is copied all at once, and for larger amounts of data this method becomes rather slow. <br><br> To establish a simple data exchange you may respond to a 'copydata' message by sending a message back right before returning. <br><br> <br><br> <b>Return value</b><br> True if the receiver responded True, False otherwise <br><br> <b>Note</b><br> To identfy a window uniquely throughout the system you use its <b>SetGUID</b> (lno link yet) method. </P> |
From: jürgen u. <cer...@us...> - 2005-07-23 19:40:16
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/copydata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901/copydata Log Message: Directory /cvsroot/wnd/wnd/wnd_doc/doc/api/copydata added to the repository |
From: jürgen u. <cer...@us...> - 2005-07-23 19:39:54
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/1. Whats new In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv786 Modified Files: whats new.dtpl Log Message: bit of this and a bit of that Index: whats new.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/1. Whats new/whats new.dtpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** whats new.dtpl 2 Jul 2005 09:24:12 -0000 1.4 --- whats new.dtpl 23 Jul 2005 19:39:40 -0000 1.5 *************** *** 2,23 **** ! ::defaultpage:: whats new in 0.1.12 ::contents-header1:: news ::contents-header2:: version history ! ::site:: whats new in 0.1.12 ! <H3><a NAME="contents">changes in wnd 0.1.12</a></H3> ! release 0.1.1 3.06.05 <br><br> <UL> <LI><a HREF="#samples">changes sample guis</a> <LI><a HREF="#controls">changes controls</a> <LI><a HREF="#api">changes api</a> ! <LI><a HREF="#gdi">changes api</a> ! <LI><a HREF="#misc">miscelaneous changes</a> </UL> --- 2,28 ---- ! ::defaultpage:: whats new in 0.1.20 ::contents-header1:: news ::contents-header2:: version history ! ! ::site:: whats new in 0.1.20 ! <H3><a NAME="contents">release 23.07.05</a></H3> ! <br><br> <UL> + <LI><a HREF="#bic">changes backwards incompatible</a> <LI><a HREF="#samples">changes sample guis</a> + <LI><a HREF="#dlgs">changes dialogs</a> <LI><a HREF="#controls">changes controls</a> + <LI><a HREF="#custom">changes custom controls</a> <LI><a HREF="#api">changes api</a> ! <LI><a HREF="#gdi">changes gdi</a> ! <LI><a HREF="#tools">changes tools</a> ! </UL> *************** *** 29,35 **** <br><br> ! With the recent changes in shell and ole, drag and drop features are now implemented in ! the framework. ! <br><br> --- 34,106 ---- <br><br> ! <HR> ! <H3><a NAME="bic" HREF="#contents">-backwards incompatible changes</a></H3> ! <blockquote> ! Seems like I was so busy wrapping win32 apis that I forgot how to write PYTHON code. Some methods or functions are using the following synthax: ! <br> ! def (arg=None, *args): ! <br> ! Does not make to much sense like this. Corrected the affected methods and ! functions so they should behave now as expected. ! <br><br> ! ! The following methods or functions are affected by the changes: ! <br> ! ! <DL> ! <DT>gdi.Font.TextOutEx ! <DD>was: TextOutEx(dc, text, x, y, rect=None, spacing=None, *flags)<br> ! corrected: TextOutEx(dc, text, x, y, *flags, **kwargs) ! <br><br> ! ! <DT>controls.toolbar.Toolbar.Button ! <DD>was: Button(ID, title, iImage=0, lp=0, *state)<br> ! corrected: Button(ID, title, *state, **kwargs) ! <br><br> ! ! <DT>controls.toolbar.Toolbar.InsertButton ! <DD>was: InsertButton(i, ID, title, iImage=0, lp=0, *state)<br> ! corrected: InsertButton(i, ID, title, *state, **kwargs) ! <br><br> ! ! <DT>controls.menu.Menu.Separator ! <DD>was: Separator(ID=0, *flags)<br> ! corrected Separator(ID, *flags) ! <br><br> ! ! <DT>api.shell.FileOperation ! <DD> was: FileOperation(fileaction, From, To, title='', hwnd=0, *flags)<br> ! corrected: FileOperation(fileaction, From, To, *flags, **kwargs)<br> ! Same goes for: ! <P> ! MoveFiles<br> ! CopyFiles<br> ! RenameFiles<br> ! DeleteFiles ! </P> ! <br> ! ! <DT>api.privleges.EnablePrivleges ! <DD>was: EnablePrivleges(hProcess=None, *privleges)<br> ! corrected: EnablePrivleges(*privleges, **kwargs)<br> ! Same goes for: ! <P> ! DisablePrivleges ! </p> ! <br> ! ! ! <DT> dlgs.choosefont.ChooseFont ! <DD>the 'hook' flag should be set in the <b>Run</B> method not on <b>__init__</b> and the <b>Run</b> method is called now like this: ! Run(hwnd, *flags, **kwargs) ! <br> ! With this change all common dialogs provide unifiorm call synthax ! <br> ! ! </DL> ! ! If you use one of the affected methods or functions, you have to manualy ! adjust your code. ! </blockquote> *************** *** 37,157 **** <H3><a NAME="samples" HREF="#contents">-sample guis</a></H3> ! <OL> ! <br> ! <OL><b>gui_dobjview</b> ! <br> ! <LI>new sample gui to view the contents of a DataObject ! either from clipboard or by draging data upon <br> ! See <code class=import>wnd.sample guis.gui_dobjview.py</code> ! </OL> ! <br> ! <OL><b>explorer</b> ! <br> ! <LI>new sample gui to demonstrate shell and dragdrop capabilities of the framework <br> ! See <code class=import>wnd.sample guis.explorer/expl.py</code> ! </OL> ! <br> ! <OL><b>gui_shellnotify</b> ! <br> ! <LI>updated the gui to handle the new ShellChangeNotification class ! <br> ! See <code class=import>wnd.sample guis.explorer/expl.py</code> </OL> - </OL> <HR> ! <H3><a NAME="controls" HREF="#contents">-controls- bugs fixed and other changes</a></H3> <OL> ! <br> ! <OL><b>DriveCombo</b> ! <br> ! <LI>new control <b>DriveCombo</b> to view drives <br> ! See <code class=import>wnd.custom.dirlist</code> ! </OL> ! <br> ! <OL><b>DirList</b> ! <br> ! <LI> new control <b>DirList</b> to handle lists of files and folders <br> ! See <code class=import>wnd.custom.dirlist</code> ! </OL> ! <br> ! <OL><b>Combobox</b> ! <br> ! <LI> fixed bug in <b>GetEditControl</b>. The combobox was not fully functional ! when the editcontrol was subclassed. This is fixed now. Same goes for Treeview ! and Listview <br> ! See <code class=import>wnd.controls.treeview</code> ! </OL> ! ! <br> ! <OL><b>Treeview</b> ! <br> ! <LI> new method <b>EndEditLabel</b> to end label editing ! <br> ! See <code class=import>wnd.controls.treeview</code> ! </OL> ! <br> ! <OL><b>Listview</b> ! <br> ! <LI> new method <b>SetOverlayImage</b> + <b>GetOverlayImage</b> to set or retrieve the overlay image of an item <br> ! See <code class=import>wnd.controls.listview</code> ! </OL> ! <br> ! <OL><b>menu</b> ! <br> ! <LI> new method <b>>Clear</b> to remove all items from a menu ! ! <LI> fixed bug in <b>>GetPopup</b>. Should work now as expected ! ! ! <br> ! See <code class=import>wnd.controls.listview</code> ! </OL> ! <br> ! <OL><b>imagelist</b> ! <br> ! <LI> <b>SetbkColor</b> is now implemeted for SystemImagelist <br> See <code class=import>wnd.controls.listview</code> </OL> ! <br> ! <OL><b>splitter</b> ! <br> ! <LI> Splitter controls support a new flag: 'feedbackbar'. <br> Draws a feeedbackbar instead of moving the splitter dynmically along with the mouse. ! ! <br> ! See <code class=import>wnd.coustom.splitter</code> ! </OL> ! ! </OL> ! --- 108,440 ---- <H3><a NAME="samples" HREF="#contents">-sample guis</a></H3> ! ! <blockquote> ! <DL> ! <DT>gui_propertysheet ! <DD>new sample gui to demonstrate the use of propertysheet and wizard <br> ! See <code class=import>wnd.sample guis.gui_propertysheet.py</code> ! <DT>gui_mdiframe ! <DD>new sample gui to demonstrate the use of mdi frames <br> ! See <code class=import>wnd.sample guis.gui_mdiframe.py</code> ! ! </DL> ! </blockquote> ! ! <HR> ! <H3><a NAME="controls" HREF="#contents">-controls- bugs fixed and other changes</a></H3> ! ! <blockquote> ! <DL> ! <DT>MDIFrame ! <DD>new control <b>MDIFrame</b><br> ! See <code class=import>wnd.controls.mdiframe</code> ! <br><br> ! <DT>PropertySheet ! <DD>new control <b>PropertySheet</b>. Handles property sheets and ! wizards<br> ! See <code class=import>wnd.controls.propertysheet</code> ! <br><br> ! ! <DT>Rebar ! <DD>new control <b>Rebar</b><br> ! See <code class=import>wnd.controls.rebar</code> ! <br><br> ! ! <DT>Trackbar ! <DD>new control <b>Trackbar</b><br> ! See <code class=import>wnd.controls.trackbar</code> ! <br><br> ! ! <DT>Datepicker ! <DD>new control <b>Datepicker</b><br> ! See <code class=import>wnd.controls.datepicker</code> ! <br><br> ! ! <DT>Monthcal ! <DD>new control <b>Monthcal</b><br> ! See <code class=import>wnd.controls.monthcal</code> ! <br><br> ! ! <DT>Textin ! <DD><UL> ! <LI><b>__len__</b> method was not working. This is fixed now ! </UL> ! See <code class=import>wnd.controls.textin</code> ! <br><br> ! ! <DT>Tab ! <DD><UL> ! <LI>implemented new method <b>FindLparam</b> ! <LI>'flatseparators' style did not work. Fixed now. ! </UL> ! See <code class=import>wnd.controls.tab</code> ! <br><br> ! ! <DT>Editbox ! <DD>fixed a bug in Editbox. Editboxes 'wantreturn' style did not insert ! a new line when enter was hit. This is fixed now.<br> ! See <code class=import>wnd.controls.editbox</code> ! <br><br> ! ! <DT>dialog boxes ! <DD>fixed a bug for 'modeless' dialog boxes. Button message 'command' ! was not processed for the first button. This is fixed now<br> ! See <code class=import>wnd.controls.dialog</code> ! <br><br> ! 'dialoglike' keyboard works now for modeless dialogs ! <br><br> ! new method <b>GetDlgItem</b> for dialogs (was not documented) ! <br><br> ! new method <b>GetMainWindow</b> ! <br><br> ! ! ! ! <DT>misc enhancements ! <DD>mainwindows have a new method: <b>ForceSingleInstance</b> to disallow ! running of more then one instance of a GUI at a time ! <br><br> ! all controls and windows and dialogs support the following new methods: ! <OL> ! <LI><b>SetGUID</b> ! <LI><b>GetGUID</b> ! <LI><b>ThreadWindows</b> ! </OL> + </DL> + </blockquote> + <HR> + <H3><a NAME="dlgs" HREF="#contents">-dialogs- bugs fixed and other changes</a></H3> + + <blockquote> + + <OL> + <DL> + <DT>new common dialogs + <DD>implemented a few new common dialogs and templates: + <OL> + <LI>OpenSaveFile (OpenFile and SaveFile) + <LI>FindText + <LI>ReplaceText + <LI>ChooseColor + <LI>BrowseForFolder + <br><br> + </OL> + + See <code class=import>wnd.dlgs</code> + </DL> + </blockquote> <HR> ! <H3><a NAME="custom" HREF="#contents">-custom controls- bugs fixed and other changes</a></H3> + <blockquote> + <OL> + <DL> + <DT>DirList + <DD>new methods <b>SortBy / GetSortBy</b> to sort the view and retrieve + sorting flags <br> + See <code class=import>wnd.custom.dirlist</code> + </DL> + </blockquote> + + + <HR> + <H3><a NAME="api" HREF="#contents">-api- bugs fixed and other changes</a></H3> ! <blockquote> ! ! <DL> ! <DT>CopyData ! <DD>new class <b>CopyData</b> to handle interprocess data exchange ! via WM_COPYDATA</b> <br> ! See <code class=import>wnd.api.copydata</code> ! </DL> ! </blockquote> ! ! ! <HR> ! <H3><a NAME="gdi" HREF="#contents">-gdi- bugs fixed and other changes</a></H3> ! <blockquote> ! ! <DL> ! <DT>BitmapFromBytes ! <DD>bitmaps got a new class <b>BitmapFromBytes</b> <br> ! See <code class=import>wnd.gdi</code> ! </DL> ! </blockquote> ! ! ! <HR> ! <H3><a NAME="tools" HREF="#contents">-tools- bugs fixed and other changes</a></H3> + <blockquote> + + <DL> + <DT>dlgeditor + <DD>bitmaps got a new class <b>BitmapFromBytes</b> + font parameter was not mentioned in the documentation + <br> + was:<br> + BeginTemplate(classname, ID, title, x, y, w, h, *styles)<br> + corrected:<br> + BeginTemplate(classname, ID, title, x, y, w, h, font, *styles) + <br><br> + ex-styles did not work; fixed now + ! ! <br><br> ! For both, DlgEditor and DlgTemplate font can be None (was not mentioned in the docs) ! <br> ! See <code class=import>wnd.tools.dlgeditor</code> ! ! ! <DT>tools ! <DD>new function ClipGUID, to create a new GUID and set it to the clipboard ! ! </DL> ! </blockquote> ! ! <br><br><br><br><br><br><br> ! ! ! ! ! ::folder:: version history ! ! ::item:: release 0.1.12 + + <H3><a NAME="contents">release date 01.07.05</a></H3> + + <br><br> + + <UL> + <LI><a HREF="#samples">changes sample guis</a> + <LI><a HREF="#controls">changes controls</a> + <LI><a HREF="#api">changes api</a> + <LI><a HREF="#gdi">changes gdi</a> + <LI><a HREF="#misc">miscelaneous changes</a> + </UL> + + <strong>NOTE:</strong> + Everything in the framework is still highly experimental. + Guess up to version 0.2 everything in the framework may change + without warning. I see no way in this state of developement to care about + backwards compatibility. Sorry for this. + <br><br> + + With the recent changes in shell and ole, drag and drop features are now implemented in + the framework. + <br><br> + + + <HR> + <H3><a NAME="samples" HREF="#contents">-sample guis</a></H3> + + <blockquote> ! <DL> ! <DT>gui_dobjview ! <DD>new sample gui to view the contents of a DataObject ! either from clipboard or by draging data upon <br> ! See <code class=import>wnd.sample guis.gui_dobjview.py</code> ! <br><br> + <DT>explorer + <DD>new sample gui to demonstrate shell and dragdrop capabilities of the framework + <br> + See <code class=import>wnd.sample guis.explorer/expl.py</code> + <br><br> ! <DT>gui_shellnotify ! <DD>updated the gui to handle the new ShellChangeNotification class <br> ! See <code class=import>wnd.sample guis.gui_shellnotify.py</code> ! <br><br> ! ! </DL> ! </blockquote> ! ! ! <HR> ! <H3><a NAME="controls" HREF="#contents">-controls- bugs fixed and other changes</a></H3> ! <blockquote> ! ! <DL> ! <DT>DriveCombo ! <DD>new control <b>DriveCombo</b> to view drives ! <br> ! See <code class=import>wnd.custom.drivecombo</code> ! <br><br> ! ! <DT>DirList ! <DD>new control <b>DirList</b> to handle lists of files and folders ! <br> ! See <code class=import>wnd.custom.dirlist</code> ! <br><br> + <DT>Combobox + <DD>fixed bug in <b>GetEditControl</b>. The combobox was not fully functional + when the editcontrol was subclassed. This is fixed now. Same goes for: + <br>Treeview<br> + and Listview + <br> + See <code class=import>wnd.controls.combobox</code> + <br><br> + + <DT>Treeview + <DD>new method <b>EndEditLabel</b> to end label editing + <br> + See <code class=import>wnd.controls.treeview</code> + <br><br> ! <DT>Listview ! <DD>new method <b>SetOverlayImage</b> + <b>GetOverlayImage</b> to set or ! retrieve the overlay image of an item <br> See <code class=import>wnd.controls.listview</code> + <br><br> + + <DT>Menu + <DD> + <OL> + <LI>new method <b>>Clear</b> to remove all items from a menu<br> + <LI>fixed bug in <b>>GetPopup</b>. Should work now as expected </OL> + See <code class=import>wnd.controls.menu</code> + <br><br> ! <DT>Imagelist ! <DD>SetbkColor</b> is now implemeted for SystemImagelist ! <br> ! See <code class=import>wnd.controls.imagelist</code> ! <br><br> ! ! <DT>Splitter ! <DD>Splitter controls support a new flag: 'feedbackbar'. <br> Draws a feeedbackbar instead of moving the splitter dynmically along with the mouse. ! <br> ! See <code class=import>wnd.controls.splitter</code> ! <br><br> ! </DL> ! </blockquote> *************** *** 159,351 **** <H3><a NAME="api" HREF="#contents"> -api- bugs fixed and other changes</a></H3> ! ! <OL> ! <OL><b>clipboard</b> ! <br> ! <LI>new module <b>clipboard</b> to provide clipboard support. ! <br>This module introduces a package 'clipformats' to provide wrapper classes ! for clipboard formats ! ! <br> ! See <code class=import>wnd.api</code> ! </OL> ! ! ! <OL><b>ole</b> ! <br> ! <LI>new module <b>ole</b>. <br> highlights here are the <b>dataobject</b> module and the <b>dragdrop</b> module ! ! <br> See <code class=import>wnd.api.ole</code> ! </OL> ! ! ! <OL><b>shell</b> ! <br> ! ! <LI>- new class <b>ShellContextMenu</b>. This class handles the messy details of invoking a context menu for a shell namespace item - <LI>new method <b>GetSpecialFolderPath</b> ! ! <LI>implemented ms-anti-trust <b>pIdl methods</b> ! <br> ! <blockquote> ! <b> ! PidlRemoveLast<br> ! PidlFromPath<br> ! PidlGetNext<br> ! PidlGetChild<br> ! PidlGetLast<br> ! PidlCopyFirst<br> ! PidlAppend<br> ! PidlIsEqual<br> ! PidlIsParent<br> ! ILIsZero<br> ! </b> </blockquote> - <br> - - <LI> new method <b>GetIShellFolder</b>, - returns the pointer to the IShelFolder given an absolute pIdl <LI>fixed a bug in <b>GetPathFromPidl</b>, should return the right thing now ! ! <LI><b>FileOperation</b> and friends where not working as expected, should be fixed now ! ! ! <LI><b>GetContextMenu</b> now accepts an array of pIdls to query the context menu for ! ! <LI>new method <b>GetDataObject</b> to retrieve the DataObject for one or more items in a folder ! <LI><b>GetAttributes</b> lost its nItems parameter and takes ! an array of pIdls now aswell as a single pIdl as argument. Same goes for all other attribute requesting ! methods. ! ! ! <br> ! See <code class=import>wnd.api.shell</code> </OL> ! ! ! ! <OL><b>ShellNamespace</b> ! <br> ! <LI>new method <b>GetDataObject</b> to retrieve the DataObject for one or more items in a folder - <LI>new method <b>GetDropTarget</b> to retrieve the DropTarget inertface of a shell item - - <LI><b>GetAttributes</b> lost its nItems parameter and takes an array of pIdls now aswell as a single pIdl as argument. Same goes for all other attribute requesting methods. - - <LI>Reworked <b>GetContextMenu</b>. Changes are not ! backwards compatible !! Returns now tuple(IContextMenu, ! version) or None if something goes wrong + Version parameter ! is now supported + an array of pIdls is accepted to query the ! common contextmenu for multiple items. ! <LI>fixed a memory leak in <b>SetCwd</b> - - <br> - See <code class=import>wnd.api.shell</code> - - </OL> - - - <br><br> ! <OL><b>ShellNew</b> ! <br> ! ! <LI>new class <b>ShellNew</b>. This class mimics Explorers 'ShellNew' menu - <br> See <code class=import>wnd.api.shell.shellnew</code> ! </OL> ! ! ! <OL><b>ShellChangeNotification</b> ! <br> ! ! <LI>new class <b>ShellChangeNotification</b>. This class is an alternative to ! the <b>ShellNotify<br> class. ! <br> See <code class=import>wnd.api.shell</code> ! </OL> ! ! ! </OL> ! ! ! ! <br><br> <HR> <H3><a NAME="gdi" HREF="#contents"> -gdi- bugs fixed and other changes</a></H3> ! ! ! <OL> ! <OL><b>icon</b> ! <br> <LI> new method <b>DrawEx</b> ! ! <LI>- fixed bug in <b>GetSize</b>. Retrieving size for monochrome ! icons failed. Should work now ! ! <br> ! See <code class=import>wnd.api.gdi</code> ! </OL> - </OL> - <HR> <H3><a NAME="misc" HREF="#contents"> -miscelaneous- bugs fixed and other changes</a></H3> ! ! <OL> ! <OL><b>RECT</b> ! <br> ! ! <LI>Changed the the <b>Subtract</b> method slightly. <br>previous versions raised an error if the the two rects did not intersect completely. This case is ignored now and the rect is left unchanged ! ! <br> See <code class=import>wnd.wintypes</code> ! </OL> ! ! </OL> ! ! ! <br><br><br><br><br><br><br> ! ! ! ! ! ! ::folder:: version history ! ::item:: what was new in 0.1.11 ! <H3><a NAME="contents">changes in wnd 0.1.11</a></H3> ! release 0.1.1 18.05.05 <br><br> --- 442,592 ---- <H3><a NAME="api" HREF="#contents"> -api- bugs fixed and other changes</a></H3> ! </blockquote> ! ! <DL> ! <DT>Clipboard ! <DD>new module <b>clipboard</b> to provide clipboard support. ! <br>This module introduces a package 'clipformats' to provide wrapper ! classes for clipboard formats ! <br> ! See <code class=import>wnd.api.clipboard</code> ! <br><br> ! ! <DT>ole ! <DD>new module <b>ole</b>. <br> highlights here are the <b>dataobject</b> module and the <b>dragdrop</b> module ! <br> See <code class=import>wnd.api.ole</code> ! <br><br> ! ! <DT>shell ! <DD> ! <OL> ! <LI>new class <b>ShellContextMenu</b>. This class handles the messy details of invoking a context menu for a shell namespace item <LI>new method <b>GetSpecialFolderPath</b> ! <LI>implemented ms-anti-trust pIdl methods<br> ! <blockquote> ! <b> ! PidlRemoveLast<br> ! PidlFromPath<br> ! PidlGetNext<br> ! PidlGetChild<br> ! PidlGetLast<br> ! PidlCopyFirst<br> ! PidlAppend<br> ! PidlIsEqual<br> ! PidlIsParent<br> ! ILIsZero<br> ! </b> </blockquote> + <LI>new method <b>GetIShellFolder</b>, + returns the pointer to the IShelFolder given an absolute pIdl <LI>fixed a bug in <b>GetPathFromPidl</b>, should return the right thing now ! <LI>FileOperation</b> and friends where not working as expected, should be fixed now ! <LI><b>GetContextMenu</b> now accepts an array of pIdls to query the ! context menu for ! <LI>new method <b>GetDataObject</b> to retrieve the DataObject for ! one or more items in a folder <LI><b>GetAttributes</b> lost its nItems parameter and takes ! an array of pIdls now aswell as a single pIdl as argument. Same goes ! for all other attribute requesting methods. </OL> + See <code class=import>wnd.api.shell</code> + <br><br> ! <DT>ShellNamespace ! <DD> ! <OL> <LI>new method <b>GetDataObject</b> to retrieve the DataObject for one or more items in a folder <LI>new method <b>GetDropTarget</b> to retrieve the DropTarget inertface of a shell item <LI><b>GetAttributes</b> lost its nItems parameter and takes an array of pIdls now aswell as a single pIdl as argument. Same goes for all other attribute requesting methods. <LI>Reworked <b>GetContextMenu</b>. Changes are not ! backwards compatible !! Returns now tuple(IContextMenu, ! version) or None if something goes wrong + Version parameter ! is now supported + an array of pIdls is accepted to query the ! common contextmenu for multiple items. <LI>fixed a memory leak in <b>SetCwd</b> + </OL> + See <code class=import>wnd.api.shell</code> + </OL> + <br><br> ! ! <DT>ShellNew ! <DD>new class <b>ShellNew</b>. This class mimics Explorers 'ShellNew' menu <br> See <code class=import>wnd.api.shell.shellnew</code> ! <br><br> ! ! <DT>ShellChangeNotification ! <DD>new class <b>ShellChangeNotification</b>. This class is an alternative to ! the <b>ShellNotify</b> class. <br> See <code class=import>wnd.api.shell</code> ! <br><br> ! ! <DT>ShellLink ! <DD>new module <b>shelllink</b> to handle shortcuts ! <br> ! See <code class=import>wnd.api.shell.shelllink</code> ! <br><br> ! ! </DL> ! </blockquote> <HR> <H3><a NAME="gdi" HREF="#contents"> -gdi- bugs fixed and other changes</a></H3> ! <blockquote> ! <DL> ! <DT>Icon ! <DD> ! <OL> <LI> new method <b>DrawEx</b> ! <LI> fixed bug in <b>GetSize</b>. Retrieving size for monochrome ! icons failed. Should work now ! ! <br> ! See <code class=import>wnd.gdi</code> ! <br><br> ! </DL> ! </blockquote> <HR> <H3><a NAME="misc" HREF="#contents"> -miscelaneous- bugs fixed and other changes</a></H3> ! <blockquote> ! <DL> ! <DT>RECT ! <DD>Changed the the <b>Subtract</b> method slightly. <br>previous versions raised an error if the the two rects did not intersect completely. This case is ignored now and the rect is left unchanged ! ! <br> See <code class=import>wnd.wintypes</code> ! <br><br> ! </DL> ! </blockquote> + <br><br><br><br><br><br><br> ! ! ::item:: release 0.1.11 ! <H3><a NAME="contents">release date 18.05.05</a></H3> ! <br><br> *************** *** 430,438 **** ! ::item:: what was new in 0.1.1 ! <H3><a NAME="contents">changes in wnd 0.1.1</a></H3> - release 0.1.1 17.05.05 <br><br> --- 671,678 ---- ! ::item:: release 0.1.1 ! <H3><a NAME="contents">release date 17.05.05</a></H3> <br><br> *************** *** 678,681 **** ! ::item:: what was new in release 0.1 initial release 29.04.05 --- 918,921 ---- ! ::item:: release 0.1 initial release 29.04.05 |
From: jürgen u. <cer...@us...> - 2005-07-23 19:39:14
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv697 Modified Files: wnd.dtpl Log Message: bit of this and a bit of that Index: wnd.dtpl =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doc/wnd.dtpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wnd.dtpl 2 Jul 2005 09:22:40 -0000 1.4 --- wnd.dtpl 23 Jul 2005 19:39:04 -0000 1.5 *************** *** 140,159 **** needed to setup a GUI from scratch <H3><a HREF="gdi/contents.html">gdi</a></H3> Here you will all the drawing related stuff - <H3><a HREF="api/contents.html">api</a></H3> - General api related modules have found their place here, like. - - - <H3><a HREF="tools/contents.html">tools</a></H3> - This modules provides tools required to make live in the win32 world easier, - like modules hosting dialog and a menu editors - <H3><a HREF="gdip/contents.html">gdip</a></H3> ! This is the very beginning of a gdi plus wrapper. Its currently not usable (see remarks in the module), but i thought I include it in case someone is interested. <br><br> --- 140,157 ---- needed to setup a GUI from scratch + <H3><a HREF="api/contents.html">api</a></H3> + General api related modules have found their place here, like modules for clipboard + support, process handling and so on. <H3><a HREF="gdi/contents.html">gdi</a></H3> Here you will all the drawing related stuff <H3><a HREF="gdip/contents.html">gdip</a></H3> ! This is the very, very beginning of a gdi plus wrapper. Its currently not usable (see remarks in the module), but i thought I include it in case someone is interested. + <H3><a HREF="tools/contents.html">tools</a></H3> + This modules provides tools intended to make live in the win32 coding wilderness + easier, like modules hosting dialog and a menu editors <br><br> *************** *** 206,209 **** --- 204,222 ---- <HR> + <strong>How can I help to improve the module ?</strong> + <br><br> + To kind. Well, you can post patches or comments + to the mailinglist that you will find at the project page + at <a HREF="http://sourceforge.net/projects/wnd/">sourceforge net</a>. + Also co-coders are highly welcome, helping to get this module on to a higher level. + There is also the one or the other language module in the framework wich could + be extended by someone dedicated, capable of translating strange phrases like + 'get data here' into exotic tounges. Finally, you might notice when reading through + the documentation that english is not the mother tounge of the developer. + High time for a comb over. Anyway. Phil Free, I refuse everything. + + + + <HR> Last but not least I want to thank the following sites: <blockquote> *************** *** 227,231 **** <br><br> ! And of course, Thomas Heller for writing his amazing <a HREF="http://starship.python.net/crew/theller/ctypes/">ctypes</a> module. </blockquote> --- 240,244 ---- <br><br> ! And of course, Thomas Heller for writing his awesome <a HREF="http://starship.python.net/crew/theller/ctypes/">ctypes</a> module. </blockquote> *************** *** 389,393 **** </P> ! # ::item:: # <code></code><br> --- 402,407 ---- </P> ! ! # ::item:: # <code></code><br> |
From: jürgen u. <cer...@us...> - 2005-07-23 19:38:01
|
Update of /cvsroot/wnd/wnd/wnd_doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv557 Modified Files: doctoolsetup.py Log Message: bit of this and a bit of that Index: doctoolsetup.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd_doc/doctoolsetup.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** doctoolsetup.py 29 Apr 2005 15:15:05 -0000 1.1.1.1 --- doctoolsetup.py 23 Jul 2005 19:37:53 -0000 1.2 *************** *** 21,25 **** METHOD_NAMES=os_join(DOC_PATH, 'ctrl-methods.txt') - #************************************************************** #************************************************************** --- 21,24 ---- |
From: jürgen u. <cer...@us...> - 2005-07-23 19:37:35
|
Update of /cvsroot/wnd/wnd/wnd/unittests/controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv476 Added Files: test_rebar.py Log Message: bit of this and a bit of that --- NEW FILE: test_rebar.py --- """ TODO Not complete """ import wnd from wnd.controls.rebar import Rebar, RebarFromHandle from wnd.controls.button import Button from wnd.controls.imagelist import Imagelist from wnd import gdi import unittest, imp, os #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: PARENT= None PATH= os.path.split(__file__)[0] DIRUP= os.path.split(PATH)[0] PATH_STANDALONE= os.path.join(DIRUP, 'teststandalone.py') PATH_HELPERS= os.path.join(DIRUP, 'testhelpers.py') helpers= imp.load_source('helpers',PATH_HELPERS) #***************************************************************** # default tests #***************************************************************** class Tests(helpers.Helpers): def __init__(self): helpers.Helpers.__init__(self) def XXXtestMoveBand(self): ## IDToIndex fails after MoveBand self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.ctrl.Band(101, 'bar', self.child2, 0, 100) self.failUnless(len(self.ctrl)==2) self.ctrl.MoveBand(1, 0) ##self.ctrl.MoveBand(0, 1) print self.ctrl.IDToIndex(101) self.ctrl.RemoveBand(100) self.ctrl.RemoveBand(101) self.failUnless(len(self.ctrl)==0) def testBand(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.ctrl.Band(101, 'bar', self.child2, 0, 100) self.failUnless(len(self.ctrl)==2) self.ctrl.RemoveBand(100) self.ctrl.RemoveBand(101) self.failUnless(len(self.ctrl)==0) def testIDToIndex(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.failUnless(self.ctrl.IDToIndex(100)==0) self.failUnless(self.ctrl.IndexToID(0)==100) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandText(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.failUnless(self.ctrl.GetBandTitle(100)=='foo') self.ctrl.SetBandTitle(100, 'bar') self.failUnless(self.ctrl.GetBandTitle(100)=='bar') self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandColors(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) clrFg, clrBk= self.ctrl.GetBandColors(100) self.ctrl.SetBandColors(100, clrBk, clrFg) self.failUnless(self.ctrl.GetBandColors(100)==(clrBk, clrFg)) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandBitmap(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) bm= gdi.SystemBitmap('size') self.ctrl.SetBandBackgroundImage(100, bm) self.failUnless(self.ctrl.GetBandBackgroundImage(100)==bm.handle) bm.Close() self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testImagelist(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) imgl= Imagelist(10, 10, 1, 0) self.ctrl.SetImagelist(imgl) self.failUnless(self.ctrl.GetImagelist()==imgl.handle) self.ctrl.SetBandImage(100, 4) self.failUnless(self.ctrl.GetBandImage(100)==4) self.ctrl.SetImagelist(None) self.failUnless(self.ctrl.GetImagelist()==None) imgl.Close() self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandControlSize(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandControlSize(100, 20, 200) self.failUnless(self.ctrl.GetBandControlSize(100)==(20, 200)) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandMaximizedWidth(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandMaximizedWidth(100, 500) self.failUnless(self.ctrl.GetBandMaximizedWidth(100)==500) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandWidth(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandWidth(100, 500) self.failUnless(self.ctrl.GetBandWidth(100)==500) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandHeaderSize(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandHeaderSize(100, 500) self.failUnless(self.ctrl.GetBandHeaderSize(100)==500) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandChild(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandHeaderSize(100, 500) self.failUnless(self.ctrl.GetBandChild(100)==self.child1.Hwnd) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) def testBandLparam(self): self.failUnless(len(self.ctrl)==0) self.ctrl.Band(100, 'foo', self.child1, 0, 100) self.failUnless(len(self.ctrl)==1) self.ctrl.SetBandLparam(100, 500) self.failUnless(self.ctrl.GetBandLparam(100)==500) self.ctrl.RemoveBand(100) self.failUnless(len(self.ctrl)==0) #***************************************************************** # test classes #***************************************************************** ## class TestRebar(unittest.TestCase, Tests): def setUp(self): self.ctrl= Rebar(PARENT) self.child1= Button(PARENT, '', 0, 0, 100, 100) self.child2= Button(PARENT, '', 0, 0, 100, 100) Tests.__init__(self) def tearDown(self): self.ctrl.Close() self.child1.Close() self.child2.Close() ## class TestRebarFromHandle(unittest.TestCase, Tests): def setUp(self): self.ctrl0= Rebar(PARENT) self.ctrl= RebarFromHandle(self.ctrl0.Hwnd) self.child1= Button(PARENT, '', 0, 0, 100, 100) self.child2= Button(PARENT, '', 0, 0, 100, 100) Tests.__init__(self) def tearDown(self): self.ctrl0.Close() self.ctrl.Close() self.child1.Close() self.child2.Close() #**************************************************************** #*************************************************************** def suite(): return (unittest.makeSuite(TestRebar), unittest.makeSuite(TestRebarFromHandle), ) if __name__=='__main__': mod= imp.load_source('foo', PATH_STANDALONE) PARENT= mod.Main() PARENT.RunTest(suite) helpers.RemovePyc(PATH) |
From: jürgen u. <cer...@us...> - 2005-07-23 19:36:41
|
Update of /cvsroot/wnd/wnd/wnd/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32749 Modified Files: gui-runtests.py testhelpers.py Log Message: bit of this and a bit of that Index: gui-runtests.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/unittests/gui-runtests.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gui-runtests.py 29 Apr 2005 15:25:29 -0000 1.1.1.1 --- gui-runtests.py 23 Jul 2005 19:36:33 -0000 1.2 *************** *** 1,3 **** --- 1,29 ---- + """Runs unittests from a GUI. + + The gui will search all subfolders for modules starting with 'test_'. + All files matching this pattern will be listed (dynamically) in the + GUIs menu. + + Each module should define a suites function, returning the runable test suites + + Each modue shoulddefine a variable PARENT, to allow the GUI to + assign itsself to. Right before running the suite the GUI will assign + itsself to this variable to allow the tests to use the GUI as parent + window. + + Each test case may include the Helpers class from the testhelpers + module within its base classes. The helpers class includes + a message handler ('onMSG'), collecting all messages send in a + cache. The methods 'GetMsg' and 'PeekMsg' can be used to + find out if a certain message was send. 'ClearMsgCache' will clear + the cache. + + + + + + """ + import os, array, imp, unittest *************** *** 145,154 **** --- 171,184 ---- def RunUnitTest(self, name, path): self.LVClear() + mod= imp.load_source(name, path) if hasattr(mod, 'suite'): + self.write('testing: %s\n' % name[5:]) + mod.PARENT= self suite=unittest.TestSuite(mod.suite()) unittest.TextTestRunner(stream=self, verbosity=VERBOSITY).run(suite) + self.write('*' *64 + '\n' ) mod.PARENT= None *************** *** 163,166 **** --- 193,198 ---- name, ext= os.path.splitext(x) if ext.lower()=='.py': + self.write('testing: %s\n' % name[5:]) + path=os.path.join(root, x) mod= imp.load_source(name, path) *************** *** 170,173 **** --- 202,207 ---- unittest.TextTestRunner(stream=self, verbosity=VERBOSITY).run(suite) + + self.write('*' *64 + '\n' + '*' *64 + '\n') mod.PARENT= None Index: testhelpers.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/unittests/testhelpers.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testhelpers.py 15 May 2005 09:54:25 -0000 1.1 --- testhelpers.py 23 Jul 2005 19:36:33 -0000 1.2 *************** *** 20,24 **** # def GetMsg(self, msg): ! """Retrieves a message in the cache and returns it. Returns the message if found, False otherwise""" flag= False --- 20,24 ---- # def GetMsg(self, msg): ! """Retrieves a message from the cache and returns it. Returns the message if found, False otherwise""" flag= False *************** *** 34,38 **** def PeekMsg(self, msg): ! """peeks a message in the cache an dremoves it if found. Return True if the message was found, False otherwise""" flag= False --- 34,38 ---- def PeekMsg(self, msg): ! """peeks a message from the cache an removes it if found. Return True if the message was found, False otherwise""" flag= False *************** *** 97,100 **** --- 97,101 ---- def RemovePyc(path): + ## removes all 'pyc' files in dir and sub root, dirs, files = os.walk(path).next() for i in files: |
From: jürgen u. <cer...@us...> - 2005-07-23 19:36:11
|
Update of /cvsroot/wnd/wnd/wnd/tools/doctool/chmcompile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32652 Modified Files: contents.py Log Message: bit of this and a bit of that Index: contents.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/tools/doctool/chmcompile/contents.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** contents.py 29 Apr 2005 15:25:24 -0000 1.1.1.1 --- contents.py 23 Jul 2005 19:36:03 -0000 1.2 *************** *** 148,152 **** ! # finalize this thinggy for i in range(level +1): level -= 1 --- 148,152 ---- ! # finalize this thingy for i in range(level +1): level -= 1 |
From: jürgen u. <cer...@us...> - 2005-07-23 19:34:55
|
Update of /cvsroot/wnd/wnd/wnd/tools/dlgeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32308 Modified Files: dlgeditor.py dlgtemplate.py res_dlg.py Log Message: bit of this and a bit of that Index: res_dlg.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/tools/dlgeditor/res_dlg.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** res_dlg.py 29 Apr 2005 15:25:06 -0000 1.1.1.1 --- res_dlg.py 23 Jul 2005 19:34:46 -0000 1.2 *************** *** 1 **** ! DLG_RES= '\x01\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x08\x10\x02\x00\x00\x00\n\x00P\x00U\x00\x00\x00\x00\x00t\x00e\x00s\x00t\x00 \x00d\x00i\x00a\x00l\x00o\x00g\x00\x00\x00\x0c\x00d\x00\x01\x00a\x00r\x00i\x00a\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x08\x002\x00\x19\x00\x0c\x00\x01\x00\x00\x00b\x00u\x00t\x00t\x00o\x00n\x00\x00\x00O\x00K\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P-\x002\x00\x19\x00\x0c\x00\x02\x00\x00\x00b\x00u\x00t\x00t\x00o\x00n\x00\x00\x00c\x00a\x00n\x00c\x00e\x00l\x00\x00\x00\x00\x00\x00\x00' \ No newline at end of file --- 1 ---- ! DLG_RES= '\x01\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x08\x10\x02\x00\x00\x00\n\x00P\x00U\x00\x00\x00\x00\x00t\x00e\x00s\x00t\x00 \x00d\x00i\x00a\x00l\x00o\x00g\x00s\x00\x00\x00\x0c\x00d\x00\x01\x00a\x00r\x00i\x00a\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x08\x002\x00\x19\x00\x0c\x00\x01\x00\x00\x00b\x00u\x00t\x00t\x00o\x00n\x00\x00\x00O\x00K\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P-\x002\x00\x19\x00\x0c\x00\x02\x00\x00\x00b\x00u\x00t\x00t\x00o\x00n\x00\x00\x00c\x00a\x00n\x00c\x00e\x00l\x00\x00\x00\x00\x00\x00\x00' \ No newline at end of file Index: dlgtemplate.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/tools/dlgeditor/dlgtemplate.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dlgtemplate.py 29 Apr 2005 15:25:04 -0000 1.1.1.1 --- dlgtemplate.py 23 Jul 2005 19:34:46 -0000 1.2 *************** *** 70,74 **** #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! #************************************************** class DlgTemplate(object): --- 70,77 ---- #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! ! #************************************************************************ ! # based on DLGTEMPLATEEX ++ DLGITEMTEMPLATEEX ! #************************************************************************ class DlgTemplate(object): *************** *** 109,113 **** def Item(self, classname, ID, title, style, exstyle, x, y, w, h): ! if not self: raise "nop template started" self._nItems += 1 style |= WS_CHILD --- 112,116 ---- def Item(self, classname, ID, title, style, exstyle, x, y, w, h): ! if not self: raise "no template started" self._nItems += 1 style |= WS_CHILD *************** *** 130,134 **** def RunModal(self, hwnd=0, lp=0): ! if not self: raise "nop template started" self._template = self.ToBuffer() #self._template = self.ToString() --- 133,137 ---- def RunModal(self, hwnd=0, lp=0): ! if not self: raise "no template started" self._template = self.ToBuffer() #self._template = self.ToString() *************** *** 139,143 **** def RunModeless(self, hwnd=0, lp=0): ! if not self: raise "nop template started" self._template = self.ToBuffer() self._pDlgProc = DIALOGPROC(self.DlgProc) --- 142,146 ---- def RunModeless(self, hwnd=0, lp=0): ! if not self: raise "no template started" self._template = self.ToBuffer() self._pDlgProc = DIALOGPROC(self.DlgProc) *************** *** 164,168 **** #************************************************ - #************************************************ --- 167,170 ---- *************** *** 177,181 **** tpl.Item('button', IDOK, 'OK', WS_VISIBLE, 0, 8, 50, 25, 12) tpl.Item('button', IDCANCEL, 'cancel', WS_VISIBLE, 0, 45, 50, 25, 12) ! #print repr(tpl.ToBuffer().raw) print tpl.RunModal() --- 179,183 ---- tpl.Item('button', IDOK, 'OK', WS_VISIBLE, 0, 8, 50, 25, 12) tpl.Item('button', IDCANCEL, 'cancel', WS_VISIBLE, 0, 45, 50, 25, 12) ! print repr(tpl.ToBuffer()) print tpl.RunModal() *************** *** 188,189 **** --- 190,288 ---- #test() + + """ + #******************************************************************************** + # based on DLGTEMPLATE ++ DLGITEMTEMPLATE + #******************************************************************************** + + #class DlgTemplateSimple(DlgTemplate): + + def __init__(self): + DlgTemplate.__init__(self) + + + def BeginTemplate(self, classname, title, style, exstyle, x, y, w, h, font): + + style |= WS_VISIBLE + if font: style |= DS_SETFONT + p= [] + p += DWORD_TOBYTES(style) # style + p += DWORD_TOBYTES(exstyle) # exstyle + p += WORD_TOBYTES(0) # nItems bit 8/19 + p += WORD_TOBYTES(x) # x + p += WORD_TOBYTES(y) # y + p += WORD_TOBYTES(w) # w + p += WORD_TOBYTES(h) # h + p += [0, 0] # menu # not yet + if classname: p += SZ_TOWBYTES(classname) + else: p += [0, 0] + p += SZ_TOWBYTES(title) + if font: + ## does not support weight and italic + p += WORD_TOBYTES(font[1]) # size + p += SZ_TOWBYTES(font[0]) # face name + # align + if len(p) % 4: p += (0, 0) + self._p = p + self._nItems = 0 + + def Item(self, classname, ID, title, style, exstyle, x, y, w, h): + if not self: raise "no template started" + self._nItems += 1 + style |= WS_CHILD + p= [] + p += DWORD_TOBYTES(style) # style + p += DWORD_TOBYTES(exstyle) # extended style + p += WORD_TOBYTES(x) # x + p += WORD_TOBYTES(y) # y + p += WORD_TOBYTES(w) # w + p += WORD_TOBYTES(h) # h + p += WORD_TOBYTES(ID) # ID (WORD in DLGTEMOPLATE) + p += SZ_TOWBYTES(classname) + p += SZ_TOWBYTES(title) + # dword align + if len(p) % 4: p += (0, 0) + else: p += (0, 0, 0, 0) + self._p += p + + + def ToBuffer(self): + if not self: raise "no template started" + self._p[8], self._p[9]= WORD_TOBYTES(self._nItems) + return buffer(''.join(map(chr, self._p)))[:] + + + + def test(): + WS_VISIBLE = 268435456 + WS_SYSMENU = 524288 + WS_SIZEBOX = 262144 + IDOK = 1 + IDCANCEL = 2 + font=('arial', 12, 100) + tpl = DlgTemplateSimple() + tpl.BeginTemplate(None, 'test dialog', WS_SYSMENU|WS_SIZEBOX, 0, 0, 100, 80, 185, font) + tpl.Item('button', IDOK, 'OK', WS_VISIBLE, 0, 8, 50, 25, 12) + tpl.Item('button', IDCANCEL, 'cancel', WS_VISIBLE, 0, 45, 50, 25, 12) + #print repr(tpl.ToBuffer()) + tpl.RunModal() + + import os + fp= open('%s\\test.dlg' % os.path.split(__file__)[0], 'w') + try: + fp.write(repr(tpl.ToBuffer())) + finally: fp.close() + + #test() + + + """ + + #************************************************ + + #************************************************ + + + + + Index: dlgeditor.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/tools/dlgeditor/dlgeditor.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dlgeditor.py 29 Apr 2005 15:25:01 -0000 1.1.1.1 --- dlgeditor.py 23 Jul 2005 19:34:46 -0000 1.2 *************** *** 81,85 **** if name[2] in styles: exstyle |= value ! styles.remove(name) elif len(name)==2: if name[1] in styles: --- 81,85 ---- if name[2] in styles: exstyle |= value ! styles.remove(name[2]) elif len(name)==2: if name[1] in styles: *************** *** 91,95 **** return style, exstyle ! #************************************************** class DlgEditor(DlgTemplate): --- 91,96 ---- return style, exstyle ! #************************************************************************************ ! #************************************************************************************ class DlgEditor(DlgTemplate): *************** *** 113,122 **** # return DlgTemplate.DlgProc(self, hwnd, msg, wp, lp) ! ! ! ! #************************************************ ! ! #************************************************ def test(): --- 114,119 ---- # return DlgTemplate.DlgProc(self, hwnd, msg, wp, lp) ! #***************************************************************************************** ! #***************************************************************************************** def test(): *************** *** 128,132 **** tpl.Item('button', IDOK, 'OK', 8, 50, 25, 12, 'visible') tpl.Item('button', IDCANCEL, 'cancel', 45, 50, 25, 12, 'visible') ! #print repr(tpl.ToBuffer().raw) print tpl.RunModal() import os --- 125,129 ---- tpl.Item('button', IDOK, 'OK', 8, 50, 25, 12, 'visible') tpl.Item('button', IDCANCEL, 'cancel', 45, 50, 25, 12, 'visible') ! #print repr(tpl.ToBuffer()) print tpl.RunModal() import os |
From: jürgen u. <cer...@us...> - 2005-07-23 19:34:03
|
Update of /cvsroot/wnd/wnd/wnd/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32072 Modified Files: __init__.py Log Message: bit of this and a bit of that Index: __init__.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/tools/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 1 May 2005 15:22:31 -0000 1.2 --- __init__.py 23 Jul 2005 19:33:55 -0000 1.3 *************** *** 1 **** --- 1,19 ---- + + """*************************************************************************** + Create a new GUID and sets it as string to the clipboard + ***************************************************************************""" + def ClipGUID(): + from ctypes import oledll, byref + from ctypes.com import GUID + from wnd.api import clipboard + + guid= GUID() + oledll.ole32.CoCreateGuid(byref(guid)) + text= clipboard.cf.text(str(guid)) + do= clipboard.DataObject(text) + clipboard.SetDataObject(do) + clipboard.Flush() + do.Close() + text.value= None + |
From: jürgen u. <cer...@us...> - 2005-07-23 19:33:39
|
Update of /cvsroot/wnd/wnd/wnd/sample-guis/explorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31885 Modified Files: expl.ini expl.py expl_dircombo.py expl_menu.py Log Message: bit of this and a bit of that Index: expl.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/explorer/expl.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expl.py 2 Jul 2005 09:21:30 -0000 1.1 --- expl.py 23 Jul 2005 19:33:31 -0000 1.2 *************** *** 92,96 **** init_dirlist(self.DirList2, 'pane2') ! ## init splitter w= self.GetClientRect().ToSize()[2] --- 92,97 ---- init_dirlist(self.DirList2, 'pane2') ! ! ## init splitter w= self.GetClientRect().ToSize()[2] *************** *** 179,191 **** paneOffsY= 4 stH= self.Statusbar.GetWindowRect().ToSize()[3] - cmbH= self.DirCombo.GetWindowRect().ToSize()[3] - #cmbH= self.DirCombo.GetItemHeight(-1) - rcSpl= self.Splitter.GetWindowRect() rcSpl.ScreenToClient(self.Hwnd) ! ! #self.DirList2.SetRedraw(False) ! self.DeferWindows( (self.DirCombo, None, None, (w/10)*6, cmbH), --- 180,187 ---- paneOffsY= 4 stH= self.Statusbar.GetWindowRect().ToSize()[3] cmbH= self.DirCombo.GetWindowRect().ToSize()[3] rcSpl= self.Splitter.GetWindowRect() rcSpl.ScreenToClient(self.Hwnd) ! self.DeferWindows( (self.DirCombo, None, None, (w/10)*6, cmbH), Index: expl_dircombo.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/explorer/expl_dircombo.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expl_dircombo.py 2 Jul 2005 09:21:30 -0000 1.1 --- expl_dircombo.py 23 Jul 2005 19:33:31 -0000 1.2 *************** *** 32,38 **** self.Item(i) ! self.maxW += self.GetTextExtend('W')[0] Combobox.SetScrollWidth(self, self.maxW) - #self.SetScrollWidth() --- 32,37 ---- self.Item(i) ! self.maxW += self.GetTextExtend('W')[0] ## arbitrary Combobox.SetScrollWidth(self, self.maxW) #self.SetScrollWidth() *************** *** 43,56 **** - def SetScrollWidth(self): - self.maxW= 0 - for i in self: - text= self.GetItemText(i) - self.maxW= max(self.GetTextExtend(text)[0], self.maxW) - self.maxW += self.GetTextExtend('W')[0] - Combobox.SetScrollWidth(self, self.maxW) - - - def onMSG(self, hwnd, msg, wp, lp): --- 42,45 ---- *************** *** 59,63 **** return lp ! if msg=='return': refresh= False --- 48,52 ---- return lp ! elif msg=='return': refresh= False *************** *** 89,93 **** ! --- 78,89 ---- ! ! def SetScrollWidth(self): ! self.maxW= 0 ! for i in self: ! text= self.GetItemText(i) ! self.maxW= max(self.GetTextExtend(text)[0], self.maxW) ! self.maxW += self.GetTextExtend('W')[0] ## arbitrary ! Combobox.SetScrollWidth(self, self.maxW) *************** *** 104,108 **** def SetText(self, path, filespec): ! if path: --- 100,104 ---- def SetText(self, path, filespec): ! # manages MRU items and sets scrollable width if path: Index: expl_menu.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/explorer/expl_menu.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expl_menu.py 2 Jul 2005 09:21:30 -0000 1.1 --- expl_menu.py 23 Jul 2005 19:33:31 -0000 1.2 *************** *** 11,15 **** p= self.Popup('&File', IDM_FILE) ! p.Item('Quit', IDM_FILE_QUIT) p= self.Popup('&Mark', IDM_MARK) --- 11,15 ---- p= self.Popup('&File', IDM_FILE) ! p.Item('Exit', IDM_FILE_QUIT) p= self.Popup('&Mark', IDM_MARK) Index: expl.ini =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/explorer/expl.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expl.ini 2 Jul 2005 09:21:30 -0000 1.1 --- expl.ini 23 Jul 2005 19:33:31 -0000 1.2 *************** *** 1,19 **** [mru_dircombo] ! 1 = D:\z ! 0 = D:\ ! 3 = C:\ ! 2 = D:\z\Neuer Ordner ! 5 = D:\_txt_ ! 4 = D:\_pyCvs ! 7 = C:\WINDOWS\DRWATSON\Desktop\py_tools ! 6 = D:\bookmarks ! 9 = C:\Eigene Dateien\My eBooks ! 8 = C:\Eigene Dateien [pane2] ! dir = D:\z\Neuer Ordner [pane1] ! dir = drives [dircombo] --- 1,19 ---- [mru_dircombo] ! 1 = C:\ ! 0 = C:\Eigene Dateien\Eigene Bilder\papaver ! 3 = C:\Eigene Dateien ! 2 = C:\Eigene Dateien\Eigene Bilder ! 5 = C:\WINDOWS\A4W_DATA ! 4 = C:\WINDOWS ! 7 = D:\z ! 6 = D:\ ! 9 = C:\WINDOWS\AppPatch ! 8 = D:\z\Neuer Ordner [pane2] ! dir = C:\Eigene Dateien\Eigene Bilder\papaver [pane1] ! dir = C:\ [dircombo] *************** *** 21,24 **** [mainwindow] ! size = 96,219,894,617 --- 21,24 ---- [mainwindow] ! size = 220,61,791,741 |
From: jürgen u. <cer...@us...> - 2005-07-23 19:31:33
|
Update of /cvsroot/wnd/wnd/wnd/sample-guis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31457 Modified Files: _HelloWorld.py gui_dobjview.py Added Files: gui_mdiframe.py gui_propertysheet.py Log Message: bit of this and a bit of that Index: gui_dobjview.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/gui_dobjview.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gui_dobjview.py 2 Jul 2005 09:20:38 -0000 1.1 --- gui_dobjview.py 23 Jul 2005 19:31:23 -0000 1.2 *************** *** 2,16 **** """simple DataObject viewer Displays information for either the DataObject currently on th eclipboard ! or for the DataObject dropped. """ import wnd - from wnd.controls.listview import Listview - from wnd.controls.menu import Menu from wnd.api import clipboard, msgbox from wnd.api.ole import dragdrop #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! ## GUI class window(wnd.Window): --- 2,33 ---- """simple DataObject viewer Displays information for either the DataObject currently on th eclipboard ! or the DataObject dropped """ import wnd from wnd.api import clipboard, msgbox from wnd.api.ole import dragdrop + from wnd.controls.menu import Menu + from wnd.controls.listview import Listview #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! ## menu IDs ! IDM_FILE = 1000 ! IDM_FILE_EXIT = 1001 ! ! idNext = IDM_FILE_EXIT + 1 ! ! IDM_CLIPBOARD = idNext ! IDM_CLIPBOARD_GET_DO = IDM_CLIPBOARD + 1 ! IDM_CLIPBOARD_CLEAR = IDM_CLIPBOARD + 2 ! ! idNext = IDM_CLIPBOARD_CLEAR + 1 ! ! IDM_VIEW = idNext ! IDM_VIEW_CLEAR = IDM_VIEW + 1 ! ! ! #********************************************************** ! #********************************************************** class window(wnd.Window): *************** *** 20,24 **** wnd.Window.__init__(self, 'wnd_dobjview', self.title, None, None, None, None, 'sysmenu', 'sizebox') ! # setup a listview self.lv = Listview(self, 0, 0, 0, 0, 'report', 'border', 'fullrowselect', 'showselalways', 'gridlines') self.lv.Column('get/set') --- 37,52 ---- wnd.Window.__init__(self, 'wnd_dobjview', self.title, None, None, None, None, 'sysmenu', 'sizebox') ! # setup menu ! self.menu= Menu() ! pop= self.menu.Popup('&File', IDM_FILE) ! pop.Item('E&xit', IDM_FILE_EXIT) ! pop= self.menu.Popup('&Clipboard', IDM_CLIPBOARD) ! pop.Item('&Get DataObject', IDM_CLIPBOARD_GET_DO) ! pop.Item('&Clear Clipboard', IDM_CLIPBOARD_CLEAR) ! pop= self.menu.Popup('&View', IDM_VIEW) ! pop.Item('&Clar View', IDM_VIEW_CLEAR) ! self.menu.Set(self) ! ! # setup listview self.lv = Listview(self, 0, 0, 0, 0, 'report', 'border', 'fullrowselect', 'showselalways', 'gridlines') self.lv.Column('get/set') *************** *** 28,51 **** self.lv.Column('index') ! # setup drag drop stuff self.drag= dragdrop.DragDrop(self.lv.Hwnd) self.drag.onMSG= self.on_dragdrop dragdrop.Register(self.lv.Hwnd, self.drag) - - # setup a menu - self.m= Menu() - p1= self.m.Popup('&File', 1000) - p1.Item('E&xit', 1001) - p2= self.m.Popup('&Clipboard', 2000) - p2.Item('&Get DataObject', 2001) - p2.Item('&Clear Clipboard', 2002) - p3= self.m.Popup('&View', 3000) - p3.Item('&Clar View', 3001) - self.m.Set(self) - ! ## helper method to print clipformats of a DataObject to the listview def lv_PrintDataObject(self, dataobject): def tmp_setdata(fmt, get=True): s= str(fmt).split('{') if get: --- 56,72 ---- self.lv.Column('index') ! # register listview as drop target self.drag= dragdrop.DragDrop(self.lv.Hwnd) self.drag.onMSG= self.on_dragdrop dragdrop.Register(self.lv.Hwnd, self.drag) ! ! # helper methods --------------------------------------------------------------------- ! def lv_PrintDataObject(self, dataobject): + ## helper method to print clipformats of a DataObject to the listview + def tmp_setdata(fmt, get=True): + # simply format the string representation of the clipboard format s= str(fmt).split('{') if get: *************** *** 75,108 **** def error(self, msg): msgbox.Msg(self.Hwnd, msg, 'DataObject viewer', 'ok', 'systemmodal') ! # menu message handler def menu_HandleMessage(self, hwnd, msg, wp, lp): ! if msg=="menu choice": ! if lp[0]==1001: self.Close() ! elif lp[0]==2001: try: self.lv_PrintDataObject(clipboard.GetDataObject()) except: ! self.error('error! \n failed to retrieve DataObject') ! elif lp[0]==2002: clipboard.Clear() ! elif lp[0]==3001: self.lv.Clear() ! ! # drag and drop message handler def on_dragdrop(self, hwnd, msg, wp, lp): ! if msg=="dragdrop": ! if wp=="drop": try: self.lv_PrintDataObject(lp[0]) except: ! self.error('error! \n failed to retrieve DataObject') ! return False ## reject DataObject ! ! # GUI message handler def onMSG(self, hwnd, msg, wp, lp): ! if msg=="size": self.lv.SetWindowPosAndSize(*lp) w= lp[2]/5 --- 96,139 ---- def error(self, msg): + # throws a messagebox + msgbox.Msg(self.Hwnd, msg, 'DataObject viewer', 'ok', 'systemmodal') ! # message handlers -------------------------------------------------------------- ! def menu_HandleMessage(self, hwnd, msg, wp, lp): ! # menu handler ! ! if msg=='menu choice': ! if lp[0]==IDM_FILE_EXIT: ! self.Close() ! elif lp[0]==IDM_CLIPBOARD_GET_DO: try: self.lv_PrintDataObject(clipboard.GetDataObject()) except: ! self.error("error! \n failed to retrieve DataObject") ! elif lp[0]==IDM_CLIPBOARD_CLEAR: ! clipboard.Clear() ! elif lp[0]==IDM_VIEW_CLEAR: ! self.lv.Clear() ! def on_dragdrop(self, hwnd, msg, wp, lp): ! # drag and drop handler ! ! if msg=='dragdrop': ! if wp=='drop': try: self.lv_PrintDataObject(lp[0]) except: ! self.error("error! \n failed to retrieve DataObject") ! return False ## reject drop anyway ! def onMSG(self, hwnd, msg, wp, lp): ! # GUI message handler ! ! if msg=='size': self.lv.SetWindowPosAndSize(*lp) w= lp[2]/5 *************** *** 113,125 **** self.lv.SetColumnWidth(4, w) ! elif msg in ("menu choice", "menu open", "menu popup"): self.menu_HandleMessage(hwnd, msg, wp, lp) ! elif msg=="destroy": try: dragdrop.Revoke(self.lv.Hwnd) except: pass ! #************************************ w = window() --- 144,157 ---- self.lv.SetColumnWidth(4, w) ! elif msg in ('menu choice', 'menu open', 'menu popup'): self.menu_HandleMessage(hwnd, msg, wp, lp) ! elif msg=='close': try: dragdrop.Revoke(self.lv.Hwnd) except: pass ! #********************************************************** ! #********************************************************** w = window() --- NEW FILE: gui_mdiframe.py --- """simple MDIFrame sample""" import wnd from wnd import gdi from wnd.controls.tab import Tab from wnd.controls.menu import Menu from wnd.controls.editbox import Editbox from wnd.controls.static import StaticHorz from wnd.controls.mdiframe import MDIFrame #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ## setup menu IDs, all IDs should be > MDIFrame.MIN_MENU_ID IDM_FILE = MDIFrame.MIN_MENU_ID + 1 IDM_FILE_NEW = IDM_FILE + 1 IDM_FILE_EXIT = IDM_FILE + 2 idNext = IDM_FILE_EXIT +1 IDM_WINDOW = idNext IDM_WINDOW_NEXT = IDM_WINDOW + 1 IDM_WINDOW_PREV = IDM_WINDOW + 2 IDM_WINDOW_TILEHORZ = IDM_WINDOW +3 IDM_WINDOW_TILEVERT = IDM_WINDOW + 4 IDM_WINDOW_CASCADE = IDM_WINDOW + 5 IDM_WINDOW_MINIMIZE = IDM_WINDOW + 6 IDM_WINDOW_RESTORE = IDM_WINDOW + 7 IDM_WINDOW_CLOSE = IDM_WINDOW + 8 IDM_WINDOW_ICONARANGE = IDM_WINDOW + 9 class MyWindow(MDIFrame): def __init__(self): self.n= 0 ## just a counter self.controls= {} ## hwnd MDI child --> associated control instance ## NOTE ## still a problem with ctypes. Cached controls ## leave pretty much garbage behind when destroyed ## and removed from the cache selftabH= 0 ## height of a tab button self.tabOffs= 0 ## vert offset inbetween buttons self.staticH= 0 ## calculate static divider height MDIFrame.__init__(self, 'MDI test', None, None, None, None, 'overlappedwindow') rc= self.GetClientRect() ## init menu self.mnu= Menu() popMdi= self.mnu.Popup('&File', IDM_FILE) popMdi.Item('&new MDI child', IDM_FILE_NEW) popMdi.Separator(0) popMdi.Item('&Exit', IDM_FILE_EXIT) pop= self.mnu.Popup('&Window', IDM_WINDOW) pop.Item('&Next', IDM_WINDOW_NEXT) pop.Item('&Previous', IDM_WINDOW_PREV) pop.Separator(0) pop.Item('Tile &Horizontally', IDM_WINDOW_TILEHORZ) pop.Item('Tile &Vertically', IDM_WINDOW_TILEVERT) pop.Item('&Cascade', IDM_WINDOW_CASCADE) pop.Separator(0) pop.Item('&Minimize All', IDM_WINDOW_MINIMIZE) pop.Item('&Restore All', IDM_WINDOW_RESTORE) pop.Item('&Close All', IDM_WINDOW_CLOSE) pop.Separator(0) pop.Item('&Arrange Icons', IDM_WINDOW_ICONARANGE) self.mnu.Set(self) ## static divider above the tab control self.st= StaticHorz(self, 0, 0, 100) self.staticH= self.st.GetWindowRect().ToSize()[3] ## setup tab control ## TODO: some cusromdrawing could help to make the buttons look better self.tab= Tab(self, 0, 0, 0, 0, 'buttons', 'flatseparators', 'fixedwidth', 'flatbuttons') self.tab.onMSG= self.on_tab self.tab.SetStyle('multiline') self.tabH, self.tabOffs= self.calculate_tab_metrics() self.tab.SetWindowSize(rc.right-rc.left, selftabH+1) ## setup MDIClient self.mdi= self.MDIClient(0, 0, 0, 0, 'clientedge', hMenu=popMdi.handle) self.mdi.onMSG= self.on_mdi ## all MDI client windows will be created dynamically from menu command ## helper methods ---------------------------------------------------------------- def calculate_tab_metrics(self): ## helper method ## calculates self.tabH and self.tabOffs ## required to adjust the tab control dynamically ## 1. !! the tab control has to fit exactly the parents with ## 3. calculate the tab button height ## 2. calculate the offset inbetween tab buttons ## ## TODO: ## - check if we have to readjust tab metrics on fontchanges ## n= len(self.tab) if n < 2: ## enshure at least two buttons are avaiable self.tab.Item('foo') if n==0: self.tab.Item('foo') ## calculate button size tabH= self.tab.GetItemRect(0).ToSize()[3] ## force tab to show multiple lines of tabs w, h= self.tab.GetWindowRect().ToSize()[2:] self.tab.SetWindowSize(0, 0) ## calculate the offset inbetween buttons rc1= self.tab.GetItemRect(0) rc2= self.tab.GetItemRect(1) if self.tab.GetRowCount()==1: ## fallback, not corect for 'flatbuttons' tabOffs= rc2.left-rc1.right else: tabOffs= rc2.top-rc1.bottom self.tab.SetWindowSize(w, h) if n < 2: self.tab.RemoveItem(1) if n==0: self.tab.RemoveItem(0) return tabH, tabOffs def size_controls(self, size= None): ## helper method ## handles resizing of controls if size==None: w, h= self.GetClientRect().ToSize()[2:] else: w, h= size[2:] ## adjust tab height to filt tab rowcount n= self.tab.GetRowCount() self.tab.SetWindowSize(w, (n*self.tabH) + (n*self.tabOffs)) tabW, tabH= self.tab.GetWindowRect().ToSize()[2:] self.DeferWindows( (self.st, None, None, w, self.staticH), (self.tab, 0, 0+self.staticH, w, tabH), (self.mdi, 0, 0+tabH+self.staticH, w, h-tabH-self.staticH) ) ## message handlers ---------------------------------------------------------------- def HandleMenuMsg(self, hwnd, msg, wp, lp): if msg=="menu choice": if lp[0]== IDM_FILE_NEW: ## create a new MDI child and place a simple editbox upon it n1= self.tab.GetRowCount() self.n += 1 w, h= self.mdi.GetClientRect().ToSize()[2:] ico= gdi.FileIcon('*.txt') mdi= self.mdi.NewChild('child-%s' % self.n, 0, 0, w/2, h/2, icon=ico) w, h= mdi.GetClientRect().ToSize()[2:] self.controls[mdi.Hwnd]= Editbox(mdi, 'sample text', 0, 0, w, h, 'autovscroll', 'autohscroll', 'wantreturn', 'vscroll', 'hscroll') ## adjust tab height to filt rowcount n2= self.tab.GetRowCount() if n1 != n2: self.size_controls() elif lp[0]==IDM_FILE_EXIT: self.Close() elif lp[0]==IDM_WINDOW_NEXT: self.mdi.ActivateNext() elif lp[0]==IDM_WINDOW_PREV: self.mdi.ActivatePrevious() elif lp[0]==IDM_WINDOW_TILEHORZ: self.mdi.Tile('horizontal') elif lp[0]==IDM_WINDOW_TILEVERT: self.mdi.Tile('verticalal') elif lp[0]==IDM_WINDOW_CASCADE: self.mdi.Cascade() elif lp[0]==IDM_WINDOW_MINIMIZE: for i in self.mdi: self.mdi.Minimize(i) elif lp[0]==IDM_WINDOW_RESTORE: for i in self.mdi: self.mdi.Restore(i) elif lp[0]==IDM_WINDOW_CLOSE: self.mdi.Clear() elif lp[0]==IDM_WINDOW_ICONARANGE: self.mdi.IconArrange() def on_tab(self, hwnd, msg, wp, lp): if msg=="selchanged": ## this is what happens when a tab is selected hwndMdi= self.tab.GetItemLparam(wp) if self.mdi.IsMinimized(hwndMdi): self.mdi.Restore(hwndMdi) self.mdi.Activate(hwndMdi) ## message handler of the MDI client window def on_mdi(self, hwnd, msg, wp, lp): if msg=="childsizing": ## control may not yet be available if 'size' is send in ## response to creating a MDI child if wp in self.controls: mdi= self.mdi.GetChild(wp) w, h= mdi.GetClientRect().ToSize()[2:] ctl= self.controls[wp] ctl.SetWindowSize(w, h) elif msg=="childcreated": ## create a tab for the MDI child ctl= self.mdi.GetChild(wp) self.tab.Item(ctl.GetText(), lp=wp) elif msg=="childdestroyed": ## remove tab ++ control from the cache i= self.tab.FindLparam(wp) if i != None: n1= self.tab.GetRowCount() self.tab.RemoveItem(i) self.controls[wp].Close() del self.controls[wp] ## collect garbage. See notes import gc gc.collect() ## adjust tab height to filt rowcount n2= self.tab.GetRowCount() if n1 != n2: self.size_controls() elif msg=="childactivated": ## select the associated tab i= self.tab.FindLparam(wp) if i != None: self.tab.Select(i) ## message handler of the MDI frame window def onMSG(self, hwnd, msg, wp, lp): if msg=="size": self.size_controls(lp) elif msg in ('menu open', 'menu popup', 'menu choice'): self.HandleMenuMsg(hwnd, msg, wp, lp) elif msg=="open": pass if msg=="close": pass #************************************************************* #************************************************************** w = MyWindow() w.Run() #wnd.Debug('leaks') ## hopefully None --- NEW FILE: gui_propertysheet.py --- """property sheet and witzard sample, bit lame currently Quite civilized in comparison to the tons of aource code piling up behind the scenes""" import gc import wnd from wnd import gdi from wnd.wintypes import BYTE from wnd.controls import dialog from wnd.controls import propertysheet from wnd.controls import button #********************************************************************* # dummy dialogs for property sheet and wizard #********************************************************************* ## DialogFromTemplate is more flexible when it comes to font sizes class dlg1(dialog.Dialog): def __init__(self, propsheet): self.propsheet= propsheet dialog.Dialog.__init__(self, 'dialog-1', 0, 0,propertysheet.PROP_MED_CXDLG, propertysheet.PROP_MED_CYDLG) def onINIT(self, hwnd, msg, wp, lp): self.bt= button.Button(self, 'Test', 20, 20, 60, 50) class dlg2(dialog.Dialog): def __init__(self, propsheet): self.propsheet= propsheet dialog.Dialog.__init__(self, 'dialog-2', 0, 0, propertysheet.PROP_MED_CXDLG, propertysheet.PROP_MED_CYDLG) def onINIT(self, hwnd, msg, wp, lp): self.bt= button.Button(self, 'Test-1', 40, 20, 60, 50) self.bt2= button.Button(self, 'Test-2', 120, 20, 60, 50) self.bt.onMSG=self.on_bt def on_bt(self, hwnd, msg, wp, lp): if msg=='command': self.propsheet.QuerySiblings(1, 222) pass def onMSG(self, hwnd, msg, wp, lp): #print self.Hwnd pass #********************************************************************* # property sheet #********************************************************************* class _property_sheet(propertysheet.PropertySheet): def __init__(self): propertysheet.PropertySheet.__init__(self, 'foo', None, 'proptitle', 'hashelp', startPage=0) self.d1= dlg1(self) self.d2= dlg2(self) self.Page(self.d1) self.Page(self.d2) def onMSG(self, hwnd, msg, wp, lp): if msg=='destroy': ## have to run a full collect here gc.collect() prop= _property_sheet() #********************************************************************* # wizard dialog #********************************************************************* class _wizard(propertysheet.PropertySheet): def __init__(self): ## dummmy bitmap for the header background pat= (BYTE*1)(0xFF) self.bm= gdi.BitmapFromBytes(1, 1, 1, 1, pat) propertysheet.PropertySheet.__init__(self, 'my wizard', None, 'wizard97', startPage=0, bmpWatermark=self.bm) self.d1= dlg1(self) self.d2= dlg2(self) self.Page(self.d1, title='wizard page 1', headerTitle='Header Title 1', headerSubTitle='Some usefull text here as subtitle') self.Page(self.d2, title='wizard page 2', headerTitle='Header Title 2', headerSubTitle='Some usefull text here as subtitle on the second page') def onMSG(self, hwnd, msg, wp, lp): if msg=='setactive': if wp==self.d1.Hwnd: pass self.SetWizardButtons('next') elif wp==self.d2.Hwnd: pass self.SetFinishText('finish') elif msg=='destroy': ## have to run a full collect here gc.collect() wizard= _wizard() #********************************************************************* # main window #********************************************************************* class window(wnd.Window): def __init__(self): wnd.Window.__init__(self, 'propsheet sample', 'Prpertysheet Sample', None, None, None, None, 'sysmenu', 'sizebox', 'dialoglike') self.bt= button.Button(self, 'prop sheet...', 40, 20, 120, 50, 'tabstop') self.bt2= button.Button(self, 'wizard...', 40, 90, 120, 50, 'tabstop') self.bt.onMSG= self.bt2.onMSG= self.on_bt def on_bt(self, hwnd, msg, wp, lp): if msg=='command': if hwnd== self.bt.Hwnd: try: r=prop.Run() except: pass elif hwnd==self.bt2.Hwnd: try: r= wizard.Run() except: pass def onMSG(self, hwnd, msg, wp, lp): pass w= window() w.Run() #wnd.Debug('leaks') Index: _HelloWorld.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/sample-guis/_HelloWorld.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** _HelloWorld.py 29 Apr 2005 15:24:58 -0000 1.1.1.1 --- _HelloWorld.py 23 Jul 2005 19:31:23 -0000 1.2 *************** *** 6,10 **** class MyWindow(wnd.Window): def __init__(self): ! wnd.Window.__init__(self, 'hello World', 'Hello World', 50, 50, 180, 100, 'sysmenu') self.button1=Button(self, 'Hello', 20, 20, 60, 30) --- 6,10 ---- class MyWindow(wnd.Window): def __init__(self): ! wnd.Window.__init__(self, 'hello World', 'Hello World!', 50, 50, 180, 100, 'sysmenu') self.button1=Button(self, 'Hello', 20, 20, 60, 30) |
From: jürgen u. <cer...@us...> - 2005-07-23 19:29:44
|
Update of /cvsroot/wnd/wnd/wnd/gdi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30946 Modified Files: bitmap.py font.py Log Message: bit of this and a bit of that Index: font.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/gdi/font.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** font.py 29 Apr 2005 15:24:25 -0000 1.1.1.1 --- font.py 23 Jul 2005 19:29:33 -0000 1.2 *************** *** 250,254 **** # TODO just a raw version so far # ! # flags 'path_ellipsis', 'word_ellipsis', 'wordbreak' + some other DrawText flags are not implemented # check flags --- 250,254 ---- # TODO just a raw version so far # ! # flags 'path_ellipsis', 'word_ellipsis', 'wordbreak' + some other DrawText flags are not yet implemented # check flags *************** *** 382,387 **** #---------------------------------------------------------------------------------------------------------------- - def TextOutEx(self, dc, text, x, y, rect=None, spacing=None, *flags): options = { 'opaque':2,'clipped':4,'glyph_index':16,'rtlreading':128} flag = 0 --- 382,387 ---- #---------------------------------------------------------------------------------------------------------------- + def TextOutEx(self, dc, text, x, y, *flags, **kwargs): options = { 'opaque':2,'clipped':4,'glyph_index':16,'rtlreading':128} flag = 0 *************** *** 389,396 **** --- 389,400 ---- try: flag |= options[i] except: raise ValueError("invalid flag: %s" % i) + + rect= kwargs.get('rect') if rect: rect = byref(rect) + spacing= kwargs.get('spacing') if spacing: arrSp=(c_int*len(spacing))(*spacing) spacing = byref(arrSp) + hOldObject = gdi32.SelectObject(dc.handle, self.handle) if not hOldObject: raise RuntimeError("invalid font") Index: bitmap.py =================================================================== RCS file: /cvsroot/wnd/wnd/wnd/gdi/bitmap.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** bitmap.py 29 Apr 2005 15:24:41 -0000 1.1.1.1 --- bitmap.py 23 Jul 2005 19:29:33 -0000 1.2 *************** *** 9,13 **** from wnd.gdi.trackhandles import TrackHandler #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! __all__= ("SYSTEM_BITMAPS", "FlipDibBits", "BitmapFromHandle", "DisposableBitmap", "CompatibleBitmap", "BitmapFromFile", "SystemBitmap") SYSTEM_BITMAPS = { --- 9,14 ---- from wnd.gdi.trackhandles import TrackHandler #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ! __all__= ("SYSTEM_BITMAPS", "FlipDibBits", "BitmapFromHandle", "DisposableBitmap", "CompatibleBitmap", "BitmapFromFile", ! "SystemBitmap", "BitmapFromBytes") SYSTEM_BITMAPS = { *************** *** 321,325 **** --- 322,332 ---- BitmapFromHandle.__init__(self, handle) + #************************************************** + class BitmapFromBytes(BitmapFromHandle): + def __init__(self, w, h, colorplanes, bits, bytes): + handle = gdi32.CreateBitmap(w, h, colorplanes, bits, byref(bytes)) + if not handle: raise RuntimeError("could not create bitmap") + BitmapFromHandle.__init__(self, handle) |