added generic implementation and documentation for wxFindReplaceDialog
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/fdrepdlg.h
|
||||
// Name: wx/fdrepdlg.h
|
||||
// Purpose: wxFindReplaceDialog class
|
||||
// Author: Markus Greither
|
||||
// Modified by: 31.07.01: VZ: integrated into wxWindows
|
||||
// Author: Markus Greither and Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 23/03/2001
|
||||
// RCS-ID:
|
||||
// Copyright: (c) Markus Greither
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLEXPORT wxFindDialogEvent;
|
||||
class WXDLLEXPORT wxFindReplaceDialog;
|
||||
class WXDLLEXPORT wxFindReplaceData;
|
||||
class WXDLLEXPORT wxFindReplaceDialogImpl;
|
||||
@@ -37,7 +38,7 @@ enum wxFindReplaceFlags
|
||||
wxFR_DOWN = 1,
|
||||
|
||||
// whole word search/replace selected
|
||||
wxFR_WHOLEWORD = 2,
|
||||
wxFR_WHOLEWORD = 2,
|
||||
|
||||
// case sensitive search/replace selected (otherwise - case insensitive)
|
||||
wxFR_MATCHCASE = 4
|
||||
@@ -89,60 +90,52 @@ private:
|
||||
wxString m_FindWhat,
|
||||
m_ReplaceWith;
|
||||
|
||||
friend class wxFindReplaceDialog;
|
||||
friend class wxFindReplaceDialogBase;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog: dialog for searching / replacing text
|
||||
// wxFindReplaceDialogBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFindReplaceDialog : public wxDialog
|
||||
class WXDLLEXPORT wxFindReplaceDialogBase : public wxDialog
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxFindReplaceDialog() { Init(); }
|
||||
wxFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
wxFindReplaceDialogBase() { m_FindReplaceData = NULL; }
|
||||
wxFindReplaceDialogBase(wxWindow * WXUNUSED(parent),
|
||||
wxFindReplaceData *data,
|
||||
const wxString& WXUNUSED(title),
|
||||
int WXUNUSED(style) = 0)
|
||||
{
|
||||
m_FindReplaceData = data;
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
|
||||
virtual ~wxFindReplaceDialog();
|
||||
virtual ~wxFindReplaceDialogBase();
|
||||
|
||||
// find dialog data access
|
||||
const wxFindReplaceData *GetData() const { return m_FindReplaceData; }
|
||||
void SetData(wxFindReplaceData *data);
|
||||
void SetData(wxFindReplaceData *data) { m_FindReplaceData = data; }
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
wxFindReplaceDialogImpl *GetImpl() const { return m_impl; }
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
// implementation only, don't use
|
||||
void Send(wxFindDialogEvent& event);
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
wxFindReplaceData *m_FindReplaceData;
|
||||
|
||||
void Init();
|
||||
|
||||
wxFindReplaceData *m_FindReplaceData;
|
||||
wxString m_title;
|
||||
|
||||
wxFindReplaceDialogImpl *m_impl;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFindReplaceDialog)
|
||||
// the last string we searched for
|
||||
wxString m_lastSearch;
|
||||
};
|
||||
|
||||
// include wxFindReplaceDialog declaration
|
||||
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
||||
#include "wx/msw/fdrepdlg.h"
|
||||
#else
|
||||
#define wxGenericFindReplaceDialog wxFindReplaceDialog
|
||||
#define sm_classwxGenericFindReplaceDialog sm_classwxFindReplaceDialog
|
||||
|
||||
#include "wx/generic/fdrepdlg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
71
include/wx/generic/fdrepdlg.h
Normal file
71
include/wx/generic/fdrepdlg.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/fdrepdlg.h
|
||||
// Purpose: wxGenericFindReplaceDialog class
|
||||
// Author: Markus Greither
|
||||
// Modified by:
|
||||
// Created: 25/05/2001
|
||||
// RCS-ID:
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "genericfdrepdlg.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxCheckBox;
|
||||
class WXDLLEXPORT wxRadioBox;
|
||||
class WXDLLEXPORT wxTextCtrl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericFindReplaceDialog: dialog for searching / replacing text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGenericFindReplaceDialog : public wxFindReplaceDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericFindReplaceDialog() { Init(); }
|
||||
|
||||
wxGenericFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString& title,
|
||||
int style = 0)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, data, title, style);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString& title,
|
||||
int style = 0);
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
void SendEvent(const wxEventType& evtType);
|
||||
|
||||
void OnFind(wxCommandEvent& event);
|
||||
void OnReplace(wxCommandEvent& event);
|
||||
void OnReplaceAll(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateFindUI(wxUpdateUIEvent& event);
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
wxCheckBox *m_chkCase,
|
||||
*m_chkWord;
|
||||
|
||||
wxRadioBox *m_radioDir;
|
||||
|
||||
wxTextCtrl *m_textFind,
|
||||
*m_textRepl;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFindReplaceDialog)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
bool Destroy();
|
||||
|
||||
virtual bool Show( bool show );
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal( int retCode );
|
||||
virtual bool IsModal() const;
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
bool Destroy();
|
||||
|
||||
virtual bool Show( bool show );
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal( int retCode );
|
||||
virtual bool IsModal() const;
|
||||
|
62
include/wx/msw/fdrepdlg.h
Normal file
62
include/wx/msw/fdrepdlg.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/fdrepdlg.h
|
||||
// Purpose: wxFindReplaceDialog class
|
||||
// Author: Markus Greither
|
||||
// Modified by: 31.07.01: VZ: integrated into wxWindows
|
||||
// Created: 23/03/2001
|
||||
// RCS-ID:
|
||||
// Copyright: (c) Markus Greither
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "mswfdrepdlg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog: dialog for searching / replacing text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFindReplaceDialog : public wxFindReplaceDialogBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxFindReplaceDialog() { Init(); }
|
||||
wxFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int style = 0);
|
||||
|
||||
virtual ~wxFindReplaceDialog();
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
wxFindReplaceDialogImpl *GetImpl() const { return m_impl; }
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
void Init();
|
||||
|
||||
wxString m_title;
|
||||
|
||||
wxFindReplaceDialogImpl *m_impl;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFindReplaceDialog)
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user