| 1061 | } |
| 1062 | |
| 1063 | void ProgressDialog::Init() |
| 1064 | { |
| 1065 | // There's a problem where the focus is not returned to the window that had |
| 1066 | // it before creating this object. The reason is because the focus events |
| 1067 | // that are sent to the parent window after the wxWindowDisabler are created |
| 1068 | // are tossed and focus will not get restored to the parent once the disabler |
| 1069 | // is deleted. (See bug #1173 for more info) |
| 1070 | // |
| 1071 | // So, we capture and restore the focus ourselves. |
| 1072 | mHadFocus = wxWindow::FindFocus(); |
| 1073 | |
| 1074 | #if defined(__WXGTK__) |
| 1075 | // Under GTK, when applying any effect that prompts the user, it's more than |
| 1076 | // likely that FindFocus() will return NULL. So, make sure something has focus. |
| 1077 | if (GetParent()) |
| 1078 | { |
| 1079 | GetParent()->SetFocus(); |
| 1080 | } |
| 1081 | #endif |
| 1082 | } |
| 1083 | |
| 1084 | void ProgressDialog::Reinit() |
| 1085 | { |