Changeset 244
- Timestamp:
- Apr 20, 2011, 12:51:29 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r238 r244 2122 2122 disp(cmd_str); 2123 2123 else %run PIVlab if selected 2124 drawnow 2124 2125 if box_test(1)==1 2125 2126 Param.Civ1=par_civ1; -
trunk/src/mouse_down.m
r238 r244 36 36 hcurrentfig=hObject;%usual plot 37 37 end 38 set(hcurrentfig,'Units','pixels') 39 currentfig_pos=get(hcurrentfig,'Position');%position of the GUI series (in pixels) 40 set(hcurrentfig,'Units','normalized') 38 41 hhcurrentfig=guidata(hcurrentfig); 39 42 test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom action, first priority … … 111 114 break 112 115 elseif isequal(htype,'uicontrol') && isequal(get(hchild(ichild),'Visible'),'on') 113 msgbox(get(hchild(ichild),'String'),get(hchild(ichild),'Tag')) 116 msg_pos(1:2)=currentfig_pos(1:2)+obj_pos(1:2).*currentfig_pos(3:4); 117 msgbox_uvmat(['uicontrol: ' get(hchild(ichild),'Tag')],'',get(hchild(ichild),'String'),msg_pos) 118 %msgbox(get(hchild(ichild),'String'),get(hchild(ichild),'Tag')) 114 119 break 115 120 end -
trunk/src/msgbox_uvmat.m
r156 r244 38 38 39 39 % --- Executes just before msgbox_uvmat is made visible. 40 function msgbox_uvmat_OpeningFcn(hObject, eventdata, handles,title,display,default_answer )40 function msgbox_uvmat_OpeningFcn(hObject, eventdata, handles,title,display,default_answer,Position) 41 41 % This function has no output args, see OutputFcn. 42 42 43 43 % Choose default command line output for msgbox_uvmat 44 44 handles.output = 'Cancel'; 45 set(handles.figure1,'Units','pixels') 46 FigPos=[100 150 500 50];%default position 47 if exist('Position','var') 48 FigPos(1)=Position(1); 49 FigPos(2)=Position(2)-FigPos(4);% upper left corner set by input Position 50 set(handles.figure1,'Position',FigPos) 51 end 52 set(handles.OK,'Units','pixels') 53 set(handles.OK,'Position',[100 2 60 30]) 54 set(handles.OK,'FontSize',15) 55 set(handles.No,'Units','pixels') 56 set(handles.No,'Position',[200 2 60 30]) 57 set(handles.No,'FontSize',15) 58 set(handles.Cancel,'Units','pixels') 59 set(handles.Cancel,'Position',[300 2 60 30]) 60 set(handles.Cancel,'FontSize',15) 45 61 46 62 % Update handles structure … … 69 85 testCancel=0; %no cancel button 70 86 testinputstring=1; 87 case 'INPUT_TXT' 88 testinputstring=1; 71 89 otherwise 72 testinputstring=1; 90 % testinputstring=1; 91 icontype=''; 92 testinputstring=exist('default_answer','var'); 73 93 end 74 94 end … … 76 96 set(handles.text1, 'String', display); 77 97 end 98 % if testinputstring 99 % set(handles.edit_box, 'Visible', 'on'); 100 % else 101 % set(handles.text1, 'Position', [0.15 0.3 0.85 0.7]); 102 % end 78 103 if testinputstring 104 % set(handles.figure1,'Position',[40,80,20*length(default_answer),50]) 79 105 set(handles.edit_box, 'Visible', 'on'); 106 if ~exist('default_answer','var'); 107 default_answer=''; 108 end 109 set(handles.edit_box, 'String', default_answer); 110 if exist('Position','var') 111 if iscell(default_answer) 112 widthstring=max(cellfun('length',default_answer)); 113 heightstring=size(default_answer,1); 114 set(handles.edit_box,'Max',2); 115 else 116 widthstring=length(default_answer); 117 heightstring=1; 118 end 119 widthstring=max(widthstring,length(title)); 120 boxsize=[10*widthstring 20*heightstring];%size of the display edit box 121 set(handles.edit_box,'Units','pixels') 122 set(handles.edit_box,'FontUnits','pixels') 123 set(handles.edit_box,'FontSize',12) 124 set(handles.edit_box,'Position',[5,34,boxsize(1),boxsize(2)]) 125 FigPos(3)=10+boxsize(1); 126 FigPos(4)=36+boxsize(2); 127 FigPos(2)=Position(2)-FigPos(4)-25; 128 set(handles.figure1,'Position',FigPos) 129 end 130 % set(handles.figure1,'Position',[40,40,20*length(default_answer),50]) 80 131 else 81 132 set(handles.text1, 'Position', [0.15 0.3 0.85 0.7]); 82 133 end 83 if exist('default_answer','var') && testinputstring84 set(handles.edit_box, 'String', default_answer);85 end86 134 % Determine the position of the dialog - centered on the screen 87 FigPos=get(0,'DefaultFigurePosition');88 OldUnits = get(hObject, 'Units');89 set(hObject, 'Units', 'pixels');90 OldPos = get(hObject,'Position');91 FigWidth = OldPos(3);92 FigHeight = OldPos(4);93 ScreenUnits=get(0,'Units');94 set(0,'Units','pixels');95 ScreenSize=get(0,'ScreenSize');96 set(0,'Units',ScreenUnits);97 98 FigPos(1)=1/2*(ScreenSize(3)-FigWidth);99 FigPos(2)=2/3*(ScreenSize(4)-FigHeight);100 FigPos(3:4)=[FigWidth FigHeight];101 set(hObject, 'Position', FigPos);102 set(hObject, 'Units', OldUnits);135 % FigPos=get(0,'DefaultFigurePosition'); 136 % OldUnits = get(hObject, 'Units'); 137 % set(hObject, 'Units', 'pixels'); 138 % OldPos = get(hObject,'Position'); 139 % FigWidth = OldPos(3); 140 % FigHeight = OldPos(4); 141 % ScreenUnits=get(0,'Units'); 142 % set(0,'Units','pixels'); 143 % ScreenSize=get(0,'ScreenSize'); 144 % set(0,'Units',ScreenUnits); 145 % 146 % FigPos(1)=1/2*(ScreenSize(3)-FigWidth); 147 % FigPos(2)=2/3*(ScreenSize(4)-FigHeight); 148 % FigPos(3:4)=[FigWidth FigHeight]; 149 % set(hObject, 'Position', FigPos); 150 % set(hObject, 'Units', OldUnits); 103 151 104 152 % Show a question icon from dialogicons.mat - variables questIconData and questIconMap -
trunk/src/pivlab.m
r243 r244 91 91 %Find the correlation max, at 255 92 92 [y,x] = find(result_conv==255,1); 93 if ~is nan(y) && ~isnan(x)93 if ~isempty(y) && ~isempty(x) 94 94 try 95 95 if subpixfinder==1 -
trunk/src/series.m
r238 r244 62 62 %default initial parameters 63 63 drawnow 64 64 set(hObject,'Units','pixels') 65 % set(0,'Units','pixels') 66 % screensize=get(0,'ScreenSize'); %screen size in pixels 67 set(hObject,'Position',[150 100 1000 600] );%position and size in pixels (get adjusted to the screen size in case of excess) 65 68 %load the list of previously browsed files in menus Open and Open_1 66 69 dir_perso=prefdir; … … 1672 1675 end 1673 1676 eval(['h_function=@' ACTION ';']); 1674 [fid,errormsg] =fopen([ACTION '.m']); 1675 InputText=textscan(fid,'%s',1,'delimiter','\n'); 1676 fclose(fid) 1677 try 1678 [fid,errormsg] =fopen([ACTION '.m']); 1679 InputText=textscan(fid,'%s',1,'delimiter','\n'); 1680 fclose(fid) 1681 set(handles.ACTION,'ToolTipString',InputText{1}{1}) 1682 end 1677 1683 if ~isequal(path_series,PathName) 1678 1684 rmpath(PathName) 1679 1685 end 1680 set(handles.ACTION,'ToolTipString',InputText{1}{1})1681 1686 varargout=h_function(); 1682 1687 Param_list={}; … … 1854 1859 1855 1860 %----------------------------- 1856 function mouse_up_gui(ggg,eventdata,handles) 1857 if isequal(get(ggg,'SelectionType'),'alt') 1858 display('global CurData, UserData of GUI series') 1859 global CurData 1860 CurData=get(ggg,'UserData'); 1861 evalin('base','global CurData');%make CurData global in the workspace 1862 evalin('base','CurData'); %display CurData in the workspace 1863 commandwindow 1864 % plot_text(CurData) 1861 function mouse_up_gui(hObject,eventdata,handles) 1862 if isequal(get(hObject,'SelectionType'),'alt') 1863 set(hObject,'Units','pixels') 1864 series_pos=get(hObject,'Position');%position of the GUI series (in pixels) 1865 set(hObject,'Units','normalized') 1866 xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo) 1867 hchild=get(hObject,'Children');%handles of all objects in the current figure 1868 %% loop on all the objects in the current figure (selected by the last mouse click) 1869 1870 for ichild=1:length(hchild) 1871 obj_pos=get(hchild(ichild),'Position');%position of the object 1872 if numel(obj_pos)>=4 && xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4); 1873 htype=get(hchild(ichild),'Type');%type of object child of the current figure 1874 %if the mouse is over an axis, look at the data 1875 if isequal(htype,'uicontrol') && isequal(get(hchild(ichild),'Visible'),'on') 1876 msg_pos(1:2)=series_pos(1:2)+obj_pos(1:2).*series_pos(3:4); 1877 msgbox_uvmat(['uicontrol: ' get(hchild(ichild),'Tag')],'',get(hchild(ichild),'String'),msg_pos) 1878 break 1879 end 1880 end 1881 end 1882 set(hObject,'Units','pixels') 1865 1883 end 1866 1884 … … 2196 2214 if isequal(mode,'#_ab') 2197 2215 dirpair=dir([filebasesub '*_*.nc']); 2198 elseif isequal(mode,'bursts')| isequal(mode,'series(Dj)')2216 elseif isequal(mode,'bursts')||isequal(mode,'series(Dj)') 2199 2217 dirpair=dir([filebasesub '_*_*-*.nc']); 2200 2218 elseif isequal(mode,'series(Di)')
Note: See TracChangeset
for help on using the changeset viewer.