MainFrame: reorganise the UI.

Some of the widgets had wrong parents.
This commit is contained in:
Guillaume Jacquemin 2020-06-14 12:18:44 +02:00
parent 7553fdaa7d
commit 07ed391cf6
3 changed files with 1240 additions and 1183 deletions

View file

@ -16,13 +16,14 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
wxBoxSizer* bSizerMain; wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL ); bSizerMain = new wxBoxSizer( wxVERTICAL );
_managerBook = new wxSimplebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); _mainPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
_massPanel = new wxPanel( _managerBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizerMainPanel;
wxBoxSizer* bSizerPanel; bSizerMainPanel = new wxBoxSizer( wxVERTICAL );
bSizerPanel = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerMainUi; _managerBook = new wxSimplebook( _mainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMainUi = new wxBoxSizer( wxHORIZONTAL ); _massPanel = new wxPanel( _managerBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerMassPanel;
bSizerMassPanel = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizerInstalled; wxStaticBoxSizer* sbSizerInstalled;
sbSizerInstalled = new wxStaticBoxSizer( new wxStaticBox( _massPanel, wxID_ANY, wxT("Installed M.A.S.S.es") ), wxVERTICAL ); sbSizerInstalled = new wxStaticBoxSizer( new wxStaticBox( _massPanel, wxID_ANY, wxT("Installed M.A.S.S.es") ), wxVERTICAL );
@ -60,7 +61,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
sbSizerInstalled->Add( bSizerSecondRow, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); sbSizerInstalled->Add( bSizerSecondRow, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bSizerMainUi->Add( sbSizerInstalled, 1, wxEXPAND|wxALL, 5 ); bSizerMassPanel->Add( sbSizerInstalled, 1, wxEXPAND|wxALL, 5 );
wxBoxSizer* bSizerImportExport; wxBoxSizer* bSizerImportExport;
bSizerImportExport = new wxBoxSizer( wxVERTICAL ); bSizerImportExport = new wxBoxSizer( wxVERTICAL );
@ -77,7 +78,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
bSizerImportExport->Add( _exportButton, 0, wxALL|wxEXPAND, 5 ); bSizerImportExport->Add( _exportButton, 0, wxALL|wxEXPAND, 5 );
bSizerMainUi->Add( bSizerImportExport, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizerMassPanel->Add( bSizerImportExport, 0, wxALIGN_CENTER_VERTICAL, 5 );
wxStaticBoxSizer* sbSizerStagingArea; wxStaticBoxSizer* sbSizerStagingArea;
sbSizerStagingArea = new wxStaticBoxSizer( new wxStaticBox( _massPanel, wxID_ANY, wxT("Staging area") ), wxVERTICAL ); sbSizerStagingArea = new wxStaticBoxSizer( new wxStaticBox( _massPanel, wxID_ANY, wxT("Staging area") ), wxVERTICAL );
@ -92,26 +93,31 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
sbSizerStagingArea->Add( _stagingAreaButton, 0, wxALL|wxEXPAND, 5 ); sbSizerStagingArea->Add( _stagingAreaButton, 0, wxALL|wxEXPAND, 5 );
bSizerMainUi->Add( sbSizerStagingArea, 1, wxEXPAND|wxALL, 5 ); bSizerMassPanel->Add( sbSizerStagingArea, 1, wxEXPAND|wxALL, 5 );
bSizerPanel->Add( bSizerMainUi, 1, wxEXPAND, 5 ); _massPanel->SetSizer( bSizerMassPanel );
_massPanel->Layout();
bSizerMassPanel->Fit( _massPanel );
_managerBook->AddPage( _massPanel, wxT("a page"), false );
_riskLabel = new wxStaticText( _massPanel, wxID_ANY, wxT("USE THIS TOOL AT YOUR OWN RISK!"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); bSizerMainPanel->Add( _managerBook, 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 ); _riskLabel->Wrap( -1 );
_riskLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); _riskLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
_riskLabel->SetForegroundColour( wxColour( 255, 0, 0 ) ); _riskLabel->SetForegroundColour( wxColour( 255, 0, 0 ) );
bSizerPanel->Add( _riskLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerMainPanel->Add( _riskLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerGameStatus; wxBoxSizer* bSizerGameStatus;
bSizerGameStatus = new wxBoxSizer( wxHORIZONTAL ); bSizerGameStatus = new wxBoxSizer( wxHORIZONTAL );
_gameStatusLabel = new wxStaticText( _massPanel, wxID_ANY, wxT("Game status:"), wxDefaultPosition, wxDefaultSize, 0 ); _gameStatusLabel = new wxStaticText( _mainPanel, wxID_ANY, wxT("Game status:"), wxDefaultPosition, wxDefaultSize, 0 );
_gameStatusLabel->Wrap( -1 ); _gameStatusLabel->Wrap( -1 );
bSizerGameStatus->Add( _gameStatusLabel, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); bSizerGameStatus->Add( _gameStatusLabel, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
_gameStatus = new wxStaticText( _massPanel, wxID_ANY, wxT("not running"), wxDefaultPosition, wxDefaultSize, 0 ); _gameStatus = new wxStaticText( _mainPanel, wxID_ANY, wxT("not running"), wxDefaultPosition, wxDefaultSize, 0 );
_gameStatus->Wrap( -1 ); _gameStatus->Wrap( -1 );
_gameStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); _gameStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
_gameStatus->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_CAPTIONTEXT ) ); _gameStatus->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_CAPTIONTEXT ) );
@ -119,22 +125,20 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
bSizerGameStatus->Add( _gameStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); bSizerGameStatus->Add( _gameStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bSizerPanel->Add( bSizerGameStatus, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerMainPanel->Add( bSizerGameStatus, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
_aboutText = new wxStaticText( _massPanel, wxID_ANY, wxT("This version of the application was tested on M.A.S.S. Builder early access version 0.3.7.\nIt may or may not work with other versions of the game.\nMade for the M.A.S.S. Builder community by Guillaume Jacquemin."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); _aboutText = new wxStaticText( _mainPanel, wxID_ANY, wxT("This version of the application was tested on M.A.S.S. Builder early access version 0.3.7.\nIt may or may not work with other versions of the game.\nMade for the M.A.S.S. Builder community by Guillaume Jacquemin."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
_aboutText->Wrap( -1 ); _aboutText->Wrap( -1 );
bSizerPanel->Add( _aboutText, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerMainPanel->Add( _aboutText, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 );
_githubLink = new wxHyperlinkCtrl( _massPanel, wxID_ANY, wxT("https://github.com/williamjcm/wxMASSManager"), wxT("https://github.com/williamjcm/wxMASSManager"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); _githubLink = new wxHyperlinkCtrl( _mainPanel, wxID_ANY, wxT("https://github.com/williamjcm/wxMASSManager"), wxT("https://github.com/williamjcm/wxMASSManager"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
bSizerPanel->Add( _githubLink, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizerMainPanel->Add( _githubLink, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
_massPanel->SetSizer( bSizerPanel ); _mainPanel->SetSizer( bSizerMainPanel );
_massPanel->Layout(); _mainPanel->Layout();
bSizerPanel->Fit( _massPanel ); bSizerMainPanel->Fit( _mainPanel );
_managerBook->AddPage( _massPanel, wxT("a page"), false ); bSizerMain->Add( _mainPanel, 1, wxEXPAND, 5 );
bSizerMain->Add( _managerBook, 1, wxEXPAND, 5 );
this->SetSizer( bSizerMain ); this->SetSizer( bSizerMain );

View file

@ -59,6 +59,66 @@
<property name="name">bSizerMain</property> <property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">_mainPanel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMainPanel</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
@ -170,16 +230,7 @@
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerPanel</property> <property name="name">bSizerMassPanel</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMainUi</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -1031,6 +1082,9 @@
</object> </object>
</object> </object>
</object> </object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT</property>
@ -1353,8 +1407,6 @@
</object> </object>
</object> </object>
</object> </object>
</object>
</object>
<object class="wxTimer" expanded="1"> <object class="wxTimer" expanded="1">
<property name="enabled">0</property> <property name="enabled">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>

View file

@ -22,10 +22,10 @@
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/stattext.h>
#include <wx/hyperlink.h>
#include <wx/panel.h> #include <wx/panel.h>
#include <wx/simplebook.h> #include <wx/simplebook.h>
#include <wx/stattext.h>
#include <wx/hyperlink.h>
#include <wx/timer.h> #include <wx/timer.h>
#include <wx/frame.h> #include <wx/frame.h>
@ -40,6 +40,7 @@ class MainFrame : public wxFrame
private: private:
protected: protected:
wxPanel* _mainPanel;
wxSimplebook* _managerBook; wxSimplebook* _managerBook;
wxPanel* _massPanel; wxPanel* _massPanel;
wxListView* _installedListView; wxListView* _installedListView;