Code covered by the BSD License  

Highlights from
Copy Paste

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 36.19 KB File ID: #27971
image thumbnail

Copy Paste

by Amitabh Verma

 

21 Jun 2010

A simple Cut, Copy, Paste contextmenu for edit boxes in GUI.

| Watch this File

File Information
Description

Copy Paste ver. 1.0

This is a very simple cut/copy/paste context menu using java handles. This code uses findjobj by Yair Altman (http://www.mathworks.com/matlabcentral/fileexchange/14317-findjobj-find-java-handles-of-matlab-graphic-objects) to locate the java handles.

Usage:
copy_paste(hObject)

Example:

f1 = figure('Name','Copy-Paste','Position', [480 480 340 100],'NumberTitle','off');
h1 = uicontrol(f1, 'Style', 'edit',...
       'String', 'Cut',...
       'BackgroundColor', [1 1 1],...
       'Position', [10 10 100 50]);
h2 = uicontrol(f1, 'Style', 'edit',...
       'String', 'Copy',...
       'BackgroundColor', [1 1 1],...
       'Position', [120 10 100 50]);
h3 = uicontrol(f1, 'Style', 'edit',...
       'String', 'Paste',...
       'BackgroundColor', [1 1 1],...
       'Position', [230 10 100 50]);

% For single edit box object
copy_paste(h2);

% For selected edit box object
copy_paste(h1,h3);

% For all the edit boxes in a figure
copy_paste(gcf) or copy_paste(f1)

Your comments and suggestions are most welcomed.

MATLAB release MATLAB 7.10 (2010a)
Other requirements Java needs to be enabled.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
cut Amitabh Verma 22 Jun 2010 10:53:18
copy Amitabh Verma 22 Jun 2010 10:53:18
paste Amitabh Verma 22 Jun 2010 10:53:18
gui Amitabh Verma 22 Jun 2010 10:53:18
java Amitabh Verma 22 Jun 2010 10:53:18
undocumented Amitabh Verma 22 Jun 2010 10:53:18
contextmenu Amitabh Verma 22 Jun 2010 10:53:18
copy Phong ào Vn 08 May 2012 02:23:55

Contact us at files@mathworks.com