From 76a4ac7dd3be4199cb4b9384fa552f554140805b Mon Sep 17 00:00:00 2001 From: William JCM Date: Sun, 14 Jun 2020 14:28:12 +0200 Subject: [PATCH] MainFrame: add GUI for the screenshot manager. --- GUI/MainFrame.cpp | 81 +++++- GUI/MainFrame.fbp | 714 ++++++++++++++++++++++++++++++++++++++++++++-- GUI/MainFrame.h | 21 +- 3 files changed, 780 insertions(+), 36 deletions(-) diff --git a/GUI/MainFrame.cpp b/GUI/MainFrame.cpp index 75a63c8..706a837 100644 --- a/GUI/MainFrame.cpp +++ b/GUI/MainFrame.cpp @@ -20,8 +20,8 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co wxBoxSizer* bSizerMainPanel; bSizerMainPanel = new wxBoxSizer( wxVERTICAL ); - _managerBook = new wxSimplebook( _mainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - _massPanel = new wxPanel( _managerBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + _managerNotebook = new wxNotebook( _mainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + _massPanel = new wxPanel( _managerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizerMassPanel; bSizerMassPanel = new wxBoxSizer( wxHORIZONTAL ); @@ -99,9 +99,68 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co _massPanel->SetSizer( bSizerMassPanel ); _massPanel->Layout(); bSizerMassPanel->Fit( _massPanel ); - _managerBook->AddPage( _massPanel, wxT("a page"), false ); + _managerNotebook->AddPage( _massPanel, wxT("M.A.S.S.es"), false ); + _screenshotsPanel = new wxPanel( _managerNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizerScreenshotsPanel; + bSizerScreenshotsPanel = new wxBoxSizer( wxHORIZONTAL ); - bSizerMainPanel->Add( _managerBook, 1, wxEXPAND, 5 ); + _screenshotsList = new wxListCtrl( _screenshotsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ALIGN_TOP|wxLC_AUTOARRANGE|wxLC_ICON|wxLC_SINGLE_SEL ); + bSizerScreenshotsPanel->Add( _screenshotsList, 1, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bSizerScreenshotCommands; + bSizerScreenshotCommands = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizerSorting; + sbSizerSorting = new wxStaticBoxSizer( new wxStaticBox( _screenshotsPanel, wxID_ANY, wxT("Sorting") ), wxVERTICAL ); + + wxBoxSizer* bSizerSortType; + bSizerSortType = new wxBoxSizer( wxHORIZONTAL ); + + _nameRadio = new wxRadioButton( sbSizerSorting->GetStaticBox(), wxID_ANY, wxT("Filename"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + _nameRadio->SetValue( true ); + bSizerSortType->Add( _nameRadio, 1, wxALL, 5 ); + + _creationDateRadio = new wxRadioButton( sbSizerSorting->GetStaticBox(), wxID_ANY, wxT("Creation date"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerSortType->Add( _creationDateRadio, 1, wxALL, 5 ); + + + sbSizerSorting->Add( bSizerSortType, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerSortOrder; + bSizerSortOrder = new wxBoxSizer( wxHORIZONTAL ); + + _ascendingRadio = new wxRadioButton( sbSizerSorting->GetStaticBox(), wxID_ANY, wxT("Ascending"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + _ascendingRadio->SetValue( true ); + bSizerSortOrder->Add( _ascendingRadio, 1, wxALL, 5 ); + + _descendingRadio = new wxRadioButton( sbSizerSorting->GetStaticBox(), wxID_ANY, wxT("Descending"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerSortOrder->Add( _descendingRadio, 1, wxALL, 5 ); + + + sbSizerSorting->Add( bSizerSortOrder, 1, wxEXPAND, 5 ); + + + bSizerScreenshotCommands->Add( sbSizerSorting, 0, wxEXPAND|wxALL, 5 ); + + _viewScreenshotButton = new wxButton( _screenshotsPanel, wxID_ANY, wxT("View"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerScreenshotCommands->Add( _viewScreenshotButton, 0, wxALL|wxEXPAND, 5 ); + + _deleteScreenshotButton = new wxButton( _screenshotsPanel, wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerScreenshotCommands->Add( _deleteScreenshotButton, 0, wxALL|wxEXPAND, 5 ); + + _screenshotDirButton = new wxButton( _screenshotsPanel, wxID_ANY, wxT("Open directory"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerScreenshotCommands->Add( _screenshotDirButton, 0, wxALL|wxEXPAND, 5 ); + + + bSizerScreenshotsPanel->Add( bSizerScreenshotCommands, 0, wxEXPAND, 5 ); + + + _screenshotsPanel->SetSizer( bSizerScreenshotsPanel ); + _screenshotsPanel->Layout(); + bSizerScreenshotsPanel->Fit( _screenshotsPanel ); + _managerNotebook->AddPage( _screenshotsPanel, wxT("Photo mode shots"), false ); + + bSizerMainPanel->Add( _managerNotebook, 1, wxEXPAND, 5 ); _riskLabel = new wxStaticText( _mainPanel, wxID_ANY, wxT("USE THIS TOOL AT YOUR OWN RISK!"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); _riskLabel->Wrap( -1 ); @@ -159,6 +218,13 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co _stagingList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( MainFrame::stagingSelectionEvent ), NULL, this ); _deleteStagedButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::deleteStagedEvent ), NULL, this ); _stagingAreaButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::stagingButtonEvent ), NULL, this ); + _nameRadio->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotFilenameSortingEvent ), NULL, this ); + _creationDateRadio->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotCreationDateSortingEvent ), NULL, this ); + _ascendingRadio->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotAscendingSortingEvent ), NULL, this ); + _descendingRadio->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotDescendingSortingEvent ), NULL, this ); + _viewScreenshotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::viewScreenshotEvent ), NULL, this ); + _deleteScreenshotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::deleteScreenshotEvent ), NULL, this ); + _screenshotDirButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::openScreenshotDirEvent ), NULL, this ); this->Connect( wxID_ANY, wxEVT_TIMER, wxTimerEventHandler( MainFrame::gameCheckTimerEvent ) ); } @@ -175,6 +241,13 @@ MainFrame::~MainFrame() _stagingList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( MainFrame::stagingSelectionEvent ), NULL, this ); _deleteStagedButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::deleteStagedEvent ), NULL, this ); _stagingAreaButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::stagingButtonEvent ), NULL, this ); + _nameRadio->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotFilenameSortingEvent ), NULL, this ); + _creationDateRadio->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotCreationDateSortingEvent ), NULL, this ); + _ascendingRadio->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotAscendingSortingEvent ), NULL, this ); + _descendingRadio->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainFrame::screenshotDescendingSortingEvent ), NULL, this ); + _viewScreenshotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::viewScreenshotEvent ), NULL, this ); + _deleteScreenshotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::deleteScreenshotEvent ), NULL, this ); + _screenshotDirButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::openScreenshotDirEvent ), NULL, this ); this->Disconnect( wxID_ANY, wxEVT_TIMER, wxTimerEventHandler( MainFrame::gameCheckTimerEvent ) ); } diff --git a/GUI/MainFrame.fbp b/GUI/MainFrame.fbp index d596011..dace211 100644 --- a/GUI/MainFrame.fbp +++ b/GUI/MainFrame.fbp @@ -123,7 +123,7 @@ 5 wxEXPAND 1 - + 1 1 1 @@ -134,6 +134,7 @@ + 1 0 @@ -158,7 +159,7 @@ 0 1 - _managerBook + _managerNotebook 1 @@ -168,14 +169,16 @@ Resizable 1 + ; ; forward_declare 0 - - a page + + + M.A.S.S.es 0 1 @@ -245,11 +248,11 @@ wxVERTICAL 1 none - + 5 wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT 1 - + 1 1 1 @@ -319,11 +322,11 @@ wxHORIZONTAL 1 none - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -392,11 +395,11 @@ moveEvent - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -465,11 +468,11 @@ deleteEvent - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -549,11 +552,11 @@ bSizerSecondRow wxHORIZONTAL none - + 5 wxALL|wxEXPAND 2 - + 1 1 1 @@ -622,11 +625,11 @@ backupEvent - + 5 wxEXPAND|wxALL 2 - + 1 1 1 @@ -708,11 +711,11 @@ bSizerImportExport wxVERTICAL none - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -781,11 +784,11 @@ importEvent - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -868,11 +871,11 @@ wxVERTICAL 1 none - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -932,11 +935,11 @@ stagingSelectionEvent - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -1005,11 +1008,11 @@ deleteStagedEvent - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -1083,6 +1086,657 @@ + + + Photo mode shots + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + _screenshotsPanel + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizerScreenshotsPanel + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + _screenshotsList + 1 + + + protected + 1 + + Resizable + 1 + + wxLC_ALIGN_TOP|wxLC_AUTOARRANGE|wxLC_ICON|wxLC_SINGLE_SEL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerScreenshotCommands + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Sorting + + sbSizerSorting + wxVERTICAL + 1 + none + + 5 + wxEXPAND + 1 + + + bSizerSortType + wxHORIZONTAL + none + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Filename + + 0 + + + 0 + + 1 + _nameRadio + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + screenshotFilenameSortingEvent + + + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Creation date + + 0 + + + 0 + + 1 + _creationDateRadio + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + screenshotCreationDateSortingEvent + + + + + + 5 + wxEXPAND + 1 + + + bSizerSortOrder + wxHORIZONTAL + none + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ascending + + 0 + + + 0 + + 1 + _ascendingRadio + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + screenshotAscendingSortingEvent + + + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Descending + + 0 + + + 0 + + 1 + _descendingRadio + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + screenshotDescendingSortingEvent + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + View + + 0 + + 0 + + + 0 + + 1 + _viewScreenshotButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + viewScreenshotEvent + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Delete + + 0 + + 0 + + + 0 + + 1 + _deleteScreenshotButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + deleteScreenshotEvent + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Open directory + + 0 + + 0 + + + 0 + + 1 + _screenshotDirButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + openScreenshotDirEvent + + + + + + + @@ -1155,11 +1809,11 @@ bSizerGameStatus wxHORIZONTAL none - + 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 1 - + 1 1 1 @@ -1216,11 +1870,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 diff --git a/GUI/MainFrame.h b/GUI/MainFrame.h index 86dead8..19b2b95 100644 --- a/GUI/MainFrame.h +++ b/GUI/MainFrame.h @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -41,7 +42,7 @@ class MainFrame : public wxFrame protected: wxPanel* _mainPanel; - wxSimplebook* _managerBook; + wxNotebook* _managerNotebook; wxPanel* _massPanel; wxListView* _installedListView; wxButton* _moveButton; @@ -54,6 +55,15 @@ class MainFrame : public wxFrame wxListBox* _stagingList; wxButton* _deleteStagedButton; wxButton* _stagingAreaButton; + wxPanel* _screenshotsPanel; + wxListCtrl* _screenshotsList; + wxRadioButton* _nameRadio; + wxRadioButton* _creationDateRadio; + wxRadioButton* _ascendingRadio; + wxRadioButton* _descendingRadio; + wxButton* _viewScreenshotButton; + wxButton* _deleteScreenshotButton; + wxButton* _screenshotDirButton; wxStaticText* _riskLabel; wxStaticText* _gameStatusLabel; wxStaticText* _gameStatus; @@ -72,6 +82,13 @@ class MainFrame : public wxFrame virtual void stagingSelectionEvent( wxCommandEvent& event ) { event.Skip(); } virtual void deleteStagedEvent( wxCommandEvent& event ) { event.Skip(); } virtual void stagingButtonEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void screenshotFilenameSortingEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void screenshotCreationDateSortingEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void screenshotAscendingSortingEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void screenshotDescendingSortingEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void viewScreenshotEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void deleteScreenshotEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void openScreenshotDirEvent( wxCommandEvent& event ) { event.Skip(); } virtual void gameCheckTimerEvent( wxTimerEvent& event ) { event.Skip(); }