CRectTracker inside a CScrollView
-
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
-
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
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.
-
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.
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
-
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.
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