界面库

优化设计器相关细节
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
return o.SetPublish(index,d);
//return o.SetPublish(index,d);
end
function WMMove(o,e):WM_MOVE;override;
begin

View File

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

View File

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

View File

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

View File

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