parent
6d2e542ed7
commit
6fbb499871
|
|
@ -21,6 +21,7 @@ uses utslvclauxiliary,UVCPropertyTypesPersistence,utslvclbase;
|
||||||
FComponentStyle; //ÀàÐÍ
|
FComponentStyle; //ÀàÐÍ
|
||||||
FComponentCreated; //¹¹ÔìÍê³É
|
FComponentCreated; //¹¹ÔìÍê³É
|
||||||
FLoader;
|
FLoader;
|
||||||
|
FCharDiscrimi;
|
||||||
function ComponentGetParent();virtual;
|
function ComponentGetParent();virtual;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
|
@ -164,7 +165,7 @@ uses utslvclauxiliary,UVCPropertyTypesPersistence,utslvclbase;
|
||||||
begin
|
begin
|
||||||
if isKeyWords(v)then return;
|
if isKeyWords(v)then return;
|
||||||
nv := lowercase(v);
|
nv := lowercase(v);
|
||||||
if new TCharDiscrimi().IsVariableName(v)then
|
if FCharDiscrimi.IsVariableName(v)then
|
||||||
begin
|
begin
|
||||||
r := RootOwner().FindComponentByName(nv);
|
r := RootOwner().FindComponentByName(nv);
|
||||||
if not r then
|
if not r then
|
||||||
|
|
@ -208,7 +209,7 @@ public //֪ͨ
|
||||||
end
|
end
|
||||||
ow := nw;
|
ow := nw;
|
||||||
end
|
end
|
||||||
if ow<>ac then
|
//if ow<>ac then
|
||||||
ow.Notification(ac,Operation);
|
ow.Notification(ac,Operation);
|
||||||
end
|
end
|
||||||
function Notification(AComponent,Operation);virtual; //֪ͨ
|
function Notification(AComponent,Operation);virtual; //֪ͨ
|
||||||
|
|
@ -299,6 +300,7 @@ public //
|
||||||
function create(AOwner);virtual;
|
function create(AOwner);virtual;
|
||||||
begin
|
begin
|
||||||
class(TSLUIBASE).create();
|
class(TSLUIBASE).create();
|
||||||
|
FCharDiscrimi := new TCharDiscrimi();
|
||||||
FChangedProperties := array();
|
FChangedProperties := array();
|
||||||
FChangedinheritedProperties := array();
|
FChangedinheritedProperties := array();
|
||||||
FComponents := NEW TFpList();
|
FComponents := NEW TFpList();
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,7 @@ type TWinControl = class(tcontrol)
|
||||||
excludestate(ControlState,csCreating);
|
excludestate(ControlState,csCreating);
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
procedure InitializeWnd();virtual; //type_twinctrol
|
function InitializeWnd();virtual; //type_twinctrol
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
@explan(说明) 窗口句柄初始化,在该函数设置窗口句柄的一些信息 %%
|
@explan(说明) 窗口句柄初始化,在该函数设置窗口句柄的一些信息 %%
|
||||||
|
|
@ -364,7 +364,7 @@ type TWinControl = class(tcontrol)
|
||||||
//if Align<>alNone then
|
//if Align<>alNone then
|
||||||
Parent.DoControlAlign();
|
Parent.DoControlAlign();
|
||||||
end
|
end
|
||||||
ImageChanged();
|
//ImageChanged();
|
||||||
// "id:",self.caption,_wapi.GetWindowLongPtrA(FHandle,GWLP_ID);
|
// "id:",self.caption,_wapi.GetWindowLongPtrA(FHandle,GWLP_ID);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ type tuiglobaldata=class()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
type TCharDiscrimi=class()
|
type TCharDiscrimi=class()
|
||||||
|
private
|
||||||
static CD_SMA;
|
static CD_SMA;
|
||||||
static CD_BGA;
|
static CD_BGA;
|
||||||
static CD_SMZ;
|
static CD_SMZ;
|
||||||
|
|
@ -87,7 +88,7 @@ type TCharDiscrimi=class()
|
||||||
begin
|
begin
|
||||||
if not CD_ISOK then
|
if not CD_ISOK then
|
||||||
begin
|
begin
|
||||||
K := 1;
|
CD_ISOK := 1;
|
||||||
CD_SMA := ord("a");
|
CD_SMA := ord("a");
|
||||||
CD_BGA := ord("A");
|
CD_BGA := ord("A");
|
||||||
CD_SMZ := ord("z");
|
CD_SMZ := ord("z");
|
||||||
|
|
@ -95,26 +96,26 @@ type TCharDiscrimi=class()
|
||||||
CD_UDL := ord("_");
|
CD_UDL := ord("_");
|
||||||
CD_NIN := ord("9");
|
CD_NIN := ord("9");
|
||||||
CD_ZER := ord("0");
|
CD_ZER := ord("0");
|
||||||
CD_ISOK := 1;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class function IsLetter(cc);
|
public
|
||||||
|
function IsLetter(cc);
|
||||||
begin
|
begin
|
||||||
return IsUppercaseLetter(CC)OR IsLowercaseLetter(cc);
|
return IsUppercaseLetter(CC)OR IsLowercaseLetter(cc);
|
||||||
end
|
end
|
||||||
class function IsLowercaseLetter(cc);
|
function IsLowercaseLetter(cc);
|
||||||
begin
|
begin
|
||||||
return(cc >= CD_SMA)and(cc <= CD_SMZ);
|
return(cc >= CD_SMA)and(cc <= CD_SMZ);
|
||||||
end
|
end
|
||||||
class function IsUppercaseLetter(cc);
|
function IsUppercaseLetter(cc);
|
||||||
begin
|
begin
|
||||||
return(cc >= CD_BGA)and(cc <= CD_BGZ);
|
return(cc >= CD_BGA)and(cc <= CD_BGZ);
|
||||||
end
|
end
|
||||||
class function IsNumber(cc);
|
function IsNumber(cc);
|
||||||
begin
|
begin
|
||||||
return(cc >= CD_ZER)and(cc <= CD_NIN);
|
return(cc >= CD_ZER)and(cc <= CD_NIN);
|
||||||
end
|
end
|
||||||
class function IsVariableName(s);
|
function IsVariableName(s);
|
||||||
begin
|
begin
|
||||||
if ifstring(s)and length(s)>= 1 then
|
if ifstring(s)and length(s)>= 1 then
|
||||||
begin
|
begin
|
||||||
|
|
@ -134,7 +135,7 @@ type TCharDiscrimi=class()
|
||||||
end
|
end
|
||||||
return 0;
|
return 0;
|
||||||
end
|
end
|
||||||
class function IsLowercaseVariableName(s);
|
function IsLowercaseVariableName(s);
|
||||||
begin
|
begin
|
||||||
if ifstring(s)and length(s)>= 1 then
|
if ifstring(s)and length(s)>= 1 then
|
||||||
begin
|
begin
|
||||||
|
|
@ -631,7 +632,7 @@ type tarray1dlk=class //
|
||||||
function dochanged(info);
|
function dochanged(info);
|
||||||
begin
|
begin
|
||||||
if onchangelock then return ;
|
if onchangelock then return ;
|
||||||
CallMessgeFunction(fonchanged,self(true),info);
|
if fonchanged then CallMessgeFunction(fonchanged,self(true),info);
|
||||||
end
|
end
|
||||||
function SwapNoCheck(i,j);
|
function SwapNoCheck(i,j);
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -5625,9 +5625,9 @@ type TCustomSpinEdit = class(TCustomControl)
|
||||||
function Create(AOwner);override;
|
function Create(AOwner);override;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
FChar := class(TCharDiscrimi);
|
FChar := new TCharDiscrimi();
|
||||||
//FLeveTimer := new TCustomTimer(self);
|
//FLeveTimer := new TCustomTimer(self);
|
||||||
FChar.sinit();
|
//FChar.sinit();
|
||||||
FMaxValue := 100;
|
FMaxValue := 100;
|
||||||
FMinValue := 0;
|
FMinValue := 0;
|
||||||
//FValue := 0;
|
//FValue := 0;
|
||||||
|
|
|
||||||
|
|
@ -758,9 +758,14 @@ type TcustomTreeCtlNode = class(TVirtualListItem)
|
||||||
{**
|
{**
|
||||||
@param(ItemCount)(integer) 子节点数量 %%
|
@param(ItemCount)(integer) 子节点数量 %%
|
||||||
@param(Hierarchy)(integer) 层级 %%
|
@param(Hierarchy)(integer) 层级 %%
|
||||||
@param(Handle)(pointer) ¾ä±ú %%
|
|
||||||
@param(Expanded)(bool) 是否展开 %%
|
@param(Expanded)(bool) 是否展开 %%
|
||||||
@param(Parent)(TcustomTreeCtlNode) 父节点 %%
|
@param(Parent)(TcustomTreeCtlNode) 父节点 %%
|
||||||
|
@param(LastChild)(TcustomTreeCtlNode) 最后一个子节点 %%
|
||||||
|
@param(dirtype)(bool) 目录类型 %%
|
||||||
|
@param(Checked)(bool) 是否勾选 %%
|
||||||
|
@param(Visible)(bool) 可见 %%
|
||||||
|
@param(ModifyChildrenChecked)(bool) 勾选的时候是否修改自己的勾选状态 %%
|
||||||
|
@param(MouseCanChecked)(bool) 能否使用鼠标点击勾选 %%
|
||||||
**}
|
**}
|
||||||
protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode;
|
protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode;
|
||||||
property CurrentAddNode read FCurrentAddNode write FCurrentAddNode;
|
property CurrentAddNode read FCurrentAddNode write FCurrentAddNode;
|
||||||
|
|
@ -1764,12 +1769,6 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
{function CreateNode();virtual;
|
|
||||||
begin
|
|
||||||
return CreateTreeNode();
|
|
||||||
r := new TcustomTreeCtlNode(self(true));
|
|
||||||
return r;
|
|
||||||
end}
|
|
||||||
function CreateTreeNode();virtual;
|
function CreateTreeNode();virtual;
|
||||||
begin
|
begin
|
||||||
return createobject(fnodecreator,self(true));
|
return createobject(fnodecreator,self(true));
|
||||||
|
|
|
||||||
|
|
@ -153,95 +153,7 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||||
ct := "";
|
ct := "";
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function GetNumber(len);//解析数字
|
|
||||||
begin
|
|
||||||
c := cchar();
|
|
||||||
r := "";
|
|
||||||
iffloat := false;
|
|
||||||
if c="0" then
|
|
||||||
begin
|
|
||||||
label parnb;
|
|
||||||
cc := cchar();
|
|
||||||
if cc in FNumberChar then
|
|
||||||
begin
|
|
||||||
while whileok() do
|
|
||||||
begin
|
|
||||||
cc := cchar();
|
|
||||||
if not(iffloat)and cc="." then
|
|
||||||
begin
|
|
||||||
iffloat := true;
|
|
||||||
r += ".";
|
|
||||||
continue;
|
|
||||||
end
|
|
||||||
if(cc="l" or cc="L")and not(iffloat)then
|
|
||||||
begin
|
|
||||||
if r then
|
|
||||||
begin
|
|
||||||
//长整数
|
|
||||||
strtoint(r);
|
|
||||||
return;
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
if(cc="l" or cc="L")then
|
|
||||||
begin
|
|
||||||
//错误
|
|
||||||
return;
|
|
||||||
end
|
|
||||||
if not(cc in FNumberChar)then
|
|
||||||
begin
|
|
||||||
if not r then
|
|
||||||
begin
|
|
||||||
return; //错误
|
|
||||||
end
|
|
||||||
if iffloat then
|
|
||||||
begin
|
|
||||||
strtofloat(r); //实数
|
|
||||||
end else
|
|
||||||
strtoint(r); //整数
|
|
||||||
cback();
|
|
||||||
end
|
|
||||||
r += cc;
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
if cc="x" or cc="X" then
|
|
||||||
begin
|
|
||||||
while whileok() do
|
|
||||||
begin
|
|
||||||
cc := cchar();
|
|
||||||
if not(cc in FHexChar)then
|
|
||||||
begin
|
|
||||||
cback();
|
|
||||||
break;
|
|
||||||
end
|
|
||||||
r += cc;
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
r := c;
|
|
||||||
goto parnb;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function GetBinary(len); //二进制数据
|
|
||||||
begin
|
|
||||||
r := "";
|
|
||||||
while whileok() do
|
|
||||||
begin
|
|
||||||
c := cchar();
|
|
||||||
if c="}" then
|
|
||||||
begin
|
|
||||||
delct(r,ct,len,TT_BIN);
|
|
||||||
break;
|
|
||||||
end
|
|
||||||
if c in FSplitter then
|
|
||||||
begin
|
|
||||||
continue;
|
|
||||||
end
|
|
||||||
r += c;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function gettokens();//½âÎö×Ö·û
|
function gettokens();//½âÎö×Ö·û
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
|
|
@ -470,6 +382,7 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
FTree;
|
FTree;
|
||||||
ftreeobj;
|
ftreeobj;
|
||||||
FS;
|
FS;
|
||||||
|
FCharDiscrimi;
|
||||||
function SetScriptPath(fn);
|
function SetScriptPath(fn);
|
||||||
begin
|
begin
|
||||||
if ifstring(fn)then
|
if ifstring(fn)then
|
||||||
|
|
@ -496,14 +409,8 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
//exportfile(ftstream(),"","d:\\tst\\abc.stm",d);
|
//exportfile(ftstream(),"","d:\\tst\\abc.stm",d);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
public
|
//public
|
||||||
function create();override;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
FCurrent := 0;
|
|
||||||
FTokens := array();
|
|
||||||
FParsers := new TTmfParserToken();
|
|
||||||
end
|
|
||||||
function whileok();
|
function whileok();
|
||||||
begin
|
begin
|
||||||
return FCurrent<FTokenlen;
|
return FCurrent<FTokenlen;
|
||||||
|
|
@ -523,7 +430,8 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
if not(n>0)then n := 1;
|
if not(n>0)then n := 1;
|
||||||
FCurrent -= n;
|
FCurrent -= n;
|
||||||
end
|
end
|
||||||
function samplevalue(v);virtual;
|
public
|
||||||
|
function samplevalue(v);
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
@expaln(˵Ã÷) ¼ò»¯½á¹û%%
|
@expaln(˵Ã÷) ¼ò»¯½á¹û%%
|
||||||
|
|
@ -570,36 +478,16 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
private
|
|
||||||
function tablelines(str,n);
|
|
||||||
|
function create();override;
|
||||||
begin
|
begin
|
||||||
lines := str2array(str,"\r\n");
|
inherited;
|
||||||
r := "";
|
FCharDiscrimi := new TCharDiscrimi();
|
||||||
for i,v in lines do
|
FCurrent := 0;
|
||||||
begin
|
FTokens := array();
|
||||||
if not v then continue;
|
FParsers := new TTmfParserToken();
|
||||||
r += n;
|
|
||||||
r += v;
|
|
||||||
r += "\r\n";
|
|
||||||
end
|
end
|
||||||
return r;
|
|
||||||
end
|
|
||||||
function totfmstr(v);
|
|
||||||
begin
|
|
||||||
if ifnil(v)then return tostn("");
|
|
||||||
if ifstring(v)and(not v)then return tostn("");
|
|
||||||
if ifstring(v)then
|
|
||||||
begin
|
|
||||||
if v in array({"item",}"end","object","inherited")then return tostn(v);
|
|
||||||
if new TCharDiscrimi().IsLowercaseVariableName(v)then
|
|
||||||
begin
|
|
||||||
return v;
|
|
||||||
end else
|
|
||||||
return tostn(v);
|
|
||||||
end else
|
|
||||||
return tostn(v);
|
|
||||||
end
|
|
||||||
public
|
|
||||||
function GetAllSubObjects(obj,r);
|
function GetAllSubObjects(obj,r);
|
||||||
begin
|
begin
|
||||||
if not obj then obj := gettree();
|
if not obj then obj := gettree();
|
||||||
|
|
@ -698,8 +586,7 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function TSLasItem(d);//tsl转换为tfm字符串格式
|
||||||
function TSLasItem(d);
|
|
||||||
begin
|
begin
|
||||||
if not ifarray(d)then return totfmstr(d);
|
if not ifarray(d)then return totfmstr(d);
|
||||||
rows := mrows(d,1);
|
rows := mrows(d,1);
|
||||||
|
|
@ -744,6 +631,22 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
|
private //解析相关
|
||||||
|
function totfmstr(v);
|
||||||
|
begin
|
||||||
|
if ifnil(v)then return tostn("");
|
||||||
|
if ifstring(v)and(not v)then return tostn("");
|
||||||
|
if ifstring(v)then
|
||||||
|
begin
|
||||||
|
if v in array({"item",}"end","object","inherited")then return tostn(v);
|
||||||
|
if FCharDiscrimi.IsLowercaseVariableName(v)then
|
||||||
|
begin
|
||||||
|
return v;
|
||||||
|
end else
|
||||||
|
return tostn(v);
|
||||||
|
end else
|
||||||
|
return tostn(v);
|
||||||
|
end
|
||||||
function GetItem();
|
function GetItem();
|
||||||
begin
|
begin
|
||||||
while whileok() do
|
while whileok() do
|
||||||
|
|
@ -1031,6 +934,7 @@ type TTmfParser = class(TTmfParserbase)
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
|
public
|
||||||
property Script write SetScript;
|
property Script write SetScript;
|
||||||
property ScriptPath write SetScriptPath;
|
property ScriptPath write SetScriptPath;
|
||||||
{**
|
{**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue