From 0fec62dfd6451eccaa070a332684d9028361900b Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Wed, 3 Jan 2007 22:43:05 +0000 Subject: [PATCH] Made wx fall back to wxChoicebook if wxTreebook is unavailable. Originally committed to SVN as r703. --- aegisub/base_grid.cpp | 2 +- aegisub/dialog_options.cpp | 8 ++++---- aegisub/dialog_options.h | 3 ++- aegisub/options.cpp | 7 ++++--- aegisub/subs_edit_ctrl.cpp | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/aegisub/base_grid.cpp b/aegisub/base_grid.cpp index e0e084670..312db9d06 100644 --- a/aegisub/base_grid.cpp +++ b/aegisub/base_grid.cpp @@ -66,7 +66,7 @@ BaseGrid::BaseGrid(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wx holding = false; // Set font - wxString fontname = Options.AsText(_T("Font Face")); + wxString fontname = Options.AsText(_T("Grid Font Face")); if (fontname.IsEmpty()) fontname = _T("Tahoma"); font.SetFaceName(fontname); font.SetPointSize(Options.AsInt(_T("Grid font size"))); diff --git a/aegisub/dialog_options.cpp b/aegisub/dialog_options.cpp index 91af392f5..db3d26485 100644 --- a/aegisub/dialog_options.cpp +++ b/aegisub/dialog_options.cpp @@ -39,6 +39,8 @@ #include "dialog_options.h" #ifdef wxUSE_TREEBOOK #include +#else +#define AddSubPage(a,b,c) AddPage(a,b,c) #endif #include "options.h" #include @@ -55,9 +57,8 @@ DialogOptions::DialogOptions(wxWindow *parent) : wxDialog(parent, -1, _T("Options"), wxDefaultPosition, wxDefaultSize) { -#ifdef wxUSE_TREEBOOK // Create book - book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(100,100)); + book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(400,300)); needsRestart = false; // Image list @@ -197,7 +198,7 @@ DialogOptions::DialogOptions(wxWindow *parent) // Second static box wxControl *control; wxString labels2[9] = { _("Normal"), _("Brackets"), _("Slashes and Parentheses"), _("Tags"), _("Parameters") , _("Error"), _("Error Background"), _("Line Break"), _("Modified Background") }; - wxString options2[11] = { _T("Normal"), _T("Brackets"), _T("Slashes"), _T("Tags"), _T("Parameters") , _T("Error"), _T("Error Background"), _T("Line Break"), _T("Edit box need enter background"), _T("Font Face"), _T("Font Size") }; + wxString options2[11] = { _T("Normal"), _T("Brackets"), _T("Slashes"), _T("Tags"), _T("Parameters") , _T("Error"), _T("Error Background"), _T("Line Break"), _T("Edit box need enter background"), _T("Edit Font Face"), _T("Edit Font Size") }; for (int i=0;i<9;i++) { wxString caption = labels2[i]+_T(": "); wxString option = options2[i]; @@ -257,7 +258,6 @@ DialogOptions::DialogOptions(wxWindow *parent) // Read ReadFromOptions(); -#endif } diff --git a/aegisub/dialog_options.h b/aegisub/dialog_options.h index 6a30efb62..e4fdcc853 100644 --- a/aegisub/dialog_options.h +++ b/aegisub/dialog_options.h @@ -49,7 +49,8 @@ #ifdef wxUSE_TREEBOOK class wxTreebook; #else -typedef wxNotebook wxTreebook; +#include +typedef wxChoicebook wxTreebook; #endif diff --git a/aegisub/options.cpp b/aegisub/options.cpp index e465603bd..0f7b1e35b 100644 --- a/aegisub/options.cpp +++ b/aegisub/options.cpp @@ -115,11 +115,11 @@ void OptionsManager::LoadDefaults() { SetColour(_T("Syntax Highlight Line Break"),wxColour(160,160,160)); SetColour(_T("Edit Box Need Enter Background"),wxColour(192,192,255)); #if defined(__WINDOWS__) - SetInt(_T("Font Size"),9); + SetInt(_T("Edit Font Size"),9); #else - SetInt(_T("Font Size"),11); + SetInt(_T("Edit Font Size"),11); #endif - SetText(_T("Font Face"),_T("")); + SetText(_T("Edit Font Face"),_T("")); // Video Options SetModificationType(MOD_AUTOMATIC); @@ -198,6 +198,7 @@ void OptionsManager::LoadDefaults() { #else SetInt(_T("Grid font size"),10); #endif + SetText(_T("Grid Font Face"),_T("")); // Audio Cosmetic SetInt(_T("Audio Spectrum Cutoff"),32); diff --git a/aegisub/subs_edit_ctrl.cpp b/aegisub/subs_edit_ctrl.cpp index c3182ad45..2695a9c3f 100644 --- a/aegisub/subs_edit_ctrl.cpp +++ b/aegisub/subs_edit_ctrl.cpp @@ -170,9 +170,9 @@ END_EVENT_TABLE() void SubsTextEditCtrl::SetStyles() { // Styles wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - wxString fontname = Options.AsText(_T("Font Face")); + wxString fontname = Options.AsText(_T("Edit Font Face")); if (fontname != _T("")) font.SetFaceName(fontname); - int size = Options.AsInt(_T("Font Size")); + int size = Options.AsInt(_T("Edit Font Size")); // Normal style StyleSetFont(0,font);