2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: fdrepdlg.h
|
2008-04-01 09:55:38 -04:00
|
|
|
// Purpose: interface of wxFindDialogEvent, wxFindReplaceDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-04-01 09:55:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
See wxFindDialogEvent::GetFlags().
|
|
|
|
*/
|
|
|
|
enum wxFindReplaceFlags
|
|
|
|
{
|
|
|
|
/** downward search/replace selected (otherwise - upwards) */
|
|
|
|
wxFR_DOWN = 1,
|
|
|
|
|
|
|
|
/** whole word search/replace selected */
|
|
|
|
wxFR_WHOLEWORD = 2,
|
|
|
|
|
|
|
|
/** case sensitive search/replace selected (otherwise - case insensitive) */
|
|
|
|
wxFR_MATCHCASE = 4
|
2012-03-31 00:39:53 -04:00
|
|
|
};
|
2008-04-01 09:55:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
These flags can be specified in wxFindReplaceDialog ctor or Create():
|
|
|
|
*/
|
|
|
|
enum wxFindReplaceDialogStyles
|
|
|
|
{
|
|
|
|
/** replace dialog (otherwise find dialog) */
|
|
|
|
wxFR_REPLACEDIALOG = 1,
|
|
|
|
|
|
|
|
/** don't allow changing the search direction */
|
|
|
|
wxFR_NOUPDOWN = 2,
|
|
|
|
|
|
|
|
/** don't allow case sensitive searching */
|
|
|
|
wxFR_NOMATCHCASE = 4,
|
|
|
|
|
|
|
|
/** don't allow whole word searching */
|
|
|
|
wxFR_NOWHOLEWORD = 8
|
2012-03-31 00:39:53 -04:00
|
|
|
};
|
2008-04-01 09:55:38 -04:00
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxFindDialogEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
wxFindReplaceDialog events.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-01 09:55:38 -04:00
|
|
|
@beginEventTable{wxFindDialogEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_FIND(id, func)}
|
2008-04-01 09:55:38 -04:00
|
|
|
Find button was pressed in the dialog.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_FIND_NEXT(id, func)}
|
2008-04-01 09:55:38 -04:00
|
|
|
Find next button was pressed in the dialog.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_FIND_REPLACE(id, func)}
|
2008-04-01 09:55:38 -04:00
|
|
|
Replace button was pressed in the dialog.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_FIND_REPLACE_ALL(id, func)}
|
2008-04-01 09:55:38 -04:00
|
|
|
Replace all button was pressed in the dialog.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_FIND_CLOSE(id, func)}
|
2008-04-01 09:55:38 -04:00
|
|
|
The dialog is being destroyed, any pointers to it cannot be used any longer.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{events}
|
|
|
|
*/
|
|
|
|
class wxFindDialogEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2011-04-03 16:31:32 -04:00
|
|
|
Constructor used by wxWidgets only.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFindDialogEvent(wxEventType commandType = wxEVT_NULL,
|
2008-03-08 08:52:38 -05:00
|
|
|
int id = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Return the pointer to the dialog which generated this event.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxFindReplaceDialog* GetDialog() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the string to find (never empty).
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString GetFindString() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-01 09:55:38 -04:00
|
|
|
Get the currently selected flags: this is the combination of
|
|
|
|
the ::wxFindReplaceFlags enumeration values.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetFlags() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the string to replace the search string with (only for replace and
|
|
|
|
replace all events).
|
|
|
|
*/
|
2008-04-01 09:55:38 -04:00
|
|
|
const wxString& GetReplaceString() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
2013-04-25 06:11:03 -04:00
|
|
|
wxEventType wxEVT_FIND;
|
|
|
|
wxEventType wxEVT_FIND_NEXT;
|
|
|
|
wxEventType wxEVT_FIND_REPLACE;
|
|
|
|
wxEventType wxEVT_FIND_REPLACE_ALL;
|
|
|
|
wxEventType wxEVT_FIND_CLOSE;
|
2012-03-31 00:39:53 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxFindReplaceData
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-01 09:55:38 -04:00
|
|
|
wxFindReplaceData holds the data for wxFindReplaceDialog.
|
|
|
|
|
|
|
|
It is used to initialize the dialog with the default values and will keep the
|
|
|
|
last values from the dialog when it is closed. It is also updated each time a
|
|
|
|
wxFindDialogEvent is generated so instead of using the wxFindDialogEvent
|
|
|
|
methods you can also directly query this object.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Note that all @c SetXXX() methods may only be called before showing the
|
|
|
|
dialog and calling them has no effect later.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2009-02-20 06:34:52 -05:00
|
|
|
@category{cmndlg,data}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxFindReplaceData : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2011-04-03 16:31:32 -04:00
|
|
|
Constructor initializes the flags to default value (0).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxFindReplaceData(wxUint32 flags = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the string to find.
|
|
|
|
*/
|
2012-10-17 11:45:20 -04:00
|
|
|
const wxString& GetFindString() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the combination of @c wxFindReplaceFlags values.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetFlags() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the replacement string.
|
|
|
|
*/
|
2012-10-17 11:45:20 -04:00
|
|
|
const wxString& GetReplaceString() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the string to find (used as initial value by the dialog).
|
|
|
|
*/
|
|
|
|
void SetFindString(const wxString& str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the flags to use to initialize the controls of the dialog.
|
|
|
|
*/
|
|
|
|
void SetFlags(wxUint32 flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the replacement string (used as initial value by the dialog).
|
|
|
|
*/
|
|
|
|
void SetReplaceString(const wxString& str);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxFindReplaceDialog
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxFindReplaceDialog is a standard modeless dialog which is used to allow the
|
|
|
|
user to search for some text (and possibly replace it with something else).
|
2008-04-01 09:55:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The actual searching is supposed to be done in the owner window which is the
|
|
|
|
parent of this dialog. Note that it means that unlike for the other standard
|
|
|
|
dialogs this one @b must have a parent window. Also note that there is no
|
|
|
|
way to use this dialog in a modal way; it is always, by design and
|
|
|
|
implementation, modeless.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-01 09:55:38 -04:00
|
|
|
Please see the @ref page_samples_dialogs sample for an example of using it.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{cmndlg}
|
|
|
|
*/
|
|
|
|
class wxFindReplaceDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2008-04-01 09:55:38 -04:00
|
|
|
wxFindReplaceDialog();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-04-01 09:55:38 -04:00
|
|
|
After using default constructor Create() must be called.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
The @a parent and @a data parameters must be non-@NULL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFindReplaceDialog(wxWindow* parent,
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFindReplaceData* data,
|
|
|
|
const wxString& title,
|
|
|
|
int style = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxFindReplaceDialog();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the dialog; use wxWindow::Show to show it on screen.
|
2008-04-01 09:55:38 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
The @a parent and @a data parameters must be non-@NULL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool Create(wxWindow* parent, wxFindReplaceData* data,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxString& title, int style = 0);
|
|
|
|
|
|
|
|
/**
|
2008-04-01 09:55:38 -04:00
|
|
|
Get the wxFindReplaceData object used by this dialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
const wxFindReplaceData* GetData() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|