Code pieces for two stages of check

zhaozj2021-02-12  152

// Mobile graphic object Procedure Tmoveableshape.MoveShapes (DELTAX, DELTAY: INTEGER); VAR I, Pass: Integer; tempControl: tcontrol; begin if not assigned (parent).

// do 2 passes through controls. The first one is to check what all //movements are valid two controls, the first time is effective, the second is mobile for pass: = 1 to 2 do begin for i : = 0 to Parent.ControlCount - 1 do begin TempControl: = Parent.Controls [I]; if TempControl is TMoveableShape then begin if (Pass = 1) and (not TMoveableShape (TempControl) .ValidMove (DeltaX, DeltaY)) then Exit Else if (pass = 2) And Tmoveableshape (TempControl) .Selected THENTMOVEESHAPE (TempControl) .Move (deltax, Deltay); End; end;

转载请注明原文地址:https://www.9cbs.com/read-6570.html

New Post(0)