1Prima::Dialog::FindDialUosge(r3)Contributed Perl DocumenPtraitmiao:n:Dialog::FindDialog(3)
2
3
4
6 Prima::Dialog::FindDialog - wrapper module for
7 Prima::Dialog::FindDialog and Prima::Dialog::ReplaceDialog to find and
8 replace text.
9
11 use Prima qw(Dialog::FindDialog Application);
12
13 my $dlg = Prima::Dialog::FindDialog-> create( findStyle => 0);
14 my $res = $dlg-> execute;
15 if ( $res == mb::Ok) {
16 print $dlg-> findText, " is to be found\n";
17 } elsif ( $res == mb::ChangeAll) {
18 print "all occurences of ", $dlg-> findText,
19 " is to be replaced by ", $dlg-> replaceText;
20 }
21
23 The module provides two classes - Prima::Dialog::FindDialog and
24 Prima::Dialog::ReplaceDialog; Prima::Dialog::ReplaceDialog is exactly
25 same as Prima::Dialog::FindDialog except that its default findStyle
26 property value is set to 0. One can use a dialog-caching technique,
27 arbitrating between findStyle value 0 and 1, and use only one instance
28 of Prima::Dialog::FindDialog.
29
30 The module does not provide the actual search algorithm; this must be
31 implemented by the programmer. The toolkit currently include some
32 facilitation to the problem - the part of algorithm for "Prima::Edit"
33 class is found in "find" in Prima::Edit, and the another part - in
34 examples/editor.pl example program. Prima::HelpWindow also uses the
35 module, and realizes its own searching algorithm.
36
38 Properties
39 All the properties select the user-assigned values, except findStyle.
40
41 findText STRING
42 Selects the text string to be found.
43
44 Default value: ''
45
46 findStyle BOOLEAN
47 If 1, the dialog provides only 'find text' interface. If 0, the
48 dialog provides also 'replace text' interface.
49
50 Default value: 1 for "Prima::Dialog::FindDialog", 0 for
51 "Prima::Dialog::ReplaceDialog".
52
53 options INTEGER
54 Combination of "fdo::" constants. For the detailed description see
55 "find" in Prima::Edit.
56
57 fdo::MatchCase
58 fdo::WordsOnly
59 fdo::RegularExpression
60 fdo::BackwardSearch
61 fdo::ReplacePrompt
62
63 Default value: 0
64
65 replaceText STRING
66 Selects the text string that is to replace the found text.
67
68 Default value: ''
69
70 scope
71 One of "fds::" constants. Represents the scope of the search: it
72 can be started from the cursor position, of from the top or of the
73 bottom of the text.
74
75 fds::Cursor
76 fds::Top
77 fds::Bottom
78
79 Default value: "fds::Cursor"
80
82 Dmitry Karasik, <dmitry@karasik.eu.org>.
83
85 Prima, Prima::Window, Prima::Edit, Prima::HelpWindow,
86 examples/editor.pl
87
88
89
90perl v5.32.0 2020-07-28 Prima::Dialog::FindDialog(3)