Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ButtonDownFcn help
Date: Mon, 29 Oct 2007 23:45:57 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 37
Message-ID: <fg5rbl$3dg$1@fred.mathworks.com>
References: <fg555k$j2e$1@fred.mathworks.com> <fg56qc$f26$1@fred.mathworks.com> <fg5a7r$4he$1@canopus.cc.umanitoba.ca> <fg5m1b$a7g$1@fred.mathworks.com> <fg5mna$j3d$1@canopus.cc.umanitoba.ca>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1193701557 3504 172.30.248.37 (29 Oct 2007 23:45:57 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Oct 2007 23:45:57 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:435159



> Hmmm, that appears to me to clear the mouse click callback 
> after clearing the edit field.

exactly - on purpose

> If so, then the callback would somehow
> have to be reprimed after the field lost focus.

This can easily be done by setting the MouseClickedCallback
in FocusLostCallback (I forget the exact name but it should
be pretty close), and clearing it in FocusGainedCallback. Or
some similar variation, you get the drift.

> Matt wasn't clear on what he would like to have happen
> after the first time; my own interpretation is that he 
> wanted mouse left-click to clear the string each time. 
> Which leads to difficulty if the user wants to use the 
> mouse to reposition within the string for editting purposes.
> 
> Matt? What do you expect after the first firing?

In most non-Matlab implementations that I've seen, following
the first clearing the data was considered "tainted" and
never cleared again, even after losing focus. Of course,
this is a matter of usability and requirements, and these
are just my 2 cents. To clear the data each time, one can
use the Focus callback as stated above. 

The above Java callbacks, along with some ~30 other standard
uicontrol callbacks are so powerful: The above example could
never be done with the standard Matlab callbacks, and yet is
so easy to achieve using the Java ones. It's such a pity
that MathWorks does not expose them in the regular Matlab
(HG) interface. Maybe someone will pick up the ball for
R2008a... Bill? anyone?

Yair Altman