Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function g_ExpandEdit(hObject,varargin) | |
2 % Callback function: run when the user click on the checkbox associated | |
3 % to each parameter, to enable its setting. | |
4 | |
5 global params guiFontSize | |
6 | |
7 origEditField = get(hObject,'UserData'); | |
8 currParamIndex = get(origEditField,'UserData'); | |
9 paramkey = params.params(currParamIndex).key; | |
10 if numel(paramkey)>6 && strcmpi(paramkey(1:7),'addpar_'), paramkey(1:7)=[]; end | |
11 paramval = get(origEditField,'String'); | |
12 | |
13 editFigPos = [200,200,800,300]; | |
14 | |
15 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')); | |
16 % Edit field title: | |
17 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'); | |
18 % Edit field: | |
19 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'); | |
20 % Ok button: | |
21 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'); | |
22 % Cancel button: | |
23 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'); | |
24 end |