mirror of https://github.com/odrling/Aegisub
Made wx fall back to wxChoicebook if wxTreebook is unavailable.
Originally committed to SVN as r703.
This commit is contained in:
parent
8d4cdcbd7d
commit
0fec62dfd6
|
@ -66,7 +66,7 @@ BaseGrid::BaseGrid(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wx
|
||||||
holding = false;
|
holding = false;
|
||||||
|
|
||||||
// Set font
|
// Set font
|
||||||
wxString fontname = Options.AsText(_T("Font Face"));
|
wxString fontname = Options.AsText(_T("Grid Font Face"));
|
||||||
if (fontname.IsEmpty()) fontname = _T("Tahoma");
|
if (fontname.IsEmpty()) fontname = _T("Tahoma");
|
||||||
font.SetFaceName(fontname);
|
font.SetFaceName(fontname);
|
||||||
font.SetPointSize(Options.AsInt(_T("Grid font size")));
|
font.SetPointSize(Options.AsInt(_T("Grid font size")));
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "dialog_options.h"
|
#include "dialog_options.h"
|
||||||
#ifdef wxUSE_TREEBOOK
|
#ifdef wxUSE_TREEBOOK
|
||||||
#include <wx/treebook.h>
|
#include <wx/treebook.h>
|
||||||
|
#else
|
||||||
|
#define AddSubPage(a,b,c) AddPage(a,b,c)
|
||||||
#endif
|
#endif
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include <wx/spinctrl.h>
|
#include <wx/spinctrl.h>
|
||||||
|
@ -55,9 +57,8 @@
|
||||||
DialogOptions::DialogOptions(wxWindow *parent)
|
DialogOptions::DialogOptions(wxWindow *parent)
|
||||||
: wxDialog(parent, -1, _T("Options"), wxDefaultPosition, wxDefaultSize)
|
: wxDialog(parent, -1, _T("Options"), wxDefaultPosition, wxDefaultSize)
|
||||||
{
|
{
|
||||||
#ifdef wxUSE_TREEBOOK
|
|
||||||
// Create book
|
// Create book
|
||||||
book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(100,100));
|
book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(400,300));
|
||||||
needsRestart = false;
|
needsRestart = false;
|
||||||
|
|
||||||
// Image list
|
// Image list
|
||||||
|
@ -197,7 +198,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
|
||||||
// Second static box
|
// Second static box
|
||||||
wxControl *control;
|
wxControl *control;
|
||||||
wxString labels2[9] = { _("Normal"), _("Brackets"), _("Slashes and Parentheses"), _("Tags"), _("Parameters") , _("Error"), _("Error Background"), _("Line Break"), _("Modified Background") };
|
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++) {
|
for (int i=0;i<9;i++) {
|
||||||
wxString caption = labels2[i]+_T(": ");
|
wxString caption = labels2[i]+_T(": ");
|
||||||
wxString option = options2[i];
|
wxString option = options2[i];
|
||||||
|
@ -257,7 +258,6 @@ DialogOptions::DialogOptions(wxWindow *parent)
|
||||||
|
|
||||||
// Read
|
// Read
|
||||||
ReadFromOptions();
|
ReadFromOptions();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
#ifdef wxUSE_TREEBOOK
|
#ifdef wxUSE_TREEBOOK
|
||||||
class wxTreebook;
|
class wxTreebook;
|
||||||
#else
|
#else
|
||||||
typedef wxNotebook wxTreebook;
|
#include <wx/choicebk.h>
|
||||||
|
typedef wxChoicebook wxTreebook;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -115,11 +115,11 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetColour(_T("Syntax Highlight Line Break"),wxColour(160,160,160));
|
SetColour(_T("Syntax Highlight Line Break"),wxColour(160,160,160));
|
||||||
SetColour(_T("Edit Box Need Enter Background"),wxColour(192,192,255));
|
SetColour(_T("Edit Box Need Enter Background"),wxColour(192,192,255));
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
SetInt(_T("Font Size"),9);
|
SetInt(_T("Edit Font Size"),9);
|
||||||
#else
|
#else
|
||||||
SetInt(_T("Font Size"),11);
|
SetInt(_T("Edit Font Size"),11);
|
||||||
#endif
|
#endif
|
||||||
SetText(_T("Font Face"),_T(""));
|
SetText(_T("Edit Font Face"),_T(""));
|
||||||
|
|
||||||
// Video Options
|
// Video Options
|
||||||
SetModificationType(MOD_AUTOMATIC);
|
SetModificationType(MOD_AUTOMATIC);
|
||||||
|
@ -198,6 +198,7 @@ void OptionsManager::LoadDefaults() {
|
||||||
#else
|
#else
|
||||||
SetInt(_T("Grid font size"),10);
|
SetInt(_T("Grid font size"),10);
|
||||||
#endif
|
#endif
|
||||||
|
SetText(_T("Grid Font Face"),_T(""));
|
||||||
|
|
||||||
// Audio Cosmetic
|
// Audio Cosmetic
|
||||||
SetInt(_T("Audio Spectrum Cutoff"),32);
|
SetInt(_T("Audio Spectrum Cutoff"),32);
|
||||||
|
|
|
@ -170,9 +170,9 @@ END_EVENT_TABLE()
|
||||||
void SubsTextEditCtrl::SetStyles() {
|
void SubsTextEditCtrl::SetStyles() {
|
||||||
// Styles
|
// Styles
|
||||||
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
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);
|
if (fontname != _T("")) font.SetFaceName(fontname);
|
||||||
int size = Options.AsInt(_T("Font Size"));
|
int size = Options.AsInt(_T("Edit Font Size"));
|
||||||
|
|
||||||
// Normal style
|
// Normal style
|
||||||
StyleSetFont(0,font);
|
StyleSetFont(0,font);
|
||||||
|
|
Loading…
Reference in New Issue