| 977 | } |
| 978 | |
| 979 | void ProjectWindow::MacShowUndockedToolbars(bool show) |
| 980 | { |
| 981 | (void)show;//compiler food |
| 982 | #ifdef __WXMAC__ |
| 983 | // Save the focus so we can restore it to whatever had it before since |
| 984 | // showing a previously hidden toolbar will cause the focus to be set to |
| 985 | // its frame. If this is not done it will appear that activation events |
| 986 | // aren't being sent to the project window since they are actually being |
| 987 | // delivered to the last tool frame shown. |
| 988 | wxWindow *focused = FindFocus(); |
| 989 | |
| 990 | // Find all the floating toolbars, and show or hide them |
| 991 | const auto &children = GetChildren(); |
| 992 | for(const auto &child : children) { |
| 993 | if (auto frame = dynamic_cast<ToolFrame*>(child)) { |
| 994 | if (!show) { |
| 995 | frame->Hide(); |
| 996 | } |
| 997 | else if (frame->GetBar() && |
| 998 | frame->GetBar()->IsVisible() ) { |
| 999 | frame->Show(); |
| 1000 | } |
| 1001 | } |
| 1002 | } |
| 1003 | |
| 1004 | // Restore the focus if needed |
| 1005 | if (focused) { |
| 1006 | focused->SetFocus(); |
| 1007 | } |
| 1008 | #endif |
| 1009 | } |
| 1010 | |
| 1011 | void ProjectWindow::OnIconize(wxIconizeEvent &event) |
| 1012 | { |