* Show the Find & Replace Window */
| 1605 | * Show the Find & Replace Window |
| 1606 | */ |
| 1607 | void CsvApplication::find() { |
| 1608 | int winIndex = app.getTopWindow(); |
| 1609 | Fl_Window *topWin = Fl::first_window(); |
| 1610 | searchWin->callback(find_substring_CB); |
| 1611 | std::string scopeMsg = "Scope: " + windows[winIndex].humanReadableSelection(); |
| 1612 | |
| 1613 | searchWinScope->copy_label(scopeMsg.c_str()); |
| 1614 | searchWin->show(); |
| 1615 | while( searchWin->shown() ) { |
| 1616 | Fl::wait(); |
| 1617 | } |
| 1618 | searchWinScope->copy_label(""); |
| 1619 | searchWinLabel->copy_label(""); |
| 1620 | searchWin->hide(); |
| 1621 | app.lastFound = {-1,-1}; |
| 1622 | windows[winIndex].grid->redraw(); |
| 1623 | |
| 1624 | Fl::check(); |
| 1625 | // restore active window |
| 1626 | if( topWin ) { |
| 1627 | Fl::first_window(topWin); |
| 1628 | topWin->show(); |
| 1629 | topWin->take_focus(); |
| 1630 | } |
| 1631 | } |
| 1632 | void CsvApplication::updateSearchWindow() { |
| 1633 | int winIndex = app.getTopWindow(); |
| 1634 | std::string scopeMsg = "Scope: " + windows[winIndex].humanReadableSelection(); |