Good to have you back.
ROY ZINN wrote:
> I've tried to play a little bit and add the canvas to scrolled window
> but no success...
I think it's possible, and indeed some did a few years back, but...
Adding the Canvas to a Scrolled Window isn't really the right way to go.
FloatCanvas already has built in the ability to sow only parts of the
whole image, and it does it with fancy double buffering, etc.
So what to do?
What you want to do is to create an alternative to NavCanvas, that
doesn't have the "hand" button (or maybe none of them, depending on if
you want people to zoom in and out or not)
In this alternative Panel, you put the Canvas and a couple (do you want
to scroll both horizontally and vertically?) wx.ScrollBars. You then
bind the events from the scrollbars, and call the Canvas.MoveImage.
Something like:
VscrollBar.Bind(EVT_SCROLL, self.OnScroll)
def OnScroll(self, event):
self.Canvas.MoveImage((0, 0.2), CoordType="Panel")
# That will move the image vertically 0.2 of the height of the panel.
How much you want it to move is up to you.
I don't immediately see how to figure out which way the user scrolled or
how much, but I suspect that that info is either in the event, or you
can query the scrollbar for the new position.
Just so everyone knows, I'm off for a Vacation for 9 days tomorrow, and
I'll be offline the whole time.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas