I have made the following changes to set the cursor for a TShape component
The TSape cursor now can be changed not only in win32, but also on Linux (tested with Ubuntu)

Changes in ExtCtrls.pas
***************
*** 329,334 ****
--- 329,337 ----
      FPen: TPen;
      FBrush: TBrush;
      FShape: TShapeType;
+          FtmpCursor : TCursor;
+          procedure MouseLeave;  override;
+          procedure MouseEnter; override;
      procedure SetBrush(Value: TBrush);
      procedure SetPen(Value: TPen);
      procedure SetShape(Value: TShapeType);
     
     
Changes in shape.inc
***************
*** 104,109 ****
--- 104,122 ----
    end;
  end;
 
+ procedure TShape.MouseLeave;
+  begin
+    Parent.Cursor:=FTmpCursor;
+    inherited MouseLeave;
+ end;
+
+ procedure TShape.MouseEnter;
+  begin
+    inherited MouseEnter;
+    FTmpCursor:=Parent.Cursor;
+    Parent.Cursor:=Self.Cursor;
+ end;
+

I hope this patch will be usefull

Greetings, Marien

Reply via email to