i want to pan a very big wxScrollWindow, i realized with dc.SetDeviceOrigin, but i still want to know what is the best way to do this?
(2)and then as for the scale problem, what is the difference beteen SetSize and SetVirtualSize ? actually i need a very big window.
(3)hwo to show the Scrollbats, i set ShowScrollbars, but it doesn't show now....
pan and scale a wxScrollWindow
Re: pan and scale a wxScrollWindow
and if i want a "infinit" wxScrollWindow, is it possible?
I mean wherever i drag, there is always the window
I mean wherever i drag, there is always the window
Re: pan and scale a wxScrollWindow
SetDeviceOrigin() only matters while drawing into the window. You just need to set a big virtual size.i want to pan a very big wxScrollWindow, i realized with dc.SetDeviceOrigin, but i still want to know what is the best way to do this?
This is not directly related to scaling. The virtual size is the whole are that can be reached by scrolling. SetSize set the outer dimensions of the visible portion. E.g. you could have a 20000x20000 area with only a 500x500 window visible.(2)and then as for the scale problem, what is the difference beteen SetSize and SetVirtualSize ? actually i need a very big window.
I think you also need to call SetScrollRate().3)hwo to show the Scrollbats, i set ShowScrollbars, but it doesn't show now....
Use the source, Luke!
Re: pan and scale a wxScrollWindow
Thoeretically possible, just not with wxScrolledWindow which is based on the concept of a defined virtual size. Also when putting native controls onto the panel, you need to consider that Windows still uses 16bit values for coordinates in some places. I'm not sure it would be possible to place a wxButton at (100000, 100000). You should try that before continuing in that direction.and if i want a "infinit" wxScrollWindow, is it possible?
I mean wherever i drag, there is always the window
Possible workaround for the "infinite area" problem: Make sure there is a 15% (or any other useful value) border around all controls. Recalculate that bounding box whenever controls are added, deleted or moved. That way there is always some free space where the user can place new items.
Use the source, Luke!
Re: pan and scale a wxScrollWindow
thanks 
so ur opinion is that don't use SetDeviceOrigin,
i now have problem:
(1)i use mouseWheel event to scale the window, and i set the virtual size, it works fine. But when i drag the scrollbar, the background drawed lines are now fresh, i mean ,how can i get the scrollbar event when i draging and dragdone it
(2)SetDeviceOrigin is not used, so how can i pan the window, use startview or sth? and i think the Pan event i deal with can do the same thing when i drag the scrollbar, so how i unify them?

so ur opinion is that don't use SetDeviceOrigin,
i now have problem:
(1)i use mouseWheel event to scale the window, and i set the virtual size, it works fine. But when i drag the scrollbar, the background drawed lines are now fresh, i mean ,how can i get the scrollbar event when i draging and dragdone it
(2)SetDeviceOrigin is not used, so how can i pan the window, use startview or sth? and i think the Pan event i deal with can do the same thing when i drag the scrollbar, so how i unify them?
Re: pan and scale a wxScrollWindow
plus, when i wheel the mouse, not only the Scale things i do works, but also the srcollbar(verticle one) is moving...i think it's the defalut event which i have to deal
Re: pan and scale a wxScrollWindow
I'm not quite sure what you mean. During the scrolling the window should receive paint events and redraw itself. If there are redraw errors, check your drawing code. Besides that you can still catch the scroll events given in the documentation:But when i drag the scrollbar, the background drawed lines are now fresh, i mean ,how can i get the scrollbar event when i draging and dragdone it
http://docs.wxwidgets.org/trunk/classwx_scrolled.html
The Scroll() method is really not that hard to find.SetDeviceOrigin is not used, so how can i pan the window, use startview or sth?
http://docs.wxwidgets.org/trunk/classwx ... d065907f69
I would recommend to use CTRL+Mouse wheel for the zooming which is the quasi standard.plus, when i wheel the mouse, not only the Scale things i do works, but also the srcollbar(verticle one) is moving...
Use the source, Luke!