编辑器,界面库

优化
This commit is contained in:
JianjunLiu
2022-08-05 18:23:40 +08:00
parent d833e12ca6
commit a5fa616a3e
11 changed files with 318 additions and 103 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ type TEditerForm = class(TVCform) //
end
function editerinfo();
begin
return "tsl语言本地编辑器\r\n版本:1.1.2\r\n日期:2022-03-22";
return "tsl语言本地编辑器\r\n版本:1.0.0\r\n日期:2022-07-19";
end
function Create(AOwner);override;
begin
+5 -5
View File
@@ -1153,12 +1153,12 @@ type TVclDesigner = class(tvcform)
),
("type":"menu","caption":"运行","items":(
("type":"menu","caption":"配置命令行","onclick":thisfunction(editcommandline)),
{$ifdef linux}
("type":"menu","caption":"运行","onclick":thisfunction(RunProject),"filed":"FRounMenu","bitmap":getrunbmpinfo()),
("type":"menu","caption":"停止","onclick":thisfunction(StopProject),"enabled":false,"filed":"FStopMenu","bitmap":getstopbmpinfo()),
{$else}
//{$ifdef linux}
//("type":"menu","caption":"运行","onclick":thisfunction(RunProject),"filed":"FRounMenu","bitmap":getrunbmpinfo()),
//("type":"menu","caption":"停止","onclick":thisfunction(StopProject),"enabled":false,"filed":"FStopMenu","bitmap":getstopbmpinfo()),
//{$else}
("type":"menu","caption":"运行","bitmap":getrunbmpinfo(),"onclick":thisfunction( debugproject)), //之前的调试运行
{$endif}
//{$endif}
)),
("type":"menu","caption":"工具","items":(
+37 -8
View File
@@ -60,11 +60,10 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
{$endif}
function InvalidateLines(FirstLine,LastLine:integer);override;
begin
//return inherited;
if not HandleAllocated()then return;
if HighLighter is class(TTslSynHighLighter)then
begin
fy :=(FirstLine-TopLine) * TextHeight;
fy :=(FirstLine-TopLine) * LineHeight;
r := ClientRect;
if fy<r[1]then return;
if fy>r[3]then return;
@@ -507,7 +506,7 @@ type TTslDebuga=class(TCustomControl)
function Debugremote(flg);
begin
{$ifdef linux}
return MessageboxA("linux目前不支持调试","提示",0,self.Handle);
//return MessageboxA("linux目前不支持调试","提示",0,self.Handle);
{$endif}
if FRemoteWait then
begin
@@ -558,7 +557,7 @@ type TTslDebuga=class(TCustomControl)
function Debuglocal(item); //调试脚本
begin
{$ifdef linux}
return MessageboxA("linux目前不支持调试","提示",0,self.Handle);
//return MessageboxA("linux目前不支持调试","提示",0,self.Handle);
{$endif}
if not item then return 0;
if FConnectchannel then return MessageboxA("正在调试中","提示",0,self.Handle);
@@ -579,7 +578,23 @@ type TTslDebuga=class(TCustomControl)
getdebuger(pms);
exestr := format('"%s" "%s" -DEBUGSERVER -DEBUGLOGIN 0 -WAITATTACH -DEBUGPORT %d -libpath "%s" ',FDebugExe,FRuningfile,FDebugport,dirs);
exestr += pms;
FDebughandle := sysexec(FDebugExe,exestr,nil,0,rcode,0);
{$ifdef linux}
//
sp := ioFileseparator();
for i:= length(FDebugExe) downto 1 do
begin
if FDebugExe[i] = sp then
begin
exepath := FDebugExe[1:i];
break;
end
end
npm := array("LD_LIBRARY_PATH=" $ exepath ,getgtkdisplay());
exestr := ParserCommandLine(exestr);
{$else }
npm := nil;
{$endif}
FDebughandle := sysexec(FDebugExe,exestr,npm,0,rcode,0);
if FDebughandle then
begin
ExecuteCommand("dbgcreatechannel");
@@ -590,6 +605,7 @@ type TTslDebuga=class(TCustomControl)
end
end
end
function wmuser(o,e):WM_USER;virtual;
begin
if FRemoteWait and not(checkconnected())then
@@ -693,7 +709,7 @@ type TTslDebuga=class(TCustomControl)
if(pid=dwProcessID)then
begin
// here h is the handle to the window
while(api.GetParent(h)<> 0) do h := api.GetParent(h);
while(api.GetParent(h)<> 0) do h := api.GetParent(h);
return h;
end
end
@@ -877,7 +893,7 @@ type TTslDebuga=class(TCustomControl)
FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",stk[0,"LINE"]-1);
end
end
//_wapi.SetForegroundWindow(self.Handle); //移动到前端 SetForegroundWindow BringWindowToTop
_wapi.SetForegroundWindow(self.Handle); //移动到前端 SetForegroundWindow BringWindowToTop
return;
end
"detached":
@@ -1091,7 +1107,9 @@ type TTslDebuga=class(TCustomControl)
begin
if FDebughandle then
begin
return SysTerminate(-1,FDebughandle);
//cd := {$ifdef linux} 1 {$else} -1 {$endif} ;
return SysTerminate(1,FDebughandle);
end
if FAttchedid then
begin
@@ -1155,6 +1173,17 @@ type TTslDebuga=class(TCustomControl)
end
//property rundirect read Frundirect write Frundirect;
private
function getgtkdisplay();
begin
try
dsp := sys_getenv("DISPLAY");
if dsp="" then dsp := ":0";
if not ifstring(dsp) then dsp := ":0";
except
dsp := ":0";
end;
return "DISPLAY="+dsp;
end
function getdefaultdbger();
begin
fdefaultdbger := gettslexefullpath();