From: Adam on
Hi,

I want the user to be able to copy and paste data from my GUI. Right now, I'm outputting data as a label. However, the user can't select and copy the label. Therefore, I'm hoping to switch to edit boxes. A couple problems I have though, is:

1) Changing the border of the edit box to match my background.
2) Changing it so that the value inside the box can be selected, but not changed.

I'm using GUIDE btw.

Thanks a lot,
Adam
From: Matt Fig on
See Q#16.

http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples


You should be able to adapt this to GUIDE.
From: Adam on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hv6d7k$spr$1(a)fred.mathworks.com>...
> See Q#16.
>
> http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
>
>
> You should be able to adapt this to GUIDE.

Thanks, any idea about changing the border color? Can this be done?
From: Matt Fig on
I am not sure what you mean by "border" color. If you mean the black line of a box around the editbox, then I do not think this is a settable property using plain MATLAB. I have seen the use of frame uicontrols to hide this. For example:


function [] = hide_border()

S.fh = figure('units','pixels',...
'position',[500 500 200 180],...
'menubar','none',...
'name','hide_border',...
'numbertitle','off',...
'resize','off');
S.ed = uicontrol('style','edit',...
'units','pixels',...
'pos',[50 80 100 20]);
BGC = get(S.fh,'color');
uicontrol('style','frame',...
'units','pixels',...
'pos',[48 78 4 24],...
'foregroundc',BGC,...
'backgroundc',BGC)
uicontrol('style','frame',...
'units','pixels',...
'foregroundc',BGC,...
'pos',[148 78 4 24],...
'backgroundc',BGC)
uicontrol('style','frame',...
'units','pixels',...
'pos',[48 78 104 4],...
'foregroundc',BGC,...
'backgroundc',BGC)
uicontrol('style','frame',...
'units','pixels',...
'pos',[48 98 104 4],...
'foregroundc',BGC,...
'backgroundc',BGC)
From: Yair Altman on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hv6sqd$t4v$1(a)fred.mathworks.com>...
> I am not sure what you mean by "border" color. If you mean the black line of a box around the editbox, then I do not think this is a settable property using plain MATLAB. I have seen the use of frame uicontrols to hide this. For example:

This can easily be done at the Java level, though. First download the FindJObj utility from the File Exchange, and then:

hEditbox = uicontrol('style','edit',...);
jEditbox = findjobj(hEditbox);
jEditbox.setBorder([]); % or: set(jEditbox,'Border',[])

Yair Altman
http://UndocumentedMatlab.com