Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.04.01;
Download: [xml.tar.bz2];

Down

How to determine the coordinates of the cursor? Find similar branches


AlexMey   (2002-03-20 12:40) [0]

Dear masters.

Tell me ...

I have a visual component (for example TreeView). You need to do the following - when the DblClick event occurs, determine the coordinates of the mouse cursor. How can this be done because in DblClick, in contrast to MouseDown, the coordinates of the cursor are not transmitted?

Thanks in advance, Alexander.



Виктор Щербаков   (2002-03-20 12:43) [1]

GetCursorPos



AlexMey   (2002-03-20 12:53) [2]

Thanks, a lot !!!



AlexMey   (2002-03-20 13:09) [3]

By the way, the GetCursorPos function returns the Absolute coordinates of the cursor, and to determine the local (i.e. inside my TreeView) I wrote

.

procedure TForm1.TreeView1DblClick (Sender: TObject);
was
cords: TPoint;
begin
GetCursorPos (cords);
// go to local coordinates. forms
cords.X: = cords.X - Form1.Left;
cords.Y: = cords.Y - Form1.Top;
// go to the local coordinates of the element
cords.X: = cords.X - TreeView1.Left;
cords.Y: = cords.Y - TreeView1.Top;
ShowMessage (IntToStr (cords.X) + "" + IntToStr (cords.Y));
end;

But in the TreeView, at the 1,1 coordinates, the 5,25 values ​​are obtained !!!!!!!!
There is some kind of bias ... Do not tell me how to deal with this?

Thanks in advance, Alexander.



Alx2   (2002-03-20 13:18) [4]

Probably worth a look ClientToScreen, ScreenToClient



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.04.01;
Download: [xml.tar.bz2];

Top









Memory: 0.56 MB
Time: 0.018 c
We answer immediately.
ghost_by
2002-03-06 20:20
2002.04.01
Show Hint s in StringGride


We answer immediately.
Yu
2002-03-21 12:06
2002.04.01
What kind of mistake?


We answer immediately.
Bxnumde
2001-12-25 00:46
2002.04.01
HOW TO TURN ON AND TURN OFF KEY !!!


We answer immediately.
Olga
2002-03-18 16:24
2002.04.01
Outlook


We answer immediately.
cok
2002-03-20 18:36
2002.04.01
Tray





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish