编辑器

优化代码树
This commit is contained in:
JianjunLiu 2023-03-27 14:03:35 +08:00
parent 0237f14153
commit ba333fba1f
3 changed files with 37 additions and 3 deletions

View File

@ -4899,6 +4899,10 @@ type tfincodemap = class(tcustomcontrol)
end end
function caretchanged(y); function caretchanged(y);
begin begin
if y>=fcaretya and y<fcaretyb then //¼Ç¼λÖüõÉÙ¼ÆËã
begin
return ;
end
if fisloading then return ; if fisloading then return ;
fissetnode := true; fissetnode := true;
GoToTheNode(y); GoToTheNode(y);
@ -4989,7 +4993,9 @@ type tfincodemap = class(tcustomcontrol)
FString := s; FString := s;
flistv := getblocktypes(); flistv := getblocktypes();
if s then r := tsl_tokenizeex_2_(s,flistv); if s then r := tsl_tokenizeex_2_(s,flistv);
else r := array(); else r := array();
fcaretya := -1;
fcaretyb := -1;
fisloading := true; fisloading := true;
nd.RecyclingChildren(); nd.RecyclingChildren();
FTempNodes := array(); FTempNodes := array();
@ -5024,13 +5030,21 @@ type tfincodemap = class(tcustomcontrol)
if v._tag <= line then if v._tag <= line then
begin begin
nd := v; nd := v;
fcaretya := v._tag;
end else end else
if v._tag >= Line then if v._tag >= Line then
begin begin
FTree.SetSel(nd); FTree.SetSel(nd);
break; fcaretyb := v._tag;
return ;
//break;
end end
end end
if nd and nd._Tag<=line then
begin
FTree.SetSel(nd);
fcaretyb := line;
end
end end
function ScriptDelBlocks(blcks,strs,Node,ct); function ScriptDelBlocks(blcks,strs,Node,ct);
begin begin
@ -5143,6 +5157,8 @@ EA5E0BB7C5850E4063EDA83420076B5E10000000049454E44AE42608200";
Ftimer; Ftimer;
Ftimer2; Ftimer2;
FString; FString;
fcaretya; //¿ªÊ¼Î»ÖüǼ
fcaretyb; //½ØÖ¹Î»ÖüǼ
end end
(* (*
type TTslCodeMap=class(TTreeView) //tsl´úÂëµØÍ¼ type TTslCodeMap=class(TTreeView) //tsl´úÂëµØÍ¼

View File

@ -433,7 +433,7 @@ type tcontrol = class(tcomponent)
begin begin
r := new TMMEASUREITEM(message,wparam,lparam,hwnd); r := new TMMEASUREITEM(message,wparam,lparam,hwnd);
end else end else
if message in array(WM_KEYDOWN,WM_KEYUP,WM_CHAR,WM_SYSKEYDOWN,WM_SYSKEYUP)THEN if message in array(WM_KEYDOWN,WM_KEYUP,WM_CHAR,WM_SYSCHAR,WM_SYSKEYDOWN,WM_SYSKEYUP)THEN
begin begin
r := new TMKEY(message,wparam,lparam,hwnd); r := new TMKEY(message,wparam,lparam,hwnd);
end else end else

View File

@ -47,6 +47,9 @@ type TWinControl = class(tcontrol)
FOnActivate; FOnActivate;
FOnKeyDown; FOnKeyDown;
FOnKeyPress; FOnKeyPress;
fonsyskeydown;
fonsyskeyup;
FOnSysKeyPress;
FOnKeyUp; FOnKeyUp;
factivecontrol; factivecontrol;
autoref autoref
@ -1173,6 +1176,18 @@ type TWinControl = class(tcontrol)
CallMessgeFunction(FOnKeyUp,o,e); CallMessgeFunction(FOnKeyUp,o,e);
keyup(o,e); keyup(o,e);
end end
function WMSYSKEYUP(o,e):WM_SYSKEYUP;virtual;
begin
CallMessgeFunction(fonsyskeyup,o,e);
end
function WMSYSKEYDOWN(o,e):WM_SYSKEYDOWN;virtual;
begin
CallMessgeFunction(fonsyskeydown,o,e);
end
function WMSYSCHAR(o,e):WM_SYSCHAR;virtual;
begin
CallMessgeFunction(FOnSysKeyPress,o,e);
end
function WMCHAR(o,e):WM_CHAR;virtual; function WMCHAR(o,e):WM_CHAR;virtual;
begin begin
CallMessgeFunction(FOnKeyPress,o,e); CallMessgeFunction(FOnKeyPress,o,e);
@ -2574,8 +2589,11 @@ type TWinControl = class(tcontrol)
property OnActivate:eventhandler read FOnActivate write FOnActivate; property OnActivate:eventhandler read FOnActivate write FOnActivate;
property OnClose:eventhandler read FOnClose write FOnClose; property OnClose:eventhandler read FOnClose write FOnClose;
property OnKeyDown:eventhandler read FOnKeyDown write FOnKeyDown; property OnKeyDown:eventhandler read FOnKeyDown write FOnKeyDown;
property OnsysKeyDown:eventhandler read FOnsysKeyDown write FOnsysKeyDown;
property OnKeyUp:eventhandler read FOnKeyUp write FOnKeyUp; property OnKeyUp:eventhandler read FOnKeyUp write FOnKeyUp;
property OnsysKeyUp:eventhandler read FOnsysKeyUp write FOnsysKeyUp;
property OnKeyPress:eventhandler read FOnKeyPress write FOnKeyPress; property OnKeyPress:eventhandler read FOnKeyPress write FOnKeyPress;
property OnSysKeyPress:eventhandler read FOnSysKeyPress write FOnSysKeyPress;
property OnDesignClick read FOnDesinedsel write FOnDesinedsel; property OnDesignClick read FOnDesinedsel write FOnDesinedsel;
property OnDesignDBLClick read FOnDesigDBLClick write FOnDesigDBLClick; property OnDesignDBLClick read FOnDesigDBLClick write FOnDesigDBLClick;
property OnDesignRClick read FOnDesinedRclick write FOnDesinedRclick; property OnDesignRClick read FOnDesinedRclick write FOnDesinedRclick;