diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf index 293f3e4..aba1afc 100644 --- a/designer/tslvcldesigner.tsf +++ b/designer/tslvcldesigner.tsf @@ -1685,11 +1685,12 @@ type TVclDesigner = class(tvcform) v[0].SetComponentProperties(v[1],va.GetTrueComponent()); end end + except end ; FTree.Loading := nil; end - function loadtfmtotree(p,d,node,owner,prs,obarray); + function loadtfmtotree(p,d,node,wr,prs,obarray); begin {** @explan(说明) 导入tfm文件 %% @@ -1712,7 +1713,7 @@ type TVclDesigner = class(tvcform) it.Imgs := FImageList.GetImageId("tdcreateform"); FLoadInheritedName := array(); end - comp := it.ComponentCreater(node,owner); + comp := it.ComponentCreater(node,wr); comp.name := d["name"]; obarray[d["name"]] := comp; FVariableSelecter.additem(comp); diff --git a/funcext/tvclib/tcontrol.tsf b/funcext/tvclib/tcontrol.tsf index ab80f59..a0e2f5a 100644 --- a/funcext/tvclib/tcontrol.tsf +++ b/funcext/tvclib/tcontrol.tsf @@ -695,7 +695,7 @@ type tcontrol = class(tcomponent) @param(e)(tuieventbase) 消息 %% **} if e.Result then exit; - if FPopupMenu is class(TcustomPopupmenu) then + if FPopupMenu is class({TcustomPopupmenu}TcustomMenu) then begin uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; _wapi.TrackPopupMenu(FPopupMenu.Handle,uf,e.lolparamsigned,e.hilparamsigned,0,e.wparam,nil); diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index 22bd6b1..15cbca7 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -1010,7 +1010,7 @@ type TTray=class(TComponent) function ShowPopUpMenu(); begin if not FHaveadd then exit; - if FPopupMenu is class(TcustomPopupmenu)then + if FPopupMenu is class({TcustomPopupmenu}TcustomMenu)then begin ps := array(x,y); _wapi.GetCursorPos(ps); @@ -1112,7 +1112,7 @@ type TVCForm = class(TScrollingWinControl) if(FTray is class(TTray))then begin tp := FTray.PopupMenu; - if tp is class(TcustomPopupmenu)then + if tp is class({TcustomPopupmenu}TcustomMenu)then begin return tp; end @@ -2490,7 +2490,7 @@ type tcoolbar = class(tcustomcoolbar) end function publishs();override; begin - return array("name","enabled","caption","autosize","border","font","color","dragbtncolor","visible","arrange"); + return array("name","enabled","caption","autosize","border","wsdlgmodalframe","font","color","dragbtncolor","visible","arrange"); end end diff --git a/funcext/tvclib/twincontrol.tsf b/funcext/tvclib/twincontrol.tsf index 24d7f3c..370662a 100644 --- a/funcext/tvclib/twincontrol.tsf +++ b/funcext/tvclib/twincontrol.tsf @@ -937,15 +937,15 @@ type TWinControl = class(tcontrol) end function WMMENURBUTTONUP(o,e):WM_MENURBUTTONUP;virtual; begin - if PopupMenu is class(TcustomPopupmenu)then PopupMenu.dispatch(e); + if PopupMenu is class({TcustomPopupmenu}TcustomMenu)then PopupMenu.dispatch(e); end function WMMENUSELECT(o,e):WM_MENUSELECT;virtual; begin - if PopupMenu is class(TcustomPopupmenu)then PopupMenu.dispatch(e); + if PopupMenu is class({TcustomPopupmenu}TcustomMenu)then PopupMenu.dispatch(e); end function WMINITMENUPOPUP(o,e):WM_INITMENUPOPUP;virtual; begin - if PopupMenu is class(TcustomPopupmenu)then PopupMenu.dispatch(e); + if PopupMenu is class({TcustomPopupmenu}TcustomMenu)then PopupMenu.dispatch(e); end function WMERASEBKGND(o,e):WM_ERASEBKGND;override; begin @@ -998,7 +998,7 @@ type TWinControl = class(tcontrol) //dc := _wapi.GetDC(SELF.hANDLE); //dcid := _wapi.SaveDC(dc); canvas.handle := dc; - if(e.wparam=0)and(PopupMenu is class(TcustomPopupmenu))then + if(e.wparam=0)and(PopupMenu is class({TcustomPopupmenu}TcustomMenu))then begin r := PopupMenu.dispatch(e); if r then @@ -1032,7 +1032,7 @@ type TWinControl = class(tcontrol) @param(o)()控件本身 %% @param(e)(TMMEASUREITEM)测量消息 %% **} - if(e.wparam=0 and e.ctltype=ODT_MENU)and(PopupMenu is class(TcustomPopupmenu))and PopupMenu.Dispatch(e)then exit; + if(e.wparam=0 and e.ctltype=ODT_MENU)and(PopupMenu is class({TcustomPopupmenu}TcustomMenu))and PopupMenu.Dispatch(e)then exit; for i := 0 to FControls.count-1 do begin it := FControls[i]; @@ -1090,7 +1090,7 @@ type TWinControl = class(tcontrol) end function WMCOMMAND(o,e):WM_COMMAND;virtual; begin - if(popupmenu is class(TcustomPopupmenu))and popupmenu.dispatch(e)then exit; + if(popupmenu is class({TcustomPopupmenu}TcustomMenu))and popupmenu.dispatch(e)then exit; hd := e.lparam; if hd then begin diff --git a/funcext/tvclib/utslvclcoolbar.tsf b/funcext/tvclib/utslvclcoolbar.tsf index 7a29b59..6ce396a 100644 --- a/funcext/tvclib/utslvclcoolbar.tsf +++ b/funcext/tvclib/utslvclcoolbar.tsf @@ -162,7 +162,8 @@ type tcustomcoolbar=class(tcustomcontrol) inherited; end function doControlALign();override;//调整位置 - begin + begin + if not HandleAllocated() then return ; mwid := 10; swid := 10; y := 0; @@ -176,7 +177,16 @@ type tcustomcoolbar=class(tcustomcontrol) if abs(dh)>4 then begin Align := alNone; - Height := (border*2)+nh; + {if WSSizebox then + begin + bw := 16; + end else + if WsDlgModalFrame then + begin + bw := 6; + end else} + if Border then bw := 2; + Height := bw+nh; Align := alTop; return ; end diff --git a/funcext/tvclib/utslvclmenu.tsf b/funcext/tvclib/utslvclmenu.tsf index 2774174..9c07d12 100644 --- a/funcext/tvclib/utslvclmenu.tsf +++ b/funcext/tvclib/utslvclmenu.tsf @@ -582,7 +582,7 @@ private begin FHandle := CreateMenu(); end else - if self(true)is class(TcustomMainmenu)then //修改 + if self(true) is class(TcustomMainmenu)then //修改 begin FHandle := CreateMenu(); end diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index 9629573..f12d978 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -4116,7 +4116,7 @@ type TcustomToolButton=class(tcomponent) if FStylesep then return ; if Parent then begin - if FPopupMenu is class(TcustomPopupmenu) then + if FPopupMenu is class({TcustomPopupmenu}TcustomMenu) then begin Parent.PopupMenu := FPopupMenu; rec := GetRect(); @@ -4188,7 +4188,10 @@ type TcustomToolButton=class(tcomponent) if nv<>FStylesep then begin FStylesep := nv; - if FToolbar then FToolbar.BtnChanged(); + if FToolbar then + begin + FToolbar.ExecuteCommand("btnchanged",0); + end end end function getShortCut(); @@ -4247,7 +4250,10 @@ type TcustomToolButton=class(tcomponent) if nv <> FEnabled then begin FEnabled := nv; - if FToolbar then FToolbar.BtnChanged(); + if FToolbar then + begin + FToolbar.ExecuteCommand("btnchanged",0); + end end end function SetVisible(v); @@ -4256,7 +4262,10 @@ type TcustomToolButton=class(tcomponent) if nv <> FVisible then begin FVisible := nv; - if FToolbar then FToolbar.BtnChanged(); + if FToolbar then + begin + FToolbar.ExecuteCommand("btnchanged",0); + end end end protected //action @@ -4316,7 +4325,10 @@ type TcustomToolButton=class(tcomponent) if ifnumber(id)and id <> FImageId then begin FImageId := id; //刷新一下 - if FToolbar then FToolbar.BtnChanged(); //FToolbar.InvalidateRect(nil,false); + if FToolbar then + begin + FToolbar.ExecuteCommand("btnchanged",0); + end end end private @@ -4369,10 +4381,14 @@ type TcustomToolBar=class(TCustomControl) end end end - {function ContextMenu(o,e);override; + function ContextMenu(o,e);override; begin + if csDesigning in ComponentState then + begin + return inherited; + end e.skip := true; - end } + end function MouseUp(o,e);override; begin if csDesigning in ComponentState then return; @@ -4447,7 +4463,7 @@ type TcustomToolBar=class(TCustomControl) begin bt := FButtons[idx]; st := bt.ShortCut; - if bt.PopupMenu is class(TcustomPopupmenu) then s1 := bt.PopupMenu.Caption; + if bt.PopupMenu is class({TcustomPopupmenu}TcustomMenu) then s1 := bt.PopupMenu.Caption; else s1 := bt.Caption; FTipWnd.Tip := s1+(st?(" ("+st+")"):""); FTipWnd.ShowTIp(); @@ -4743,11 +4759,18 @@ type TcustomToolBar=class(TCustomControl) FCurrentPos := nil; FMouseDownIdx :=-1; end - function BtnChanged(); + function ExecuteCommand(cmd,pm);override; begin - CalcButtonsRect(); - InvalidateRect(nil,false); - end + case cmd of + "btnchanged": + begin + CalcButtonsRect(); + InvalidateRect(nil,false); + return 0; + end + end ; + return inherited; + end protected procedure SetAlign(Value:TAlign);override; begin @@ -4784,8 +4807,8 @@ type TcustomToolBar=class(TCustomControl) return; end imglst := ImageList; //图标 - imgw := 36; - imgh := 36; + imgw := 28; + imgh := 28; if imglst is class(TCustomImageList)then begin imgw := imglst.Width+4;