1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/fdrepdlg.cpp
3 // Purpose: wxFindReplaceDialog class
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
34 #include "wx/palmos/private.h"
36 #include "wx/fdrepdlg.h"
38 // ----------------------------------------------------------------------------
39 // functions prototypes
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 IMPLEMENT_DYNAMIC_CLASS(wxFindReplaceDialog
, wxDialog
)
48 // ----------------------------------------------------------------------------
49 // wxFindReplaceDialogImpl: the internals of wxFindReplaceDialog
50 // ----------------------------------------------------------------------------
52 class WXDLLEXPORT wxFindReplaceDialogImpl
55 wxFindReplaceDialogImpl(wxFindReplaceDialog
*dialog
, int flagsWX
);
56 ~wxFindReplaceDialogImpl();
58 void InitFindWhat(const wxString
& str
);
59 void InitReplaceWith(const wxString
& str
);
61 void SubclassDialog(HWND hwnd
);
63 static UINT
GetFindDialogMessage() { return ms_msgFindDialog
; }
65 // only for passing to ::FindText or ::ReplaceText
66 FINDREPLACE
*GetPtrFindReplace() { return &m_findReplace
; }
68 // set/query the "closed by user" flag
69 void SetClosedByUser() { m_wasClosedByUser
= TRUE
; }
70 bool WasClosedByUser() const { return m_wasClosedByUser
; }
73 void InitString(const wxString
& str
, LPTSTR
*ppStr
, WORD
*pLen
);
75 // the owner of the dialog
78 // the previous window proc of our owner
79 WNDPROC m_oldParentWndProc
;
81 // the find replace data used by the dialog
82 FINDREPLACE m_findReplace
;
84 // TRUE if the user closed us, FALSE otherwise
85 bool m_wasClosedByUser
;
87 // registered Message for Dialog
88 static UINT ms_msgFindDialog
;
90 wxDECLARE_NO_COPY_CLASS(wxFindReplaceDialogImpl
);
93 UINT
wxFindReplaceDialogImpl::ms_msgFindDialog
= 0;
95 // ============================================================================
97 // ============================================================================
99 // ----------------------------------------------------------------------------
100 // wxFindReplaceDialogImpl
101 // ----------------------------------------------------------------------------
103 wxFindReplaceDialogImpl::wxFindReplaceDialogImpl(wxFindReplaceDialog
*dialog
,
108 void wxFindReplaceDialogImpl::InitString(const wxString
& str
,
109 LPTSTR
*ppStr
, WORD
*pLen
)
113 void wxFindReplaceDialogImpl::InitFindWhat(const wxString
& str
)
117 void wxFindReplaceDialogImpl::InitReplaceWith(const wxString
& str
)
121 void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd
)
125 wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl()
129 // ============================================================================
130 // wxFindReplaceDialog implementation
131 // ============================================================================
133 // ----------------------------------------------------------------------------
134 // wxFindReplaceDialog ctors/dtor
135 // ----------------------------------------------------------------------------
137 void wxFindReplaceDialog::Init()
141 wxFindReplaceDialog::wxFindReplaceDialog(wxWindow
*parent
,
142 wxFindReplaceData
*data
,
143 const wxString
&title
,
145 : wxFindReplaceDialogBase(parent
, data
, title
, flags
)
149 wxFindReplaceDialog::~wxFindReplaceDialog()
153 bool wxFindReplaceDialog::Create(wxWindow
*parent
,
154 wxFindReplaceData
*data
,
155 const wxString
&title
,
161 // ----------------------------------------------------------------------------
162 // wxFindReplaceData show/hide
163 // ----------------------------------------------------------------------------
165 bool wxFindReplaceDialog::Show(bool show
)
170 // ----------------------------------------------------------------------------
171 // wxFindReplaceDialog title handling
172 // ----------------------------------------------------------------------------
174 void wxFindReplaceDialog::SetTitle( const wxString
& title
)
178 wxString
wxFindReplaceDialog::GetTitle() const
183 // ----------------------------------------------------------------------------
184 // wxFindReplaceDialog position/size
185 // ----------------------------------------------------------------------------
187 void wxFindReplaceDialog::DoSetSize(int WXUNUSED(x
), int WXUNUSED(y
),
188 int WXUNUSED(width
), int WXUNUSED(height
),
189 int WXUNUSED(sizeFlags
))
191 // ignore - we can't change the size of this standard dialog
195 // NB: of course, both of these functions are completely bogus, but it's better
197 void wxFindReplaceDialog::DoGetSize(int *width
, int *height
) const
201 void wxFindReplaceDialog::DoGetClientSize(int *width
, int *height
) const
205 #endif // wxUSE_FINDREPLDLG