编辑器

修正
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 function FindWindowA(lpClassName:string;lpWindowName:string):pointer;stdcall;external "User32.dll" name "FindWindowA";//ÒýÈëapi
{$endif} {$endif}
function getdcompath();
begin
{$ifdef linux}
bpath := ".vcl/tsl/";
{$else}
bpath := TS_GetUserProfileHome();
{$endif}
return bpath+"designer"+ioFileseparator()+"dcmps"+ioFileseparator();
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8618,7 +8618,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
end end
function GtkBaseEventName();override; function GtkBaseEventName();override;
begin 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 end
function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override; function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override;
begin begin

View File

@ -3453,7 +3453,18 @@ begin
ph += vi; ph += vi;
end end
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_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_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"; function TS_GetHomePath(t:integer):string;cdecl;external {$ifdef linux}"libTSSVRAPI.so"{$else}"TSSVRAPI.dll"{$endif} name "TS_GetHomePath";