diff --git a/designer/examples/action/resource.tfm/e_actionmain.tfm b/designer/examples/action/resource.tfm/e_actionmain.tfm index 9bc7f8c..71377a2 100644 --- a/designer/examples/action/resource.tfm/e_actionmain.tfm +++ b/designer/examples/action/resource.tfm/e_actionmain.tfm @@ -1,6 +1,6 @@ object e_actionmain1:e_actionmain caption="action 范例" - height=520.0 + height=520 left=451 onclose=e_actionmain1_close popupmenu=popupmenu1 diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf index 710b516..e504ccd 100644 --- a/designer/tslvcldesigner.tsf +++ b/designer/tslvcldesigner.tsf @@ -735,11 +735,7 @@ type TDVirutalWindow = class(TCustomControl) function Recycling();override; begin inherited; - if FBindComponent is class(TComponent) then - begin - FBindComponent.Recycling(); - FBindComponent := nil; - end + FBindComponent := nil; end property BindComp read FBindComponent write SetBindComponent; property WindowFileds read FWindowFileds write FWindowFileds; diff --git a/funcext/tvclib/tcomponent.tsf b/funcext/tvclib/tcomponent.tsf index 44a3117..0575fe7 100644 --- a/funcext/tvclib/tcomponent.tsf +++ b/funcext/tvclib/tcomponent.tsf @@ -193,7 +193,22 @@ public begin end - Procedure Notification(AComponent,Operation);virtual; + function relnotification(ac,Operation);//通知关联的组件 + begin + ow := ac; + while ow do + begin + nw := ow.Owner; + if not nw then + begin + break; + end + ow := nw; + end + if ow<>ac then + ow.Notification(ac,Operation); + end + function Notification(AComponent,Operation);virtual; begin {** @explan(说明) 通知处理 %% @@ -331,8 +346,11 @@ public begin if not FComponentCreated then exit; Destroying(); + ////////////////////////// + relnotification(self(true),"recycling"); + /////////////////////// DestroyComponents(); - If FOwner is class(tcomponent)Then FOwner.RemoveComponent(Self); + If FOwner is class(tcomponent)Then FOwner.RemoveComponent(self(true)); //self inherited; end function Destroy();virtual; diff --git a/funcext/tvclib/tcontrol.tsf b/funcext/tvclib/tcontrol.tsf index a0e2f5a..72f7811 100644 --- a/funcext/tvclib/tcontrol.tsf +++ b/funcext/tvclib/tcontrol.tsf @@ -1392,6 +1392,7 @@ type tcontrol = class(tcomponent) if rchange then begin //mtic; + //relnotification(self(true),array("type":"possize","flag":rchange,"data":array(fleft,ftop,FWidth,FHeight))); obj := class(tUIglobalData).uigetdata("tuiapplication"); if obj then begin diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index ff46bbc..9a2fd35 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -1021,12 +1021,12 @@ type TTray=class(TComponent) return true; end end - procedure Notification(AComponent:TComponent;Operation:TOperation);override; + function Notification(AComponent:TComponent;Operation:TOperation);override; begin {** @explan(说明) 通知消息处理 %% **} - if Operation=opRemove then + if Operation="recycling" then //opRemove begin if FPopupMenu=AComponent then begin @@ -1428,12 +1428,12 @@ type TVCForm = class(TScrollingWinControl) end end end - procedure Notification(AComponent:TComponent;Operation:TOperation);override; + function Notification(AComponent:TComponent;Operation:TOperation);override; begin {** @explan(说明) 通知消息处理 %% **} - if Operation=opRemove then + if Operation="recycling" then //opRemove begin if AComponent=FMainMenu then FMainMenu := nil; if FTray=AComponent then diff --git a/funcext/tvclib/utslvclaction.tsf b/funcext/tvclib/utslvclaction.tsf index 0026482..4981b34 100644 --- a/funcext/tvclib/utslvclaction.tsf +++ b/funcext/tvclib/utslvclaction.tsf @@ -106,7 +106,7 @@ type TBasicAction=class(TComponent) function Notification(AComponent,Operation);override; begin inherited; - if Operation=opRemove and AComponent=FActionComponent then + if Operation="recycling" and AComponent=FActionComponent then //opRemove begin FActionComponent := nil; if FParent is class(TCustomactionlist)then @@ -332,7 +332,7 @@ type TCustomactionlist=class(TComponent) function Notification(AComponent,Operation);override; begin inherited; - if Operation=opRemove and AComponent=FActionComponent then + if Operation="recycling" and AComponent=FActionComponent then //opRemove begin DeleteAllActions(); end diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index 8939f07..a0b1e76 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -939,23 +939,25 @@ type tnumindexarray = Class **} p := params; st := p[0]; + if not(st>=0) then st := 0; sl := p[1]; sl := ifnil(sl)?inf:sl; - sl := sl<0?0:sl; + sl := (sl>=0)?sl:0; len := length(FData); st := st<0?0:st; st := st >= len?(len):st; et := st+sl; et := et >= len?(len):et; r := array(); - idx := 0; + {idx := 0; for i := st to et-1 do begin r[idx++]:= FData[i]; - end + end } + r := FData[st:(et-1)]; r1 := FData[0:st-1]; r2 := FData[et:len-1]; - FData := r1 union p[2:]union r2; + FData := r1 union p[2:] union r2; if len <> length(FData)then LengthChanged(length(FData)-len); return r; end @@ -1012,7 +1014,7 @@ type tnumindexarray = Class end function splices(startid,sellength,vs); begin - if ifarray(vs)then return callinarray(thisfunction(splice),array(startid,sellength)union vs); + if ifarray(vs)then return callinarray(thisfunction(splice),array(startid,sellength) union vs); return array(); end function LengthChanged(n);virtual; diff --git a/funcext/tvclib/utslvcldlg.tsf b/funcext/tvclib/utslvcldlg.tsf index 36fb81d..b669f85 100644 --- a/funcext/tvclib/utslvcldlg.tsf +++ b/funcext/tvclib/utslvcldlg.tsf @@ -25,7 +25,7 @@ type TCommDlg=class(tcomponent) end function Notification(AComponent,Operation);override; begin - if Operation=opRemove then + if Operation="recycling" then //opRemove begin if AComponent=FWndOwner then FWndOwner := nil; end diff --git a/funcext/tvclib/utslvclmenu.tsf b/funcext/tvclib/utslvclmenu.tsf index b9c88ff..83f0f0c 100644 --- a/funcext/tvclib/utslvclmenu.tsf +++ b/funcext/tvclib/utslvclmenu.tsf @@ -472,7 +472,7 @@ private function Notification(AComponent:TComponent;Operation:TOperation);override; begin inherited; - if Operation=opRemove then + if Operation="recycling" then //opRemove begin if AComponent=Action then Action := nil; end diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index fc6bed3..e8c9021 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -4089,7 +4089,7 @@ type tcustommenubutton = class()// end function DoOnClick(o,e); //点击 begin - if fParent and (fmenu is class(TcustomMenu)) then + if fParent.HandleAllocated() and (fmenu is class(TcustomMenu)) then begin if fmenu.ItemCount>0 then //弹出菜单处理 begin @@ -4732,8 +4732,8 @@ type TcustomToolBar=class(TCustomControl) return font.Height+bw+4; end imglst := ImageList; //图标 - imgw := 36; - imgh := 36; + imgw := 28; + imgh := 28; if imglst is class(TCustomImageList)then begin imgw := imglst.Width+4; @@ -4772,8 +4772,8 @@ type TcustomToolBar=class(TCustomControl) return 40; end imglst := ImageList; //图标 - imgw := 36; - imgh := 36; + imgw := 28; + imgh := 28; if imglst is class(TCustomImageList)then begin imgw := imglst.Width+4; @@ -4812,7 +4812,7 @@ type TcustomToolBar=class(TCustomControl) end function Notification(a,op);override; begin - if a=fmainmenu and op=opRemove then + if a=fmainmenu and op="recycling" then begin setmainmenu(nil); end @@ -4887,7 +4887,7 @@ type TcustomToolBar=class(TCustomControl) end CalcButtonsRect(); end - function setmainmenu(v); + function setmainmenu(v); //设置主菜单 begin if v<>fmainmenu then begin @@ -4895,24 +4895,24 @@ type TcustomToolBar=class(TCustomControl) begin fmainmenu := v; fmainmenu.onchanged := thisfunction(mainmenuchanged); - mainmenuchanged(); - doControlALign(); + mainmenuchanged(); end else begin fmainmenu := nil; fmenubtns := new tnumindexarray(); end + doControlALign(); InvalidateRect(nil,false); end end - function EndShowWnd(); + function EndShowWnd();//提示框 begin FShowTimeIndexA :=-1; FTimer.Stop(); FTipWnd.Visible := false; end - function CalcButtonsRect(); + function CalcButtonsRect(); //计算按钮区域 begin if(IsUpDating())then begin @@ -4933,7 +4933,7 @@ type TcustomToolBar=class(TCustomControl) s := mu.Caption; wh := GetTextWidthAndHeightWidthFont(s,self.font,0);// wh fmenubtnrects[i]:= array(x,y,x+wh[0]+5,rc[3]); - x:=x+wh[0]+8; + x:=x+wh[0]+15; if x>rc[2] then break; //只有一行 end else begin