Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CRectTracker inside a CScrollView

CRectTracker inside a CScrollView

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fahr
    wrote on last edited by
    #1

    Hello, I'm having the following problem; when I try to put a CRectTracker inside a CScrollView, it LOOKS fine, but doesn't actually work. As soon as I scroll an item inside the CRectTracker out of the screen, it appears as if the item IS outside the working area, but the actual rectangle surrounding the item remains stuck to the side on which I scrolled it out. So the picture appears to be half out of the working area, but when I click next to the picture, it still grabs the rectangle and I see the surrounding rectangle line as if the objects border is at the working area border. Does anyone have a solution for this problem? Thanks, - Fahr

    M 1 Reply Last reply
    0
    • F Fahr

      Hello, I'm having the following problem; when I try to put a CRectTracker inside a CScrollView, it LOOKS fine, but doesn't actually work. As soon as I scroll an item inside the CRectTracker out of the screen, it appears as if the item IS outside the working area, but the actual rectangle surrounding the item remains stuck to the side on which I scrolled it out. So the picture appears to be half out of the working area, but when I click next to the picture, it still grabs the rectangle and I see the surrounding rectangle line as if the objects border is at the working area border. Does anyone have a solution for this problem? Thanks, - Fahr

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      If I understand correctly, you need to use CWnd::SetCapture to capture the mouse event to the view that has the action. you do a SetCapture on the ButtonDown , and you do a release capture on the ButtonUp. Max.

      F A 2 Replies Last reply
      0
      • M Maximilien

        If I understand correctly, you need to use CWnd::SetCapture to capture the mouse event to the view that has the action. you do a SetCapture on the ButtonDown , and you do a release capture on the ButtonUp. Max.

        F Offline
        F Offline
        Fahr
        wrote on last edited by
        #3

        I guess that's not quite what I mean... Check out the following screenshots, the first one shows where the rectangle is when I select it. The second one is more clear, it shows the border of the rectangle is sizing dots, while the content is obviously scrolled out... screenshots: http://www.lycantrope.com:5000/~Vahlinear/recttracker1.jpg http://www.lycantrope.com:5000/~Vahlinear/recttracker2.jpg Thanks, - Fahr

        1 Reply Last reply
        0
        • M Maximilien

          If I understand correctly, you need to use CWnd::SetCapture to capture the mouse event to the view that has the action. you do a SetCapture on the ButtonDown , and you do a release capture on the ButtonUp. Max.

          A Offline
          A Offline
          Azadeh
          wrote on last edited by
          #4

          I think Fahr's problem is similar to my problem.I want to explain more , maybe someone could solve our problem. I wrote a program that someone could choose items from a toolbar and put them on the document by clicking left button of mouse on the view. I considered a CRectTracker variable for each symbol and in the OnDraw function I draw each symbol's tracker's rectangle.And for selecting each symbol which is shown on the page I check if the position of left click of mouse is in the tracker of any of the symbols or not.At the beginning I used CView class but now I want to use CScrollView in order that my program could support scrolling.I changed the base class of my view class to CScrollView and write some lines in its OnInitialUpdate in order to set the size of scrolling.Now I scroll my program but when I put an item on the page and scroll the page , in some places that my item doesn't exist , it seems that its tracker exists and if I move it or delete it or sth else , those changes would be applied on the real item that is somewhere upper than there. I think I should change the coordinates of the CRectTracker variable of my item , but I don't know how. Thanks Azadeh

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups