Skip to content

Commit

Permalink
syntax highlight dialog: wrong tab is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Mar 22, 2024
1 parent ef7af3a commit 95aac76
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions LiteEditor/SyntaxHighlightBaseDlg.wxcp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}, {
"type": "bool",
"m_label": "Enable Window Persistency:",
"m_value": false
"m_value": true
}, {
"type": "string",
"m_label": "Title:",
Expand Down Expand Up @@ -448,7 +448,7 @@
}, {
"type": "bool",
"m_label": "Selected",
"m_value": false
"m_value": true
}, {
"type": "bool",
"m_label": "Null Page",
Expand Down
23 changes: 22 additions & 1 deletion LiteEditor/syntaxhighlightbasedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SyntaxHighlightBaseDlg::SyntaxHighlightBaseDlg(wxWindow* parent, wxWindowID id,

m_panelGeneral =
new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL);
m_notebook->AddPage(m_panelGeneral, _("General"), false);
m_notebook->AddPage(m_panelGeneral, _("General"), true);

wxBoxSizer* boxSizer198 = new wxBoxSizer(wxVERTICAL);
m_panelGeneral->SetSizer(boxSizer198);
Expand Down Expand Up @@ -435,6 +435,22 @@ SyntaxHighlightBaseDlg::SyntaxHighlightBaseDlg(wxWindow* parent, wxWindowID id,
m_stdBtnSizer10->AddButton(m_buttonApply);
m_stdBtnSizer10->Realize();

#if wxVERSION_NUMBER >= 2900
if (!wxPersistenceManager::Get().Find(m_notebook)) {
wxPersistenceManager::Get().RegisterAndRestore(m_notebook);
} else {
wxPersistenceManager::Get().Restore(m_notebook);
}
#endif

#if wxVERSION_NUMBER >= 2900
if (!wxPersistenceManager::Get().Find(m_notebook2)) {
wxPersistenceManager::Get().RegisterAndRestore(m_notebook2);
} else {
wxPersistenceManager::Get().Restore(m_notebook2);
}
#endif

SetName(wxT("SyntaxHighlightBaseDlg"));
SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
if (GetSizer()) {
Expand All @@ -445,6 +461,11 @@ SyntaxHighlightBaseDlg::SyntaxHighlightBaseDlg(wxWindow* parent, wxWindowID id,
} else {
CentreOnScreen(wxBOTH);
}
if (!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
// Connect events
m_choiceAppearance->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &SyntaxHighlightBaseDlg::OnCodeLiteAppearance, this);
m_colourPickerSelTextBgColour->Bind(wxEVT_COMMAND_COLOURPICKER_CHANGED, &SyntaxHighlightBaseDlg::OnSelTextChanged,
Expand Down
3 changes: 3 additions & 0 deletions LiteEditor/syntaxhighlightdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ SyntaxHighlightDlg::SyntaxHighlightDlg(wxWindow* parent)
m_choiceAppearance->SetSelection(appearance);
#endif

// Use a default big size for this dialog
::clSetDialogBestSizeAndPosition(this);

// Theme handling
CentreOnParent();
}
Expand Down

0 comments on commit 95aac76

Please sign in to comment.