annotate m-toolbox/m/gui/gltpda/g_ExpandEdit.m @ 4:e3c5468b1bfe database-connection-manager

Integrate with LTPDAPreferences
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
1 function g_ExpandEdit(hObject,varargin)
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
2 % Callback function: run when the user click on the checkbox associated
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
3 % to each parameter, to enable its setting.
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
4
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
5 global params guiFontSize
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
6
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
7 origEditField = get(hObject,'UserData');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
8 currParamIndex = get(origEditField,'UserData');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
9 paramkey = params.params(currParamIndex).key;
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
10 if numel(paramkey)>6 && strcmpi(paramkey(1:7),'addpar_'), paramkey(1:7)=[]; end
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
11 paramval = get(origEditField,'String');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
12
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
13 editFigPos = [200,200,800,300];
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
14
f0afece42f48 Import.
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'));
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
16 % Edit field title:
f0afece42f48 Import.
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');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
18 % Edit field:
f0afece42f48 Import.
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');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
20 % Ok button:
f0afece42f48 Import.
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');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
22 % Cancel button:
f0afece42f48 Import.
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');
f0afece42f48 Import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
24 end