I made a one line fix to the component source so that the mouse cursors appear without handling OnMouseMove in the project. Debugging a OnMouseMove event is difficult so there may be a better way to achieve this, but the fix seems to work. All I had to do is add an exit in the OnMouseMove event so the cursor code is executed and not overwritten by code following the exit. The exit is shown in boldface:
procedure TImageEnView.MouseMove(Shift: TShiftState; X, Y: Integer);
procedure _MoveSelLayers(iMoveX, iMoveY: Integer);
var
aLayer: TIELayer;
i: Integer;
begin
if ( iMoveX = 0 ) and ( iMoveY = 0 ) then
exit;
for i := 0 to LayersCount - 1 do
begin
// Moving aLayer
aLayer := TIELayer( fLayers[ I ]);
if ( aLayer.Locked = False ) and aLayer.Selected then
begin
aLayer.PosX := aLayer.PosX - iMoveX;
aLayer.PosY := aLayer.PosY - iMoveY;
end;
end;
end;
procedure _RotateSelLayers(Value: Double; bSnapToStep: Boolean);
var
aLayer: TIELayer;
i: Integer;
begin
for i := 0 to LayersCount - 1 do
begin
// Rotating aLayer
aLayer := TIELayer( fLayers[ I ]);
if ( aLayer.Locked = False ) and ( aLayer.Selected or ( i = fRotatingLayer )) then
begin
if bSnapToStep then
aLayer.Rotate := trunc( Value / fLayersRotateStep ) * fLayersRotateStep
else
aLayer.Rotate := Value;
end;
end;
end;
var
inLayerX, inLayerY: integer;
grip: TIEGrip;
ii: integer;
layer: TIELayer;
cx, cy: Integer;
dx, dy: Double;
max_x, max_y: Integer;
ox, oy: Integer;
begin
inherited;
fSavedSelectionBase := fSelectionBase;
fSelectionBase := iesbClientArea;
inLayerX := ilimit( X, CurrentLayer.ClientAreaBox.Left, CurrentLayer.ClientAreaBox.Right + 1 );
inLayerY := ilimit( Y, CurrentLayer.ClientAreaBox.Top, CurrentLayer.ClientAreaBox.Bottom + 1 );
if not UserInteractions_MouseMoveExclusive(Shift, X, Y, MouseCapture) then
begin
if MouseCapture then
begin
// inside Mouse Capture
if miScroll in fMouseInteract then
begin
// panning
SetViewXY(fHSVX1 - trunc((X - fMouseDownX)*fMouseScrollRate), fHSVY1 - trunc((Y - fMouseDownY)*fMouseScrollRate) ); // 3.0.2
end
else
if fRectResizing <> ieNone then
begin
// resize rectangular selection
MouseMoveScroll;
fRectResizing := SelectResizeEx(fRectResizing, inLayerX, inLayerY, (ssAlt in Shift) or fForceALTkey or (fSelectionAspectRatio>0));
DoSelectionChanging;
end
else
if fSelectMoving > -1 then
begin
// move selection
if iesoCanScroll in fSelectionOptions then
MouseMoveScroll;
fSelectMoving := SelectMoveEx(fSelectMoving,
CurrentLayer.ConvXScr2Bmp(inLayerX) - CurrentLayer.ConvXScr2Bmp(fPredX),
CurrentLayer.ConvYScr2Bmp(inLayerY) - CurrentLayer.ConvYScr2Bmp(fPredY),
iesoCutBorders in fSelectionOptions);
DoSelectionChanging;
end
else
if fRectSelecting then
begin
// select rectangle
MouseSelectRectangle(inLayerX, inLayerY, Shift);
end
else
if fPolySelecting then
begin
// select polygon
MouseMoveScroll;
Paint;
PolyDraw1;
AnimPolygonAddPtEx(fHPolySel, CurrentLayer.ConvXScr2Bmp(inLayerX), CurrentLayer.ConvYScr2Bmp(inLayerY));
AniPolyFunc(self, true);
DoSelectionChanging;
end
else
if fCircSelecting then
begin
// select circle
MouseSelectCircle(inLayerX, inLayerY, Shift);
end
else
if (fMovingLayer > -1) then
begin
// Moving a layer
layer := TIELayer(fLayers[fMovingLayer]);
if not layer.Locked then
begin
if not fMovResRotLayerStarted and Proc.AutoUndo and ( loAutoUndoLayerChanges in fLayerOptions ) then
Proc.SaveUndo(ieuLayer);
fMovResRotLayerStarted := true;
MouseMoveScroll;
ox := Layer.PosX + ( XScr2Bmp(X) - XScr2Bmp(fPredLX));
oy := Layer.PosY + ( YScr2Bmp(Y) - YScr2Bmp(fPredLY));
fLayerMoved := ( ox <> layer.PosX ) or ( oy <> layer.PosY ) or fLayerMoved;
_MoveSelLayers( layer.PosX - ox, layer.PosY - oy );
SetInteractionHint('X=' + IntToStr( Layer.PosX ) + ' Y=' + IntToStr( Layer.PosY ), X, Y, 'X=000 Y=000');
fUpdate_MaskCache := fMovingLayer;
if fDelayZoomFilter then
fStable := fStableReset;
Update;
if fLayerMoved then
DoLayerNotify(fLayersCurrent, ielMoving);
end;
end
else
if fMovingRotationCenter > -1 then
begin
// moving rotation center
layer := TIELayer(fLayers[fMovingRotationCenter]);
layer.RotateCenterX := layer.ConvXScr2Bmp(X) / layer.Bitmap.Width;
layer.RotateCenterY := layer.ConvYScr2Bmp(Y) / layer.Bitmap.Height;
SetInteractionHint('X='+IntToStr(trunc(layer.RotateCenterX*layer.Width)) + ' Y='+IntToStr(trunc(layer.RotateCenterY*layer.Height)), X, Y, 'X=000 Y=000');
fUpdate_MaskCache := fMovingRotationCenter;
Update;
end
else
if (fRotatingLayer > -1) then
begin
// Rotating a layer
layer := TIELayer(fLayers[fRotatingLayer]);
if not layer.Locked then
begin
if not fMovResRotLayerStarted and Proc.AutoUndo and ( loAutoUndoLayerChanges in fLayerOptions ) then
Proc.SaveUndo(ieuFullLayer);
fMovResRotLayerStarted := true;
dx := ((XScr2Bmp(X) - XScr2Bmp(fPredLX)))/4;
dy := ((YScr2Bmp(Y) - YScr2Bmp(fPredLY)))/4;
cx := CurrentLayer.ConvXBmp2Scr( trunc(CurrentLayer.RotateCenterX * CurrentLayer.Bitmap.Width) );
cy := CurrentLayer.ConvYBmp2Scr( trunc(CurrentLayer.RotateCenterY * CurrentLayer.Bitmap.Height) );
if X > cx then
dy := -dy;
if Y < cy then
dx := -dx;
fRotatingLayerValue := fRotatingLayerValue + dx + dy;
_RotateSelLayers( fRotatingLayerValue, ssShift in Shift );
SetInteractionHint(IEFloatToStrS(layer.Rotate)+'°', X, Y, '0000°');
fUpdate_MaskCache := fRotatingLayer;
if fLayersRotationDelayFilterOnPreview then
fStable := fStableReset;
Update;
DoLayerNotify(fLayersCurrent, ielRotating);
end;
end
else
if (fLayerResizing <> ieNone) and (not CurrentLayer.Locked) then
begin
// Resizing a layer
if not fMovResRotLayerStarted and Proc.AutoUndo and ( loAutoUndoLayerChanges in fLayerOptions ) then
Proc.SaveUndo(ieuLayer);
if not fMovResRotLayerStarted then
fLayersResizingAR := CurrentLayer.Height / CurrentLayer.Width;
fMovResRotLayerStarted := true;
MouseMoveScroll;
MouseResizeLayer(X, Y, (ssAlt in Shift) or fForceALTkey);
SetInteractionHint(IntToStr(CurrentLayer.Width)+' x '+IntToStr(CurrentLayer.Height), X, Y, '0000 x 0000');
fUpdate_MaskCache := fLayersCurrent;
Update;
DoLayerNotify(fLayersCurrent, ielResizing);
end;
// out of Mouse Capture
end
else
if fPolySelecting and not (fLassoSelecting) then
begin
PolyDraw1;
if (ssAlt in Shift) or fForceALTkey then
with PIEAnimPoly(fHPolySel)^ do
if (PolyCount > 0) and (Poly^[PolyCount - 1].x <> IESELBREAK) then
_CastPolySelCC(Poly^[PolyCount - 1].x - fViewX + fOffX, Poly^[PolyCount - 1].y - fViewY + fOffY, inLayerX, inLayerY);
fMMoveX := inLayerX;
fMMoveY := inLayerY;
PolyDraw1;
DoSelectionChanging;
end
else
if (miSelect in fMouseInteract) or (miSelectPolygon in fMouseInteract) or
(miSelectCircle in fMouseInteract) or
(miSelectMagicWand in fMouseInteract) or (miSelectLasso in fMouseInteract) then
begin
grip := GetResizingGrip(X, Y, Shift);
DoMouseInResizingGrip(grip);
if grip = ieNone then
begin
ii := GetMovingGrip(X, Y, Shift);
if ii > -1 then
// moving cursor
SetTempCursor(crIESizeAll)
else
begin
// default cursor
if (ssShift in Shift) and fEnableShiftKey then
begin
case cursor of
crIECrossSight : SetTempCursor(crIECrossSightPlus);
crIEThickCross : SetTempCursor(crIEThickCrossPlus);
end;
end
else
RestoreCursor;
end;
end
else
begin
// resizing cursors
case grip of
ieTopLeft, ieBottomRight: SetTempCursor(crIESizeNWSE);
ieTopRight, ieBottomLeft: SetTempCursor(crIESizeNESW);
ieLeftSide, ieRightSide: SetTempCursor(crIESizeWE);
ieTopSide, ieBottomSide: SetTempCursor(crIESizeNS);
end;
end;
end
else
if (miRotateLayers in fMouseInteract) then
begin
// layers rotation. Rotate only the currently selected layer.
if IsPointInsideLayer(X, Y, fLayersCurrent) then
RestoreCursor
else
begin
cx := CurrentLayer.ConvXBmp2Scr( trunc(CurrentLayer.RotateCenterX * CurrentLayer.Bitmap.Width) );
cy := CurrentLayer.ConvYBmp2Scr( trunc(CurrentLayer.RotateCenterY * CurrentLayer.Bitmap.Height) );
if (X < cx) and (Y < cy) then
SetTempCursor(crIERotateSE)
else
if (X < cx) and (Y > cy) then
SetTempCursor(crIERotateNE)
else
if (X > cx) and (Y < cy) then
SetTempCursor(crIERotateSW)
else
if (X > cx) and (Y > cy) then
SetTempCursor(crIERotateNW);
end;
end
else
if ((miResizeLayers in fMouseInteract) or (miMoveLayers in fMouseInteract)) then
begin
grip := ieNone;
if (miResizeLayers in fMouseInteract) then
begin
if LayersAllowMultiSelect then
grip := FindLayerGripAnySel(X, Y)
else
if TIELayer(fLayers[fLayersCurrent]).Locked = False then
grip := FindLayerGrip(X, Y);
end;
if grip = ieNone then
begin
ii := FindLayerAt(X, Y);
if (ii > -1) and (not TIELayer(fLayers[ii]).Locked) and (miMoveLayers in fMouseInteract) then
// moving cursor
SetTempCursor(crIESizeAll)
else
// default cursor
RestoreCursor;
end
else
begin
// resizing cursors
case grip of
ieTopLeft, ieBottomRight : SetTempCursor(crIESizeNWSE);
ieTopRight, ieBottomLeft : SetTempCursor(crIESizeNESW);
ieLeftSide, ieRightSide : SetTempCursor(crIESizeWE);
ieTopSide, ieBottomSide : SetTempCursor(crIESizeNS);
end;
exit; // Temporary fix so correct cursor appears
end;
end;
end;
UserInteractions_MouseMove(Shift, X, Y, MouseCapture);
// Rulers
if fRulerParams.HandleMouseMove( Shift, X, Y ) then
SetTempCursor( crDefault )
else
RestoreCursor;
if (miMovingScroll in fMouseInteract) and ((fPredLx <> X) or (fPredLy <> Y)) and not MouseCapture then
begin
GetMaxViewXY(max_x, max_y);
cx := trunc( (imax(imin(ClientWidth -1, X), 0)/(ClientWidth )-0.02) * 1.05 * (max_x) );
cy := trunc( (imax(imin(ClientHeight-1, Y), 0)/(ClientHeight)-0.02) * 1.05 * (max_y) );
SetViewXYSmooth( cx, cy );
end;
if fSelectionMask.IsPointInside(CurrentLayer.ConvXScr2Bmp(inLayerX), CurrentLayer.ConvYScr2Bmp(inLayerY)) then
DoMouseInSel;
fMMoveX := inLayerX;
fMMoveY := inLayerY;
fSelectionBase := fSavedSelectionBase;
fPredX := inLayerX;
fPredY := inLayerY;
fPredLx := X;
fPredLy := Y;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development