OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Constructing and creating Find and Replace common dialog boxes

Because the find and replace dialog boxes are modeless, you normally keep a pointer to them as a data member in your parent window object to make it easy to communicate with them.

The find and replace common dialog boxes are modeless. Construct and create them in response to a command (for example, a menu item Search|Find or Search|Replace) to display the dialog box and let the user enter the search information.

TFindReplaceDialog::TData has the standard Flags members, plus members for holding the find and replace strings.

The following example shows the pointer to the find dialog box in the parent window object and shows the command event response function that constructs and creates the dialog box:

class TDatabaseWindow : public
TFrameWindow
{
.
.
.
TFindReplaceDialog::TData SearchData;
TFindReplaceDialog* SearchDialog;
.
.
.
};
void TDatabaseWindow::CmEditFind()
{
// If the find dialog box is not already
// constructed, construct and create it now
if (!SearchDialog) {
SearchData.Flags |= FR_DOWN; // default to searching down
SearchDialog = new TFindDialog(this, SearchData)
SearchDialog->Create();
}
}

See Also