界面库

优化设计器相关细节
This commit is contained in:
JianjunLiu 2022-10-21 10:30:55 +08:00
parent 3ceedb95cb
commit b17bb2c85b
5 changed files with 31 additions and 19 deletions

View File

@ -770,7 +770,7 @@ type TPropGrid = class(TTSLDataGrid)
end end
end end
end end
return o.SetPublish(index,d); //return o.SetPublish(index,d);
end end
function WMMove(o,e):WM_MOVE;override; function WMMove(o,e):WM_MOVE;override;
begin begin

View File

@ -287,6 +287,8 @@ public //
function create(AOwner);virtual; function create(AOwner);virtual;
begin begin
class(TSLUIBASE).create(); class(TSLUIBASE).create();
FChangedProperties := array();
FChangedinheritedProperties := array();
FComponents := NEW TFpList(); FComponents := NEW TFpList();
FFreeNotifies := NEW TFpList(); FFreeNotifies := NEW TFpList();
FComponentStyle := array(csInheritable); FComponentStyle := array(csInheritable);
@ -453,7 +455,7 @@ public //
#!end #!end
private //设计器中属性事件相关 private //设计器中属性事件相关
FEventsProperties; FEventsProperties;
FChangedPropertiesflg; FChangedinheritedProperties;
FChangedProperties; FChangedProperties;
FVariableProperties; FVariableProperties;
function GetPublishInfo();//属性获取 function GetPublishInfo();//属性获取
@ -555,9 +557,9 @@ public //
for i,vi in ps do for i,vi in ps do
begin begin
n := vi["name"]; n := vi["name"];
if (f<>2) and ifarray(FChangedPropertiesflg) and FChangedPropertiesflg[n] then continue;
vv := FChangedProperties[n]; vv := FChangedProperties[n];
if ifnil(vv)then continue; if ifnil(vv)then continue;
if (f<>2) and ( FChangedinheritedProperties[n]=vv) then continue;
vit := vi["type"]; vit := vi["type"];
otype := GetComponentPropertyType(vit);//GetPropertyType(vit); otype := GetComponentPropertyType(vit);//GetPropertyType(vit);
if vi["write"]and otype then if vi["write"]and otype then
@ -578,13 +580,8 @@ public //
{** {**
@explan(说明) 设计器相关函数 %% @explan(说明) 设计器相关函数 %%
**} **}
if not ifarray(FChangedProperties)then FChangedProperties := array(); if pp then FChangedinheritedProperties[n] := v;
if not ifarray(FChangedPropertiesflg)then FChangedPropertiesflg := array();
if pp then FChangedPropertiesflg[n] := true;
//reindex(FChangedProperties,array(n:nil));
if FChangedProperties[n]=v then return ;
FChangedProperties[n]:= v; FChangedProperties[n]:= v;
if not(pp) then reindex(FChangedPropertiesflg,array(n:nil));
end end
function DeleteChangedPublish(n);virtual;//删除属性 function DeleteChangedPublish(n);virtual;//删除属性
begin begin
@ -611,6 +608,7 @@ public //
if ifobj(otype)then if ifobj(otype)then
begin begin
iv := otype.UnformatEdit(v); //反转换 iv := otype.UnformatEdit(v); //反转换
if FChangedProperties[n]=vi then continue; //没有改变
SetChangedPublish(n,iv,pp); //保存 SetChangedPublish(n,iv,pp); //保存
if vit="eventhandler" then //分类保存 if vit="eventhandler" then //分类保存
begin begin

View File

@ -1769,7 +1769,8 @@ type tmemo = class(TSynMemoNorm)
function DoTextChanged(p);override;//Îı¾¸Ä±ä function DoTextChanged(p);override;//Îı¾¸Ä±ä
begin begin
inherited; inherited;
calldatafunction(Fonchange,self(true),new tuieventbase(0,0,0,0)); if Fonchange then
calldatafunction(Fonchange,self(true),new tuieventbase(0,0,0,0));
end end
function MouseUp(o,e);override; function MouseUp(o,e);override;
begin begin
@ -3840,6 +3841,7 @@ type TListView = class(TDrawGrid)
end end
function CallSelChanged(); function CallSelChanged();
begin begin
if OnSelChanged then
return calldatafunction(OnSelChanged,self(true),new tuieventbase(0,0,0,0)); return calldatafunction(OnSelChanged,self(true),new tuieventbase(0,0,0,0));
end end
function SetCanSelected(v); function SetCanSelected(v);
@ -4515,7 +4517,8 @@ type tmonthcalendar = class(TCustomControl)
r := FCalender.ExecuteCommand("meselbypos",e.pos); r := FCalender.ExecuteCommand("meselbypos",e.pos);
if std=3 or r="today" then if std=3 or r="today" then
begin begin
CallMessgeFunction(FonSelect,self(true),new tuieventbase(0,0,0,0)); if FonSelect then
CallMessgeFunction(FonSelect,self(true),new tuieventbase(0,0,0,0));
end end
end end
end end
@ -4554,7 +4557,8 @@ type tmonthcalendar = class(TCustomControl)
end end
function DoDatechanged(); function DoDatechanged();
begin begin
CallMessgeFunction(FonSelectChange,self(true),new tuieventbase(0,0,0,0)); if FonSelectChange then
CallMessgeFunction(FonSelectChange,self(true),new tuieventbase(0,0,0,0));
end end
function recycling();override; function recycling();override;
begin begin
@ -4686,7 +4690,8 @@ type tdatetimepicker = class(tthreeEntry)
if d>ct then es[2].text := inttostr(ct); if d>ct then es[2].text := inttostr(ct);
end end
end end
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); if Fonselectchange then
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0));
end end
"dtadate": "dtadate":
begin begin
@ -4697,8 +4702,9 @@ type tdatetimepicker = class(tthreeEntry)
decodedate(dt,y,m,d); decodedate(dt,y,m,d);
es[0].text := inttostr(y); es[0].text := inttostr(y);
es[1].text := inttostr(m); es[1].text := inttostr(m);
es[2].text := inttostr(d); es[2].text := inttostr(d);
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); if Fonselectchange then
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0));
end else end else
begin begin
y := strtointdef(es[0].text,2021); y := strtointdef(es[0].text,2021);
@ -4861,7 +4867,8 @@ type ttimepicker = class(tthreeEntry)
if ti<0 then p.text := "24"; if ti<0 then p.text := "24";
else if ti>24 then p.text := "0"; else if ti>24 then p.text := "0";
end end
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); if Fonselectchange then
calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0));
end end
end end
end end

View File

@ -303,8 +303,10 @@ type tcustompagecontrol = class(TCustomControl)
InsureIdxVisible(id); InsureIdxVisible(id);
InvalidateRect(nil,false); InvalidateRect(nil,false);
DoControlAlign(); DoControlAlign();
doonSelChanging(self(true),new tuieventbase(0,0,0,0)); if OnSelChanging then
doonSelChange(self(true),new tuieventbase(0,0,0,0)); doonSelChanging(self(true),new tuieventbase(0,0,0,0));
if OnSelChange then
doonSelChange(self(true),new tuieventbase(0,0,0,0));
end else end else
if FTabItems.length()=0 then if FTabItems.length()=0 then
begin begin

View File

@ -2398,11 +2398,14 @@ type tcustomedit=class(TCustomControl)
end end
function doonmaxtext(); function doonmaxtext();
begin begin
CallMessgeFunction(FOnMaxText,self(true),new tuieventbase(0,0,0,0)); if FOnMaxText then
CallMessgeFunction(FOnMaxText,self(true),new tuieventbase(0,0,0,0));
end end
function DoChanged(); function DoChanged();
begin begin
if FOnChange then
CallMessgeFunction(FOnChange,self(true),new tuieventbase(0,0,0,0)); CallMessgeFunction(FOnChange,self(true),new tuieventbase(0,0,0,0));
if FOnUpdate then
CallMessgeFunction(FOnUpdate,self(true),new tuieventbase(0,0,0,0)); CallMessgeFunction(FOnUpdate,self(true),new tuieventbase(0,0,0,0));
end end
function FontChanged(sender);override; function FontChanged(sender);override;
@ -3292,6 +3295,7 @@ type TcustomListBox=class(TCustomListBoxbase)
FSelBegin := FSelEnd := n; FSelBegin := FSelEnd := n;
SelRange(true); SelRange(true);
SetYpos(n); SetYpos(n);
if FselectionChange then
CallMessgeFunction(FselectionChange,self(true),new tuieventbase(0,0,0,0)); CallMessgeFunction(FselectionChange,self(true),new tuieventbase(0,0,0,0));
end end
function getItemSelectedState(n); function getItemSelectedState(n);
@ -3330,6 +3334,7 @@ type TcustomListBox=class(TCustomListBoxbase)
if FMultisel <> 2 or not isValidIndex(n)or b=getItemSelectedState(n)then return; if FMultisel <> 2 or not isValidIndex(n)or b=getItemSelectedState(n)then return;
if b then FMultisel3Data[n]:= b; if b then FMultisel3Data[n]:= b;
else reindex(FMultisel3Data,array(n:nil)); else reindex(FMultisel3Data,array(n:nil));
if FselectionChange then
CallMessgeFunction(FselectionChange,self(true),new tuieventbase(0,0,0,0)); CallMessgeFunction(FselectionChange,self(true),new tuieventbase(0,0,0,0));
InvalidateIdxRect(n); InvalidateIdxRect(n);
end end