Niels Menke wrote: > As far as i understand it, the conversion seems necessary though, as the > placement of the image (pixel) depends on the outer bounds of the window > (world).
yup, but I think it can be simpler. > However, i've seen the WorldToPixel method pop up ridiculously > often when profiling the application, so this might indeed add to the > problem. That needs to be called for every object that is drawn, every time it is drawn (pixel coords are not cached). However, it's generally a lot faster than the drawing operation anyway. > With the limited knowledge i have so far, i don't see an easy > way around this, though. nope, but the key is to avoid extra drawing. > The implementation on the demo seems to use some moving from NavCanvas > though, is this correct? > Or more accurately, i noticed the moving not to be bound to anything at > all, but seeming to be coming from NavCanvas in the demos. > We use a FloatCanvas in the application, and as far as i understand it, > i can't use the NavCanvas because i can't have the navigation bar. Shouldn't be a problem. All NavCanvas does is add the toolbar. The toolbar then sets the Mode on FloatCanvas, so all you need to do is set the FloatCanvas mode the same way that NavCanvas does it. > i do have a strong > feeling that i'm just missing something simple here. yup. all that is built in to either FloatCanvas (in older versions) or GUIModes (in newer versions). Either way you can just use it. > I'm currently using wxPython 2.8.7.1 and the FloatCanvas version that > comes bundled with it. I've done a pathetic job of keeping the version in the wxPython distro up to date -- you've now given me a reason why I should try harder. > As this is what is deployed on all of our Systems > that do any work with the underlying application, i'd like to stick with > it if possible. Are there any major performance upgrades or important > bugfixes in the latest Revision? I don't really remember what's changed, but no, there aren't any major performance issues -- only added features, and some re-structuring. The GUI modes are handles differently in older an newer versions, but either way the "Move" mode is there, with essentially the same code, just in a different place. Take a look in the NavCanvas in the version you are using, and see how it sets the mode -- then so the same thing in your code. -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
