This is the message handler of sorts for the Find/Replace dialog, it interprets the message and passes the control to the appropriate function
| 364 | // This is the message handler of sorts for the Find/Replace dialog, it interprets the message and passes the control |
| 365 | // to the appropriate function |
| 366 | LONG CScriptStudio::OnFindReplace(WPARAM wParam, LPARAM lParam) { |
| 367 | // Get a pointer to the calling dialog |
| 368 | CFindReplaceDialog *pDlg = CFindReplaceDialog::GetNotifier(lParam); |
| 369 | ASSERT(pDlg != NULL); |
| 370 | |
| 371 | // See what the user is up to out there... |
| 372 | if (pDlg->IsTerminating()) { |
| 373 | // Time to kill the dialog box |
| 374 | return 0; |
| 375 | } |
| 376 | |
| 377 | if (pDlg->ReplaceAll()) { |
| 378 | // Put a call to your ReplaceAll() method here... |
| 379 | CString find, repl; |
| 380 | find = pDlg->GetFindString(); |
| 381 | repl = pDlg->GetReplaceString(); |
| 382 | if (pDlg->MatchCase()) |
| 383 | m_FindMatchCase = true; |
| 384 | else |
| 385 | m_FindMatchCase = false; |
| 386 | ReplaceAll(find.GetBuffer(1), repl.GetBuffer(1)); |
| 387 | return 0; |
| 388 | } |
| 389 | |
| 390 | if (pDlg->ReplaceCurrent()) { |
| 391 | // Put a call to your ReplaceCurrent() method here... |
| 392 | CString repl; |
| 393 | repl = pDlg->GetReplaceString(); |
| 394 | if (pDlg->MatchCase()) |
| 395 | m_FindMatchCase = true; |
| 396 | else |
| 397 | m_FindMatchCase = false; |
| 398 | ReplaceCurrent(repl.GetBuffer(1)); |
| 399 | return 0; |
| 400 | } |
| 401 | |
| 402 | CString str; |
| 403 | if (pDlg->MatchCase()) |
| 404 | m_FindMatchCase = true; |
| 405 | else |
| 406 | m_FindMatchCase = false; |
| 407 | str = pDlg->GetFindString(); |
| 408 | |
| 409 | FindNext(str.GetBuffer(1)); |
| 410 | |
| 411 | return 0; |
| 412 | } |
| 413 | |
| 414 | // This initializes a Find/Replace dialog box (if bFind==false it sets up a Find and Replace, else it's just Find) |
| 415 | void CScriptStudio::InitFindReplace(BOOL bFind) { |
nothing calls this directly
no test coverage detected