From 667772a463433df4ce9c904b113fd33a7cffa934 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 20 Oct 2023 17:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 鍗囩骇 --- designer/teditorform.tsf | 2 ++ designer/utslvcldesigner.tsf | 2 ++ funcext/tvclib/tslvcl.tsf | 2 +- funcext/tvclib/utslvclauxiliary.tsf | 26 ++++++++++++++++--- .../tvclib/uvcpropertytypespersistence.tsf | 14 ---------- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/designer/teditorform.tsf b/designer/teditorform.tsf index e597893..1116b00 100644 --- a/designer/teditorform.tsf +++ b/designer/teditorform.tsf @@ -25,6 +25,8 @@ type teditorform = class(TVCform) // function editerinfo(); begin s := "tsl语言本地编辑器\r\n版本:1.0.0\r\n日期:2022-07-19"; + sc := get_resource_by_name("tsleditor.tsl.about"); + if ifstring(sc) then return sc; f := tslfilename()+".about"; if fileexists("",f) then begin diff --git a/designer/utslvcldesigner.tsf b/designer/utslvcldesigner.tsf index f21ed22..bbb965a 100644 --- a/designer/utslvcldesigner.tsf +++ b/designer/utslvcldesigner.tsf @@ -573,6 +573,8 @@ type TVclDesigner = class(tvcform) function editerinfo(); begin s := "tsl语言界面设计器\r\n版本:1.0.0\r\n日期:2023-01-19"; + sc := get_resource_by_name("vcldesigner.tsl.about"); + if sc then return sc; f := tslfilename()+".about"; if fileexists("",f) then begin diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index a9ccd3f..5ee222b 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -4951,7 +4951,7 @@ type TRegKey = class @param(vn)(string) value 名字 %% **} if not FHandle then return -1; - if not(ifstring(vn))then return -1; + if not(ifstring(vn) or ifnil(vn))then return -1; return RegDeleteValueA(FHandle,vn); end function DeleteKeyA(vn); diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index 0ae91ca..2eaf7fe 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -29,7 +29,7 @@ function intersectrect(rec1,rec2,irec); function bitcombination(s,v,f); function IsTextUTF8(str); function exportjsonformat(d,tbw,ct); - +function get_resource_by_name(n); //**************************** /////////////////// function ParserCommandLine(s); //解析命令行参数 @@ -3643,9 +3643,29 @@ begin end return ""; end - +function get_resource_by_name(n); +begin + global g_w_tfm_resource; + return g_w_tfm_resource[n]; +end +function uinit(); +begin + global g_w_tfm_resource; + g_w_tfm_resource := array(); + try + getglobalcache("@@tsl-resource@@",rs); + for i,v in rs do + begin + if ifstring(i) and ifstring(v) then + begin + g_w_tfm_resource[lowercase(i)] := v; + end + end + except + end +end initialization - +uinit(); end. //////////////////////暂时没用到的类型/////////////////////////////////////// diff --git a/funcext/tvclib/uvcpropertytypespersistence.tsf b/funcext/tvclib/uvcpropertytypespersistence.tsf index fb8de34..8b6f53b 100644 --- a/funcext/tvclib/uvcpropertytypespersistence.tsf +++ b/funcext/tvclib/uvcpropertytypespersistence.tsf @@ -2353,20 +2353,6 @@ begin end function Sinitlib(); begin - global g_w_tfm_resource; - g_w_tfm_resource := array(); - try - getglobalcache("@@tsl-resource@@",rs); - for i,v in rs do - begin - if ifstring(i) and ifstring(v) then - begin - g_w_tfm_resource[lowercase(i)] := v; - end - end - except - end - types := array( //"tpropertytype", "tpropertynatural", "tpropertyinteger",