思路:
开发了一个Panel控件,Panel本身会把 Controls 的内容进行保存!
现在有一问题,并不所以的Controls 的 Save事件都能满足要求。
现为 Paenel 增加 一 OnSave 事件, 用来作些其他的动作!问题:
我现在没有太明白 事件的整个是怎么回事?
1、现在Panel本身是可以作事件了,Panel本身的Save怎么来调 panel.OnSave 事件?
2、 property DataSource: TDataSource read GetDataSource write SetDataSource
其中的 Read, Write 怎么样来理解?
开发了一个Panel控件,Panel本身会把 Controls 的内容进行保存!
现在有一问题,并不所以的Controls 的 Save事件都能满足要求。
现为 Paenel 增加 一 OnSave 事件, 用来作些其他的动作!问题:
我现在没有太明白 事件的整个是怎么回事?
1、现在Panel本身是可以作事件了,Panel本身的Save怎么来调 panel.OnSave 事件?
2、 property DataSource: TDataSource read GetDataSource write SetDataSource
其中的 Read, Write 怎么样来理解?
赋值调用 SetDataSource
begin
{ Call OnClick if assigned and not equal to associated action's OnExecute.
If associated action's OnExecute assigned then call it, otherwise, call
OnClick. }
if Assigned(FOnClick) and (Action <> nil) and (@FOnClick <> @Action.OnExecute) then
FOnClick(Self)
else if not (csDesigning in ComponentState) and (ActionLink <> nil) then
ActionLink.Execute(Self)
else if Assigned(FOnClick) then
FOnClick(Self);
end;再找找Click是哪调用的就行了.