编辑器

修正
This commit is contained in:
JianjunLiu 2023-10-27 11:46:40 +08:00
parent faf5a8aaa5
commit d742f8edfa
9 changed files with 34 additions and 46 deletions

View File

@ -78,13 +78,3 @@ function PostMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):in
function FindWindowA(lpClassName:string;lpWindowName:string):pointer;stdcall;external "User32.dll" name "FindWindowA";//ÒýÈëapi
{$endif}
function getdcompath();
begin
{$ifdef linux}
bpath := ".vcl/tsl/";
{$else}
bpath := TS_GetUserProfileHome();
{$endif}
return bpath+"designer"+ioFileseparator()+"dcmps"+ioFileseparator();
end

View File

@ -87,16 +87,8 @@ type teditorform = class(TVCform) //
begin
inherited ;
GLobal G_OpenHostory;
//////////////////Ŀ¼/////////////////////
{$ifdef linux}
home := sysgetenv("HOME");
if home then basepath := home+"/.vcl/";
else
basepath := ".vcl/";
{$else}
basepath := TS_GetUserProfileHome();
{$endif}
//////////////////Ŀ¼/////////////////////
basepath := TS_GetUserProfileHome();
sp := ioFileseparator();
FCache := basepath+"editer"+sp+"cmpCaches";
FPathDirPath := basepath+"editer"+sp+"paths.tsm";

View File

@ -331,14 +331,7 @@ type TProjectView = class(TVCForm) //
end
FTslEditer.ReadOnlyDirs := array(GetVCLdir());
fio := ioFileseparator();
{$ifdef linux}
home := sysgetenv("HOME");
if home then bpath := home+"/.vcl/";
else
bpath := ".vcl/";
{$else}
bpath := TS_GetUserProfileHome();
{$endif}
FTslEditer.TslCacheDir := bpath+"designer"+fio+"cmpCaches";
FCodeblockPath := bpath+"editer"+fio+"BlockManager.tsm";
Fhighlightpath := bpath+"editer"+fio+"highlight.tsm";
@ -1542,7 +1535,12 @@ end
r := array();
r["build"] := "--buildexe";
r["buildfile"] := "."+"\\"+FExecEntry+".tsl";
r["output"] := "."+"\\"+FExecEntry+".exe";
{$ifdef linux}
hz := ".out";
{$else}
hz := ".exe";
{$endif}
r["output"] := "."+"\\"+FExecEntry+hz;
r["exports"] := "";
r["dependsdir"]:=".\\";
r["depends"]:="";
@ -2218,11 +2216,7 @@ implementation
type TDesignerProjectsRecoder = class() //¹¤³ÌÃû¼Ç¼
function Create();
begin
{$ifdef linux}
bpath := ".vcl/tsl/";
{$else}
bpath := TS_GetUserProfileHome();
{$endif}
ph := bpath+"designer"+ioFileseparator()+"ProjectsInfo.ini";
CreateDirWithFileName(ph);
FIni := new TIniFileExta("",ph);

View File

@ -1609,7 +1609,8 @@ type TPageEditerItem=class(TPageItem)
for i := length(v) downto 1 do
begin
if v[i]=sp then
begin
begin
Caption := v[i+1:];
if ddex>i then
begin
fscriptname := v[(i+1):(ddex-1)];
@ -1617,7 +1618,6 @@ type TPageEditerItem=class(TPageItem)
begin
fscriptname := v[i+1:];
end
Caption := fscriptname;
break;
end
if v[i]="." then

View File

@ -2003,12 +2003,8 @@ type tdcompextmgr = class()
ffile ;
end
function getdesignerpath();
begin
{$ifdef linux}
bpath := ".vcl/tsl/";
{$else}
begin
bpath := TS_GetUserProfileHome();
{$endif}
return bpath+"designer"+ioFileseparator();
end
function getdesginerini();

View File

@ -1,5 +1,6 @@
#!/bin/bash
LOCKFILE=/tmp/$(basename "$0").lock
#! LOCKFILE=/tmp/tsldesginer.lock
LOCKFILE=/tmp/tsleditor.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
echo " $0 already running"
exit
@ -10,9 +11,10 @@ trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
#将当前程序进程id写入锁文件
echo $$ > ${LOCKFILE}
# 做你需要的事情
TSLPATH=$(dirname $(dirname $(realpath $0) ))
export GDK_BACKEND=x11
export LD_LIBRARY_PATH=../
../TSL ../exec_tsl/vcldesigner.tsl -libpath ../designer/
export LD_LIBRARY_PATH="${TSLPATH}/"
"${TSLPATH}/TSL" "${TSLPATH}/exec_tsl/vcldesigner.tsl" -libpath "${TSLPATH}/designer/"
# sleep 1000

View File

@ -1,5 +1,6 @@
#!/bin/bash
LOCKFILE=/tmp/$(basename "$0").lock
#! LOCKFILE=/tmp/$(basename "$0").lock
LOCKFILE=/tmp/tsleditor.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
echo " $0 already running"
exit
@ -11,7 +12,9 @@ trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
echo $$ > ${LOCKFILE}
# 做你需要的事情
export GDK_BACKEND=x11
export LD_LIBRARY_PATH=../;../TSL ../exec_tsl/tsleditor.tsl -libpath ../designer/
TSLPATH=$(dirname $(dirname $(realpath $0) ))
export LD_LIBRARY_PATH="${TSLPATH}/"
"${TSLPATH}/TSL" "${TSLPATH}/exec_tsl/tsleditor.tsl" -libpath "${TSLPATH}/designer/"
# sleep 1000

View File

@ -8618,7 +8618,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
end
function GtkBaseEventName();override;
begin
return inherited union2 array("configure-event","delete-event","scroll-event","activate-default");
return inherited union2 array("configure-event","delete-event","scroll-event"{,"activate-default"});
end
function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override;
begin

View File

@ -3453,7 +3453,18 @@ begin
ph += vi;
end
end
function TS_GetUserProfileHome():string;cdecl;external {$ifdef linux}"libTSSVRAPI.so"{$else}"TSSVRAPI.dll"{$endif} name "TS_GetUserProfileHome";
{$ifdef linux}
function TS_GetUserProfileHome();
begin
home := sysgetenv("HOME");
if home then bpath := home+"/.vcl/";
else
bpath := ".vcl/";
return bpath;
end
{$else}
function TS_GetUserProfileHome():string;cdecl;external "TSSVRAPI.dll" name "TS_GetUserProfileHome";
{$endif}
function TS_GetUserProfileHomeInstance(t:integer):string;cdecl;external {$ifdef linux}"libTSSVRAPI.so"{$else}"TSSVRAPI.dll"{$endif} name "TS_GetUserProfileHomeInstance";
function TS_GetUserConfigHome(t:integer):string;cdecl;external {$ifdef linux}"libTSSVRAPI.so"{$else}"TSSVRAPI.dll"{$endif} name "TS_GetUserConfigHome";
function TS_GetHomePath(t:integer):string;cdecl;external {$ifdef linux}"libTSSVRAPI.so"{$else}"TSSVRAPI.dll"{$endif} name "TS_GetHomePath";