octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MouseMode in QtHandles


From: John W. Eaton
Subject: MouseMode in QtHandles
Date: Tue, 03 Feb 2015 12:29:33 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

Michael.

I've been looking at making the pan and zoom functions more compatible with Matlab and making them work with QtHandles plotting. Taking Matlab's zoom function as an example, it can return some kind of object that says how the mouse is supposed to work for zooming. This object works like a handle but isn't a classdef object and doesn't seem to be a graphics handle either (you may recall that we discussed this in Montreal).

If you do

  zoom on

then the object that's returned includes a field that has Enabled = "on". Other fields are described in the Matlab docs. I wanted to use a classdef object for this, but there were some problems (not important at the moment). So instead I decided to just create a struct that is stored as a hidden figure property. Then QtHandles or other toolkit code can look at this property and decide what to do for mouse clicks. It won't be completely compatible, but at least it works to store the info and can probably be converted to some other type of object that can provide better compatibility later.

Then I noticed that there is already a MouseMode enum in QtHandles. I'd rather not store this info in multiple places, so instead of storing m_mouseMode in the QtHandles Figure object, I'd have the Figure object get and set the values from the graphics properties as needed. Do you see a problem with that?

Also, can you help me understand what the intent of m_lastMouseMode is? I don't understand why that is needed. Do you remember?

Thanks,

jwe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]