Drag Cursor
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Drag Cursor
In many other applications we see that when a drag cursor is moved over a window ( or control ) that does not accept the drop, the cursor changes as circle with a line inside. The user knows that this control does not accept the drop. Only the window ( control ) which accepts the drop shows the drag cursor in its original shape.
In the programs we develop with FW, the drag cursor looks the same even when it is moved over windows ( controls ) which do not accept drop. ( bDropOver data is nil ).
Is it possible for the Window class's method MouseMove examines the cursor, and if it is a drag cursor originating from some other control, and if the window's bDropOver is nil, to change the shape of cursor to the Circle with Dash cursor ?
In the programs we develop with FW, the drag cursor looks the same even when it is moved over windows ( controls ) which do not accept drop. ( bDropOver data is nil ).
Is it possible for the Window class's method MouseMove examines the cursor, and if it is a drag cursor originating from some other control, and if the window's bDropOver is nil, to change the shape of cursor to the Circle with Dash cursor ?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
We could control that behavior from the MouseMove() method.
We need to check the object that it is below the mouse, and if it is a FWH object, and then check its bDropOver codeblock contents.
We need to check the object that it is below the mouse, and if it is a FWH object, and then check its bDropOver codeblock contents.
Last edited by Antonio Linares on Tue Jan 29, 2008 9:15 am, edited 1 time in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
To locate the control that it is under the mouse we can use WindowFromPoint()
To check if it is a FWH object, we can use:
We could modify METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TControl if we want to turn it a standard behavior
To check if it is a FWH object, we can use:
Code: Select all
hWndCtl = WindowFromPoint( nRow, nCol )
if oWndFromHwnd( hWndCtl ) != nil .and. oWndFromHwnd( hWndCtl ):bDragOver != nil
SetCursor( ... )
else
SetCursor( ... )
endif
Last edited by Antonio Linares on Tue Jan 29, 2008 9:20 am, edited 3 times in total.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
I'm thinking that there must be a Windows API for this since other programs (like Windows Explorer) can communicate with other programs when dragging the cusor because it changes depending on which program the drag cursor is over. When I dragged it over one program it changed to a link icon, and then over another program and it changed to a black circle containing a slash.
James
James
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
James, Nageswararao,
FWH does not use the standard Windows API for such conversation. We did it that way to have full control on it (as we may need to drop "non standard" Windows contents, as Harbour objects, codeblocks, etc.).
But, on the other hand, we can't drop on non FWH apps cause that
Maybe we should combine both methods
FWH does not use the standard Windows API for such conversation. We did it that way to have full control on it (as we may need to drop "non standard" Windows contents, as Harbour objects, codeblocks, etc.).
But, on the other hand, we can't drop on non FWH apps cause that
Maybe we should combine both methods
Last edited by Antonio Linares on Tue Jan 29, 2008 9:24 am, edited 1 time in total.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
NageswaraRao,
>Isn't the change in the shape of drag cursor a native behaviour of windows? Dont think all windows are programmed to change the shape.
I'm not sure what you mean?
I dragged a file from Windows Explorer over IE (FiveWin Forum) and it changed to a link icon, then over an email monitoring program and it changed to the circle/slash. The first two are Microsft programs, but the last one isn't.
James
>Isn't the change in the shape of drag cursor a native behaviour of windows? Dont think all windows are programmed to change the shape.
I'm not sure what you mean?
I dragged a file from Windows Explorer over IE (FiveWin Forum) and it changed to a link icon, then over an email monitoring program and it changed to the circle/slash. The first two are Microsft programs, but the last one isn't.
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Yes, I am not in a hurry either. Drag & drop is nice to have, but not a requirement. Lots of users never even discover it.
I did build a prototype app that makes use of D&D and it seems to be quite useful to me. But, I know how to use it, so I know where I can drop and where I can't. So, visual "hinting" would be a nice addition.
James
I did build a prototype app that makes use of D&D and it seems to be quite useful to me. But, I know how to use it, so I know where I can drop and where I can't. So, visual "hinting" would be a nice addition.
James
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Mr Antonio
Here is a suggestion.
At the outset, when the first window is created a NoDropCursor is created either as static variable or class variable in the Window.prg. At the end of the application this cursor is destroyed. Assuming this is done, I suggest the following modification to the MoveMove method of Window.Prg
Please review.
Here is a suggestion.
At the outset, when the first window is created a NoDropCursor is created either as static variable or class variable in the Window.prg. At the end of the application this cursor is destroyed. Assuming this is done, I suggest the following modification to the MoveMove method of Window.Prg
Code: Select all
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TWindow
/*
// original code
if ::oCursor != nil
SetCursor( ::oCursor:hCursor )
else
CursorArrow()
endif
*/
// Proposed Code
if uDropInto != nil .and. ::bDropOver == nil .and. ::bDropFiles == nil
SetCursor( oNoDropCursor:hCusor )
elseif ::oCursor != nil
SetCursor( ::oCursor:hCursor )
else
CursorArrow()
endif
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India