Allow using multiple instances of the application window.

All instances share the same config file.
Each instance can independently
 - work on a device
 - define its own stamps.
They can work simultaneously.
This commit is contained in:
Saleem Edah-Tally
2025-07-13 12:46:36 +02:00
parent c10aac922d
commit 24f58fa13d
3 changed files with 52 additions and 33 deletions

12
XS7.cpp
View File

@@ -105,6 +105,18 @@ void XS7::OnAppKeyPressed(wxKeyEvent& evt)
{
if (evt.GetKeyCode() == 'Q')
Close();
// Create a new instance of the application window.
if (evt.GetKeyCode() == 'N')
{
static int instanceId = 0;
instanceId++;
XS7 * instance = new XS7(nullptr, wxID_ANY);
instance->Show(false);
instance->Setup(m_config);
const wxString title = instance->GetTitle() + _T(" (#") + to_string(instanceId) + _T(")");
instance->SetTitle(title);
instance->Show(true);
}
}
if (evt.GetKeyCode() == WXK_ESCAPE)
if (m_insaneWidget)