diff -Nur a/trunk/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/trunk/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp
a
|
b
|
|
150 | 150 | #endif |
151 | 151 | } |
152 | 152 | |
| 153 | ATLASDLLIMPEXP void Atlas_CloseWindow() |
| 154 | { |
| 155 | if (wxTheApp) { |
| 156 | wxWindow *w; |
| 157 | while ((w = wxTheApp->GetTopWindow())) { |
| 158 | wxCloseEvent ev(wxEVT_CLOSE_WINDOW); |
| 159 | wxPostEvent(w, ev); |
| 160 | |
| 161 | if (!w->GetParent()) |
| 162 | return; |
| 163 | |
| 164 | wxWindow *ow = w; |
| 165 | while (ow == wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow() != NULL) |
| 166 | usleep(100*1000); |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
153 | 171 | ATLASDLLIMPEXP void Atlas_DisplayError(const wchar_t* text, size_t WXUNUSED(flags)) |
154 | 172 | { |
155 | 173 | // This is called from the game thread. |
diff -Nur a/trunk/source/tools/atlas/AtlasUI/Misc/DLLInterface.h b/trunk/source/tools/atlas/AtlasUI/Misc/DLLInterface.h
a
|
b
|
|
25 | 25 | ATLASDLLIMPEXP void Atlas_SetMessagePasser(AtlasMessage::MessagePasser*); |
26 | 26 | ATLASDLLIMPEXP void Atlas_SetDataDirectory(const wchar_t* path); |
27 | 27 | ATLASDLLIMPEXP void Atlas_StartWindow(const wchar_t* type); |
| 28 | ATLASDLLIMPEXP void Atlas_CloseWindow(); |
28 | 29 | |
29 | 30 | ATLASDLLIMPEXP void Atlas_GLSetCurrent(void* context); |
30 | 31 | ATLASDLLIMPEXP void Atlas_GLSwapBuffers(void* context); |
diff -Nur a/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp b/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
a
|
b
|
|
692 | 692 | |
693 | 693 | void ScenarioEditor::OnOpen(wxCommandEvent& WXUNUSED(event)) |
694 | 694 | { |
695 | | wxFileDialog dlg (NULL, wxFileSelectorPromptStr, |
| 695 | wxFileDialog dlg(wxTheApp->GetTopWindow(), wxFileSelectorPromptStr, |
696 | 696 | Datafile::GetDataDirectory() + _T("/mods/public/maps/scenarios"), m_OpenFilename, |
697 | 697 | _T("PMP files (*.pmp)|*.pmp|All files (*.*)|*.*"), |
698 | 698 | wxFD_OPEN); |
| 699 | wxTheApp->SetTopWindow(&dlg); |
| 700 | |
699 | 701 | // Set default filter |
700 | 702 | dlg.SetFilterIndex(0); |
701 | 703 | |
diff -Nur a/trunk/source/tools/atlas/GameInterface/GameLoop.cpp b/trunk/source/tools/atlas/GameInterface/GameLoop.cpp
a
|
b
|
|
51 | 51 | |
52 | 52 | // Loaded from DLL: |
53 | 53 | void (*Atlas_StartWindow)(const wchar_t* type); |
| 54 | void (*Atlas_CloseWindow)(); |
54 | 55 | void (*Atlas_SetDataDirectory)(const wchar_t* path); |
55 | 56 | void (*Atlas_SetConfigDirectory)(const wchar_t* path); |
56 | 57 | void (*Atlas_SetMessagePasser)(MessagePasser*); |
… |
… |
|
217 | 218 | // Pump SDL events (e.g. hotkeys) |
218 | 219 | SDL_Event_ ev; |
219 | 220 | while (SDL_PollEvent(&ev.ev)) |
| 221 | { |
220 | 222 | in_dispatch_event(&ev); |
| 223 | if (ev.ev.type == SDL_QUIT) |
| 224 | Atlas_CloseWindow(); |
| 225 | } |
221 | 226 | |
222 | 227 | if (g_GUI) |
223 | 228 | g_GUI->TickObjects(); |
… |
… |
|
276 | 281 | try |
277 | 282 | { |
278 | 283 | dll.LoadSymbol("Atlas_StartWindow", Atlas_StartWindow); |
| 284 | dll.LoadSymbol("Atlas_CloseWindow", Atlas_CloseWindow); |
279 | 285 | dll.LoadSymbol("Atlas_SetMessagePasser", Atlas_SetMessagePasser); |
280 | 286 | dll.LoadSymbol("Atlas_SetDataDirectory", Atlas_SetDataDirectory); |
281 | 287 | dll.LoadSymbol("Atlas_SetConfigDirectory", Atlas_SetConfigDirectory); |