[Wnd-commit] wnd/wnd_doc/doc/controls/dialog classes/findtext .CVSIGNORE,NONE,1.1 findtext.dtpl,NONE
Status: Alpha
Brought to you by:
jurner
|
From: jürgen u. <cer...@us...> - 2005-07-23 20:05:31
|
Update of /cvsroot/wnd/wnd/wnd_doc/doc/controls/dialog classes/findtext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5898 Added Files: .CVSIGNORE findtext.dtpl Log Message: bit of this and a bit of that --- NEW FILE: .CVSIGNORE --- *.html *.gif --- NEW FILE: findtext.dtpl --- ::defaultpage:: FindText ::site:: FindText <IMG SRC="findtext.gif"></IMG> <br><br> <a HREF="contents.html">FindText contents</a> <br><br> ::site:: class FindText <code class=import>defined in: wnd.dlgs.openfile</code><br><br> <code>FindText(*flags)</code><br> Creates an modeless find text dialogbox. <br><br> <br> flags can be a combination of the following flags: flags can be a combination of the following flags: <DL> <DT>'debug' <DD>if the dialog is hooked this will allow for debugging its messages. The message handler will be called with a message 'debug' <br> lp= the message ID<br> wp= formated message as string <br><br> <DT>'debugall' <DD>same as 'debug' but prints out more messages <br><br> </DL> <br><br> <b>NOTE</b><br> Due to the fact that the FindText dialog is a nodeless dialogbox you have to create its parent window with the 'dialoglike' style set to enable keyboard support for the dialog. <P> ::site:: class FindTextFromTemplate <code class=import>defined in: wnd.dlgs.openfile</code><br><br> <code>FindTextFromTemplate(template, *flags)</code><br> Inits a find text dialog class from a custom template. <br><br> Template should be a string containing the raw bytes of the template to create the dialog from. <br> flags can be a combination of the following flags: flags can be a combination of the following flags: <DL> <DT>'debug' <DD>if the dialog is hooked this will allow for debugging its messages. The message handler will be called with a message 'debug' <br> lp= the message ID<br> wp= formated message as string <br><br> <DT>'debugall' <DD>same as 'debug' but prints out more messages <br><br> </DL> <br><br> <b>NOTE</b><br> Due to the fact that the FindText dialog is a nodeless dialogbox you have to create its parent window with the 'dialoglike' style set to enable keyboard support for the dialog. <P> ::site:: class FindTextFromInstance <code class=import>defined in: wnd.dlgs.choosefont</code><br><br> <code>FindTextFromInstance(instance, templatename, *flags)</code><br> <P> Inits a find text dialog class from a custom template in a dll. <br><br> instance should be the handle to a dll containing the template or a sll loaded with ctypes. templatename its resource identifier. <br><br> <b>Note</b><br> <b>(!!) This class is currently not tested, so please report any missbehaviour.</b> <br><br> flags can be a combination of the following flags: <DL> <DT>'debug' <DD>if the dialog is hooked this will allow for debugging its messages. The message handler will be called with a message 'debug' <br> lp= the message ID<br> wp= formated message as string <br><br> <DT>'debugall' <DD>same as 'debug' but prints out more messages <br><br> </DL> <br><br> <b>NOTE</b><br> Due to the fact that the FindText dialog is a nodeless dialogbox you have to create its parent window with the 'dialoglike' style set to enable keyboard support for the dialog. <P> ::site:: FindText messages A FindText dialog the following messages to the message handler:<br><br> <DL> <DT>'fr_findtext' <DD>the user has cklicked the 'find' button<br> wp=text to find<br> lp=flags <br><br> 'flags' is a list containing none one or more of the following flags: <br> <TABLE class="table1" BORDER="1"> <TR> <TD>'down'</TD> <TD>search direction is down. If 'down' is not in list, search direction is up</TD> </TR> <TR> <TD>'matchcase'</TD> <TD>the search should be case sensitive. If 'matchcase' is not in lisr seach should be performed case insensitive</TD> </TR> <TR> <TD>'wholeword'</TD> <TD>the search should match whole word only. If 'wholeword' is not in list the search should be performed matching any occurences chars specified</TD> </TR> </TABLE> <br><br> <DT>'fr_buffererror' <DD>Send if the buffer intended to hold the string the user specified as search string is not large enough to hold all the chars<br> wp='find'<br> lp=tuple(required-buffer-size, actual-buffer-size) <br><br> Its up to you how to react on receiving this messaqge. One way is call <a HREF="FindText methods/SetBufferSize.html">SetBufferSize</a> and adjust the buffer. After doing so you will receive the 'fr_findtext' message with the correct number of chars. You may aswell return False here to cancel the 'fr_findtext' message, or process the 'fr_findtext' message with the truncated number of chars. <br><br> </DL> ::folder:: FindText methods FindText instances support all dialog methods except RunModal and RunModeless. (no link currently available) plus the following methods: ::item:: Run <code>Run(hwnd, what, *flags, **kwargs)</code><br> <P> Runs the FindText dialog <DL> <DT>hwnd <DD>hwnd of the parent window. You have to specify a valid hwnd, otherwise the dialog can not be created <br><br> <DT>what <DD>the searchstring you want to initialize the dialogbox with. Can be '' (empty string) <br><br> <DT>*flags <DD>One or more of the following flags: <br> <TABLE class="table1" BORDER="1"> <TR> <TD>'hidematchcase'</TD> <TD>hides the match case checkbox</TD> </TR> <TR> <TD>'hideupdown'</TD> <TD>hides the search direction radioboxes</TD> </TR> <TR> <TD>'nowholeword'</TD> <TD>disables the the whole word checkbox</TD> </TR> <TR> <TD>'nomatchcase'</TD> <TD>disables the match case checkbox</TD> </TR> <TR> <TD>noupdown'</TD> <TD>hides the the search direction radioboxes</TD> </TR> <TR> <TD>'hidewholeword'</TD> <TD>hides the the whole word checkbox</TD> </TR> <TR> <TD>'hook'</TD> <TD>hooks the dialog, so you can process messages like for any othe rdialog</TD> </TR> <TR> <TD>'showhelp'</TD> <TD>shows the help button</TD> </TR> </TABLE> <DT>kwargs <DD>The following keyword arguments are recognised: <TABLE class="table1" BORDER="1"> <TR> <TD>'buffersize'</TD> <TD>the size of the buffer containing the search string.</TD> </TR> <br><br> <b>Return value</b><br> The hwnd of the dialogbox if it coulg sucefully created </P> ::item:: SetBufferSize <code>SetBufferSize(n)</code><br> <P>Sets the size of the buffer used to hold the find string <br><br> This method works only if the dialog is actually running <br><br> <b>Return value</b><br> True on successs, False otherwise </P> ::item:: SetSearchDirectionn <code>SetSearchDirection(direction)</code><br> <P>Checks the 'up' search direction radiobox if you pass 'up' as direction, the 'down' radiobox if you pass 'down' as direction. <br><br> This method works only if the dialog is actually running <br><br> <b>Return value</b><br> True on successs, False otherwise </P> ::item:: GetSearchDirection <code>GetSearchDirection()</code><br> <P>Returns either 'up' or 'down', according to the search direction currently selected <br><br> This method works only if the dialog is actually running. If the dialog is not running, return value is always False <br><br> <b>Return value</b><br> True on successs, False otherwise </P> ::item:: CheckWholeWord <code>CheckWholeWord()</code><br> <P>Checks the whole word checkbox <br><br> This method works only if the dialog is actually running <br><br> <b>Return value</b><br> True on successs, False otherwise </P> ::item:: isWholeWordChecked <code>isWholeWordChecked()</code><br> <P>Returns True if the whole word checkbox is checked, False otherwise <br><br> This method works only if the dialog is actually running </P> ::item:: CheckMatchCase <code>CheckMatchCase()</code><br> <P>Checks the match case checkbox <br><br> This method works only if the dialog is actually running <br><br> <b>Return value</b><br> True on successs, False otherwise </P> ::item:: IsMatchCaseChecked <code>IsMatchCaseChecked()</code><br> <P>Returns True if the match case checkbox is checked, False otherwise <br><br> This method works only if the dialog is actually running </P> ::site:: customizing FindText There are two ways to customize the FindText dialog: <P> <OL> <LI>by hooking it <LI>by passing a custom dialog template to it (with or without hooking) </OL> </P> <H3>hooking</H3> This will subclass the dialog. You can process all messages like for any other dialog. Create controls in response to the onINIT handler play around with the default controls or whatever. <br><br> The rules are like this. If you return 0 from a message handler the systems dialog proc will process the message as usual, if you return 1 it will not. <H3>custom template</H3> You can pass a custom template to the dialog, to be used as template for the dialog. The following table shows the controls the standard dialog hosts. <br><br> In 'wnd/dlgs/templates/openfile.py' you will find the default template for the OpenSaveFile dialog. You can use this template to base your customized template upon. <br><br> <b>Notes</b><br> <OL> <LI>The ids for the controls you will find in <code class=import>wnd.consts.dlgs</code> <LI>the classname for the main-form should not be specifyed in the template <LI>before you start massive typing work, see <i>'wnd/dlgs/templates/findtext.py'</I> for a default template of the dialogbox <LI> </OL> The FindText dialog contains the following controls: <TABLE class="table1" BORDER="1"> <TH colspan=4>default font used is: 8 (size)</TH> <TR> <TD><b>classname</b></TD> <TD><b>id</b></TD> <TD><b>title</b></TD> <TD><b>size</b></TD> <TD><b>style</b></TD> </TR> <TR> <TD>>'MS Shell Dlg' (mainform)</TD> <TD>-</TD> <TD>'Find'</TD> <TD>30, 73, 236, 62</TD> <TD>WS_BORDER | WS_CAPTION | DS_MODALFRAME | WS_POPUP | WS_SYSMENU | DS_3DLOOK | DS_CONTEXTHELP</TD> </TR> <TR> <TD>'static'</TD> <TD>0xFFFFFFFF</TD> <TD>'Fi&nd what:'</TD> <TD>4, 8, 42, 8</TD> <TD>SS_LEFT | WS_VISIBLE</TD> </TR> <TR> <TD>'edit'</TD> <TD>edt1</TD> <TD>''</TD> <TD>47, 7, 128, 12</TD> <TD>WS_GROUP | WS_TABSTOP | ES_AUTOHSCROLL | WS_VISIBLE | WS_EX_CLIENTEDGE</TD> </TR> <TR> <TD>'button'</TD> <TD>chx1</TD> <TD>'Match &whole word only'</TD> <TD>4, 26, 100, 12</TD> <TD>WS_GROUP | BS_AUTOCHECKBOX | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>chx1</TD> <TD>'Match &case'</TD> <TD>4, 42, 64, 12</TD> <TD>BS_AUTOCHECKBOX | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>grp1</TD> <TD>'Direction'</TD> <TD>107, 26, 68, 28</TD> <TD>WS_GROUP | BS_GROUPBOX | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>rad1</TD> <TD>'&Up'</TD> <TD>111, 38, 25, 12</TD> <TD>WS_GROUP | BS_AUTORADIOBOX | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>rad2</TD> <TD>'&Down'</TD> <TD>138, 38, 35, 12</TD> <TD>BS_AUTORADIOBOX | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>IDOK</TD> <TD>'&Find Next'</TD> <TD>182, 5, 50, 14</TD> <TD>WS_GROUP | WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>'Cancel'</TD> <TD>IDCANCEL</TD> <TD>182, 23, 50, 14</TD> <TD>WS_VISIBLE</TD> </TR> <TR> <TD>'button'</TD> <TD>pshHelp</TD> <TD>'&Help'</TD> <TD>182, 45, 50, 14</TD> <TD>WS_VISIBLE</TD> </TR> </TABLE> |