Re: ClipCursor trouble
- From: "Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 19 Nov 2006 00:45:37 -0500
The point is based on client coordinates of a sprite's rectangle. Joe, I
abbreviated because the related chunks are quite intricate with
calculations, and I wanted to make sure I got an answer in this group. In
short, the cursor is "demoed" from its current location to
m_ptMoveCursorToward, with the related timer killed when ptMoveCursorFrom
becomes equal to ptMoveCursorToward. The cursor is clipped at every point
along its path. The process is normally very smooth and perfectly accurate;
but when I resize the window, the cursor parallels the path at a distance.
Is it possible to advise me on the basis of this information?
------------------
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:a5nvl2l09pq5tn3cbnkk26epki51l7hgjj@xxxxxxxxxx
Not enough information here. Is CPoint in screen or client coordinates?
On Sat, 18 Nov 2006 19:54:06 -0500, "Steve Russell"
<srussell@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
Thanks, Joe. Here is where I think the trouble first shows up. I have****
spent all day trying to understand and solve it, including various uses of
ScreenToClient etc that I have read in various literature, particularly
after your comments.
void CTestView::SetMoveCursorToward(CPoint point)
{
m_ptMoveCursorToward.x = point.x;
m_ptMoveCursorToward.y = point.y;
What's wrong with writing
m_ptMoveCursorToward = point;
?
I don't see the role this plays. A spec of expected behavior would help.
How is 'point'
computed, and what relationship does it have to the current cursor
position? And since I
don't actually see a SetClipCursor call anywhere here, it is hard to guess
what is
intended.
****
*****
::GetCursorPos(&m_ptMoveCursorFrom);
m_bCursorCouldBeMovingToward = true;
m_nMoveCursorTowardCounter = 0;
SetTimer(Timer_MoveCursorToward,0,NULL);
Since the role of these variables is not defined, and the role of the
timer is not
specified, and the timer handler code is not shownt is hard to guess what
any of this code
is attempting to do.
****
}Joseph M. Newcomer [MVP]
--------
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:id3vl2pjg1eeed3o670fvk20il8ma03u05@xxxxxxxxxx
Show the code. Note that you must use screen coordinates, which means
you
must recompute
the cursor position any time the window is moved or resized.
joe
On Sat, 18 Nov 2006 17:03:47 -0500, "Steve Russell"
<srussell@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
I should add that in the resized window, when I run a test withJoseph M. Newcomer [MVP]
GetCursorPos
and then create a small color filled rectangle centered on those
coordinates, the rectangle is accurate, but my cursor is in a different
position. The smaller the window, the greater the divergence.
-------------
"Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23%231Ujo1CHHA.4928@xxxxxxxxxxxxxxxxxxxxxxx
I am unable to use ClipCursor accurately when I resize my window.
Maximized is the only state in which I get perfect results. Is there
something I should know about the relationship between ClipCursor and
resizing a window?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: ClipCursor trouble
- From: Joseph M . Newcomer
- Re: ClipCursor trouble
- References:
- ClipCursor trouble
- From: Steve Russell
- Re: ClipCursor trouble
- From: Steve Russell
- Re: ClipCursor trouble
- From: Joseph M . Newcomer
- Re: ClipCursor trouble
- From: Steve Russell
- Re: ClipCursor trouble
- From: Joseph M . Newcomer
- ClipCursor trouble
- Prev by Date: Re: Creating Run Time Controls
- Next by Date: CHHTML Dialog - notify when the page is loaded
- Previous by thread: Re: ClipCursor trouble
- Next by thread: Re: ClipCursor trouble
- Index(es):
Relevant Pages
|