Mercurial > hg > ltpda
diff m-toolbox/m/gui/gltpda/g_ExpandEdit.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/m/gui/gltpda/g_ExpandEdit.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,24 @@ +function g_ExpandEdit(hObject,varargin) + % Callback function: run when the user click on the checkbox associated + % to each parameter, to enable its setting. + + global params guiFontSize + + origEditField = get(hObject,'UserData'); + currParamIndex = get(origEditField,'UserData'); + paramkey = params.params(currParamIndex).key; + if numel(paramkey)>6 && strcmpi(paramkey(1:7),'addpar_'), paramkey(1:7)=[]; end + paramval = get(origEditField,'String'); + + editFigPos = [200,200,800,300]; + + editFigure = figure('Name',paramkey,'Tag','expandedEditField','MenuBar','none','Toolbar','none','NumberTitle','off','Units','pixels','Position',editFigPos,'Resize','on','ResizeFcn','refresh(gcf)','Color', get(0, 'defaultuicontrolbackgroundcolor')); + % Edit field title: + uicontrol('Parent',editFigure,'HorizontalAlignment','left','Position',[5 editFigPos(4)-30 editFigPos(3)-10 20],'String','Use this box to type in the value of the selected parameter:','FontName','Times New Roman','FontSize',9,'FontWeight','normal','Visible','on','Style','text'); + % Edit field: + editField = uicontrol('Parent',editFigure,'String',paramval,'UserData',currParamIndex,'Units','pixels','HorizontalAlignment','left','Position',[5 30 editFigPos(3)-7 editFigPos(4)-60],'FontSize',guiFontSize+1,'Visible','on','max',100,'Style','edit'); + % Ok button: + uicontrol('UserData',[editField,origEditField],'TooltipString','Apply this setting','String','Set','Parent',editFigure,'BackgroundColor',[0.7 0.7 0.7],'HorizontalAlignment','center','Position',[editFigPos(3)-150 5 70 20],'Visible','on','Callback',@g_editValueCallback,'Style','pushbutton'); + % Cancel button: + uicontrol('TooltipString','Close this window','String','Close','Parent',editFigure,'BackgroundColor',[0.7 0.7 0.7],'HorizontalAlignment','center','Position',[editFigPos(3)-75 5 70 20],'Visible','on','Callback','closereq','Style','pushbutton'); +end