Christian Kohlöffel wrote: >> A possibility -- if LeftUp is caught in your code, and you don't call >> event.Skip(), then RubberBAndBox may never get it, so it will keep >> "Drawing" set to True, and keep drawing the box as you move. > > But the event.Skip() should be done in the Floatcanvas code because the > first event which is evaluated is the hit of the Line with the > Floatcanvas function and Bind in line 1325: > shape.geo_hdl.Bind(FloatCanvas.EVT_FC_LEFT_UP, self.ShapeGotHit) > > this event doesnt seem to be skipped.
Ah! good point -- In general, the Hit testing of objects has been used by itself -- not in concert with other GUI actions. > I also could use a different Event > like Middle Mouse or Double Click or similar but thats not what i want. Nor should you. > Is there a possibility to change the order of the events so that the > first event will be the Rubberbandbox The way to do this is to change the GUI modes. They are defined in floatcanvas/GUIMode.py You can derive from GUIMouse, and add the add the Skip(), or, what I might do, add the Rubber Band Box code in there -- that code could be in a GUIMode mixin, that could be added to a GUIMode class when required. However, it may be best that event.Skip() be added to all the methods of the stock GUIMouse Mode. I'm a bit nervous about this, as it hasn't been that way, and who knows what might break? Please give it a try, and let us know how it works out! > If you want i can also send my questions to the mailinglist if you > would prefer that. Please do, I like to get it in the archives, and other folks may have ideas. >> yes, you are right -- it assumes that you have the floatcanvas package >> on your sys.path -- I wonder what the "right" way to do that relative >> import is? I've figured that out. In Utilities/GUI.py: from .. import FloatCanvas This will work on 2.5 and above, I think. The only issue is that it WON'T work if you try to import GUI.py from the interpreter when inside the floatcanvas package -- why the heck not, I don't know, but it makes it hard to test code that uses relative imports -- oh well. -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 chris.bar...@noaa.gov _______________________________________________ FloatCanvas mailing list FloatCanvas@mithis.com http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas