diff --git a/src/internal/xrcpreview.cpp b/src/internal/xrcpreview.cpp index a4a557b0a..b6c6e58c6 100644 --- a/src/internal/xrcpreview.cpp +++ b/src/internal/xrcpreview.cpp @@ -171,7 +171,7 @@ bool XrcPreview::Create(wxWindow* parent, wxWindowID id, const wxString& title, /////////////////// Non-generated Copyright/License Info //////////////////// // Purpose: Test XRC // Author: Ralph Walden -// Copyright: Copyright (c) 2022 KeyWorks Software (Ralph Walden) +// Copyright: Copyright (c) 2022-2024 KeyWorks Software (Ralph Walden) // License: Apache License -- see ../../LICENSE ///////////////////////////////////////////////////////////////////////////// @@ -339,6 +339,9 @@ void XrcPreview::OnPreview(wxCommandEvent& WXUNUSED(event)) return; } + tt_cwd cwd(true); + wxSetWorkingDirectory(Project.ArtDirectory().make_wxString()); + wxDialog dlg; if (xrc_resource->LoadDialog(&dlg, this, dlg_name)) { @@ -399,6 +402,9 @@ void XrcPreview::OnInit(wxInitDialogEvent& event) m_scintilla->MarkerDefine(node_marker, wxSTC_MARK_BOOKMARK, wxNullColour, *wxGREEN); event.Skip(); + + wxCommandEvent dummy; + OnGenerate(dummy); } void XrcPreview::OnImport(wxCommandEvent& WXUNUSED(event)) diff --git a/src/previews.cpp b/src/previews.cpp index de2a93a63..65566a68a 100644 --- a/src/previews.cpp +++ b/src/previews.cpp @@ -166,6 +166,9 @@ void Preview(Node* form_node) return; } + tt_cwd cwd(true); + wxSetWorkingDirectory(Project.ArtDirectory().make_wxString()); + XrcCompare dlg_compare; if (!dlg_compare.DoCreate(wxGetMainFrame(), form_node)) { @@ -256,6 +259,9 @@ void PreviewXrc(Node* form_node) return; } + tt_cwd cwd(true); + wxSetWorkingDirectory(Project.ArtDirectory().make_wxString()); + switch (form_node->getGenName()) { case gen_wxDialog: