1<TITLE>finddialog - Create and manipulate a find dialog widget</TITLE> 2<H1>finddialog - Create and manipulate a find dialog widget</H1> 3 4</pre><H2>SYNOPSIS</H2> 5<B>finddialog<I> <I>pathName </I>?<I>options</I>? 6</pre><H2>INHERITANCE</H2> 7itk::Toplevel <- Shell <- Dialogshell <- Finddialog 8</pre><H2>STANDARD OPTIONS</H2> 9<P> 10<table cellpadding=5> 11<td valign=top> 12<B>activeBackground</B><br> 13<B>cursor</B><br> 14<B>highlightColor</B><br> 15<B>insertOffTime</B><br> 16<B>selectBorderWidth</B><br> 17</td> 18<td valign=top> 19<B>activeForeground</B><br> 20<B>disabledForeground</B><br> 21<B>highlightThickness</B><br> 22<B>insertOnTime</B><br> 23<B>selectColor</B><br> 24</td> 25<td valign=top> 26<B>background</B><br> 27<B>font</B><br> 28<B>insertBackground</B><br> 29<B>insertWidth</B><br> 30<B>selectForeground</B><br> 31</td> 32<td valign=top> 33<B>borderWidth</B><br> 34<B>foreground</B><br> 35<B>insertBorderWidth</B><br> 36<B>selectBackground</B><br> 37</td> 38</table> 39<P> 40See the <A HREF="http://www.sco.com/Technology/tcl/man/tk_man/options.n.html"> "options" </A> manual entry for details on the standard options. 41</pre><H2>ASSOCIATED OPTIONS</H2> 42<P> 43<table cellpadding=5> 44<td valign=top> 45<B>selectColor</B><br> 46</td> 47<td valign=top> 48</td> 49<td valign=top> 50</td> 51<td valign=top> 52</td> 53</table> 54<P> 55See the "checkbutton" widget manual entry for details on the above 56associated options. 57<P> 58<table cellpadding=5> 59<td valign=top> 60<B>selectColor</B><br> 61</td> 62<td valign=top> 63</td> 64<td valign=top> 65</td> 66<td valign=top> 67</td> 68</table> 69<P> 70See the <A HREF="entryfield.n.html"> "entryfield" </A> widget manual entry for details on the above 71associated options. 72<P> 73<table cellpadding=5> 74<td valign=top> 75<B>labelFont</B><br> 76</td> 77<td valign=top> 78</td> 79<td valign=top> 80</td> 81<td valign=top> 82</td> 83</table> 84<P> 85See the <A HREF="labeledwidget.n.html"> "labeledwidget" </A> widget manual entry for details on the above 86associated options. 87</pre><H2>INHERITED OPTIONS</H2> 88<P> 89<table cellpadding=5> 90<td valign=top> 91<B>buttonBoxPadX</B><br> 92<B>padY</B><br> 93</td> 94<td valign=top> 95<B>buttonBoxPadY</B><br> 96<B>separator</B><br> 97</td> 98<td valign=top> 99<B>buttonBoxPos</B><br> 100<B>thickness</B><br> 101</td> 102<td valign=top> 103<B>padX</B><br> 104</td> 105</table> 106<P> 107See the <A HREF="dialogshell.n.html"> "dialogshell" </A> widget manual entry for details on the above 108inherited options. 109<P> 110<table cellpadding=5> 111<td valign=top> 112<B>height</B><br> 113</td> 114<td valign=top> 115<B>master</B><br> 116</td> 117<td valign=top> 118<B>modality</B><br> 119</td> 120<td valign=top> 121<B>width</B><br> 122</td> 123</table> 124<P> 125See the "shell" widget manual entry for details on the above 126inherited options. 127<P> 128<table cellpadding=5> 129<td valign=top> 130<B>title</B><br> 131</td> 132<td valign=top> 133</td> 134<td valign=top> 135</td> 136<td valign=top> 137</td> 138</table> 139<P> 140See the "Toplevel" widget manual entry for details on the above 141inherited options. 142</pre><H2>WIDGET-SPECIFIC OPTIONS</H2> 143<P> 144<pre> 145Name: <B>clearCommand</B> 146Class: <B>Command</B> 147Command-Line Switch: <B>-clearcommand</B> 148</pre> 149<UL> 150Specifies a command to be invoked following a clear operation. 151The option is meant to be used as means of notification that the 152clear has taken place and allow other actions to take place such 153as disabling a find again menu. 154</UL> 155<P> 156<pre> 157Name: <B>matchCommand</B> 158Class: <B>Command</B> 159Command-Line Switch: <B>-matchcommand</B> 160</pre> 161<UL> 162Specifies a command to be invoked following a find operation. 163The command is called with a match point as an argument which identifies 164where exactly where in the text or scrolledtext widget that the match 165is located. Should a match not be found the match point is {}. The 166option is meant to be used as a means of notification that the 167find operation has completed and allow other actions to take place 168such as disabling a find again menu option if the match point was {}. 169</UL> 170<P> 171<pre> 172Name: <B>patternBackground</B> 173Class: <B>Background</B> 174Command-Line Switch: <B>-patternbackground</B> 175</pre> 176<UL> 177Specifies the background color of the text matching the search 178pattern. It may have any of the forms accepted by Tk_GetColor. 179The default is gray44. 180</UL> 181<P> 182<pre> 183Name: <B>patternForeground</B> 184Class: <B>Background</B> 185Command-Line Switch: <B>-patternforeground</B> 186</pre> 187<UL> 188Specifies the foreground color of the text matching the search 189pattern. It may have any of the forms accepted by Tk_GetColor. 190The default is white. 191</UL> 192<P> 193<pre> 194Name: <B>searchBackground</B> 195Class: <B>Background</B> 196Command-Line Switch: <B>-searchbackground</B> 197</pre> 198<UL> 199Specifies the background color of the line containing the matching 200the search pattern. It may have any of the forms accepted by Tk_GetColor. 201The default is gray77. 202</UL> 203<P> 204<pre> 205Name: <B>searchForeground</B> 206Class: <B>Background</B> 207Command-Line Switch: <B>-searchforeground</B> 208</pre> 209<UL> 210Specifies the foreground color of the line containing the matching 211the search pattern. It may have any of the forms accepted by Tk_GetColor. 212The default is black. 213</UL> 214<P> 215<pre> 216Name: <B>textWidget</B> 217Class: <B>TextWidget</B> 218Command-Line Switch: <B>-textwidget</B> 219</pre> 220<UL> 221Specifies the text or scrolledtext widget to be searched. 222</UL> 223</pre><HR> 224 225</pre><H2>DESCRIPTION</H2> 226<P> 227The <B>finddialog</B> command creates a find dialog that works in 228conjunction with a text or scrolledtext widget to provide a means 229of performing search operations. The user is prompted for a text 230pattern to be found in the text or scrolledtext widget. The 231search can be for all occurances, by regular expression, considerate 232of the case, or backwards. 233 234</pre><H2>METHODS</H2> 235<P> 236The <B>finddialog</B> command creates a new Tcl command whose 237name is <I>pathName</I>. This 238command may be used to invoke various 239operations on the widget. It has the following general form: 240<pre> 241<I>pathName option </I>?<I>arg arg ...</I>? 242</pre> 243<I>Option</I> and the <I>arg</I>s 244determine the exact behavior of the command. The following 245commands are possible for finddialog widgets: 246</pre><H2>INHERITED METHODS</H2> 247<P> 248<table cellpadding=5> 249<td valign=top> 250<B>add</B><br> 251<B>invoke</B><br> 252</td> 253<td valign=top> 254<B>buttonconfigure</B><br> 255<B>show</B><br> 256</td> 257<td valign=top> 258<B>default</B><br> 259</td> 260<td valign=top> 261<B>hide</B><br> 262</td> 263</table> 264<P> 265See the <A HREF="buttonbox.n.html"> "buttonbox" </A> widget manual entry for details on the above 266inherited methods. 267<P> 268<table cellpadding=5> 269<td valign=top> 270<B>activate</B><br> 271</td> 272<td valign=top> 273<B>center</B><br> 274</td> 275<td valign=top> 276<B>deactivate</B><br> 277</td> 278<td valign=top> 279</td> 280</table> 281<P> 282See the "shell" widget manual entry for details on the above 283inherited methods. 284</pre><H2>WIDGET-SPECIFIC METHODS</H2> 285<DL> 286<DT> <I>pathName <B>cget</B> <I>option</I> 287</I></B> 288<DD> Returns the current value of the configuration option given 289by <I>option</I>. 290<I>Option</I> may have any of the values accepted by the <B>finddialog</B> 291command. 292</DL> 293<DL> 294<DT> <I>pathName <B>clear</B> 295</I></B> 296<DD> Clears the pattern in the entry field and the pattern matchin 297indicators in the text or scrolledtext widget. 298</DL> 299<DL> 300<DT> <I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>? 301</I></B> 302<DD> Query or modify the configuration options of the widget. 303If no <I>option</I> is specified, returns a list describing all of 304the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for 305information on the format of this list). If <I>option</I> is specified 306with no <I>value</I>, then the command returns a list describing the 307one named option (this list will be identical to the corresponding 308sublist of the value returned if no <I>option</I> is specified). If 309one or more <I>option-value</I> pairs are specified, then the command 310modifies the given widget option(s) to have the given value(s); in 311this case the command returns an empty string. 312<I>Option</I> may have any of the values accepted by the <B>finddialog</B> 313command. 314</DL> 315<DL> 316<DT> <I>pathName <B>find</B> 317</I></B> 318<DD> Search for a specific text string in the text widget given by 319the -textwidget option. This method is the standard callback 320for the Find button. It is made available such that it can be 321bound to a find again action. 322 323</DL> 324</pre><H2>COMPONENTS</H2> 325<P> 326<pre> 327Name: <B>all</B> 328Class: <B>Checkbutton</B> 329</pre> 330<UL> 331The all component specifies that all the matches of the pattern should be 332found when performing the search. See the "checkbutton" widget manual 333entry for details on the all component item. 334</UL> 335<P> 336<pre> 337Name: <B>backwards</B> 338Class: <B>Checkbutton</B> 339</pre> 340<UL> 341The backwards component specifies that the search should continue in 342a backwards direction towards the beginning of the text or scrolledtext 343widget. See the "checkbutton" widget manual entry for details on the 344backwards component item. 345</UL> 346<P> 347<pre> 348Name: <B>case</B> 349Class: <B>Checkbutton</B> 350</pre> 351<UL> 352The case component specifies that the case of the pattern should be 353taken into consideration when performing the search. See the 354"checkbutton" widget manual entry for details on the case component item. 355</UL> 356<P> 357<pre> 358Name: <B>pattern</B> 359Class: <B>Entryfield</B> 360</pre> 361<UL> 362The pattern component provides the pattern entry field. See the 363"entryfield" widget manual entry for details on the pattern component item. 364</UL> 365<P> 366<pre> 367Name: <B>regexp</B> 368Class: <B>Checkbutton</B> 369</pre> 370<UL> 371The regexp component specifies that the pattern is a regular expression. 372See the "checkbutton" widget manual entry for details on the regexp 373component item. 374</UL> 375</table> 376 377</pre><H2>EXAMPLE</H2> 378<pre> 379 scrolledtext .st 380 pack .st 381 .st insert end "Now is the time for all good men\\n" 382 .st insert end "to come to the aid of their country" 383 384 finddialog .fd -textwidget .st 385 .fd center .st 386 .fd activate 387</pre> 388</pre><H2>AUTHOR</H2> 389Mark L. Ulferts 390</pre><H2>KEYWORDS</H2> 391finddialog, dialogshell, shell, widget 392 393