From 33d710b201548e15367a34613846dd66fd3b195e Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Wed, 18 Jan 2023 17:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 浼樺寲缁嗚妭 --- designer/tslvcldesigner.tsf | 44 ++++++++++++++++++++++----- designer/utslcodeeditor.tsf | 4 ++- designer/utslvcldebuger.tsf | 14 ++++++--- funcext/tvclib/twincontrol.tsf | 55 +++++++++++++++++++++++++++++++++- 4 files changed, 104 insertions(+), 13 deletions(-) diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf index c79da8f..b344ad9 100644 --- a/designer/tslvcldesigner.tsf +++ b/designer/tslvcldesigner.tsf @@ -592,7 +592,11 @@ type TVclDesigner = class(tvcform) l := O.left; r := o.top; if not FPropGrid.SetGridValue("left",l,O) then o.setpublish("left",l); - if not FPropGrid.SetGridValue("top",r,O) then o.setpublish("top",r); + if not FPropGrid.SetGridValue("top",r,O) then o.setpublish("top",r); + if o.WsPopUp then return ; + p := o.parent; + if p then + p.Invalidaterect(nil,0); end function ComponentSize(o,e);//大小改变 begin @@ -603,7 +607,10 @@ type TVclDesigner = class(tvcform) h := o.height; if not FPropGrid.SetGridValue("width",w,O) then o.setpublish("width",w); if not FPropGrid.SetGridValue("height",h,O) then o.setpublish("height",h); - + if o.WsPopUp then return ; + p := o.parent; + if p then + p.Invalidaterect(nil,0); //setcomponentfocus(o,false); end function DesignerClose(o,e) //控件窗口关闭 @@ -650,7 +657,7 @@ type TVclDesigner = class(tvcform) if FComponentCreater and FCurrentNode and FCurrentClikPos then begin par := FCurrentNode.Component.Cwnd; - r := FComponentCreater.ComponentCreater(FCurrentNode,FCurrentNode.Component.Cwnd); + r := FComponentCreater.ComponentCreater(FCurrentNode,par); if not r then exit; ////////////////////////////////////////// //npar := par; @@ -814,11 +821,32 @@ type TVclDesigner = class(tvcform) if e then e.skip := true; end private //节点点击 + factivatedonging; function windowactive(o,e); begin + if e.wparam then begin + o1 := o; + if FCurrentNode then + begin + wd := FCurrentNode.Component.Cwnd; + wd1 := wd; + while wd1 do + begin + if wd1 = o then + begin + factivatedonging := true; + ClickComponent(wd,e); + factivatedonging := false; + return ; + end + wd1 := wd1.parent; + end + end + factivatedonging := true; ClickComponent(o,e); + factivatedonging := false; end end function ClickComponent(o,e); //点击组件选择 @@ -836,12 +864,13 @@ type TVclDesigner = class(tvcform) end if FCurrentNode<> nd then begin - wd := o;//nd.Component.Cwnd; + //wd := o;//nd.Component.Cwnd; //if wd is class(TWincontrol) then _wapi.BringWindowToTop(wd.Handle); tr.SetSel(nd); TreeNodeSelected(nd); end; setcomponentfocus(o,true); + if factivatedonging then return ; if FComponentCreater and FCurrentNode then begin //SetSysParam("cpos_screan",array(e.lolparam,e.hilparam)); @@ -849,9 +878,10 @@ type TVclDesigner = class(tvcform) begin FCurrentNode := (tr.RootItem.items)[0]; if not FCurrentNode then return FComponentCreater := nil; - O1 := FCurrentNode.Component.Cwnd; - if not o1 then return FComponentCreater := nil; - end else o1 := o; + //O1 := FCurrentNode.Component.Cwnd; + //if not o1 then return FComponentCreater := nil; + end + //else o1 := o; xy := array(0,0); _wapi.GetCursorPos(xy); FCurrentClikPos := o.ScreenToClient(xy[0],xy[1]); diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index a75740e..58098f4 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -2515,7 +2515,7 @@ type TEditer=class(TCustomcontrol) // rd := FPageEditerMenus["查看"]; if rd then begin - mtic; + //mtic; it := GetCurrentEditer(); s := it.CanJump(); if s then @@ -2604,6 +2604,8 @@ type TEditer=class(TCustomcontrol) // it.FEditer.TabChar := FTabChar; it.FEditer.PageItem := it; it.FEditer.hgcolor := Fhightercolor; + tf := FTslCacheDir+"newfile"+ioFileseparator()+"new"; + if pos(tf,n)=1 then it.fisnewfile := true; it.FEditer.QuckKeys := Thisfunction(EditerQuckKeys); it.FEditer.OnTextSetFocus := function(o,e) begin diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index 6c73bbe..206aa79 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -1280,11 +1280,17 @@ type TTslDebuga=class(TCustomControl) end "dbgeval": //执行 begin - if FConnectchannel and p and ifstring(p)then + if FConnectchannel then begin - getvalewnd("ans"); - dbgeval(FConnectchannel,p); - end + if p and ifstring(p) then + begin + getvalewnd("ans"); + dbgeval(FConnectchannel,p); + end + end else + begin + FShowText.Text +="非调试状态!"; + end end end end diff --git a/funcext/tvclib/twincontrol.tsf b/funcext/tvclib/twincontrol.tsf index fbe756e..cad1270 100644 --- a/funcext/tvclib/twincontrol.tsf +++ b/funcext/tvclib/twincontrol.tsf @@ -1916,7 +1916,60 @@ type TWinControl = class(tcontrol) x+=dx; cv.SetPixel(array(x,y),c); end - end + end + ctls := controls; + rcs := array(); + sel := -1; + selr := 0; + len := ctls.count-1 ; + for i:= 0 to len do + begin + vi := ctls[i]; + if vi is class(TWinControl) then + begin + if vi.Visible then rcs[i] := vi.BoundsRect; + if vi.DesigningSelect() then + begin + sel := i; + selr := rcs[i]; + end + end + end + if sel >=0 then + begin + pc := cv.pen.color; + pct := cv.pen.style; + cv.pen.Style := PS_DOT; + cv.pen.color := 0x3f3f3f; + for i := 0 to len do + begin + if i=sel then continue; + rc := rcs[i]; + if not rc then continue; + if rc[0] = selr[0] then + begin + cv.moveto(array(rc[0],min(rc[1],selr[1]))); + cv.LineTo(array(rc[0],max(rc[1],selr[1]))); + end + if rc[1]=selr[1] then + begin + cv.moveto(array(min(rc[0],selr[0]),rc[1])); + cv.LineTo(array(max(rc[0],selr[0]),rc[1])); + end + if rc[2] = selr[2] then + begin + cv.moveto(array(rc[2],min(rc[1],selr[1]))); + cv.LineTo(array(rc[2],max(rc[1],selr[1]))); + end + if rc[3] = selr[3] then + begin + cv.moveto(array(min(rc[0],selr[0]),rc[3])); + cv.LineTo(array(max(rc[0],selr[0]),rc[3])); + end + end + cv.pen.color := pc; + cv.pen.style := pct; + end end end function ControlCreateWnd();