need help with drawing and scrolling
-
in my application i draw rectangles, using points in LButtonDown, MouseMove and LButtonUp, 1) I don't want LButtonUp to happen outside of my view, How can i stop that? 2) My rectangles can be moved using arrow buttons, i want scrollers to appear if any point of my rects are outside of the display area(if the window is small) 3) when i scroll the window, my objects ARE redrawn but they don't move with the window. They stick to the same location. Do i need to do world to normalize to device? Need code for that.... If you can answer any of the above questions it will be highly appreciated :) thanks, F.Dost
-
in my application i draw rectangles, using points in LButtonDown, MouseMove and LButtonUp, 1) I don't want LButtonUp to happen outside of my view, How can i stop that? 2) My rectangles can be moved using arrow buttons, i want scrollers to appear if any point of my rects are outside of the display area(if the window is small) 3) when i scroll the window, my objects ARE redrawn but they don't move with the window. They stick to the same location. Do i need to do world to normalize to device? Need code for that.... If you can answer any of the above questions it will be highly appreciated :) thanks, F.Dost
- if the user releases the button outside your window, what should happen? 2) call SetScrollSizes with the size of your total window (including objects that have moved off the visible part). 3) GetScrollPos, then add the position to your drawing locations. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
-
- if the user releases the button outside your window, what should happen? 2) call SetScrollSizes with the size of your total window (including objects that have moved off the visible part). 3) GetScrollPos, then add the position to your drawing locations. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
thank you for your respond.... 1) i don't want cursor to go out of my window if it is pressed and is drawing cursor, 3) i can't change the coordiantes of my objects, caz i write them in the file and read them, user will be able to draw in say (500 by 500), but the view can be smaller of bigger, do you think i need to scale my view to (500 by 500)? Thanks, F.Dost
-
in my application i draw rectangles, using points in LButtonDown, MouseMove and LButtonUp, 1) I don't want LButtonUp to happen outside of my view, How can i stop that? 2) My rectangles can be moved using arrow buttons, i want scrollers to appear if any point of my rects are outside of the display area(if the window is small) 3) when i scroll the window, my objects ARE redrawn but they don't move with the window. They stick to the same location. Do i need to do world to normalize to device? Need code for that.... If you can answer any of the above questions it will be highly appreciated :) thanks, F.Dost
By using SetCapture in LMBDown you can make your window continue to recieve the events when your mouse leaves the window. You can also use OnMOuseMove to check your position and limit it ( you'll still need setcapture to get the message ) but limiting a users mouse movement is almost never a good idea. Don't forget to call REleaseCapture in LMB up. Use a ScrollView and you get the scrollers for free A scrollview will probably fix problem 3 as well. Christian The content of this post is not necessarily the opinion of my yadda yadda yadda. To understand recursion, we must first understand recursion.