diff --git a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp index 74f98ba329..1c3db3af79 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp +++ b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2014 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -35,12 +35,12 @@ enum { static const wxString scenarioPath(L"maps/scenarios/"); static const wxString skirmishPath(L"maps/skirmishes/"); -MapDialog::MapDialog(wxWindow* parent, MapDialogType type) +MapDialog::MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon) : wxDialog(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600,400), wxCAPTION|wxRESIZE_BORDER|wxCLOSE_BOX|wxSYSTEM_MENU), m_Type(type) { Freeze(); - SetIcon(wxIcon(_T("ICON_ScenarioEditor"))); // load from atlas.rc + SetIcon(icon); if (m_Type == MAPDIALOG_OPEN) SetTitle(_("Choose map to open")); diff --git a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.h b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.h index e595861410..6f4c00af35 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.h +++ b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2014 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -31,7 +31,7 @@ enum MapDialogType { MAPDIALOG_OPEN, MAPDIALOG_SAVE }; class MapDialog : public wxDialog { public: - MapDialog(wxWindow* parent, MapDialogType type); + MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon); /** * Returns VFS path of selected map with .xml extension, else empty string diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp index 24046e3e30..0065c13ad0 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp @@ -380,15 +380,16 @@ ScenarioEditor::ScenarioEditor(wxWindow* parent) SetOpenFilename(_T("")); #if defined(__WXMSW__) - SetIcon(wxIcon(_T("ICON_ScenarioEditor"))); // load from atlas.rc + m_Icon = wxIcon(_T("ICON_ScenarioEditor")); // load from atlas.rc #else { const wxString relativePath (_T("tools/atlas/icons/ScenarioEditor.ico")); wxFileName filename (relativePath, wxPATH_UNIX); filename.MakeAbsolute(Datafile::GetDataDirectory()); - SetIcon(wxIcon(filename.GetFullPath(), wxBITMAP_TYPE_ICO)); + m_Icon = wxIcon(filename.GetFullPath(), wxBITMAP_TYPE_ICO); } #endif + SetIcon(m_Icon); wxToolTip::Enable(true); @@ -663,7 +664,7 @@ bool ScenarioEditor::OpenFile(const wxString& name, const wxString& filename) void ScenarioEditor::OnOpen(wxCommandEvent& WXUNUSED(event)) { - MapDialog dlg (NULL, MAPDIALOG_OPEN); + MapDialog dlg (NULL, MAPDIALOG_OPEN, m_Icon); if (dlg.ShowModal() == wxID_OK) { wxString filename = dlg.GetFilename(); @@ -740,7 +741,7 @@ void ScenarioEditor::OnSave(wxCommandEvent& event) void ScenarioEditor::OnSaveAs(wxCommandEvent& WXUNUSED(event)) { - MapDialog dlg(NULL, MAPDIALOG_SAVE); + MapDialog dlg(NULL, MAPDIALOG_SAVE, m_Icon); if (dlg.ShowModal() == wxID_OK) { wxString filename(dlg.GetFilename()); diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h index d978687852..e3c16ea3b6 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2014 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -86,6 +86,8 @@ private: wxString m_OpenFilename; FileHistory m_FileHistory; + wxIcon m_Icon; + DECLARE_EVENT_TABLE(); };