Malcolm Clift wrote:
I'm new to python and am looking for away to display music notation. As for
setting the font, of course the examples are there, I just didn't use my
eyes. Sorry.
Chris, can I ask you will FloatCanvas do antialiasing of fonts?
FloatCanvas uses wx's font rendering, so I think that means anti-aliasing for true-type fonts, at least on some systems.
Also, not particularly to do with FloatCanvas, but my needs are similar to
your 'Hit test foreground' example, With the right up/down/left/right box,
how would I impliment a stepped drag. What I mean is, at the moment when you
click on a hit point it steps in that direction, would there be some way to
drag it through these steps?
Doing it in FloatCanvas is pretty different than doing it without, but I'll give a little summary in either case:
1) catch the mouse-down event, and check if it's on one of your objects (FloatCanvas does this for you). Set a flag if it is, and store the coords of the point clicked. Set wx.Window.CaptureMouse(), so that if they move out of the window, you don't' lose what's happening
2) catch EVT_MOTION, and if the "moving" flag is set, calculate how far the mouse has moved, and redraw the image, if it has moved far enough to be at the next step.
3) repeat (2) until....
4) catch EVT_LEFT_UP, and reset: wx.Window.CaptureMouse(), and your "moving" flag
or:
download FloatCanvas from:
http://home.comcast.net/~chrishbarker/FloatCanvas/
In there you'll find a PolyEditor example that does much of what you need to do.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov