[Wnd-commit] wnd/wnd_doc/doc/api/shell/shellnew shellnew.dtpl,NONE,1.1 shellnew.gif,NONE,1.1
Status: Alpha
Brought to you by:
jurner
|
From: jürgen u. <cer...@us...> - 2005-07-02 09:37:18
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/api/shell/shellnew In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15312 Added Files: shellnew.dtpl shellnew.gif Log Message: bit of this and a bit of that --- NEW FILE: shellnew.dtpl --- ::site:: function GetShellNew <code class=import>defined in: wnd.api.shell.shellnew</code><br><br> <code>GetShellNew()</code><br> <br><br> This function is used by <a HREF="class ShellNewMenu.html">ShellNewMenu</a> class to retrieve all (valid) 'shellnew' handlers from the registry. <br><br> The function assumes that the 'ShellNew' key cna be found either directly under the file asociation key or in an emidiate subkey of the key named after the default key of the asociation: <br> <pre> i.e. '.txt' --> 'ShellNew' or '.txt' --> 'text.file' --> 'ShellNew' </pre> Dono wether this is suficient or not. We'll see <br><br> <b>Return value<b/><br><br> A list of all available (valid!!) ShellNew asociations sorted. The list returned contains a list for each item [name, file-asoc, command, data] <TABLE class="table1" BORDER="1"> <TR> <TD>file-asoc</TD> <TD>something like: '.txt' or 'folder'</TD> </TR> <TR> <TD>'command'</TD> <TD>indicates how to create the file and how to use the data member can be one of the following: <P> 'command' (data is the shell command to create the new file) <br><br> 'data' (data is template data for a new file as bytes array) <br><br> 'filename' (data is a path to a template file to be used as new file) <br><br> 'folder' (data is ''. Should create a new folder) <br><br> 'nullfile' (data is '', the file should be created as empty 'txt' file) <br> </P> </TD> </TR> <TR> <TD>'data'</TD> <TD>data required to create the item</TD> </TR> </TABLE> ::site:: class ShellNewMenu <code class=import>defined in: wnd.api.shell.shellnew</code><br><br> <code>ShellNewMenu(minID, maxID)</code><br> <br><br> <P> This class handles all the details required to create an Explorer like 'ShellNew' menu <br><br> <IMG SRC="shellnew.gif"></IMG> <br><br> <DL> <DT>idMin <DD>the minimum allowable menu ID to be used by the menu <DT>idMax <DD>the maxinimum allowable menu ID to be used by the class </DL> <br><br> <P> ::site:: ShellNewMenu messages currently the ShellNewMenu does not send any message:<br><br> ::folder:: ShellNewMenu methods ShellNewMenu instances support the following methods: ::item:: QueryShellNewMenu <code>QueryShellNewMenu(Popup)</code><br> <P>fills the specified Popup instance with file asociations, registered as shell new handlers. </P> ::item:: IsMenuID <code>IsMenuID(ID)</code><br> <P>Returns True if a menu ID is in the range of the menu IDs used by the shell new menu, False otherwise. <br><br> This may usually be True only for IDs in the range from <b>idMin</b> up to <b>idMin + no items found</b>. </P> ::item:: HandleMessage <code>HandleMessage(hwnd, msg, wp, lp)</code><br> <P>This is the message handler responsible for drawing the items and processing all other menu related commands for the ShellNewmenu. <br><br> Passing 'cracked' messages like 'drawitem' or 'measureitem' into the handler does not have any effect. The hanldler requires the 'raw' messages to be passed in. <br><br> There is Two ways of passing the messages to the menu: One is to subclass the parent window by using <a HREF="SubclassParent.html">SubclassParent</a> and <a HREF="SRestoreParentProc.html">RestoreParentProc</a> <br> This will call this handler automatically doing all the required processing internally <br><br> The second is to pass all menu related mesages directly to this handler whenever the popup should be displayed. <br><br> <b>Return value</b><br><br> nonzero if the handler processed a message, zero otherwise </P> ::item:: MakeUniqueFilename <code>MakeUniqueFilename(path, name, ext=None, isdir=False)</code><br> <P>Helper method used by ShellNewmenu to create a unique file or directory name. <DL> <DT>path <DD>the filepath where the new item is intended to be created <DT>name <DD>the filename of the item <DT>ext <DD>the extension the item <DT>isdir <DD>flag to indicate if the item is supposd to be a directory </DL> <br><br> This method does its best to mimic micros~1 'New Foder (1)', 'New Foder (2)' standard names. Although this method is used internally you may find it usefull in some cases or may want to overwrite it. <br><br> <b>Return value</b><br> The full path to the new item </P> ::item:: InvokeCommand <code>InvokeCommand(ID, path)</code><br> <P>Invokes a comand, given its ID and the full path of the folder to invoke the command for. </P> ::item:: SubclassParent <code>SubclassParent(window)</code><br> <P>Subclasses the parent window to enshure proper menu message handling <br><br> The window remains subclassed untill you call <a HREF="RestoreParentProc.html">RestoreParentProc</a> </P> ::item:: RestoreParentProc <code>RestoreParentProc(window)</code><br> <P>Restores the default window proc of the parent window <br><br> See <a HREF="SubclassParent.html">SubclassParent</a> </P> --- NEW FILE: shellnew.gif --- (This appears to be a binary file; contents omitted.) |