add cartridge reader

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2026-02-12 11:47:02 +01:00
parent eb21513dd5
commit 669a5d8ce6
25 changed files with 984 additions and 73 deletions

9
main/include/cApp.h Normal file
View File

@@ -0,0 +1,9 @@
#pragma once
#include <wx/wx.h>
class cApp : public wxApp
{
public:
bool OnInit() override;
};

14
main/include/ui/cFrame.h Normal file
View File

@@ -0,0 +1,14 @@
#pragma once
#include <wx/wx.h>
class cFrame : public wxMDIParentFrame
{
public:
cFrame();
private:
void OnHello(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
};

8
main/src/cApp.cpp Normal file
View File

@@ -0,0 +1,8 @@
#include "cApp.h"
#include "ui/cFrame.h"
bool cApp::OnInit()
{
auto *frame = new cFrame();
return frame->Show(true);
}

4
main/src/main.cpp Normal file
View File

@@ -0,0 +1,4 @@
#include "cApp.h"
#include <wx/wx.h>
wxIMPLEMENT_APP(cApp);

38
main/src/ui/cFrame.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include "ui/cFrame.h"
enum { ID_Hello = 1 };
cFrame::cFrame() : wxMDIParentFrame(nullptr, wxID_ANY, "Hello World") {
auto *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu item");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
auto *menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT);
auto *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
SetMenuBar(menuBar);
CreateStatusBar();
SetStatusText("Welcome to wxWidgets!");
Bind(wxEVT_MENU, &cFrame::OnHello, this, ID_Hello);
Bind(wxEVT_MENU, &cFrame::OnAbout, this, wxID_ABOUT);
Bind(wxEVT_MENU, &cFrame::OnExit, this, wxID_EXIT);
}
void cFrame::OnExit(wxCommandEvent &event) { Close(true); }
void cFrame::OnAbout(wxCommandEvent &event) {
wxMessageBox("This is a wxWidgets Hello World example", "About Hello World",
wxOK | wxICON_INFORMATION);
}
void cFrame::OnHello(wxCommandEvent &event) {
wxLogMessage("Hello world from wxWidgets!");
}