Thread Subject: Drag an object with GUI

Subject: Drag an object with GUI

From: jk Wang

Date: 26 Jan, 2008 17:29:02

Message: 1 of 4

Hi, folks,

I need your help!

Do you know how to write a GUI program in MATLAB that can
implement a function, which enables the user to drag one
object from one window to another window?

Thanks a lot!

Jiankang



Subject: Drag an object with GUI

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 27 Jan, 2008 05:57:36

Message: 2 of 4

In article <fnfqku$a7d$1@fred.mathworks.com>,
jk Wang <wjk1984@gmail.com> wrote:

>Do you know how to write a GUI program in MATLAB that can
>implement a function, which enables the user to drag one
>object from one window to another window?

I would try using the figure WindowButtonDownFcn to detect
the mouse press and figure out which object was being picked up,
and then I would use the figure WindowMotionFcn to detect
the motion and use it to draw the feedback image to show the
object was being dragged; then WindowButtonUpFcn to detect
which figure you are now on. Once you know the source and
destination figures, you can set() the Parent of the object
to be the new figure.
--
   "History is a pile of debris" -- Laurie Anderson

Subject: Drag an object with GUI

From: Yair Altman

Date: 27 Jan, 2008 11:50:03

Message: 3 of 4

> Do you know how to write a GUI program in MATLAB that can
> implement a function, which enables the user to drag one
> object from one window to another window?


There are a few Drag-n-Drop submissions on the File Exchange:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16312
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4224
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15294
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3678

Yair Altman
http://ymasoftware.com

Subject: Drag an object with GUI

From: jk Wang

Date: 27 Jan, 2008 18:24:02

Message: 4 of 4

Thank you very much!

Jiankang

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fnhr5b$4aj$1@fred.mathworks.com>...
> > Do you know how to write a GUI program in MATLAB that
can
> > implement a function, which enables the user to drag one
> > object from one window to another window?
>
>
> There are a few Drag-n-Drop submissions on the File
Exchange:
>
http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=16312
>
http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=4224
>
http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=15294
>
http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=3678
>
> Yair Altman
> http://ymasoftware.com
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
drag and drop Yair Altman 27 Jan, 2008 06:54:57
object drag jk Wang 26 Jan, 2008 12:30:20
gui jk Wang 26 Jan, 2008 12:30:20
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com