[GRASS-dev] catch mouse click from MapDisplay

Michael Barton Michael.Barton at asu.edu
Tue Aug 16 10:47:35 EDT 2011


Search in mapdisp.py and mapdisp_window.py for the code for query. These handlers grab mouse screen coords and translate them into earth coords. Same for zoom and pan handlers.

Michael Barton
School of Human Evolution &Social Change
Center for Social Dynamics & Complexity
Arizona State University

...Sent from my iPad

On Aug 16, 2011, at 5:33 AM, "Margherita Di Leo" <dileomargherita at gmail.com<mailto:dileomargherita at gmail.com>> wrote:

Hi Michael,

thanks for answering. I actually did not find a function to pick the coordinates of a point by a mouse click, could you please point me the function that I should use?

Thanks in advance,

madi

On Tue, Aug 16, 2011 at 2:47 AM, Michael Barton <<mailto:Michael.Barton at asu.edu>Michael.Barton at asu.edu<mailto:Michael.Barton at asu.edu>> wrote:
Maid,

There are already methods for capturing mouse clicks and drags in the several modules that control the display. This is clear given the fact that you can use a mouse to measure, zoom, profile, etc. Please do not add new ones. Use the existing classes and methods.

Michael Barton
School of Human Evolution &Social Change
Center for Social Dynamics & Complexity
Arizona State University

...Sent from my iPad

On Aug 15, 2011, at 1:04 PM, "<mailto:grass-dev-request at lists.osgeo.org>grass-dev-request at lists.osgeo.org<mailto:grass-dev-request at lists.osgeo.org><mailto:<mailto:grass-dev-request at lists.osgeo.org>grass-dev-request at lists.osgeo.org<mailto:grass-dev-request at lists.osgeo.org>>" <<mailto:grass-dev-request at lists.osgeo.org>grass-dev-request at lists.osgeo.org<mailto:grass-dev-request at lists.osgeo.org><mailto:<mailto:grass-dev-request at lists.osgeo.org>grass-dev-request at lists.osgeo.org<mailto:grass-dev-request at lists.osgeo.org>>> wrote:

Date: Mon, 15 Aug 2011 19:17:48 +0200
From: Margherita Di Leo <<mailto:<mailto:dileomargherita at gmail.com>dileomargherita at gmail.com<mailto:dileomargherita at gmail.com>><mailto:dileomargherita at gmail.com>dileomargherita at gmail.com<mailto:dileomargherita at gmail.com><mailto:<mailto:dileomargherita at gmail.com>dileomargherita at gmail.com<mailto:dileomargherita at gmail.com>>>
Subject: [GRASS-dev] catch mouse click from MapDisplay
To: <mailto:<mailto:grass-dev at lists.osgeo.org>grass-dev at lists.osgeo.org<mailto:grass-dev at lists.osgeo.org>> <mailto:grass-dev at lists.osgeo.org> grass-dev at lists.osgeo.org<mailto:grass-dev at lists.osgeo.org><mailto:<mailto:grass-dev at lists.osgeo.org>grass-dev at lists.osgeo.org<mailto:grass-dev at lists.osgeo.org>>
Message-ID:
      <<mailto:<mailto:CA%2BV6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com>CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com<mailto:CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com>><mailto:CA%2BV6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com>CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com<mailto:CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com><mailto:<mailto:CA%2BV6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com>CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com<mailto:CA+V6ZhWFsG3TzDFDu-0YPV5WPDRw9mQw_NNrn3cKNi1DDgOYbA at mail.gmail.com>>>
Content-Type: text/plain; charset="utf-8"

Hi Devs,

For my GSoC project I am looking for a way to catch the coordinates of a
point by a mouse click over the Map Display. I was wondering if it's more
"wise" to edit the existing mapdisp_window.py file or define my own
OnLeftDown function in my code, which would override the one of class
BufferedWindow, or? As I am not allowed to edit the core source code, I ask
you devs what is better to do.

Thanks,

madi

--
Eng. Margherita Di Leo
Ph.D. Candidate
Methods and Technologies for Environmental Monitoring
Department of Environmental Engineering and Physics (DIFA)

University of Basilicata
Campus Macchia Romana
85100 - Potenza
Italy

Office: +39-0971205360<tel:%2B39-0971205360><tel:+39-0971205360<tel:%2B39-0971205360>>



--
Eng. Margherita Di Leo
Ph.D. Candidate
Methods and Technologies for Environmental Monitoring
Department of Environmental Engineering and Physics (DIFA)

University of Basilicata
Campus Macchia Romana
85100 - Potenza
Italy

Office: +39-0971205360





More information about the grass-dev mailing list