Correct wxStyledTextCtrl::StartStyling for wx 3.1
This commit is contained in:
parent
6ff1729303
commit
93b2794c85
3 changed files with 15 additions and 3 deletions
|
@ -400,7 +400,11 @@ void DialogFontsCollector::OnAddText(ValueEvent<color_str_pair> &event) {
|
||||||
auto const& utf8 = str.second.utf8_str();
|
auto const& utf8 = str.second.utf8_str();
|
||||||
collection_log->AppendTextRaw(utf8.data(), utf8.length());
|
collection_log->AppendTextRaw(utf8.data(), utf8.length());
|
||||||
if (str.first) {
|
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->SetStyling(utf8.length(), str.first);
|
||||||
}
|
}
|
||||||
collection_log->GotoPos(pos + utf8.length());
|
collection_log->GotoPos(pos + utf8.length());
|
||||||
|
|
|
@ -246,7 +246,11 @@ void DialogTranslation::UpdateDisplay() {
|
||||||
int initial_pos = original_text->GetLength();
|
int initial_pos = original_text->GetLength();
|
||||||
original_text->AppendTextRaw(block->GetText().c_str());
|
original_text->AppendTextRaw(block->GetText().c_str());
|
||||||
if (i == cur_block) {
|
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);
|
original_text->SetStyling(block->GetText().size(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,11 @@ void SubsTextEditCtrl::UpdateStyle() {
|
||||||
cursor_pos = -1;
|
cursor_pos = -1;
|
||||||
UpdateCallTip();
|
UpdateCallTip();
|
||||||
|
|
||||||
|
#if wxVERSION_NUMBER >= 3100
|
||||||
|
StartStyling(0);
|
||||||
|
#else
|
||||||
StartStyling(0, 255);
|
StartStyling(0, 255);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
|
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
|
||||||
SetStyling(line_text.size(), 0);
|
SetStyling(line_text.size(), 0);
|
||||||
|
|
Loading…
Reference in a new issue