90 memset(&fr, 0,
sizeof(FINDREPLACE));
91 fr.lStructSize =
sizeof(FINDREPLACE);
94 Data.Flags &= ~(FR_FINDNEXT|FR_REPLACE|FR_REPLACEALL|FR_DIALOGTERM);
95 fr.Flags = FR_ENABLEHOOK | Data.Flags;
97 fr.lpTemplateName = templateId;
98 fr.Flags |= FR_ENABLETEMPLATE;
101 fr.Flags &= ~FR_ENABLETEMPLATE;
103 fr.lpstrFindWhat = Data.FindWhat;
104 fr.wFindWhatLen =
static_cast<uint16>(Data.BuffSize);
105 fr.lpstrReplaceWith = Data.ReplaceWith;
106 fr.wReplaceWithLen =
static_cast<uint16>(Data.BuffSize);
115 LPCTSTR title,
TModule* module)
162 Data.Flags = fr.Flags;
174 Data.Flags = (
reinterpret_cast<LPFINDREPLACE
>(param2))->Flags;
176 Data.Flags = fr.Flags;
187 LPCTSTR title,
TModule* module)
208 return FindText(&fr);
221 LPCTSTR title,
TModule* module)
242 return ReplaceText(&fr);
#define PRECONDITIONX(condition, message)
TCommonDialog(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Invokes a TWindow constructor, passing the parent window parent, and constructs a common dialog box t...
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Override this to process messages within the dialog function.
static INT_PTR CALLBACK StdDlgProc(HWND, UINT, WPARAM, LPARAM) noexcept
Callback procs for hooking TDialog to native window.
virtual THandle PerformCreate() override
TFindDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructs a TFindDialog object with the given parent window, resource ID, and caption.
The TFindReplaceDialog::TData class encapsulates information necessary to initialize a TFindReplace d...
uint32 Error
If the dialog box is successfully created, Error is 0.
int BuffSize
BuffSize contains the size of the text buffer.
TData(uint32 flags=0, int buffSize=81)
Constructs a TData object with the specified flag value that initializes the status of the dialog box...
TData & operator=(const TData &src)
TCHAR * ReplaceWith
ReplaceWith contains the replacement string.
TCHAR * FindWhat
Contains the search string.
~TData()
Destroys a ~TData object.
uint32 Flags
Flags, which indicates the state of the control buttons and the action that occurred in the dialog bo...
TFindReplaceDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructs a TFindReplaceDialog object with a parent window, resource ID, and caption.
void EvNCDestroy()
Calls TWindow::EvNCDestroy, which responds to an incoming EV_WM_NCDESTROY message which tells the own...
void UpdateData(TParam2 param=0)
Updates the flags from the passed-in parameter.
auto DialogFunction(TMsgId, TParam1, TParam2) -> INT_PTR override
Returns true if a message is handled.
virtual void Init(TResId templateId)
Used by constructors in derived classes, Init initializes a TFindReplaceDialog object with the curren...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TReplaceDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructs a TReplaceDialog object with a parent window, resource ID, template name,...
virtual THandle PerformCreate() override
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual THandle PerformCreate()
Called from Create to perform the final step in creating an Windows interface element to be associate...
TWindow * GetParentO() const
Return the OWL's parent for this window.
TModule * GetModule() const
Returns a pointer to the module object.
void EvNCDestroy()
Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface elemen...
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
void readBytes(void *, size_t)
Reads sz bytes from current stream position, and writes them to data.
Base class for writing streamable objects.
void writeBytes(const void *, size_t)
Writes sz bytes from the data buffer to the stream.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of FindReplace- abstract, Find-, Replace- common Dialog classes.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core).
UINT TMsgId
Message ID type.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.