More UI overhaul.

This commit is contained in:
David Given
2022-09-02 00:11:34 +02:00
parent 98a125eb06
commit 4cd87ab08a
7 changed files with 1637 additions and 2627 deletions

View File

@@ -1,4 +1,5 @@
comment: 'Commodore 1541 common settings'
is_extension: true
image_reader {
filename: "commodore1541.d64"

View File

@@ -1,4 +1,5 @@
comment: 'DVK MX common settings'
is_extension: true
image_writer {
filename: "mx.img"

View File

@@ -9,183 +9,6 @@
///////////////////////////////////////////////////////////////////////////
MainWindowGen::MainWindowGen( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( 450,500 ), wxDefaultSize );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK ) );
r = new wxFlexGridSizer( 0, 2, 0, 0 );
r->AddGrowableCol( 1 );
r->AddGrowableRow( 0 );
r->SetFlexibleDirection( wxHORIZONTAL );
r->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 2, 1, 0, 0 );
fgSizer4->AddGrowableRow( 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
visualiser = new VisualisationControl( this, wxID_ANY, wxDefaultPosition, wxSize( 200,480 ), wxBORDER_THEME );
visualiser->SetMinSize( wxSize( 200,480 ) );
fgSizer4->Add( visualiser, 1, wxALL|wxEXPAND, 5 );
stopButton = new wxButton( this, wxID_ANY, wxT("Stop"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( stopButton, 0, wxALIGN_CENTER|wxALL, 5 );
r->Add( fgSizer4, 1, wxEXPAND, 5 );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 1, 0, 0 );
fgSizer2->AddGrowableCol( 0 );
fgSizer2->AddGrowableRow( 1 );
fgSizer2->SetFlexibleDirection( wxVERTICAL );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer3->AddGrowableCol( 1 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText4 = new wxStaticText( this, wxID_ANY, wxT("Device:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
fgSizer3->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
deviceCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SORT );
fgSizer3->Add( deviceCombo, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, wxT("Flux source/sink:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
fgSizer3->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
fluxSourceSinkCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fluxSourceSinkCombo->Append( wxT("drive:0") );
fluxSourceSinkCombo->Append( wxT("drive:1") );
fgSizer3->Add( fluxSourceSinkCombo, 0, wxALL|wxEXPAND, 5 );
m_staticText51 = new wxStaticText( this, wxID_ANY, wxT("Format:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText51->Wrap( -1 );
fgSizer3->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
wxArrayString formatChoiceChoices;
formatChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, formatChoiceChoices, wxCB_SORT );
formatChoice->SetSelection( 0 );
fgSizer3->Add( formatChoice, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
highDensityToggle = new wxCheckBox( this, wxID_ANY, wxT("High density disk"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( highDensityToggle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
fgSizer2->Add( fgSizer3, 1, wxEXPAND, 5 );
notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panel1 = new wxPanel( notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer5;
fgSizer5 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer5->AddGrowableCol( 0 );
fgSizer5->AddGrowableRow( 0 );
fgSizer5->SetFlexibleDirection( wxBOTH );
fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
additionalSettingsEntry = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
fgSizer5->Add( additionalSettingsEntry, 0, wxALL|wxEXPAND, 5 );
m_panel1->SetSizer( fgSizer5 );
m_panel1->Layout();
fgSizer5->Fit( m_panel1 );
notebook->AddPage( m_panel1, wxT("Additional settings"), true );
m_panel2 = new wxPanel( notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer8;
fgSizer8 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer8->AddGrowableCol( 0 );
fgSizer8->AddGrowableRow( 0 );
fgSizer8->SetFlexibleDirection( wxBOTH );
fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
logEntry = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH );
fgSizer8->Add( logEntry, 0, wxALL|wxEXPAND, 5 );
m_panel2->SetSizer( fgSizer8 );
m_panel2->Layout();
fgSizer8->Fit( m_panel2 );
notebook->AddPage( m_panel2, wxT("Logs"), false );
m_panel3 = new wxPanel( notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer9;
fgSizer9 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer9->AddGrowableCol( 0 );
fgSizer9->AddGrowableRow( 0 );
fgSizer9->SetFlexibleDirection( wxBOTH );
fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
protoConfigEntry = new wxTextCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
fgSizer9->Add( protoConfigEntry, 0, wxALL|wxEXPAND, 5 );
m_panel3->SetSizer( fgSizer9 );
m_panel3->Layout();
fgSizer9->Fit( m_panel3 );
notebook->AddPage( m_panel3, wxT("Debug info"), false );
fgSizer2->Add( notebook, 1, wxEXPAND | wxALL, 5 );
wxGridSizer* m_sizer;
m_sizer = new wxGridSizer( 0, 2, 0, 0 );
readFluxButton = new wxButton( this, wxID_ANY, wxT("Read flux"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizer->Add( readFluxButton, 0, wxALL|wxEXPAND, 5 );
readImageButton = new wxButton( this, wxID_ANY, wxT("Read image"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizer->Add( readImageButton, 0, wxALL|wxEXPAND, 5 );
writeFluxButton = new wxButton( this, wxID_ANY, wxT("Write flux"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizer->Add( writeFluxButton, 0, wxALL|wxEXPAND, 5 );
writeImageButton = new wxButton( this, wxID_ANY, wxT("Write image"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizer->Add( writeImageButton, 0, wxALL|wxEXPAND, 5 );
fgSizer2->Add( m_sizer, 1, wxEXPAND|wxFIXED_MINSIZE, 5 );
r->Add( fgSizer2, 1, wxEXPAND, 5 );
this->SetSizer( r );
this->Layout();
m_menubar1 = new wxMenuBar( 0 );
m_menu1 = new wxMenu();
wxMenuItem* m_menuItem2;
m_menuItem2 = new wxMenuItem( m_menu1, wxID_ABOUT, wxString( wxT("About") ) , wxEmptyString, wxITEM_NORMAL );
m_menu1->Append( m_menuItem2 );
wxMenuItem* m_menuItem1;
m_menuItem1 = new wxMenuItem( m_menu1, wxID_EXIT, wxString( wxT("E&xit") ) , wxEmptyString, wxITEM_NORMAL );
m_menu1->Append( m_menuItem1 );
m_menubar1->Append( m_menu1, wxT("&File") );
this->SetMenuBar( m_menubar1 );
// Connect Events
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindowGen::OnAbout ), this, m_menuItem2->GetId());
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindowGen::OnExit ), this, m_menuItem1->GetId());
}
MainWindowGen::~MainWindowGen()
{
// Disconnect Events
}
FluxViewerWindowGen::FluxViewerWindowGen( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
@@ -267,104 +90,168 @@ HexViewerWindowGen::~HexViewerWindowGen()
}
MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
MainWindowGen::MainWindowGen( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) );
wxFlexGridSizer* fgSizer9;
fgSizer9 = new wxFlexGridSizer( 2, 1, 0, 0 );
fgSizer9 = new wxFlexGridSizer( 1, 1, 0, 0 );
fgSizer9->AddGrowableCol( 0 );
fgSizer9->AddGrowableRow( 1 );
fgSizer9->AddGrowableRow( 0 );
fgSizer9->SetFlexibleDirection( wxBOTH );
fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
wxFlexGridSizer* fgSizer10;
fgSizer10 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer10->AddGrowableCol( 0 );
fgSizer10->SetFlexibleDirection( wxHORIZONTAL );
fgSizer10->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer11;
fgSizer11 = new wxFlexGridSizer( 2, 3, 0, 0 );
fgSizer11->AddGrowableCol( 0 );
fgSizer11->AddGrowableCol( 1 );
fgSizer11->AddGrowableCol( 2 );
fgSizer11->AddGrowableRow( 0 );
fgSizer11->SetFlexibleDirection( wxVERTICAL );
fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText7 = new wxStaticText( this, wxID_ANY, wxT("Device"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer11->Add( m_staticText7, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
m_staticText8 = new wxStaticText( this, wxID_ANY, wxT("Drive / Image"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
fgSizer11->Add( m_staticText8, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
m_staticText6 = new wxStaticText( this, wxID_ANY, wxT("Format"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
fgSizer11->Add( m_staticText6, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
wxArrayString deviceChoiceChoices;
deviceChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, deviceChoiceChoices, 0 );
deviceChoice->SetSelection( 0 );
fgSizer11->Add( deviceChoice, 0, wxALIGN_CENTER|wxALL|wxEXPAND, 5 );
sourceChoice = new wxComboBox( this, wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgSizer11->Add( sourceChoice, 0, wxALL|wxEXPAND, 5 );
wxArrayString formatChoiceChoices;
formatChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, formatChoiceChoices, 0 );
formatChoice->SetSelection( 0 );
fgSizer11->Add( formatChoice, 0, wxALL|wxEXPAND, 5 );
fgSizer10->Add( fgSizer11, 1, wxEXPAND, 5 );
m_toolBar1 = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_TEXT );
readDiskTool = m_toolBar1->AddTool( wxID_ANY, wxT("Read"), wxArtProvider::GetBitmap( wxART_COPY, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxT("Read disk to image"), wxEmptyString, NULL );
writeDiskTool = m_toolBar1->AddTool( wxID_ANY, wxT("Write"), wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );
browseTool = m_toolBar1->AddTool( wxID_ANY, wxT("Browse"), wxArtProvider::GetBitmap( wxART_FOLDER_OPEN, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );
m_toolBar1->AddSeparator();
stopTool = m_toolBar1->AddTool( wxID_ANY, wxT("Stop"), wxArtProvider::GetBitmap( wxART_CROSS_MARK, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );
m_toolBar1->Realize();
fgSizer10->Add( m_toolBar1, 0, wxEXPAND, 5 );
fgSizer9->Add( fgSizer10, 1, wxEXPAND, 5 );
m_notebook2 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
dataPanel = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
outerNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
dataPanel = new wxPanel( outerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer10;
gSizer10 = new wxGridSizer( 1, 1, 0, 0 );
m_simplebook4 = new wxSimplebook( dataPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
idlePanel = new wxPanel( m_simplebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
innerNotebook = new wxSimplebook( dataPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
idlePanel = new wxScrolledWindow( innerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
idlePanel->SetScrollRate( 5, 5 );
wxGridSizer* gSizer11;
gSizer11 = new wxGridSizer( 1, 1, 0, 0 );
m_staticText10 = new wxStaticText( idlePanel, wxID_ANY, wxT("Select a device, drive and format,\nand then press one of the buttons above."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticText10->Wrap( -1 );
gSizer11->Add( m_staticText10, 0, wxALIGN_CENTER|wxALL, 5 );
wxFlexGridSizer* fgSizer8;
fgSizer8 = new wxFlexGridSizer( 0, 1, 0, 0 );
fgSizer8->AddGrowableCol( 0 );
fgSizer8->SetFlexibleDirection( wxBOTH );
fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
fgSizer8->SetMinSize( wxSize( 400,-1 ) );
m_staticText61 = new wxStaticText( idlePanel, wxID_ANY, wxT("Pick one of:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText61->Wrap( -1 );
fgSizer8->Add( m_staticText61, 0, wxALIGN_CENTER|wxALL, 5 );
realDiskRadioButton = new wxRadioButton( idlePanel, wxID_ANY, wxT("Real disk"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizer8->Add( realDiskRadioButton, 0, wxALL|wxEXPAND, 5 );
m_panel8 = new wxPanel( idlePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxVERTICAL );
deviceCombo = new wxComboBox( m_panel8, wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizer3->Add( deviceCombo, 0, wxALL|wxEXPAND, 5 );
wxString driveChoiceChoices[] = { wxT("drive:0"), wxT("drive:1") };
int driveChoiceNChoices = sizeof( driveChoiceChoices ) / sizeof( wxString );
driveChoice = new wxChoice( m_panel8, wxID_ANY, wxDefaultPosition, wxDefaultSize, driveChoiceNChoices, driveChoiceChoices, 0 );
driveChoice->SetSelection( 0 );
bSizer3->Add( driveChoice, 0, wxALL|wxEXPAND, 5 );
highDensityToggle = new wxCheckBox( m_panel8, wxID_ANY, wxT("This is a high density disk"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( highDensityToggle, 0, wxALL|wxEXPAND, 5 );
m_panel8->SetSizer( bSizer3 );
m_panel8->Layout();
bSizer3->Fit( m_panel8 );
fgSizer8->Add( m_panel8, 1, wxEXPAND | wxALL, 5 );
fluxImageRadioButton = new wxRadioButton( idlePanel, wxID_ANY, wxT("Flux image"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( fluxImageRadioButton, 0, wxALL|wxEXPAND, 5 );
m_panel91 = new wxPanel( idlePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer121;
gSizer121 = new wxGridSizer( 1, 1, 0, 0 );
fluxImagePicker = new wxFilePickerCtrl( m_panel91, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL );
gSizer121->Add( fluxImagePicker, 0, wxALL|wxEXPAND, 5 );
m_panel91->SetSizer( gSizer121 );
m_panel91->Layout();
gSizer121->Fit( m_panel91 );
fgSizer8->Add( m_panel91, 1, wxEXPAND | wxALL, 5 );
diskImageRadioButton = new wxRadioButton( idlePanel, wxID_ANY, wxT("Disk image"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( diskImageRadioButton, 0, wxALL|wxEXPAND, 5 );
m_panel101 = new wxPanel( idlePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer1211;
gSizer1211 = new wxGridSizer( 1, 1, 0, 0 );
diskImagePicker = new wxFilePickerCtrl( m_panel101, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL );
gSizer1211->Add( diskImagePicker, 0, wxALL|wxEXPAND, 5 );
m_panel101->SetSizer( gSizer1211 );
m_panel101->Layout();
gSizer1211->Fit( m_panel101 );
fgSizer8->Add( m_panel101, 1, wxEXPAND | wxALL, 5 );
m_staticText23 = new wxStaticText( idlePanel, wxID_ANY, wxT("then select a format:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgSizer8->Add( m_staticText23, 0, wxALIGN_CENTER|wxALL, 5 );
m_panel11 = new wxPanel( idlePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer6;
fgSizer6 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer6->AddGrowableCol( 0 );
fgSizer6->SetFlexibleDirection( wxBOTH );
fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxArrayString formatChoiceChoices;
formatChoice = new wxChoice( m_panel11, wxID_ANY, wxDefaultPosition, wxDefaultSize, formatChoiceChoices, 0 );
formatChoice->SetSelection( 0 );
fgSizer6->Add( formatChoice, 0, wxALL|wxEXPAND, 5 );
extraConfigurationButton = new wxButton( m_panel11, wxID_ANY, wxT("Add more"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer6->Add( extraConfigurationButton, 0, wxALL, 5 );
m_panel11->SetSizer( fgSizer6 );
m_panel11->Layout();
fgSizer6->Fit( m_panel11 );
fgSizer8->Add( m_panel11, 1, wxEXPAND | wxALL, 5 );
m_staticText19 = new wxStaticText( idlePanel, wxID_ANY, wxT("and press one of"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText19->Wrap( -1 );
fgSizer8->Add( m_staticText19, 0, wxALIGN_CENTER|wxALL, 5 );
wxGridSizer* gSizer9;
gSizer9 = new wxGridSizer( 1, 1, 0, 0 );
wxGridSizer* gSizer101;
gSizer101 = new wxGridSizer( 1, 3, 0, 0 );
m_button5 = new wxButton( idlePanel, wxID_ANY, wxT("Read"), wxDefaultPosition, wxDefaultSize, 0 );
m_button5->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_TOOLBAR ) );
gSizer101->Add( m_button5, 0, wxALIGN_CENTER|wxALL, 5 );
m_button6 = new wxButton( idlePanel, wxID_ANY, wxT("Write"), wxDefaultPosition, wxDefaultSize, 0 );
m_button6->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_TOOLBAR ) );
m_button6->SetBitmapDisabled( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_BUTTON ) );
gSizer101->Add( m_button6, 0, wxALIGN_CENTER|wxALL, 5 );
m_button7 = new wxButton( idlePanel, wxID_ANY, wxT("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
m_button7->SetBitmap( wxArtProvider::GetBitmap( wxART_FOLDER_OPEN, wxART_TOOLBAR ) );
gSizer101->Add( m_button7, 0, wxALIGN_CENTER|wxALL, 5 );
gSizer9->Add( gSizer101, 1, wxEXPAND, 5 );
fgSizer8->Add( gSizer9, 1, wxEXPAND, 5 );
gSizer11->Add( fgSizer8, 1, wxALIGN_CENTER|wxALL, 5 );
idlePanel->SetSizer( gSizer11 );
idlePanel->Layout();
gSizer11->Fit( idlePanel );
m_simplebook4->AddPage( idlePanel, wxT("a page"), false );
imagePanel = new wxPanel( m_simplebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
innerNotebook->AddPage( idlePanel, wxT("a page"), false );
imagePanel = new wxPanel( innerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
m_splitter3 = new wxSplitterWindow( imagePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_splitter3->Connect( wxEVT_IDLE, wxIdleEventHandler( MyFrame4::m_splitter3OnIdle ), NULL, this );
m_splitter3->Connect( wxEVT_IDLE, wxIdleEventHandler( MainWindowGen::m_splitter3OnIdle ), NULL, this );
m_panel10 = new wxPanel( m_splitter3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer5;
@@ -408,8 +295,8 @@ MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, cons
imagePanel->SetSizer( bSizer4 );
imagePanel->Layout();
bSizer4->Fit( imagePanel );
m_simplebook4->AddPage( imagePanel, wxT("a page"), false );
browsePanel = new wxPanel( m_simplebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
innerNotebook->AddPage( imagePanel, wxT("a page"), false );
browsePanel = new wxPanel( innerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer23;
fgSizer23 = new wxFlexGridSizer( 2, 1, 0, 0 );
fgSizer23->AddGrowableCol( 0 );
@@ -451,16 +338,16 @@ MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, cons
browsePanel->SetSizer( fgSizer23 );
browsePanel->Layout();
fgSizer23->Fit( browsePanel );
m_simplebook4->AddPage( browsePanel, wxT("a page"), false );
innerNotebook->AddPage( browsePanel, wxT("a page"), false );
gSizer10->Add( m_simplebook4, 1, wxEXPAND | wxALL, 5 );
gSizer10->Add( innerNotebook, 1, wxEXPAND | wxALL, 5 );
dataPanel->SetSizer( gSizer10 );
dataPanel->Layout();
gSizer10->Fit( dataPanel );
m_notebook2->AddPage( dataPanel, wxT("Data"), false );
loggingPanel = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
outerNotebook->AddPage( dataPanel, wxT("Data"), true );
loggingPanel = new wxPanel( outerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer6;
gSizer6 = new wxGridSizer( 1, 1, 0, 0 );
@@ -471,24 +358,8 @@ MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, cons
loggingPanel->SetSizer( gSizer6 );
loggingPanel->Layout();
gSizer6->Fit( loggingPanel );
m_notebook2->AddPage( loggingPanel, wxT("Logging"), true );
configPanel = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer5;
fgSizer5 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer5->AddGrowableCol( 0 );
fgSizer5->AddGrowableRow( 0 );
fgSizer5->SetFlexibleDirection( wxBOTH );
fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
additionalSettingsEntry = new wxTextCtrl( configPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
fgSizer5->Add( additionalSettingsEntry, 0, wxALL|wxEXPAND, 5 );
configPanel->SetSizer( fgSizer5 );
configPanel->Layout();
fgSizer5->Fit( configPanel );
m_notebook2->AddPage( configPanel, wxT("Extra configuration"), false );
debugPanel = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
outerNotebook->AddPage( loggingPanel, wxT("Logging"), false );
debugPanel = new wxPanel( outerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer91;
fgSizer91 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer91->AddGrowableCol( 0 );
@@ -503,9 +374,9 @@ MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, cons
debugPanel->SetSizer( fgSizer91 );
debugPanel->Layout();
fgSizer91->Fit( debugPanel );
m_notebook2->AddPage( debugPanel, wxT("Current configuration"), false );
outerNotebook->AddPage( debugPanel, wxT("Current configuration"), false );
fgSizer9->Add( m_notebook2, 1, wxEXPAND, 5 );
fgSizer9->Add( outerNotebook, 1, wxEXPAND, 5 );
this->SetSizer( fgSizer9 );
@@ -529,11 +400,11 @@ MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, cons
this->Centre( wxBOTH );
// Connect Events
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MyFrame4::OnAbout ), this, m_menuItem2->GetId());
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MyFrame4::OnExit ), this, m_menuItem1->GetId());
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindowGen::OnAbout ), this, m_menuItem2->GetId());
m_menu1->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindowGen::OnExit ), this, m_menuItem1->GetId());
}
MyFrame4::~MyFrame4()
MainWindowGen::~MainWindowGen()
{
// Disconnect Events

View File

File diff suppressed because it is too large Load Diff

View File

@@ -9,82 +9,38 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include "visualisationcontrol.h"
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/button.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include "fluxviewercontrol.h"
#include <wx/scrolbar.h>
#include <wx/sizer.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/stattext.h>
#include <wx/radiobut.h>
#include <wx/combobox.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/menu.h>
#include <wx/frame.h>
#include "fluxviewercontrol.h"
#include <wx/scrolbar.h>
#include <wx/toolbar.h>
#include <wx/filepicker.h>
#include <wx/button.h>
#include <wx/scrolwin.h>
#include "visualisationcontrol.h"
#include <wx/splitter.h>
#include <wx/dataview.h>
#include <wx/scrolwin.h>
#include <wx/simplebook.h>
#include <wx/notebook.h>
#include <wx/statusbr.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class MainWindowGen
///////////////////////////////////////////////////////////////////////////////
class MainWindowGen : public wxFrame
{
private:
wxFlexGridSizer* r;
protected:
VisualisationControl* visualiser;
wxButton* stopButton;
wxStaticText* m_staticText4;
wxComboBox* deviceCombo;
wxStaticText* m_staticText5;
wxComboBox* fluxSourceSinkCombo;
wxStaticText* m_staticText51;
wxChoice* formatChoice;
wxCheckBox* highDensityToggle;
wxNotebook* notebook;
wxPanel* m_panel1;
wxTextCtrl* additionalSettingsEntry;
wxPanel* m_panel2;
wxTextCtrl* logEntry;
wxPanel* m_panel3;
wxTextCtrl* protoConfigEntry;
wxButton* readFluxButton;
wxButton* readImageButton;
wxButton* writeFluxButton;
wxButton* writeImageButton;
wxMenuBar* m_menubar1;
wxMenu* m_menu1;
// Virtual event handlers, override them in your derived class
virtual void OnAbout( wxCommandEvent& event ) { event.Skip(); }
virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
public:
MainWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("FluxEngine"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 587,595 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~MainWindowGen();
};
///////////////////////////////////////////////////////////////////////////////
/// Class FluxViewerWindowGen
///////////////////////////////////////////////////////////////////////////////
@@ -135,29 +91,37 @@ class HexViewerWindowGen : public wxFrame
};
///////////////////////////////////////////////////////////////////////////////
/// Class MyFrame4
/// Class MainWindowGen
///////////////////////////////////////////////////////////////////////////////
class MyFrame4 : public wxFrame
class MainWindowGen : public wxFrame
{
private:
protected:
wxStaticText* m_staticText7;
wxStaticText* m_staticText8;
wxStaticText* m_staticText6;
wxChoice* deviceChoice;
wxComboBox* sourceChoice;
wxChoice* formatChoice;
wxToolBar* m_toolBar1;
wxToolBarToolBase* readDiskTool;
wxToolBarToolBase* writeDiskTool;
wxToolBarToolBase* browseTool;
wxToolBarToolBase* stopTool;
wxNotebook* m_notebook2;
wxNotebook* outerNotebook;
wxPanel* dataPanel;
wxSimplebook* m_simplebook4;
wxPanel* idlePanel;
wxStaticText* m_staticText10;
wxSimplebook* innerNotebook;
wxScrolledWindow* idlePanel;
wxStaticText* m_staticText61;
wxRadioButton* realDiskRadioButton;
wxPanel* m_panel8;
wxComboBox* deviceCombo;
wxChoice* driveChoice;
wxCheckBox* highDensityToggle;
wxRadioButton* fluxImageRadioButton;
wxPanel* m_panel91;
wxFilePickerCtrl* fluxImagePicker;
wxRadioButton* diskImageRadioButton;
wxPanel* m_panel101;
wxFilePickerCtrl* diskImagePicker;
wxStaticText* m_staticText23;
wxPanel* m_panel11;
wxChoice* formatChoice;
wxButton* extraConfigurationButton;
wxStaticText* m_staticText19;
wxButton* m_button5;
wxButton* m_button6;
wxButton* m_button7;
wxPanel* imagePanel;
wxSplitterWindow* m_splitter3;
wxPanel* m_panel10;
@@ -176,8 +140,6 @@ class MyFrame4 : public wxFrame
wxButton* browserCommitButton;
wxPanel* loggingPanel;
wxTextCtrl* logEntry;
wxPanel* configPanel;
wxTextCtrl* additionalSettingsEntry;
wxPanel* debugPanel;
wxTextCtrl* protoConfigEntry;
wxMenuBar* m_menubar4;
@@ -191,14 +153,14 @@ class MyFrame4 : public wxFrame
public:
MyFrame4( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 745,620 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
MainWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("FluxEngine"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 828,620 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~MyFrame4();
~MainWindowGen();
void m_splitter3OnIdle( wxIdleEvent& )
{
m_splitter3->SetSashPosition( 0 );
m_splitter3->Disconnect( wxEVT_IDLE, wxIdleEventHandler( MyFrame4::m_splitter3OnIdle ), NULL, this );
m_splitter3->Disconnect( wxEVT_IDLE, wxIdleEventHandler( MainWindowGen::m_splitter3OnIdle ), NULL, this );
}
};

View File

@@ -19,8 +19,11 @@
extern const std::map<std::string, std::string> formats;
#define CONFIG_SOURCESINK "SourceSink"
#define CONFIG_FORMAT "Format"
#define CONFIG_FLUX "FluxSourceSink"
#define CONFIG_EXTRACONFIG "ExtraConfig"
#define CONFIG_FLUXIMAGE "FluxImage"
#define CONFIG_DISKIMAGE "DiskImage"
MainWindow::MainWindow():
MainWindowGen(nullptr),
@@ -63,17 +66,24 @@ MainWindow::MainWindow():
if (MainWindow::formatChoice->GetCount() > 0)
formatChoice->SetSelection(defaultFormat);
wxString defaultFluxSourceSink = fluxSourceSinkCombo->GetString(0);
_config.Read(CONFIG_FLUX, &defaultFluxSourceSink);
fluxSourceSinkCombo->SetValue(defaultFluxSourceSink);
//wxString defaultFluxSourceSink = sourceCombo->GetString(0);
//_config.Read(CONFIG_FLUX, &defaultFluxSourceSink);
//sourceCombo->SetValue(defaultFluxSourceSink);
realDiskRadioButton->Bind(wxEVT_RADIOBUTTON, &MainWindow::OnConfigRadioButtonClicked, this);
fluxImageRadioButton->Bind(wxEVT_RADIOBUTTON, &MainWindow::OnConfigRadioButtonClicked, this);
diskImageRadioButton->Bind(wxEVT_RADIOBUTTON, &MainWindow::OnConfigRadioButtonClicked, this);
realDiskRadioButton->SetValue(true);
wxCommandEvent dummyEvent;
OnConfigRadioButtonClicked(dummyEvent);
formatChoice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &MainWindow::OnControlsChanged, this);
fluxSourceSinkCombo->Bind(wxEVT_TEXT, &MainWindow::OnControlsChanged, this);
readFluxButton->Bind(wxEVT_BUTTON, &MainWindow::OnReadFluxButton, this);
readImageButton->Bind(wxEVT_BUTTON, &MainWindow::OnReadImageButton, this);
writeFluxButton->Bind(wxEVT_BUTTON, &MainWindow::OnWriteFluxButton, this);
writeImageButton->Bind(wxEVT_BUTTON, &MainWindow::OnWriteImageButton, this);
stopButton->Bind(wxEVT_BUTTON, &MainWindow::OnStopButton, this);
//sourceCombo->Bind(wxEVT_TEXT, &MainWindow::OnControlsChanged, this);
//readFluxButton->Bind(wxEVT_BUTTON, &MainWindow::OnReadFluxButton, this);
//readImageButton->Bind(wxEVT_BUTTON, &MainWindow::OnReadImageButton, this);
//writeFluxButton->Bind(wxEVT_BUTTON, &MainWindow::OnWriteFluxButton, this);
//writeImageButton->Bind(wxEVT_BUTTON, &MainWindow::OnWriteImageButton, this);
//stopTool->Bind(wxEVT_BUTTON, &MainWindow::OnStopButton, this);
visualiser->Bind(TRACK_SELECTION_EVENT, &MainWindow::OnTrackSelection, this);
UpdateState();
@@ -84,12 +94,29 @@ void MainWindow::OnExit(wxCommandEvent& event)
Close(true);
}
void MainWindow::OnConfigRadioButtonClicked(wxCommandEvent&)
{
auto configRadioButton = [&](wxRadioButton* button) {
auto* following = button->GetNextSibling();
if (button->GetValue())
following->Show();
else
following->Hide();
};
configRadioButton(realDiskRadioButton);
configRadioButton(fluxImageRadioButton);
configRadioButton(diskImageRadioButton);
idlePanel->Layout();
}
void MainWindow::OnControlsChanged(wxCommandEvent& event)
{
_config.Write(CONFIG_FORMAT,
formatChoice->GetString(formatChoice->GetSelection()));
_config.Write(CONFIG_FLUX,
fluxSourceSinkCombo->GetValue());
//_config.Write(CONFIG_FLUX,
// sourceCombo->GetValue());
UpdateState();
}
void MainWindow::OnStopButton(wxCommandEvent&)
@@ -103,8 +130,8 @@ void MainWindow::OnReadFluxButton(wxCommandEvent&)
{
PrepareConfig();
FluxSource::updateConfigForFilename(config.mutable_flux_source(),
fluxSourceSinkCombo->GetValue().ToStdString());
//FluxSource::updateConfigForFilename(config.mutable_flux_source(),
// sourceCombo->GetValue().ToStdString());
visualiser->Clear();
_currentDisk = nullptr;
@@ -136,10 +163,10 @@ void MainWindow::OnWriteFluxButton(wxCommandEvent&)
{
PrepareConfig();
FluxSink::updateConfigForFilename(config.mutable_flux_sink(),
fluxSourceSinkCombo->GetValue().ToStdString());
FluxSource::updateConfigForFilename(config.mutable_flux_source(),
fluxSourceSinkCombo->GetValue().ToStdString());
//FluxSink::updateConfigForFilename(config.mutable_flux_sink(),
// sourceCombo->GetValue().ToStdString());
//FluxSource::updateConfigForFilename(config.mutable_flux_source(),
// sourceCombo->GetValue().ToStdString());
SetHighDensity();
ShowConfig();
@@ -286,29 +313,29 @@ void MainWindow::ShowConfig()
void MainWindow::ApplyCustomSettings()
{
for (int i = 0; i < additionalSettingsEntry->GetNumberOfLines(); i++)
{
auto setting = additionalSettingsEntry->GetLineText(i).ToStdString();
setting = trimWhitespace(setting);
if (setting.size() == 0)
continue;
//for (int i = 0; i < additionalSettingsEntry->GetNumberOfLines(); i++)
//{
// auto setting = additionalSettingsEntry->GetLineText(i).ToStdString();
// setting = trimWhitespace(setting);
// if (setting.size() == 0)
// continue;
auto equals = setting.find('=');
if (equals != std::string::npos)
{
auto key = setting.substr(0, equals);
auto value = setting.substr(equals + 1);
setProtoByString(&config, key, value);
}
else
FlagGroup::parseConfigFile(setting, formats);
}
// auto equals = setting.find('=');
// if (equals != std::string::npos)
// {
// auto key = setting.substr(0, equals);
// auto value = setting.substr(equals + 1);
// setProtoByString(&config, key, value);
// }
// else
// FlagGroup::parseConfigFile(setting, formats);
//}
}
void MainWindow::OnLogMessage(std::shared_ptr<const AnyLogMessage> message)
{
logEntry->AppendText(Logger::toString(*message));
notebook->SetSelection(1);
//notebook->SetSelection(1);
std::visit(
overloaded{
@@ -362,11 +389,11 @@ void MainWindow::UpdateState()
{
bool running = wxGetApp().IsWorkerThreadRunning();
writeImageButton->Enable(!running && !!_currentDisk);
writeFluxButton->Enable(!running && !!_currentDisk);
stopButton->Enable(running);
readFluxButton->Enable(!running);
readImageButton->Enable(!running);
//writeImageButton->Enable(!running && !!_currentDisk);
//writeFluxButton->Enable(!running && !!_currentDisk);
//stopTool->Enable(running);
//readFluxButton->Enable(!running);
//readImageButton->Enable(!running);
}
void MainWindow::UpdateDevices()

View File

@@ -17,6 +17,7 @@ public:
private:
void OnExit(wxCommandEvent& event);
void OnStopButton(wxCommandEvent&);
void OnConfigRadioButtonClicked(wxCommandEvent&);
void OnReadFluxButton(wxCommandEvent&);
void OnReadImageButton(wxCommandEvent&);
void OnWriteFluxButton(wxCommandEvent&);