parent
4f4029a835
commit
287e1b7d89
|
|
@ -4903,7 +4903,6 @@ type tfincodemap = class(tcustomcontrol)
|
||||||
if e.charcode=13 then
|
if e.charcode=13 then
|
||||||
begin
|
begin
|
||||||
et := geteditor();
|
et := geteditor();
|
||||||
echo ">>>enter\r\n";
|
|
||||||
if et then et.SetFocus();
|
if et then et.SetFocus();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ TYPE TMemoLineList=class(tnumindexarray) //
|
||||||
begin
|
begin
|
||||||
if(Flock)then
|
if(Flock)then
|
||||||
begin
|
begin
|
||||||
|
//echo "+++\r\n";
|
||||||
FEdit.UpDateScroll();
|
FEdit.UpDateScroll();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -651,7 +652,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
FIsCaretShow; //光标可见
|
FIsCaretShow; //光标可见
|
||||||
fcaretcreated; //光标已经构造成功
|
fcaretcreated; //光标已经构造成功
|
||||||
fForceCaret;
|
fForceCaret;
|
||||||
fcaretcout; //列选择时候的caret count
|
|
||||||
FCharsInWindow; //
|
FCharsInWindow; //
|
||||||
fTextHeight; //行高
|
fTextHeight; //行高
|
||||||
fLinesInWindow; //能显示的行数
|
fLinesInWindow; //能显示的行数
|
||||||
|
|
@ -839,7 +839,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
r[1]:= RC[1]+fTextHeight * iy;
|
r[1]:= RC[1]+fTextHeight * iy;
|
||||||
iy++;
|
iy++;
|
||||||
r[3]:= r[1]+fTextHeight;
|
r[3]:= r[1]+fTextHeight;
|
||||||
if i+1=fCaretY then //当前行
|
if i+1=fCaretY then
|
||||||
begin
|
begin
|
||||||
if Color<>fcurrentLineColor then
|
if Color<>fcurrentLineColor then
|
||||||
begin
|
begin
|
||||||
|
|
@ -856,19 +856,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
if FSelectionMode=smLine then
|
if FSelectionMode=smLine then
|
||||||
begin
|
begin
|
||||||
end else
|
end else
|
||||||
if FSelectionMode=smColumn then
|
|
||||||
begin
|
|
||||||
a1 := min(bb[1],ee[1]);
|
|
||||||
a2 := max(bb[1],ee[1]);
|
|
||||||
if a1=e2 then
|
|
||||||
begin
|
|
||||||
src := array(0,0,0,0);
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
src[0]+= fCharWidth *(a1-1);
|
|
||||||
src[2]:= src[0]+fCharWidth *(a2-a1);
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
begin
|
begin
|
||||||
if bb[0]=ee[0]then //同一行
|
if bb[0]=ee[0]then //同一行
|
||||||
begin
|
begin
|
||||||
|
|
@ -1255,8 +1242,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end
|
end
|
||||||
if not s then return;
|
if not s then return;
|
||||||
bb := array(fCaretY,fCaretX);
|
bb := array(fCaretY,fCaretX);
|
||||||
r := buffer_InsertChars(bb,ee,s,FSelectionMode);
|
r := buffer_InsertChars(bb,s);
|
||||||
fUndoList.AddChange(crInsert,bb,r,s,FSelectionMode);
|
fUndoList.AddChange(crInsert,bb,r,s,0);
|
||||||
SetCaretXY(r);
|
SetCaretXY(r);
|
||||||
UpdateCaret();
|
UpdateCaret();
|
||||||
memtextchanged(bb);
|
memtextchanged(bb);
|
||||||
|
|
@ -1453,17 +1440,20 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
begin
|
begin
|
||||||
nx := 1;
|
nx := 1;
|
||||||
//////////////20230323 回到非空白行首/////////////////////////////////
|
//////////////20230323 回到非空白行首/////////////////////////////////
|
||||||
s := fLines.GetStringByIndex(fCaretY-1); //[fCaretY-1];
|
if FSelectionMode=smNormal then
|
||||||
if ifstring(s) and s then
|
|
||||||
begin
|
begin
|
||||||
for i := 1 to length(s) do
|
s := fLines.GetStringByIndex(fCaretY-1); //[fCaretY-1];
|
||||||
|
if ifstring(s) and s then
|
||||||
begin
|
begin
|
||||||
vi := s[i];
|
for i := 1 to length(s) do
|
||||||
if vi<>" " or vi="\t" then
|
|
||||||
begin
|
begin
|
||||||
nx := i;
|
vi := s[i];
|
||||||
if fCaretX = nx then nx := 1;
|
if vi<>" " or vi="\t" then
|
||||||
break;
|
begin
|
||||||
|
nx := i;
|
||||||
|
if fCaretX = nx then nx := 1;
|
||||||
|
break;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1596,7 +1586,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
begin
|
begin
|
||||||
if not(ifarray(p2)and ifarray(p1)and p2[0]>= 1 and p2[1]>= 1)then return;
|
if not(ifarray(p2)and ifarray(p1)and p2[0]>= 1 and p2[1]>= 1)then return;
|
||||||
SetCaretXY(p2);
|
SetCaretXY(p2);
|
||||||
|
|
||||||
IncPaintLock();
|
IncPaintLock();
|
||||||
if Sel then
|
if Sel then
|
||||||
begin
|
begin
|
||||||
|
|
@ -1615,21 +1604,10 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
ed := GetBlockEnd()[0];
|
ed := GetBlockEnd()[0];
|
||||||
InvalidateLines(bg,ed);
|
InvalidateLines(bg,ed);
|
||||||
end
|
end
|
||||||
if FSelectionMode=smColumn then
|
fBlockBegin := CaretXY;
|
||||||
begin
|
fBlockEnd := CaretXY;
|
||||||
if fBlockBegin then fBlockBegin[1] := caretxy[1];
|
|
||||||
fBlockEnd := CaretXY;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
fBlockBegin := CaretXY;
|
|
||||||
fBlockEnd := CaretXY;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if FSelectionMode=smColumn and P2[0]<>P1[0] then
|
UpDateCaret();
|
||||||
begin
|
|
||||||
ReCreateCaret();
|
|
||||||
end else
|
|
||||||
UpDateCaret();
|
|
||||||
DecPaintLock();
|
DecPaintLock();
|
||||||
end
|
end
|
||||||
published
|
published
|
||||||
|
|
@ -1677,7 +1655,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
begin
|
begin
|
||||||
if fCaretX >= fLeftChar and(fCaretX<fCharsInWindow+fLeftChar)and FTopLine <= fCaretY and fCaretY<FTopLine+fLinesInWindow then
|
if fCaretX >= fLeftChar and(fCaretX<fCharsInWindow+fLeftChar)and FTopLine <= fCaretY and fCaretY<FTopLine+fLinesInWindow then
|
||||||
begin
|
begin
|
||||||
_wapi.SetCaretPos(FGutter.Width+FCharWidth *(FCaretX-FLeftChar),(fTextHeight *(fCaretY-FTopLine-((FSelectionMode=smColumn)?(fcaretcout-1):0))+3));
|
_wapi.SetCaretPos(FGutter.Width+FCharWidth *(FCaretX-FLeftChar),(fTextHeight *(fCaretY-FTopLine)+3));
|
||||||
//_wapi.ShowCaret(self.Handle);
|
//_wapi.ShowCaret(self.Handle);
|
||||||
if not FIsCaretShow then
|
if not FIsCaretShow then
|
||||||
begin
|
begin
|
||||||
|
|
@ -1912,7 +1890,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
begin
|
begin
|
||||||
fBlockEnd := array(len,1+fLines[len-1].StrLength());
|
fBlockEnd := array(len,1+fLines[len-1].StrLength());
|
||||||
InvalidateRect(nil,false);
|
InvalidateRect(nil,false);
|
||||||
end
|
end else
|
||||||
end
|
end
|
||||||
function CopyToClipboard(); //复制选择
|
function CopyToClipboard(); //复制选择
|
||||||
begin
|
begin
|
||||||
|
|
@ -1945,7 +1923,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end
|
end
|
||||||
function SetSelectionMode(v);
|
function SetSelectionMode(v);
|
||||||
begin
|
begin
|
||||||
if(v <> FSelectionMode)and(v in array(smNormal,smLine,smColumn))then FSelectionMode := v;
|
if(v <> FSelectionMode)and(v in array(smNormal,smLine))then FSelectionMode := v;
|
||||||
end
|
end
|
||||||
function MoveCaretHorz(stp,sel);
|
function MoveCaretHorz(stp,sel);
|
||||||
begin
|
begin
|
||||||
|
|
@ -2022,15 +2000,9 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
crDelete:
|
crDelete:
|
||||||
begin
|
begin
|
||||||
//插入
|
//插入
|
||||||
if item.FSelMode = smColumn then
|
SetCaretXY(item.FStartPos);
|
||||||
begin
|
InsertChars(item.FStr);
|
||||||
|
//echo tostn(item);
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
SetCaretXY(item.FStartPos);
|
|
||||||
InsertChars(item.FStr);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -2250,7 +2222,42 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
if not GetSelAvail()then return r;
|
if not GetSelAvail()then return r;
|
||||||
bb := GetBlockBegin();
|
bb := GetBlockBegin();
|
||||||
ee := GetBlockEnd();
|
ee := GetBlockEnd();
|
||||||
r := buffer_getchars(bb,ee,FSelectionMode);
|
if FSelectionMode=smLine then
|
||||||
|
begin
|
||||||
|
len := ee[0];
|
||||||
|
for i := bb[0]to ee[0] do
|
||||||
|
begin
|
||||||
|
r += fLines[i-1].FStr;
|
||||||
|
if i<len then r += "\r\n";
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if bb[0]=ee[0]then
|
||||||
|
begin
|
||||||
|
s := fLines[bb[0]-1].FStr;
|
||||||
|
if ee[1]>bb[1]and ee[1]>1 then
|
||||||
|
try
|
||||||
|
r := s[bb[1]:ee[1]-1]; //可能出错,添加try
|
||||||
|
except
|
||||||
|
r := "";
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//第一行
|
||||||
|
s := fLines[bb[0]-1].FStr;
|
||||||
|
if bb[1]<= length(s)then r += s[bb[1]:];
|
||||||
|
r += "\r\n";
|
||||||
|
//中间
|
||||||
|
for i := bb[0]to ee[0]-2 do
|
||||||
|
begin
|
||||||
|
r += fLines[i].FStr;
|
||||||
|
r += "\r\n";
|
||||||
|
end
|
||||||
|
//最后一行
|
||||||
|
s := fLines[ee[0]-1].FStr;
|
||||||
|
if s and ee[1]>1 then r += s[1:ee[1]-1];
|
||||||
|
end
|
||||||
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function SetCaretX(cx);
|
function SetCaretX(cx);
|
||||||
|
|
@ -2285,9 +2292,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end
|
end
|
||||||
function GetSelAvail();
|
function GetSelAvail();
|
||||||
begin
|
begin
|
||||||
r := fBlockBegin <> fBlockEnd and fBlockBegin and fBlockEnd;
|
return fBlockBegin <> fBlockEnd and fBlockBegin and fBlockEnd;
|
||||||
if FSelectionMode=smColumn then return fBlockBegin[1]<>fBlockEnd[1];
|
|
||||||
return r;
|
|
||||||
end
|
end
|
||||||
function SelectNextChar(); //选取后一个字符
|
function SelectNextChar(); //选取后一个字符
|
||||||
begin
|
begin
|
||||||
|
|
@ -2325,7 +2330,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end else
|
end else
|
||||||
if fCaretY>1 then
|
if fCaretY>1 then
|
||||||
begin
|
begin
|
||||||
//if FSelectionMode=smColumn then return ;
|
|
||||||
s := fLines.GetStringByIndex(fCaretY-2);
|
s := fLines.GetStringByIndex(fCaretY-2);
|
||||||
fBlockEnd := array(CaretY-1,length(s)+1);
|
fBlockEnd := array(CaretY-1,length(s)+1);
|
||||||
end
|
end
|
||||||
|
|
@ -2338,15 +2342,27 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
IncPaintLock();
|
IncPaintLock();
|
||||||
ee := GetBlockEnd();
|
ee := GetBlockEnd();
|
||||||
bb := DeleteSel();
|
bb := DeleteSel();
|
||||||
|
up := false;
|
||||||
|
if bb[0]=ee[0]then
|
||||||
|
begin
|
||||||
|
//InvalidateLines(bb[0],bb[0]);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
up := true;
|
||||||
|
end
|
||||||
if v then
|
if v then
|
||||||
begin
|
begin
|
||||||
bb2 := buffer_InsertChars(bb,ee,v,FSelectionMode);
|
bb2 := buffer_InsertChars(bb,v);
|
||||||
fUndoList.AddChange(crInsert,bb,bb2,v,FSelectionMode);
|
fUndoList.AddChange(crInsert,bb,bb2,v,0);
|
||||||
fUndoList.MergeReplaceItem();
|
fUndoList.MergeReplaceItem();
|
||||||
fBlockEnd := bb2;
|
fBlockEnd := bb2;
|
||||||
|
if bb2[0]<> bb[0]then up := true;
|
||||||
end else
|
end else
|
||||||
bb2 := bb;
|
bb2 := bb;
|
||||||
ExecuteCommand(ecGotoXY,bb2);
|
ExecuteCommand(ecGotoXY,bb2);
|
||||||
|
//SetCaretXY(bb2);
|
||||||
|
//if up then UpDateScroll();
|
||||||
|
//UpDateCaret();
|
||||||
DecPaintLock();
|
DecPaintLock();
|
||||||
memtextchanged(bb);
|
memtextchanged(bb);
|
||||||
end
|
end
|
||||||
|
|
@ -2357,13 +2373,13 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
if not GetSelAvail()then return 0;
|
if not GetSelAvail()then return 0;
|
||||||
bb := GetBlockBegin();
|
bb := GetBlockBegin();
|
||||||
ee := GetBlockEnd();
|
ee := GetBlockEnd();
|
||||||
if FSelectionMode= smLine then
|
if FSelectionMode=smLine then
|
||||||
begin
|
begin
|
||||||
bb[1]:= 1;
|
bb[1]:= 1;
|
||||||
ee[1]:= fLines[ee[0]-1].StrLength()+1;
|
ee[1]:= fLines[ee[0]-1].StrLength()+1;
|
||||||
end
|
end
|
||||||
fUndoList.AddChange(crDelete,bb,ee,GetSelText(),FSelectionMode);
|
fUndoList.AddChange(crDelete,bb,ee,GetSelText(),0);
|
||||||
buffer_DeleteChars(bb,ee,FSelectionMode);
|
buffer_DeleteChars(bb,ee);
|
||||||
fBlockBegin := fBlockEnd := bb;
|
fBlockBegin := fBlockEnd := bb;
|
||||||
return bb;
|
return bb;
|
||||||
end
|
end
|
||||||
|
|
@ -2409,14 +2425,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
if FReadOnly then return;
|
if FReadOnly then return;
|
||||||
if fcaretcreated then return;
|
if fcaretcreated then return;
|
||||||
h := Font.Height;
|
h := Font.Height;
|
||||||
if FSelectionMode=smColumn then
|
|
||||||
begin
|
|
||||||
if fBlockBegin and fBlockEnd then
|
|
||||||
begin
|
|
||||||
fcaretcout := max(abs(fBlockBegin[0]-fBlockEnd[0])+1,1);
|
|
||||||
if fcaretcout>1 then h := fTextHeight*fcaretcout;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
hd := Handle;
|
hd := Handle;
|
||||||
_wapi.CreateCaret(hd,nil,1,h);
|
_wapi.CreateCaret(hd,nil,1,h);
|
||||||
_wapi.ShowCaret(hd);
|
_wapi.ShowCaret(hd);
|
||||||
|
|
@ -2434,142 +2442,28 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end
|
end
|
||||||
FHasFocus;
|
FHasFocus;
|
||||||
//buffer 处理
|
//buffer 处理
|
||||||
function buffer_getchars(bb,ee,sm);//获得
|
function buffer_DeleteChars(bb,ee); //删除选择
|
||||||
begin
|
|
||||||
r := "";
|
|
||||||
case FSelectionMode of
|
|
||||||
smLine:
|
|
||||||
begin
|
|
||||||
for i := bb[0] to ee[0] do
|
|
||||||
begin
|
|
||||||
r += fLines[i-1].FStr;
|
|
||||||
r += "\r\n";
|
|
||||||
end
|
|
||||||
end
|
|
||||||
smColumn:
|
|
||||||
begin
|
|
||||||
len := ee[0];
|
|
||||||
a1 := min(bb[1],ee[1]);
|
|
||||||
a2 := max(bb[1],ee[1]);
|
|
||||||
if a1=a2 then return r;
|
|
||||||
for i := bb[0] to ee[0] do
|
|
||||||
begin
|
|
||||||
ri := fLines[i-1].FStr;
|
|
||||||
lri := length(ri);
|
|
||||||
a22 := min(a2-1,lri);
|
|
||||||
if lri then
|
|
||||||
begin
|
|
||||||
if bytetype(ri,a1)=2 then
|
|
||||||
begin
|
|
||||||
a11 := a1+1;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
a11 := a1;
|
|
||||||
end
|
|
||||||
if bytetype(ri,a22)=1 then
|
|
||||||
begin
|
|
||||||
a22-=1;
|
|
||||||
end
|
|
||||||
if a11<=a22 then r+=ri[a11:a22];
|
|
||||||
end
|
|
||||||
if i<len then r += "\r\n";
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if bb[0]=ee[0]then
|
|
||||||
begin
|
|
||||||
s := fLines[bb[0]-1].FStr;
|
|
||||||
if ee[1]>bb[1]and ee[1]>1 then
|
|
||||||
try
|
|
||||||
r := s[bb[1]:ee[1]-1]; //可能出错,添加try
|
|
||||||
except
|
|
||||||
r := "";
|
|
||||||
end;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
//第一行
|
|
||||||
s := fLines[bb[0]-1].FStr;
|
|
||||||
if bb[1]<= length(s)then r += s[bb[1]:];
|
|
||||||
r += "\r\n";
|
|
||||||
//中间
|
|
||||||
for i := bb[0]to ee[0]-2 do
|
|
||||||
begin
|
|
||||||
r += fLines[i].FStr;
|
|
||||||
r += "\r\n";
|
|
||||||
end
|
|
||||||
//最后一行
|
|
||||||
s := fLines[ee[0]-1].FStr;
|
|
||||||
if s and ee[1]>1 then r += s[1:ee[1]-1];
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
return r;
|
|
||||||
end
|
|
||||||
function buffer_DeleteChars(bb,ee,sm); //删除选择
|
|
||||||
begin
|
begin
|
||||||
if bb=ee then return;
|
if bb=ee then return;
|
||||||
case sm of
|
if bb[0]=ee[0]then //删除一行中的
|
||||||
smLine:
|
begin
|
||||||
begin
|
str := fLines.GetStringByIndex(bb[0]-1);
|
||||||
fLines.splices(bb[0]-1,max(1,ee[0]-bb[0]+1),array());
|
str[bb[1]:ee[1]-1]:= "";
|
||||||
end
|
fLines.SetValueByIndex(bb[0]-1,str);
|
||||||
smColumn:
|
end else //多行
|
||||||
begin
|
begin
|
||||||
a1 := min(bb[1],ee[1]);
|
//删除后半
|
||||||
a2 := max(bb[1],ee[1]);
|
str := fLines.GetStringByIndex(bb[0]-1);
|
||||||
if a1=a2 then return r;
|
if str and length(str)>= bb[1]then str[bb[1]:]:= "";
|
||||||
for i := bb[0] to ee[0] do
|
//删除前半
|
||||||
begin
|
str2 := fLines.GetStringByIndex(ee[0]-1);
|
||||||
ri := fLines.GetStringByIndex(i-1);
|
if ee[1]>1 and str2 then str2[1:ee[1]-1]:= "";
|
||||||
lri := length(ri);
|
fLines.SetValueByIndex(bb[0]-1,str+str2);
|
||||||
a22 := min(a2-1,lri);
|
//删除中间
|
||||||
if lri then
|
fLines.splices(bb[0],ee[0]-bb[0],array());
|
||||||
begin
|
|
||||||
if bytetype(ri,a1)=2 then
|
|
||||||
begin
|
|
||||||
a11 := a1+1;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
a11 := a1;
|
|
||||||
end
|
|
||||||
if bytetype(ri,a22)=1 then
|
|
||||||
begin
|
|
||||||
a22-=1;
|
|
||||||
end
|
|
||||||
if a11<=a22 then
|
|
||||||
begin
|
|
||||||
ri[a11:a22]:="";
|
|
||||||
fLines.SetValueByIndex(i-1,ri);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
smNormal:
|
|
||||||
begin
|
|
||||||
if bb[0]=ee[0]then //删除一行中的
|
|
||||||
begin
|
|
||||||
str := fLines.GetStringByIndex(bb[0]-1);
|
|
||||||
str[bb[1]:ee[1]-1]:= "";
|
|
||||||
fLines.SetValueByIndex(bb[0]-1,str);
|
|
||||||
end else //多行
|
|
||||||
begin
|
|
||||||
//删除后半
|
|
||||||
str := fLines.GetStringByIndex(bb[0]-1);
|
|
||||||
if str and length(str)>= bb[1]then str[bb[1]:]:= "";
|
|
||||||
//删除前半
|
|
||||||
str2 := fLines.GetStringByIndex(ee[0]-1);
|
|
||||||
if ee[1]>1 and str2 then str2[1:ee[1]-1]:= "";
|
|
||||||
fLines.SetValueByIndex(bb[0]-1,str+str2);
|
|
||||||
//删除中间
|
|
||||||
fLines.splices(bb[0],ee[0]-bb[0],array());
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function buffer_InsertChars(cxy,ee,str,sm); //插入
|
function buffer_InsertChars(cxy,str); //插入
|
||||||
begin
|
begin
|
||||||
if not(ifstring(str)and str)then return;
|
if not(ifstring(str)and str)then return;
|
||||||
ss := str2array(str,"\n");
|
ss := str2array(str,"\n");
|
||||||
|
|
|
||||||
|
|
@ -2407,8 +2407,6 @@ type cef_life_span_handler_t=class(cef_contain_base)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI thread before a new popup browser is created. The
|
/// Called on the UI thread before a new popup browser is created. The
|
||||||
/// |browser| and |frame| values represent the source of the popup request.
|
/// |browser| and |frame| values represent the source of the popup request.
|
||||||
|
|
@ -3743,6 +3741,35 @@ type cef_request_context_t=class(cef_contain_base)
|
||||||
//property get_extension index "get_extension" read _getvalue_ write _setvalue_;
|
//property get_extension index "get_extension" read _getvalue_ write _setvalue_;
|
||||||
//property get_media_router index "get_media_router" read _getvalue_ write _setvalue_;
|
//property get_media_router index "get_media_router" read _getvalue_ write _setvalue_;
|
||||||
end
|
end
|
||||||
|
type cef_domvisitor_t=class(cef_contain_base)
|
||||||
|
private
|
||||||
|
function structdescribe();override;
|
||||||
|
begin
|
||||||
|
return array(
|
||||||
|
("base","user",getbasestruct()),
|
||||||
|
("visit","intptr",0));
|
||||||
|
end
|
||||||
|
public
|
||||||
|
function create(ptr)
|
||||||
|
begin
|
||||||
|
inherited ;
|
||||||
|
end
|
||||||
|
///
|
||||||
|
/// Method executed for visiting the DOM. The document object passed to this
|
||||||
|
/// function represents a snapshot of the DOM at the time this function is
|
||||||
|
/// executed. DOM objects are only valid for the scope of this function. Do
|
||||||
|
/// not keep references to or attempt to access any DOM objects outside the
|
||||||
|
/// scope of this function.
|
||||||
|
property visit read getcallpropertybyindex write setcallpropertybyindex;
|
||||||
|
procedure visit_i(sf:pointer;dom:pointer);stdcall;
|
||||||
|
begin
|
||||||
|
c := getcallback(functionname());
|
||||||
|
if c then
|
||||||
|
begin
|
||||||
|
call(c,self(true),cef_object_get( dom,class(cef_domdocument_t)));
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
type cef_cookie_visitor_t=class(cef_contain_base)
|
type cef_cookie_visitor_t=class(cef_contain_base)
|
||||||
private
|
private
|
||||||
function structdescribe();override;
|
function structdescribe();override;
|
||||||
|
|
@ -3902,6 +3929,7 @@ type cef_delete_cookies_callback_t=class(cef_set_cookie_callback_t)
|
||||||
if c then call(c,self(true),success);
|
if c then call(c,self(true),success);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
type cef_cookie_t=class(cef_contain_base)
|
type cef_cookie_t=class(cef_contain_base)
|
||||||
private
|
private
|
||||||
function structdescribe();override;
|
function structdescribe();override;
|
||||||
|
|
@ -5395,7 +5423,7 @@ begin
|
||||||
end
|
end
|
||||||
procedure cef_run_message_loop();external "libcef.dll" name "cef_run_message_loop";
|
procedure cef_run_message_loop();external "libcef.dll" name "cef_run_message_loop";
|
||||||
procedure cef_do_message_loop_work();external "libcef.dll" name "cef_do_message_loop_work";
|
procedure cef_do_message_loop_work();external "libcef.dll" name "cef_do_message_loop_work";
|
||||||
function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;cdecl;external "libcef.dll" name "cef_execute_process";
|
function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;cdecl;external "libcef.dll" name "cef_execute_process";
|
||||||
|
|
||||||
|
|
||||||
function getcefboundsstruct();
|
function getcefboundsstruct();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue