From 61be4855f826abc129d404317fe68453f8fda2d4 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Thu, 8 Feb 2024 15:05:05 +0100 Subject: [PATCH 1/2] Remove forced font size Signed-off-by: Maxime Gervais --- Source/GUI/WxWidgets/GUI_Main_HTML.cpp | 3 --- Source/GUI/WxWidgets/GUI_Main_Text.cpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/Source/GUI/WxWidgets/GUI_Main_HTML.cpp b/Source/GUI/WxWidgets/GUI_Main_HTML.cpp index 02c18f456..3733fd5e9 100644 --- a/Source/GUI/WxWidgets/GUI_Main_HTML.cpp +++ b/Source/GUI/WxWidgets/GUI_Main_HTML.cpp @@ -27,9 +27,6 @@ GUI_Main_HTML::GUI_Main_HTML(Core* Core_, wxWindow* parent) : wxHtmlWindow(parent, -1, wxPoint(1, 1), wxSize(parent->GetClientSize().GetWidth()-1, parent->GetClientSize().GetHeight()-1)), GUI_Main_Common_Core(Core_) { - int Size[7]={ 7, 8, 10, 12, 16, 22, 30}; - SetFonts(wxEmptyString, wxEmptyString, Size); - //Drag and Drop #if wxUSE_DRAG_AND_DROP && defined(__WXMAC__) SetDropTarget(new FileDrop(C)); diff --git a/Source/GUI/WxWidgets/GUI_Main_Text.cpp b/Source/GUI/WxWidgets/GUI_Main_Text.cpp index a610410c2..952b1e306 100644 --- a/Source/GUI/WxWidgets/GUI_Main_Text.cpp +++ b/Source/GUI/WxWidgets/GUI_Main_Text.cpp @@ -30,9 +30,6 @@ GUI_Main_Text::GUI_Main_Text(Core* Core_, wxWindow* parent) Font.SetFamily(wxFONTFAMILY_MODERN); wxTextAttr Attr; Attr.SetFont(Font); - #if wxCHECK_VERSION(2, 9, 0) - Attr.SetFontSize(8); - #endif SetDefaultStyle(Attr); //Drag and Drop From e0abab51371fb687b6ac5ad90bc4a25f92889c29 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Mon, 12 Feb 2024 11:58:49 +0100 Subject: [PATCH 2/2] Add preference panel for default view & font size Signed-off-by: Maxime Gervais --- Project/GNU/GUI/Makefile.am | 1 + Source/GUI/WxWidgets/GUI_Main.cpp | 98 +---------- Source/GUI/WxWidgets/GUI_Main.h | 5 + Source/GUI/WxWidgets/GUI_Main_Menu.cpp | 17 ++ Source/GUI/WxWidgets/GUI_Main_Text.cpp | 20 ++- Source/GUI/WxWidgets/GUI_Preferences.cpp | 211 +++++++++++++++++++++++ Source/GUI/WxWidgets/GUI_Preferences.h | 68 ++++++++ 7 files changed, 318 insertions(+), 102 deletions(-) create mode 100644 Source/GUI/WxWidgets/GUI_Preferences.cpp create mode 100644 Source/GUI/WxWidgets/GUI_Preferences.h diff --git a/Project/GNU/GUI/Makefile.am b/Project/GNU/GUI/Makefile.am index 20a7ec255..fefc99c85 100644 --- a/Project/GNU/GUI/Makefile.am +++ b/Project/GNU/GUI/Makefile.am @@ -16,6 +16,7 @@ mediainfo_gui_SOURCES = \ ../../../Source/GUI/WxWidgets/GUI_Main_Sheet.cpp \ ../../../Source/GUI/WxWidgets/GUI_Main_Text.cpp \ ../../../Source/GUI/WxWidgets/GUI_Main_Tree.cpp \ + ../../../Source/GUI/WxWidgets/GUI_Preferences.cpp \ ../../../Source/CLI/CommandLine_Parser.cpp \ ../../../Source/CLI/Help.cpp \ ../../../Source/Common/Core.cpp diff --git a/Source/GUI/WxWidgets/GUI_Main.cpp b/Source/GUI/WxWidgets/GUI_Main.cpp index 99eb03157..ca3491f64 100644 --- a/Source/GUI/WxWidgets/GUI_Main.cpp +++ b/Source/GUI/WxWidgets/GUI_Main.cpp @@ -6,6 +6,7 @@ //--------------------------------------------------------------------------- #include "wx/wxprec.h" +#include "wx/preferences.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif @@ -78,6 +79,7 @@ GUI_Main::GUI_Main(int argc, MediaInfoNameSpace::Char** argv_ansi, const wxPoint //GUI View=NULL; + PreferencesEditor=NULL; CenterOnScreen(); //Drag and Drop @@ -232,102 +234,6 @@ GUI_Main::GUI_Main(int argc, MediaInfoNameSpace::Char** argv_ansi, const wxPoint //--------------------------------------------------------------------------- GUI_Main::~GUI_Main() { - - //Save view state - wxConfig *config = new wxConfig(wxT("mediainfo-gui")); - - - wxConfigBase *pConfig = wxConfigBase::Get(); - if ( pConfig == NULL ) - { - return; - } - - bool rememberView; - if ( !pConfig->Read(wxT("rememberView"), &rememberView)) - { - rememberView=1; - pConfig->Write(wxT("/rememberView"), 1); - } - - if (rememberView == 1) - { - enum Core::kind currentView = C->Kind_Get(); - - switch (currentView) - { - case 0: - pConfig->Write(wxT("/View"), wxT("Easy")); - break; - case 1: - pConfig->Write(wxT("/View"), wxT("Sheet")); - break; - case 2: - pConfig->Write(wxT("/View"), wxT("Tree")); - break; - case 3: - pConfig->Write(wxT("/View"), wxT("HTML")); - break; - case 4: - pConfig->Write(wxT("/View"), wxT("Text")); - break; - case 5: - pConfig->Write(wxT("/View"), wxT("XML")); - break; - case 6: - pConfig->Write(wxT("/View"), wxT("JSON")); - break; - case 7: - pConfig->Write(wxT("/View"), wxT("PBCore")); - break; - case 8: - pConfig->Write(wxT("/View"), wxT("PBCore2")); - break; - case 9: - pConfig->Write(wxT("/View"), wxT("reVTMD")); - break; - case 10: - pConfig->Write(wxT("/View"), wxT("MPEG7_Strict")); - break; - case 11: - pConfig->Write(wxT("/View"), wxT("MPEG7_Relaxed")); - break; - case 12: - pConfig->Write(wxT("/View"), wxT("MPEG7_Extended")); - break; - case 13: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_5")); - break; - case 14: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_6")); - break; - case 15: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_8_ps")); - break; - case 16: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_8_sp")); - break; - case 17: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_8_ps_json")); - break; - case 18: - pConfig->Write(wxT("/View"), wxT("EBUCore_1_8_sp_json")); - break; - case 19: - pConfig->Write(wxT("/View"), wxT("FIMS_1_1")); - break; - case 20: - pConfig->Write(wxT("/View"), wxT("FIMS_1_2")); - break; - case 21: - pConfig->Write(wxT("/View"), wxT("FIMS_1_3")); - break; - case 22: - pConfig->Write(wxT("/View"), wxT("NISO_Z39_87")); - break; - } - } - delete C; //C=NULL; delete View; //View=NULL; } diff --git a/Source/GUI/WxWidgets/GUI_Main.h b/Source/GUI/WxWidgets/GUI_Main.h index 1612ac2f0..398f50f47 100644 --- a/Source/GUI/WxWidgets/GUI_Main.h +++ b/Source/GUI/WxWidgets/GUI_Main.h @@ -17,6 +17,7 @@ //--------------------------------------------------------------------------- #include "GUI/Common/GUI_Main_Common_Core.h" +#include "wx/preferences.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- @@ -62,6 +63,7 @@ class GUI_Main : public wxFrame wxMenu* Menu_File_Open; wxMenuItem* Menu_File_Open_Files; wxMenuItem* Menu_File_Open_Directory; + wxMenuItem* Menu_File_Preferences; wxMenuItem* Menu_File_Quit; wxMenu* Menu_View; wxMenuItem* Menu_View_Easy; @@ -105,6 +107,7 @@ class GUI_Main : public wxFrame void Menu_Create(); void OnMenu_File_Open_Files (wxCommandEvent &event); void OnMenu_File_Open_Directory (wxCommandEvent &event); + void OnMenu_File_Preferences (wxCommandEvent &event); void OnMenu_File_Quit (wxCommandEvent &event); void OnMenu_View_Easy (wxCommandEvent &event); void OnMenu_View_Sheet (wxCommandEvent &event); @@ -156,6 +159,8 @@ class GUI_Main : public wxFrame //GUI GUI_Main_Common_Core* View; + wxPreferencesEditor* PreferencesEditor; + //wxWidgets DECLARE_EVENT_TABLE() //Any class wishing to process wxWindows events must use this macro }; diff --git a/Source/GUI/WxWidgets/GUI_Main_Menu.cpp b/Source/GUI/WxWidgets/GUI_Main_Menu.cpp index c0074b95e..a487cdc5a 100644 --- a/Source/GUI/WxWidgets/GUI_Main_Menu.cpp +++ b/Source/GUI/WxWidgets/GUI_Main_Menu.cpp @@ -19,6 +19,7 @@ #include "GUI/WxWidgets/GUI_Main_Tree.h" #include "GUI/WxWidgets/GUI_Main_HTML.h" #include "GUI/WxWidgets/GUI_Main_Text.h" +#include "GUI/WxWidgets/GUI_Preferences.h" #include "Common/Core.h" #include //--------------------------------------------------------------------------- @@ -33,6 +34,7 @@ enum ID_Menu_File_Open, ID_Menu_File_Open_Files, ID_Menu_File_Open_Directory, + ID_Menu_File_Preferences, ID_Menu_File_Quit, ID_Menu_View_Easy, ID_Menu_View_Sheet, @@ -73,6 +75,7 @@ BEGIN_EVENT_TABLE(GUI_Main, wxFrame) //Menu EVT_MENU(ID_Menu_File_Open_Files, GUI_Main::OnMenu_File_Open_Files) EVT_MENU(ID_Menu_File_Open_Directory, GUI_Main::OnMenu_File_Open_Directory) + EVT_MENU(ID_Menu_File_Preferences, GUI_Main::OnMenu_File_Preferences) EVT_MENU(wxID_EXIT, GUI_Main::OnMenu_File_Quit) EVT_MENU(ID_Menu_View_Easy, GUI_Main::OnMenu_View_Easy) EVT_MENU(ID_Menu_View_Sheet, GUI_Main::OnMenu_View_Sheet) @@ -133,6 +136,7 @@ void GUI_Main::Menu_Create() //File Menu_File=new wxMenu; Menu_File->Append(ID_Menu_File_Open, __T("Open"), Menu_File_Open); + Menu_File_Preferences =Menu_File->Append(ID_Menu_File_Preferences, __T("&Preferences")); Menu_File->AppendSeparator(); Menu_File_Quit =Menu_File->Append(wxID_EXIT, __T("E&xit\tAlt-X"), __T("Quit this program")); @@ -222,6 +226,19 @@ void GUI_Main::OnMenu_File_Open_Files(wxCommandEvent& WXUNUSED(event)) View->GUI_Refresh(); } + +//--------------------------------------------------------------------------- +void GUI_Main::OnMenu_File_Preferences(wxCommandEvent& WXUNUSED(event)) +{ + if (!PreferencesEditor) + { + PreferencesEditor=new wxPreferencesEditor(wxT("Preferences")); + PreferencesEditor->AddPage(new GUI_Preferences_Page_General(this)); + } + + PreferencesEditor->Show(this); +} + //--------------------------------------------------------------------------- void GUI_Main::OnMenu_File_Open_Directory(wxCommandEvent& WXUNUSED(event)) { diff --git a/Source/GUI/WxWidgets/GUI_Main_Text.cpp b/Source/GUI/WxWidgets/GUI_Main_Text.cpp index 952b1e306..99e07ab24 100644 --- a/Source/GUI/WxWidgets/GUI_Main_Text.cpp +++ b/Source/GUI/WxWidgets/GUI_Main_Text.cpp @@ -9,6 +9,7 @@ #ifndef WX_PRECOMP #include "wx/wx.h" #endif +#include "wx/config.h" #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -26,12 +27,6 @@ GUI_Main_Text::GUI_Main_Text(Core* Core_, wxWindow* parent) : wxTextCtrl(parent, -1, __T(""), wxPoint(0, 0), wxSize(parent->GetClientSize().GetWidth()-0, parent->GetClientSize().GetHeight()-0), wxTE_READONLY|wxTE_MULTILINE|wxTE_RICH|wxTE_RICH2), GUI_Main_Common_Core(Core_) { - wxFont Font; - Font.SetFamily(wxFONTFAMILY_MODERN); - wxTextAttr Attr; - Attr.SetFont(Font); - SetDefaultStyle(Attr); - //Drag and Drop #if wxUSE_DRAG_AND_DROP && defined(__WXMAC__) SetDropTarget(new FileDrop(C)); @@ -53,6 +48,19 @@ GUI_Main_Text::~GUI_Main_Text() //--------------------------------------------------------------------------- void GUI_Main_Text::GUI_Refresh() { + wxConfigBase* Config=wxConfigBase::Get(); + long TextSize=Config->ReadLong(wxT("/TextSize"), 0); + if (TextSize>(long)wxFONTSIZE_XX_LARGE) + TextSize=0; + + wxFont Font; + Font.SetFamily(wxFONTFAMILY_MODERN); + Font.SetSymbolicSize((wxFontSymbolicSize)TextSize); + + wxTextAttr Attr; + Attr.SetFont(Font); + SetDefaultStyle(Attr); + Clear(); WriteText(C->Inform_Get().c_str()); } diff --git a/Source/GUI/WxWidgets/GUI_Preferences.cpp b/Source/GUI/WxWidgets/GUI_Preferences.cpp new file mode 100644 index 000000000..c410b3896 --- /dev/null +++ b/Source/GUI/WxWidgets/GUI_Preferences.cpp @@ -0,0 +1,211 @@ +/* Copyright (c) MediaArea.net SARL. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license that can + * be found in the License.html file in the root of the source tree. + */ + +//--------------------------------------------------------------------------- +#include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif +#include "wx/config.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif +#include "GUI/WxWidgets/GUI_Preferences.h" +#include "GUI/WxWidgets/GUI_Main.h" + +//--------------------------------------------------------------------------- + +//*************************************************************************** +// GUI_Preference_Panel_General +//*************************************************************************** + +//--------------------------------------------------------------------------- +GUI_Preference_Panel_General::GUI_Preference_Panel_General(wxWindow* Parent, GUI_Main* Main) : wxPanel(Parent), Main(Main) +{ + // Init + wxSizer* Sizer=new wxBoxSizer(wxVERTICAL); + + // Default view + ViewsLabel=new wxStaticText(this, wxID_ANY, wxT("Default view:")); + wxString Views[]= + { + wxT("Easy"), + wxT("Text"), + wxT("HTML"), + wxT("XML"), + wxT("JSON"), + wxT("MPEG-7 (strict)"), + wxT("MPEG-7 (relaxed)"), + wxT("MPEG-7 (extended)"), + wxT("PBCore 1.2"), + wxT("PBCore 2.0"), + wxT("EBUCore 1.5"), + wxT("EBUCore 1.6"), + wxT("EBUCore 1.8 (acq. metadata: parameter then segment)"), + wxT("EBUCore 1.8 (acq. metadata: segment then parameter)"), + wxT("EBUCore 1.8 (acq. metadata: parameter then segment, json output)"), + wxT("EBUCore 1.8 (acq. metadata: segment then parameter, json output)"), + wxT("FIMS 1.1 (beta)"), + wxT("FIMS 1.2 (beta)"), + wxT("NISO Z39.87"), + wxT("reVTMD") + }; + ViewsComboBox=new wxComboBox(this, wxID_ANY, wxT("Select an option"), wxDefaultPosition, + wxDefaultSize, WXSIZEOF(Views), Views, wxCB_READONLY); + ViewsComboBox->Bind(wxEVT_COMBOBOX, &GUI_Preference_Panel_General::ChangeDefaultView, this); + + // Font size + SizesLabel=new wxStaticText(this, wxID_ANY, wxT("Font size for text views:")); + wxString Sizes[]= + { + wxT("Extra small"), + wxT("Very small"), + wxT("Small"), + wxT("Normal"), + wxT("Large"), + wxT("Very large"), + wxT("Extra large") + }; + SizesComboBox=new wxComboBox(this, wxID_ANY, wxT("Select an option"), wxDefaultPosition, + wxDefaultSize, WXSIZEOF(Sizes), Sizes, wxCB_READONLY); + SizesComboBox->Bind(wxEVT_COMBOBOX, &GUI_Preference_Panel_General::ChangeTextSize, this); + + Sizer->Add(ViewsLabel, 0, wxALL | wxALIGN_LEFT, 20); + Sizer->Add(ViewsComboBox, 0, wxALL | wxEXPAND, 20); + Sizer->Add(SizesLabel, 0, wxALL | wxALIGN_LEFT, 20); + Sizer->Add(SizesComboBox, 0, wxALL | wxEXPAND, 20); + SetSizerAndFit(Sizer); +} + +//--------------------------------------------------------------------------- +bool GUI_Preference_Panel_General::TransferDataToWindow() +{ + wxConfigBase* Config=wxConfigBase::Get(); + + wxString View=Config->Read(wxT("/View"), wxT("Easy")); + if (View==wxT("Easy")) + ViewsComboBox->SetSelection(0); + else if (View==wxT("Text")) + ViewsComboBox->SetSelection(1); + else if (View==wxT("HTML")) + ViewsComboBox->SetSelection(2); + else if (View==wxT("XML")) + ViewsComboBox->SetSelection(3); + else if (View==wxT("JSON")) + ViewsComboBox->SetSelection(4); + else if (View==wxT("MPEG7_Strict")) + ViewsComboBox->SetSelection(5); + else if (View==wxT("MPEG7_Relaxed")) + ViewsComboBox->SetSelection(6); + else if (View==wxT("MPEG7_Extended")) + ViewsComboBox->SetSelection(7); + else if (View==wxT("PBCore_1_2")) + ViewsComboBox->SetSelection(8); + else if (View==wxT("PBCore_2_0")) + ViewsComboBox->SetSelection(9); + else if (View==wxT("EBUCore_1_5")) + ViewsComboBox->SetSelection(10); + else if (View==wxT("EBUCore_1_6")) + ViewsComboBox->SetSelection(11); + else if (View==wxT("EBUCore_1_8_ps")) + ViewsComboBox->SetSelection(12); + else if (View==wxT("EBUCore_1_8_sp")) + ViewsComboBox->SetSelection(13); + else if (View==wxT("EBUCore_1_8_ps_json")) + ViewsComboBox->SetSelection(14); + else if (View==wxT("EBUCore_1_8_sp_json")) + ViewsComboBox->SetSelection(15); + else if (View==wxT("FIMS_1_1")) + ViewsComboBox->SetSelection(16); + else if (View==wxT("FIMS_1_2")) + ViewsComboBox->SetSelection(17); + else if (View==wxT("NISO_Z39_87")) + ViewsComboBox->SetSelection(18); + else if (View==wxT("reVTMD")) + ViewsComboBox->SetSelection(19); + else + ViewsComboBox->SetSelection(0); + + long TextSize=Config->ReadLong(wxT("/TextSize"), 0); + if (TextSize+3GetCount()) + SizesComboBox->SetSelection(TextSize+3); + else + SizesComboBox->SetSelection(3); + + return true; +} + +//--------------------------------------------------------------------------- +bool GUI_Preference_Panel_General::TransferDataFromWindow() +{ + wxConfigBase* Config=wxConfigBase::Get(); + if (Config==NULL) + return false; + + switch (ViewsComboBox->GetSelection()) + { + case 0: Config->Write(wxT("/View"), wxT("Easy")); break; + case 1: Config->Write(wxT("/View"), wxT("Text")); break; + case 2: Config->Write(wxT("/View"), wxT("HTML")); break; + case 3: Config->Write(wxT("/View"), wxT("XML")); break; + case 4: Config->Write(wxT("/View"), wxT("JSON")); break; + case 5: Config->Write(wxT("/View"), wxT("MPEG7_Strict")); break; + case 6: Config->Write(wxT("/View"), wxT("MPEG7_Relaxed")); break; + case 7: Config->Write(wxT("/View"), wxT("MPEG7_Extended")); break; + case 8: Config->Write(wxT("/View"), wxT("PBCore_1_2")); break; + case 9: Config->Write(wxT("/View"), wxT("PBCore_2_0")); break; + case 10: Config->Write(wxT("/View"), wxT("EBUCore_1_5")); break; + case 11: Config->Write(wxT("/View"), wxT("EBUCore_1_6")); break; + case 12: Config->Write(wxT("/View"), wxT("EBUCore_1_8_ps")); break; + case 13: Config->Write(wxT("/View"), wxT("EBUCore_1_8_sp")); break; + case 14: Config->Write(wxT("/View"), wxT("EBUCore_1_8_ps_json")); break; + case 15: Config->Write(wxT("/View"), wxT("EBUCore_1_8_sp_json")); break; + case 16: Config->Write(wxT("/View"), wxT("FIMS_1_1")); break; + case 17: Config->Write(wxT("/View"), wxT("FIMS_1_2")); break; + case 18: Config->Write(wxT("/View"), wxT("NISO_Z39_87")); break; + case 19: Config->Write(wxT("/View"), wxT("reVTMD")); break; + default: Config->Write(wxT("/View"), wxT("Easy")); break; + } + + Config->Write(wxT("/TextSize"), SizesComboBox->GetSelection()-3); + Main->View_Refresh(); + + return true; +} + +//--------------------------------------------------------------------------- +void GUI_Preference_Panel_General::UpdateSettingsIfNecessary() +{ + if (wxPreferencesEditor::ShouldApplyChangesImmediately()) + TransferDataFromWindow(); +} + +//--------------------------------------------------------------------------- +void GUI_Preference_Panel_General::ChangeDefaultView(wxCommandEvent&) +{ + UpdateSettingsIfNecessary(); +} + +//--------------------------------------------------------------------------- +void GUI_Preference_Panel_General::ChangeTextSize(wxCommandEvent&) +{ + UpdateSettingsIfNecessary(); +} + +//*************************************************************************** +// GUI_Preferences_Page_General +//*************************************************************************** + +//--------------------------------------------------------------------------- +GUI_Preferences_Page_General::GUI_Preferences_Page_General(GUI_Main* Main) : wxStockPreferencesPage(Kind_General), Main(Main) +{ +} + +//--------------------------------------------------------------------------- +wxWindow* GUI_Preferences_Page_General::CreateWindow(wxWindow* Parent) +{ + return new GUI_Preference_Panel_General(Parent, Main); +} \ No newline at end of file diff --git a/Source/GUI/WxWidgets/GUI_Preferences.h b/Source/GUI/WxWidgets/GUI_Preferences.h new file mode 100644 index 000000000..6b89b88a3 --- /dev/null +++ b/Source/GUI/WxWidgets/GUI_Preferences.h @@ -0,0 +1,68 @@ +/* Copyright (c) MediaArea.net SARL. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license that can + * be found in the License.html file in the root of the source tree. + */ + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// +// WxWidgets GUI for MediaInfo, Preferences Dialog +// +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +//--------------------------------------------------------------------------- +#ifndef GUI_PreferencesH +#define GUI_PreferencesH +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#include "wx/preferences.h" +#include +#include +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +class wxChoice; +class wxComboBox; +class wxStaticText; +class GUI_Main; +//--------------------------------------------------------------------------- + +//*************************************************************************** +// GUI_Preference_Panel_General +//*************************************************************************** + +class GUI_Preference_Panel_General : public wxPanel +{ +public: + GUI_Preference_Panel_General(wxWindow* Parent, GUI_Main* Main); + virtual bool TransferDataToWindow() override; + virtual bool TransferDataFromWindow() override; + +private: + void UpdateSettingsIfNecessary(); + void ChangeDefaultView(wxCommandEvent&); + void ChangeTextSize(wxCommandEvent&); + + GUI_Main* Main; + wxStaticText* ViewsLabel; + wxComboBox* ViewsComboBox; + wxStaticText* SizesLabel; + wxComboBox* SizesComboBox; +}; + +//*************************************************************************** +// GUI_Preferences_Page_General +//*************************************************************************** + +class GUI_Preferences_Page_General : public wxStockPreferencesPage +{ +public: + GUI_Preferences_Page_General(GUI_Main* Main); + virtual wxWindow *CreateWindow(wxWindow* Parent) override; + +private: + GUI_Main* Main; +}; + +#endif