Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Any way to detect mouse click in edit text(uicontrol)

Subject: Any way to detect mouse click in edit text(uicontrol)

From: Olivier

Date: 15 Apr, 2010 09:40:08

Message: 1 of 4

Is there any way to find if the user is double clicking in the 'edit text' box in a gui

Subject: Any way to detect mouse click in edit text(uicontrol)

From: Yair Altman

Date: 17 Apr, 2010 19:25:05

Message: 2 of 4

"Olivier " <sumit.iitkgp@gmail.com> wrote in message <hq6mto$6af$1@fred.mathworks.com>...
> Is there any way to find if the user is double clicking in the 'edit text' box in a gui


I don't understand why you would want to do this: clicking in edit-boxes has a very well-known GUI behavior, which is not Matlab-specific: Single-clicking selects the edit-box (moves it into focus); double-clicking selects the entire text within the editbox. Matlab editboxes behave like this so why would you wish to modify this behavior?

(of course it can be done, but I don't want to give you the answer if you are asking the wrong question...)

Yair Altman
http://UndocumentedMatlab.com

Subject: Any way to detect mouse click in edit text(uicontrol)

From: Olivier

Date: 20 Apr, 2010 06:20:05

Message: 3 of 4

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hqd1uh$pho$1@fred.mathworks.com>...
> "Olivier " <sumit.iitkgp@gmail.com> wrote in message <hq6mto$6af$1@fred.mathworks.com>...
> > Is there any way to find if the user is double clicking in the 'edit text' box in a gui
>
>
> I don't understand why you would want to do this: clicking in edit-boxes has a very well-known GUI behavior, which is not Matlab-specific: Single-clicking selects the edit-box (moves it into focus); double-clicking selects the entire text within the editbox. Matlab editboxes behave like this so why would you wish to modify this behavior?
>
> (of course it can be done, but I don't want to give you the answer if you are asking the wrong question...)
>
> Yair Altman
> http://UndocumentedMatlab.com

Hi Yair

I understand the behaviour predefined in the matlab. But in my gui I have an 'edit text' box and wants that when user clicks on the text box another uesr interface opens up to provide the user with the choices to enter in the edit box and at the same time user can also enter the data of her/his own wish which might not be mentioned in the list.

If you have the way to do it, Please let me know it would be of great help.
Thank You
Sumit

Subject: Any way to detect mouse click in edit text(uicontrol)

From: Yair Altman

Date: 20 Apr, 2010 07:27:04

Message: 4 of 4

"Olivier " <sumit.iitkgp@gmail.com> wrote in message
> I understand the behaviour predefined in the matlab. But in my gui I have an 'edit text' box and wants that when user clicks on the text box another uesr interface opens up to provide the user with the choices to enter in the edit box and at the same time user can also enter the data of her/his own wish which might not be mentioned in the list.


Instead of using an edit-box, use an editable drop-down (aka popup-menu or combo-box) control:

jcb = javax.swing.JComboBox({'Red','Green','Blue'});
jcb.setEditable(1);
[hjcb,hContainer] = javacomponent(jcb,[200,200,100,20],gcf);

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us