Correct wxStyledTextCtrl::StartStyling for wx 3.1

This commit is contained in:
Myaamori 2020-11-22 18:17:19 +00:00 committed by Ryan Lucia
parent 6ff1729303
commit 93b2794c85
3 changed files with 15 additions and 3 deletions

View file

@ -400,7 +400,11 @@ void DialogFontsCollector::OnAddText(ValueEvent<color_str_pair> &event) {
auto const& utf8 = str.second.utf8_str();
collection_log->AppendTextRaw(utf8.data(), utf8.length());
if (str.first) {
collection_log->StartStyling(pos, 31);
#if wxVERSION_NUMBER >= 3100
collection_log->StartStyling(pos);
#else
collection_log->StartStyling(pos, 255);
#endif
collection_log->SetStyling(utf8.length(), str.first);
}
collection_log->GotoPos(pos + utf8.length());

View file

@ -246,7 +246,11 @@ void DialogTranslation::UpdateDisplay() {
int initial_pos = original_text->GetLength();
original_text->AppendTextRaw(block->GetText().c_str());
if (i == cur_block) {
original_text->StartStyling(initial_pos, 31);
#if wxVERSION_NUMBER >= 3100
original_text->StartStyling(initial_pos);
#else
original_text->StartStyling(initial_pos, 255);
#endif
original_text->SetStyling(block->GetText().size(), 1);
}
}

View file

@ -261,7 +261,11 @@ void SubsTextEditCtrl::UpdateStyle() {
cursor_pos = -1;
UpdateCallTip();
StartStyling(0,255);
#if wxVERSION_NUMBER >= 3100
StartStyling(0);
#else
StartStyling(0, 255);
#endif
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
SetStyling(line_text.size(), 0);