CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Please Help !!!

  1. #1
    Join Date
    Apr 1999
    Location
    India
    Posts
    15

    Please Help !!!

    I have an tracker and when I scroll down , my tracker is at the same place but the covering object(ellipse or rectangle) moves up.
    Pls advice me the way to move tracker also !!!

    regards,
    Kapil



  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Please Help !!!

    If you are manually positioning the tracker, you must call CScrollView::GetScrollPosition() and offset your tracker's CRect by the contents of the CPoint returned. I.e.,

    CPoint ptScrollPos ;
    CRect rctTracker(0, 0, 100, 50); // Top-left, with no scrolling.

    ptScrollPos = GetScrollPosition();
    rctTracker.OffsetRect(ptScrollPos); // ALWAYS top-left now.

    Does this help?



    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    Apr 1999
    Location
    India
    Posts
    15

    Re: Please Help !!!

    Thanx for the suggestion but the problem is bit more complex as its not derived from CRect, the object is derived from CRetcTracker , which takes the parameter in Device coordinates.
    I am waiting for your reply.

    Regards,
    Kapil



  4. #4
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Please Help !!!

    I think it should still work - after all, the CRectTracker still uses a standard CRect for its position and size.

    Why do you say 'device co-ordinates'? I cannot find any mention that the position must be in device co-ords, although we have VC++ V4.0 here, so it may say that in later versions. It DOES say 'client' (description of m_rect member), but it is assuming a non-scrolling window, I believe. Have you tried it and it fails?

    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured