From d45725ab829fa5cab0b98b3d114ce38cd50f2a1b Mon Sep 17 00:00:00 2001 From: lsv Date: Thu, 7 May 2026 13:53:41 +0500 Subject: [PATCH] Copy bookmark selection. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Выделеные Ctrl+B фрагменты текста теперь копируются в виде выделеного желтым фоновым цветом. --- ctl/ctlSQLBox.cpp | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 7f9fdc7..0e07056 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -1822,7 +1822,7 @@ wxString ctlSQLBox::TextToHtml(int start, int end,bool isAddNewLine, const std:: int lenstr = selText.Length(); //str = wxT("
"); str.Alloc(lenstr*2); - str = wxString::Format("
", fontName, sz, fontName); + str = wxString::Format("
", fontName, sz); int k = 0; int l = 1; wxString newline = "
"; @@ -1836,14 +1836,48 @@ wxString ctlSQLBox::TextToHtml(int start, int end,bool isAddNewLine, const std:: int lenobj; if (listobj.size()>0) {pos=listobj[IndexObj].startIndex; obj=listobj[IndexObj].table;lenobj=obj.Len();} wxString lstr; + wxString bgclr=""; + // find Indicator bookmark + int spos=-1; + int epos=-1; + int tmppos=0; + int textlen=GetTextLength(); + while (tmppos0 && tmppos!=textlen) { + spos=tmppos; + epos=IndicatorEnd(9,tmppos); + if (epos>=start) break; + tmppos=epos; + spos=epos=-1; + } else break; + } + bool refreshgbcolor=false; while (k=spos && spos!=-1) { + refreshgbcolor=true; + bgclr="#ffff00"; + tmppos=IndicatorEnd(9,epos); + if (tmppos==textlen) spos=-1; + else spos=tmppos; + } else if (startp>=epos && epos!=-1) { + bgclr=""; + refreshgbcolor=true; + tmppos=IndicatorEnd(9,spos); + if (tmppos==textlen) epos=-1; + else epos=tmppos; + } + if (prevColor != tColor || refreshgbcolor) { + str+= wxT("
"); - prevColor = tColor; + if (prevColor != tColor) prevColor = tColor; + refreshgbcolor=false; } //str.append(str[k].GetValue()); wxUniChar c = selText[k];