编辑器

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

View File

@ -433,7 +433,7 @@ type tcontrol = class(tcomponent)
begin
r := new TMMEASUREITEM(message,wparam,lparam,hwnd);
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
r := new TMKEY(message,wparam,lparam,hwnd);
end else

View File

@ -47,6 +47,9 @@ type TWinControl = class(tcontrol)
FOnActivate;
FOnKeyDown;
FOnKeyPress;
fonsyskeydown;
fonsyskeyup;
FOnSysKeyPress;
FOnKeyUp;
factivecontrol;
autoref
@ -1173,6 +1176,18 @@ type TWinControl = class(tcontrol)
CallMessgeFunction(FOnKeyUp,o,e);
keyup(o,e);
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;
begin
CallMessgeFunction(FOnKeyPress,o,e);
@ -2574,8 +2589,11 @@ type TWinControl = class(tcontrol)
property OnActivate:eventhandler read FOnActivate write FOnActivate;
property OnClose:eventhandler read FOnClose write FOnClose;
property OnKeyDown:eventhandler read FOnKeyDown write FOnKeyDown;
property OnsysKeyDown:eventhandler read FOnsysKeyDown write FOnsysKeyDown;
property OnKeyUp:eventhandler read FOnKeyUp write FOnKeyUp;
property OnsysKeyUp:eventhandler read FOnsysKeyUp write FOnsysKeyUp;
property OnKeyPress:eventhandler read FOnKeyPress write FOnKeyPress;
property OnSysKeyPress:eventhandler read FOnSysKeyPress write FOnSysKeyPress;
property OnDesignClick read FOnDesinedsel write FOnDesinedsel;
property OnDesignDBLClick read FOnDesigDBLClick write FOnDesigDBLClick;
property OnDesignRClick read FOnDesinedRclick write FOnDesinedRclick;