diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index d9762c8..d1955f4 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -4096,40 +4096,7 @@ function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); begin return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); end -type TCanvsRgnClipAutoSave=class - {** - @expan(说明) 裁剪canvas区域,销毁时还原 %% - **} - function Create(cvs,rec); - begin - {** - @explan(说明)构造裁剪对象 %% - @param(cvs)(tcustomcanvas) canvas 对象 %% - @param(rec)(array(左上右下))区域 %% - **} - if(cvs is class(tcustomcanvas))and cvs.HandleAllocated()and ifarray(rec)then - begin - FW32api := cvs._wapi; - FCvsHandle := cvs.Handle; - FCrg := FW32api.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); - FBKrg := FW32api.SelectClipRgn(FCvsHandle,FCrg); //裁剪区域 - end - end - function Destroy(); - begin - if FW32api and FCvsHandle and FBKrg and FCrg then - begin - FW32api.SelectClipRgn(FCvsHandle,FBKrg); //恢复区域 - FW32api.DeleteObject(FCrg); //销毁区域 - end - FW32api := nil; - end - private - FBKrg; - FCrg; - FCvsHandle; - FW32api; -end + InitialIzation end. diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index 21be06e..11de62b 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -2047,6 +2047,40 @@ type TIniFileExter=class() ffilename; finiobj; end +type TCanvsRgnClipAutoSave=class + {** + @expan(说明) 裁剪canvas区域,销毁时还原 %% + **} + function Create(cvs,rec); + begin + {** + @explan(说明)构造裁剪对象 %% + @param(cvs)(tcustomcanvas) canvas 对象 %% + @param(rec)(array(左上右下))区域 %% + **} + if(ifobj(cvs))and cvs.HandleAllocated()and ifarray(rec)then + begin + FW32api := cvs._wapi; + FCvsHandle := cvs.Handle; + FCrg := FW32api.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); + FBKrg := FW32api.SelectClipRgn(FCvsHandle,FCrg); //裁剪区域 + end + end + function Destroy(); + begin + if FW32api and FCvsHandle and FBKrg and FCrg then + begin + FW32api.SelectClipRgn(FCvsHandle,FBKrg); //恢复区域 + FW32api.DeleteObject(FCrg); //销毁区域 + end + FW32api := nil; + end + private + FBKrg; + FCrg; + FCvsHandle; + FW32api; +end implementation function includestate(u,s); begin diff --git a/funcext/tvclib/utslvclgrid.tsf b/funcext/tvclib/utslvclgrid.tsf index a313ac0..df24771 100644 --- a/funcext/tvclib/utslvclgrid.tsf +++ b/funcext/tvclib/utslvclgrid.tsf @@ -932,64 +932,21 @@ type TcustomGridCtl = class(tcustomscrollcontrol) // FCurrentSizeId; FCurrentSizePos; end - - - -type TCanvsRgnClipAutoSave=class()//canvas 裁剪 - {** - @expan(说明) 裁剪canvas区域,销毁时还原 %% - **} - function Create(cvs,rec); - begin - {** - @explan(说明)构造裁剪对象 %% - @param(cvs)(tcustomcanvas) canvas 对象 %% - @param(rec)(array(左上右下))区域 %% - **} - if(cvs is class(tcustomcanvas))and cvs.HandleAllocated()and ifarray(rec)then - begin - FW32api := cvs._wapi; - FCvsHandle := cvs.Handle; - FCrg := FW32api.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); - FBKrg := FW32api.SelectClipRgn(FCvsHandle,FCrg); //裁剪区域 - end - end - function Destroy(); - begin - if FW32api and FCvsHandle and FBKrg and FCrg then - begin - FW32api.SelectClipRgn(FCvsHandle,FBKrg); //恢复区域 - FW32api.DeleteObject(FCrg); //销毁区域 - end - FW32api := nil; - end - private - FBKrg; - FCrg; - FCvsHandle; - FW32api; -end implementation -type TPAINTCOUNT=class - {** - @explan(说明) 绘制计数 %% - **} +type TPAINTCOUNT=class()//绘制标记 function create(v); begin - if v is class(TControl)then - begin - FPainter := v; - v.IncPaintLock(); - end + FPainter := v; + v.IncPaintLock(); end function Destroy(); begin - if FPainter then FPainter.DecPaintLock(); + FPainter.DecPaintLock(); FPainter := nil; end FPainter; end -type TMerger=class +type TMerger=class()//合并单元格类型 public FCells; function Create(); @@ -1000,12 +957,12 @@ type TMerger=class begin return length(FCells); end - function mergeid(i,j); + function mergeid(i,j);//是否合并 begin i := FCells[0]; j := FCells[1]; end - function CellInMerge(i,j); + function CellInMerge(i,j);//是属于某个合并 begin if isok()then begin @@ -1013,7 +970,7 @@ type TMerger=class end return false; end - function GetRange(); + function GetRange();//获得合并的区域 begin r := array(); if isok()then @@ -1022,46 +979,11 @@ type TMerger=class end return r; end - function SetMergeCells(rec); + function SetMergeCells(rec);//合并区域 begin FCells := array(); if not ifarray(rec)then return; if(rec[2]>= rec[0]and rec[3]>rec[1])or(rec[2]>rec[0]and rec[3]>= rec[1])then FCells := rec; end end -type TCanvsRgnClipAutoSave=class()//canvas 裁剪 - {** - @expan(说明) 裁剪canvas区域,销毁时还原 %% - **} - function Create(cvs,rec); - begin - {** - @explan(说明)构造裁剪对象 %% - @param(cvs)(tcustomcanvas) canvas 对象 %% - @param(rec)(array(左上右下))区域 %% - **} - if(cvs is class(tcustomcanvas))and cvs.HandleAllocated()and ifarray(rec)then - begin - FW32api := cvs._wapi; - FCvsHandle := cvs.Handle; - FCrg := FW32api.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); - FBKrg := FW32api.SelectClipRgn(FCvsHandle,FCrg); //裁剪区域 - end - end - function Destroy(); - begin - if FW32api and FCvsHandle and FBKrg and FCrg then - begin - FW32api.SelectClipRgn(FCvsHandle,FBKrg); //恢复区域 - FW32api.DeleteObject(FCrg); //销毁区域 - end - FW32api := nil; - end - private - FBKrg; - FCrg; - FCvsHandle; - FW32api; -end - end. \ No newline at end of file