界面库

消除对c的依赖
This commit is contained in:
2024-04-19 11:20:41 +08:00
parent 1098e9d6aa
commit d560c062d2
30 changed files with 1817 additions and 647 deletions
+2 -162
View File
@@ -1523,20 +1523,6 @@ type TPageEditerItem=class(TPageItem)
FEditer.ChangedFlag := false;
if not FTslSynText then return;
if not(s)then return;
{r := tsl_tokenizeex_2_(s,1);
cs := r["class"];
if ifarray(cs)and cs[0]then
begin
lcs1 := lowercase(cs[0]);
if lcs1 in array("tdcreateform","tdcreatepanel")then
begin
try
if not FTslParser then FTslParser := new ttslscripparser(); #! end
except
end;
return; //返回
end
end}
if not FTslParser then FTslParser := new ttslscripparser(); #! end
//FTslParser := nil;
end
@@ -1858,7 +1844,6 @@ type TEditer=class(TCustomcontrol) //
"charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0);
FTslDebug := new TTslDebug(self);
FFindListWnd := new TFindListWnd(self);
//FCodeMap := new TTslCodeMap(self);
FFileopen := new TOpenFileADlg(self);
FFileSave := new TSavefileADlg(self);
FFileopen.WndOwner := self;
@@ -1873,7 +1858,6 @@ type TEditer=class(TCustomcontrol) //
FFindListWnd.OnDblClick := thisfunction(FindListChoosed);
FGotoLineWnd.Visible := false;
/////////////////////////
//FCodeMap.visible := false;
FFindWnd.Visible := false;
FFileSave.Filter := array("any":"*.*","tsl文件":"*.tsl;*.tsf");
FFileSave.Caption := "另存为";
@@ -1965,7 +1949,6 @@ type TEditer=class(TCustomcontrol) //
FinCodemap.Parent := self;
fcoolbar.Parent := self;
FPageEditer.Parent := self;
//FCodeMap.parent := self;
FGotoLineWnd.Parent := self;
FFindWnd.parent := self;
FFileopen.parent := self;
@@ -3321,8 +3304,6 @@ type TEditer=class(TCustomcontrol) //
end
"代码地图(alt+m)":
begin
//InitShowWndPos(FCodeMap,"cm",250,100);
//FCodeMap.ShowMap();
if FinCodemap and not(FinCodemap.Visible) then
begin
FinCodemap.doshow(true);
@@ -3566,8 +3547,6 @@ type TEditer=class(TCustomcontrol) //
end
ord("M"):
begin
//InitShowWndPos(FCodeMap,"cm",250,100);
//FCodeMap.ShowMap();
if FinCodemap then
begin
FinCodemap.doshow(1);
@@ -4254,7 +4233,6 @@ type TEditer=class(TCustomcontrol) //
FToolbar;
FStatus;
FInfoShowWnd;
//FCodeMap;
FinCodemap;
FListPages;
FFindWnd;
@@ -5263,7 +5241,7 @@ type tfincodemap = class(tcustomcontrol)
end else
FString := s;
flistv := getblocktypes();
if s then r := tsl_tokenizeex_2_(s,flistv);
if s then r := unit(utssvr_tsltoken_c).get_tsl_tokenizeex(s,flistv);// tsl_tokenizeex_2_(s,flistv);
else r := array();
fcaretya := -1;
fcaretyb := -1;
@@ -5433,145 +5411,7 @@ EA5E0BB7C5850E4063EDA83420076B5E10000000049454E44AE42608200";
public
FTree;
end
(*
type TTslCodeMap=class(TTreeView) //tsl代码地图
function Create(AOwner);
begin
inherited;
caption := "代码树:支持[左/右/上/下/enter]键";
width := 400;
height := 800;
WsPopUp := true;
WsSysMenu := true;
WsSizeBox := true;
OnClose := function(o,e)
begin
o.visible := false;
e.skip := true;
if not FTreeEditer then return;
FTreeEditer.SetFocus();
end
OnActivate := function(o,e)
begin
if not e.wparam then CodeMapLive(o,e);
{o.Visible := false;
if not FTreeEditer then return;
FTreeEditer.SetFocus();}
end
onKeyPress := thisfunction(CodeMapLive);
//OnDblClick := thisfunction(SynNodeSelected);
OnSelChanged := thisfunction(SynNodeSelected);
end
function CodeMapLive(o,e);
begin
o.Visible := false;
if not FTreeEditer then return;
FTreeEditer.SetFocus();
end
function SynNodeSelected(o,e);
begin
//双击
if not FTreeEditer then return;
nd := CurrentNode;
if not nd then return ;
line := nd._tag;
if line>0 then
begin
FTreeEditer.ExecuteCommand(FTreeEditer.ecGoToXY,array(line,1));
end
end
function hasFocus();override;
begin
return true;
end
function ShowMap();
begin
FTreeEditer := nil;
it := Owner.GetCurrentItem();
if not it then return;
//caption := "codemap:"+it.ScriptPath;
FTreeEditer := it.FEditer;
s := FTreeEditer.Text;
if FString <> s then
begin
FString := s;
LoadString(s,FTreeEditer.CaretY);
end else
GoToTheNode(FTreeEditer.CaretY);
end
function Recycling();override;
begin
inherited;
FTempNodes := nil; //节点
FEditer := nil;
FString := nil;
FTreeEditer := nil;
end
private
function LoadString(s,line);
begin
{ 代码块快类型
#define Block_TypeClass 1
#define Block_Function 2
#define Block_Statements 4
#define Block_If 8
#define Block_Else 16
#define Block_SubCase 32
#define Block_Goto_Label 64
#define Block_Empty_Begin_End 128
#define Block_Try 256
#define Block_NeedSql 512
#define Block_UnitStruct 1024
}
if s then r := tsl_tokenizeex_2_(s,1+2+4+8+16+32+256+1024+2048+4096);
else r := array();
RootNode.RecyclingChildren();
FTempNodes := array();
ScriptDelBlocks(r["blcks"],str2array(s,"\r\n"),self.RootNode,0);
GoToTheNode(line);
end
function GoToTheNode(line);
begin
nd := FTempNodes[0];
for i,v in FTempNodes do
begin
if v._tag <= line then
begin
nd := v;
end else
if v._tag >= Line then
begin
SetSel(nd);
break;
end
end
Show();
if _wapi.GetFocus()<> Handle then
begin
SetFocus();
end
end
function ScriptDelBlocks(blcks,strs,Node,ct);
begin
if not blcks then return;
for i,v in blcks do
begin
if v["mtype"]<> 1 then
begin
cnd := CreateTreeNode();
cnd.Caption := trim(strs[v["mbeg"]-1]);
cnd._tag := v["mbeg"];
FTempNodes[length(FTempNodes)]:= cnd;
cnd.parent := node;
end
if not cnd then cnd := node;
ScriptDelBlocks(v["msub"],strs,cnd,ct+1);
end
end
FTempNodes; //节点
FString; //字符串
FTreeEditer; //编辑框
end *)
type TListPages=class(TListBox)
function Create(AOwner);override;
begin
+4 -4
View File
@@ -339,7 +339,7 @@ type TTSLCompletion= class(TSynCompletion)
r[idx]["order"] := 0;
idx++;
end
gjz := tslL_getfunctions_2_();
gjz := unit(utssvr_tsltoken_c).get_sys_functions();//tslL_getfunctions_2_();
for i,v in gjz do
begin
c := v+" <sysfun>";
@@ -400,7 +400,7 @@ type TTslSynHighLighter = class(TSynHighLighter)
FKeyWords[v] := v;
end
FBinFunc := array();
for i,v in tslL_getfunctions_2_() do
for i,v in unit(utssvr_tsltoken_c).get_sys_functions() do
begin
FBinFunc[v]:=v;
end
@@ -1885,7 +1885,7 @@ type TTsfFileParser = class() //
s := d["value"];
if not(s and ifstring(s)) then return rt ;
if errtslcode(s) then return rt;
r := tsl_tokenizeex_2_(s,1);
r := unit(utssvr_tsltoken_c).get_tsl_tokenizeex(s,1);//tsl_tokenizeex_2_(s,1);
if not( r and ifarray(r)) then return rt;
cls := array();
ScriptDelBlocks(r["blcks"],str2array(s,"\n"),cls);
@@ -2176,7 +2176,7 @@ type TTsfFileParser = class() //
r := array();
rdd := "";
end else
r := tsl_tokenizeex_2_(rdd,1);
r := unit(utssvr_tsltoken_c).get_tsl_tokenizeex(rdd,1);//tsl_tokenizeex_2_(rdd,1);
end else
begin
r := array();
+1 -1
View File
@@ -1549,7 +1549,7 @@ type TTslDebuga=class(TCustomControl)
FRuningfile := item.OrigScriptPath; // %% E:\TSUIGROUP\script\tgdb.tsl%%;
FDebugtsfs["__main__"]:= FRuningfile;
ls := item.FEditer.lines;
d := tsl_tokenizeex_2_(item.FEditer.Text,0xffff);
d := unit(utssvr_tsltoken_c).get_tsl_tokenizeex(item.FEditer.Text,0xffff);//tsl_tokenizeex_2_(item.FEditer.Text,0xffff);
for i,v in d["blcks"] do
begin
s := ls.GetStringByIndex(v["mbeg"]-1);
+3 -2
View File
@@ -2071,10 +2071,11 @@ end
function staticInit();
begin
global g_orig_lib_path;
unit(utssvr_api_c).get_tssvr_api_c();
np := getdesignerpath()+"dcmps"+ioFileseparator();
CreateDirWithFileName(np+"1.txt");
g_orig_lib_path := tsl_getlibpath_()+";"+Getfuncextdir();
tsl_setlibpath_( np+";"+g_orig_lib_path);
g_orig_lib_path := get_self_libpath()+";"+Getfuncextdir();//tsl_getlibpath_()
set_self_libpath( np+";"+g_orig_lib_path);//tsl_setlibpath_
ini := static getdesginerini();
//class(TDSocketServer),class(TDSocketClient),
//注册的componet