]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: fdrepdlg.h | |
e54c96f1 | 3 | // Purpose: interface of wxFindDialogEvent |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxFindDialogEvent | |
11 | @wxheader{fdrepdlg.h} | |
7c913512 | 12 | |
23324ae1 | 13 | wxFindReplaceDialog events |
7c913512 | 14 | |
23324ae1 FM |
15 | @library{wxcore} |
16 | @category{events} | |
17 | */ | |
18 | class wxFindDialogEvent : public wxCommandEvent | |
19 | { | |
20 | public: | |
21 | /** | |
22 | Constuctor used by wxWidgets only. | |
23 | */ | |
4cc4bfaf | 24 | wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, |
23324ae1 FM |
25 | int id = 0); |
26 | ||
27 | /** | |
28 | Return the pointer to the dialog which generated this event. | |
29 | */ | |
328f5751 | 30 | wxFindReplaceDialog* GetDialog() const; |
23324ae1 FM |
31 | |
32 | /** | |
33 | Return the string to find (never empty). | |
34 | */ | |
328f5751 | 35 | wxString GetFindString() const; |
23324ae1 FM |
36 | |
37 | /** | |
38 | Get the currently selected flags: this is the combination of @c wxFR_DOWN, | |
39 | @c wxFR_WHOLEWORD and @c wxFR_MATCHCASE flags. | |
40 | */ | |
328f5751 | 41 | int GetFlags() const; |
23324ae1 FM |
42 | |
43 | /** | |
44 | Return the string to replace the search string with (only for replace and | |
45 | replace all events). | |
46 | */ | |
328f5751 | 47 | const wxString GetReplaceString() const; |
23324ae1 FM |
48 | }; |
49 | ||
50 | ||
e54c96f1 | 51 | |
23324ae1 FM |
52 | /** |
53 | @class wxFindReplaceData | |
54 | @wxheader{fdrepdlg.h} | |
7c913512 FM |
55 | |
56 | wxFindReplaceData holds the data for | |
23324ae1 FM |
57 | wxFindReplaceDialog. It is used to initialize |
58 | the dialog with the default values and will keep the last values from the | |
7c913512 | 59 | dialog when it is closed. It is also updated each time a |
23324ae1 FM |
60 | wxFindDialogEvent is generated so instead of |
61 | using the wxFindDialogEvent methods you can also directly query this object. | |
7c913512 | 62 | |
23324ae1 FM |
63 | Note that all @c SetXXX() methods may only be called before showing the |
64 | dialog and calling them has no effect later. | |
7c913512 | 65 | |
23324ae1 FM |
66 | @library{wxcore} |
67 | @category{FIXME} | |
68 | */ | |
69 | class wxFindReplaceData : public wxObject | |
70 | { | |
71 | public: | |
72 | /** | |
73 | Constuctor initializes the flags to default value (0). | |
74 | */ | |
75 | wxFindReplaceData(wxUint32 flags = 0); | |
76 | ||
77 | /** | |
78 | Get the string to find. | |
79 | */ | |
80 | const wxString GetFindString(); | |
81 | ||
82 | /** | |
83 | Get the combination of @c wxFindReplaceFlags values. | |
84 | */ | |
328f5751 | 85 | int GetFlags() const; |
23324ae1 FM |
86 | |
87 | /** | |
88 | Get the replacement string. | |
89 | */ | |
90 | const wxString GetReplaceString(); | |
91 | ||
92 | /** | |
93 | Set the string to find (used as initial value by the dialog). | |
94 | */ | |
95 | void SetFindString(const wxString& str); | |
96 | ||
97 | /** | |
98 | Set the flags to use to initialize the controls of the dialog. | |
99 | */ | |
100 | void SetFlags(wxUint32 flags); | |
101 | ||
102 | /** | |
103 | Set the replacement string (used as initial value by the dialog). | |
104 | */ | |
105 | void SetReplaceString(const wxString& str); | |
106 | }; | |
107 | ||
108 | ||
e54c96f1 | 109 | |
23324ae1 FM |
110 | /** |
111 | @class wxFindReplaceDialog | |
112 | @wxheader{fdrepdlg.h} | |
7c913512 | 113 | |
23324ae1 FM |
114 | wxFindReplaceDialog is a standard modeless dialog which is used to allow the |
115 | user to search for some text (and possibly replace it with something else). | |
116 | The actual searching is supposed to be done in the owner window which is the | |
117 | parent of this dialog. Note that it means that unlike for the other standard | |
118 | dialogs this one @b must have a parent window. Also note that there is no | |
119 | way to use this dialog in a modal way; it is always, by design and | |
120 | implementation, modeless. | |
7c913512 | 121 | |
23324ae1 | 122 | Please see the dialogs sample for an example of using it. |
7c913512 | 123 | |
23324ae1 FM |
124 | @library{wxcore} |
125 | @category{cmndlg} | |
126 | */ | |
127 | class wxFindReplaceDialog : public wxDialog | |
128 | { | |
129 | public: | |
130 | //@{ | |
131 | /** | |
7c913512 | 132 | After using default constructor Create() |
23324ae1 | 133 | must be called. |
4cc4bfaf | 134 | The @a parent and @a data parameters must be non-@NULL. |
23324ae1 FM |
135 | */ |
136 | wxFindReplaceDialog(); | |
4cc4bfaf | 137 | wxFindReplaceDialog(wxWindow* parent, |
7c913512 FM |
138 | wxFindReplaceData* data, |
139 | const wxString& title, | |
140 | int style = 0); | |
23324ae1 FM |
141 | //@} |
142 | ||
143 | /** | |
144 | Destructor. | |
145 | */ | |
146 | ~wxFindReplaceDialog(); | |
147 | ||
148 | /** | |
149 | Creates the dialog; use wxWindow::Show to show it on screen. | |
4cc4bfaf | 150 | The @a parent and @a data parameters must be non-@NULL. |
23324ae1 | 151 | */ |
4cc4bfaf | 152 | bool Create(wxWindow* parent, wxFindReplaceData* data, |
23324ae1 FM |
153 | const wxString& title, int style = 0); |
154 | ||
155 | /** | |
156 | Get the wxFindReplaceData object used by this | |
157 | dialog. | |
158 | */ | |
328f5751 | 159 | const wxFindReplaceData* GetData() const; |
23324ae1 | 160 | }; |
e54c96f1 | 161 |