0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function g_ExpandEdit(hObject,varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % Callback function: run when the user click on the checkbox associated
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % to each parameter, to enable its setting.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 global params guiFontSize
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 origEditField = get(hObject,'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 currParamIndex = get(origEditField,'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 paramkey = params.params(currParamIndex).key;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 if numel(paramkey)>6 && strcmpi(paramkey(1:7),'addpar_'), paramkey(1:7)=[]; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 paramval = get(origEditField,'String');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 editFigPos = [200,200,800,300];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
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'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 % Edit field title:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
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');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 % Edit field:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
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');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 % Ok button:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
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');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 % Cancel button:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
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');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 end
|