MouseCursor Problems

MouseCursor Problems

Post by Davi » Sat, 14 Jun 2003 18:34:35



procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Cursor := crHourGlass;
end;

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
    Cursor := crDefault;
end;

Why dosn't the cursor change in this code?

I am using win2000 and delphi6!

regards,
David

 
 
 

MouseCursor Problems

Post by Michael Koo » Sat, 14 Jun 2003 18:39:18


Hi David,
take the following code, this works...
------------
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

var
    Save_Cursor:TCursor;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
Save_Cursor := screen.Cursor;
end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
screen.Cursor := crHourGlass;
end;

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
screen.Cursor := save_cursor;
or ....
screen.Cursor := crdefault;
end;

end.

------------
HINT:...I don't know why your example won't works !!
best regards
Michael Koop


>procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
>  Shift: TShiftState; X, Y: Integer);
>begin
>  Cursor := crHourGlass;
>end;

>procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
>  Shift: TShiftState; X, Y: Integer);
>begin
>    Cursor := crDefault;
>end;

>Why dosn't the cursor change in this code?

>I am using win2000 and delphi6!

>regards,
>David


 
 
 

MouseCursor Problems

Post by Davi » Sat, 14 Jun 2003 19:34:10


Quote:> Hi David,
> take the following code, this works...
> procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
>   Shift: TShiftState; X, Y: Integer);
> begin
> screen.Cursor := crHourGlass;
> end;

> procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
>   Shift: TShiftState; X, Y: Integer);
> begin
> screen.Cursor := save_cursor;
> or ....
> screen.Cursor := crdefault;
> end;

Thanks, it does, but I want to change the cursor of one control only. In my
simple example the form, and in my real code a control inherited from
TCustomControl.

Any ideas, how to solve it?

regards,
David

 
 
 

MouseCursor Problems

Post by Wayne Herber » Sat, 14 Jun 2003 23:58:39


There is some sort of oddity in the mouse cursor routines.  If has to do
with the messages being passed to the child window or control in which
the cursor is active.  In my case, the cursor is in a TImage inside a
scrollbox so my code looks like this:

    ScrBox.Perform (WM_SETCURSOR,ScrBox.Handle,HTCLIENT);
    MapImg.Cursor := cursorSpot;

MapImg is my TImage.


> procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
>   Shift: TShiftState; X, Y: Integer);
> begin
>   Cursor := crHourGlass;
> end;

> procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
>   Shift: TShiftState; X, Y: Integer);
> begin
>     Cursor := crDefault;
> end;

> Why dosn't the cursor change in this code?

> I am using win2000 and delphi6!

> regards,
> David

 
 
 

1. Mousecursor in VESA mode

Hi all,

I've made a program which runs in VESA mode 0101h and uses a mouse.
With my mouse came a mouse driver with a VESA module. Without that my mouse
cursor isn't visible. I was wondering if anyone knows how to make a driver
which supports a mousecursor in VESA mode. After all, it would be nice to
actually see where your cursor is when you wanna draw something. Any info
is greatly appreciated.

My thanx in advance,

Arjen.

2. File formats for objects WANTED!

3. Mousecursor

4. Send 20 FREE Pages of Fax to any Fax machines in the World!

5. Does anyone have a 3DFX mousecursor example?

6. Newbie's question: realistic textures

7. transparent mousecursor

8. Flares

9. Mousecursor Question

10. Mousecursor

11. How can I set the mousecursor on position that I want?

12. Problems..Problems..Problems

13. UDO importation problem/POV-ray rendering problem?