Hi Laurent, Alan
I have just committed the changes exposing plTranslateCursor in the
C++ binding. I have also documented it in the main API section - Alan,
please tell me if this is not appropriate as it will not be exposed in
other bindings. Also I am not 100% sure about the plGraphicsIn::state
variable. This doesn't appear to be documented anywhere, there are
just references to X11/X.h. I found a copy of that online, but haven't
had chance to read up in detail. We really should document it
ourselves.

Laurent, if you are making use of the wxPLplotwindow templated class,
then the easiest way to catch the mouse position now using the latest
source is to inherit from this class and overload the virtual function
OnLocate, which accepts a const reference to a PLGraphicsIn. This
structure will have already been passed to plTranslateCursor and will
have all relevant variables filled in. You can check wxPLplotDemo for
an example of how this works. Alternatively you can check out
wxPLplotwindow.h (in particular the OnMouse method) to see how you can
write your own event capture code if you prefer.

Phil



On 22 December 2015 at 08:21, Phil Rosenberg <p.d.rosenb...@gmail.com> wrote:
> Okay Alan, will do. I was just a bit worried that there might be a reason
> why pltranslatecursor had never been documented or propagated to other
> bindings.
> ________________________________
> From: Alan W. Irwin
> Sent: ‎20/‎12/‎2015 19:51
> To: Phil Rosenberg
> Cc: Laurent Berger; plplot-devel@lists.sourceforge.net
> Subject: Re: [Plplot-devel] Screen coordinates to data coordinates
> withwxWidgets driver
>
> On 2015-12-20 12:07-0000 Phil Rosenberg wrote:
>
>> Hi Laurent
>> (Alan, please see my email below - I accidentally replied to Laurent
>> instead of replying to all yesterday)
>>
>> I've just  had a look and you can use plTranslateCursor to get the
>> coordinates. This function is listed as part of the API on p181 of the
>> documentation, but it doesn't seem to be documented anywhere.
>>
>> This function isn't exposed in the C++ interface, so therefore isn't
>> exposed by the wxWidgets interface. Hence I am not sure how you can
>> access it unless you are using the C interface.
>>
>> Alan - I have just written some code to expose plTranslateCursor in
>> the C++ interface and have added some code to the wxWidgets binding to
>> capture mouse events and pass them back to the user easily.
>>
>> Are you happy for me to commit these changes?
>
> Sure.  There won't be a freeze on such merges to master for quite some
> time so go ahead.  Please also include a test that exercises your
> changes.  Would examples/c++/wxPLplotDemo.cpp be suitable for such a
> test?
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation for stellar interiors (freeeos.sf.net); the Time
> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
> software package (plplot.sf.net); the libLASi project
> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
> and the Linux Brochure Project (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________

------------------------------------------------------------------------------
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to