octave-maintainers
[Top][All Lists]
Advanced

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

Re: MouseMode in QtHandles


From: Michael Goffioul
Subject: Re: MouseMode in QtHandles
Date: Tue, 3 Feb 2015 14:00:55 -0500

On Tue, Feb 3, 2015 at 1:49 PM, John W. Eaton <address@hidden> wrote:
On 02/03/2015 12:46 PM, Michael Goffioul wrote:

It's been a while, but looking at the code, I believe it is to keep
track of the mouse mode when the toolbar is hidden. That is: when you
hide the toolbar, you want to revert to NoMode as it could be awkward to
have some mouse mode enabled, while not being able to change it; so
m_mouseMode is reset to NoMode, as it's being used in the rest of the
code. However, when you show the toolbar again, you may want to restore
the mouse mode to what it was initially (especially to keep the visual
state of the toggle buttons in sync with the actual mouse mode).

It's probably better to check first in Matlab how this is handled. Maybe
I made things to complicated and we should just maintain the mouse mode,
even after hiding the toolbar.

What test would you do?

gca
hz = zoom('on')
<zoom should be enabled in the toolbar and be the active mouse mode>
get(hz, 'Enabled')
set(gcf, 'toolbar', 'none')
<check what is the active mouse mode in the figure>
get(hz, 'Enabled')
set(gcf, 'toolbar', 'figure')
<check if the zoom button is still toggled in the toolbar>
<check the active mouse mode in the figure>
get(hz, 'Enabled')
 
Maybe I'm missing something, but it seems to me that it would be sufficient to just check the figure properties when displaying the toolbar and display whatever is consistent with the properties.

The main point is IMO whether one should maintain the mouse mode when the toolbar is hidden. If you do, then it's easy and you can get rid of m_lastMouseMode, as you can leave m_mouseMode unchanged (this is with the current code, but the same holds if you move the mouse mode as a figure property). If you don't, then you have to update the graphics objects with the new mouse mode (zoom structure, figure property...), and you have to determine what to do when you show the toolbar again.

Michael.


reply via email to

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