<div class="gmail_quote"><div>Hi Vasek,<br><br>I just tried your API in my rstream GUI and it works very well, thanks a lot for your work! To devs who have SVN writing permission, may I ask if is it possible to commit this patch into the core code please?<br>
<br>Thanks,<br><br>madi<br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>---------- Forwarded message ----------<br>From: Wenzeslaus &lt;<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>&gt;<br>
To: <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>Date: Tue, 16 Aug 2011 19:44:11 +0200<br>Subject: [GRASS-dev] Re: wxGUI: MapDisplay mouse events<br>Hi list,<br>
<br>
I have suggestion about processing mouse events from MapDisplay<br>
(BufferedWindow, GLWindow). In mapdisplay_mouse_events.diff is<br>
implementation of API which should be enough generic to be used by<br>
more than one module.<br>
<br>
You can bind your own handler to MapDisplay (MapWindow to be precise)<br>
MouseEvents by public API. It is no longer necessary to edit code in<br>
*mapdisp*.py files. (It is the main advantage.)<br>
<br>
I have attached test code (mapdisplay_mouse_events_example.diff). It<br>
gets coordinates from MapDisplay. I think it is<br>
something like Margarita needs in her rstream module. Example is also<br>
included in doc string.<br>
<br>
Suggested code works with both 2D (BufferedWindow) and 3D (GLWindow)<br>
and with multiple MapDisplays.  It is also possible to override<br>
current cursor.<br>
<br>
It doesn&#39;t work with Digitizer (VDigitWindow) (no errors but functions<br>
report unsuccessful binds).<br>
<br>
The handler can be also unbound with this API. However all other<br>
handlers will be unbounded (and only MapWindow handlers will be<br>
bounded again). Unbind only one handler is not possible in wxPython.<br>
<br>
I&#39;m not sure how to handle standard behaviour of mouse events in<br>
MapWindow and its subclasses. Now, functions connected with<br>
mouse[&#39;use&#39;] are disabled by setting mouse[&#39;use&#39;] to other value. But<br>
there are also other aproaches. Functions can be disabled in wxPython<br>
way by Unbind() or we can let functions to do what they do usualy, but<br>
it will be very confusing, I think.<br>
<br>
Vasek<br>
<br clear="all"><br></blockquote></div><br>-- <br><span style="color: rgb(102, 102, 102);">Eng. Margherita Di Leo</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">Ph.D. Candidate</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Methods and Technologies for Environmental Monitoring</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">Department of Environmental Engineering and Physics (DIFA)</span><br style="color: rgb(102, 102, 102);">
<br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">University of Basilicata </span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">Campus Macchia Romana</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">85100 - Potenza </span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">Italy</span><br style="color: rgb(102, 102, 102);"><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Office: +39-0971205360</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);"></span><br><br><br>