Changeset 244


Ignore:
Timestamp:
Apr 20, 2011, 12:51:29 PM (13 years ago)
Author:
sommeria
Message:

various bug repair, improved display of msgbox_uvmat

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r238 r244  
    21222122            disp(cmd_str);
    21232123        else       %run PIVlab if selected
     2124            drawnow
    21242125            if box_test(1)==1
    21252126                Param.Civ1=par_civ1;
  • trunk/src/mouse_down.m

    r238 r244  
    3636    hcurrentfig=hObject;%usual plot
    3737end
     38    set(hcurrentfig,'Units','pixels')
     39    currentfig_pos=get(hcurrentfig,'Position');%position of the GUI series (in pixels)
     40    set(hcurrentfig,'Units','normalized')
    3841hhcurrentfig=guidata(hcurrentfig);
    3942test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom action, first priority
     
    111114            break
    112115        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'))
    114119            break
    115120        end
  • trunk/src/msgbox_uvmat.m

    r156 r244  
    3838
    3939% --- Executes just before msgbox_uvmat is made visible.
    40 function msgbox_uvmat_OpeningFcn(hObject, eventdata, handles,title,display,default_answer)
     40function msgbox_uvmat_OpeningFcn(hObject, eventdata, handles,title,display,default_answer,Position)
    4141% This function has no output args, see OutputFcn.
    4242
    4343% Choose default command line output for msgbox_uvmat
    4444handles.output = 'Cancel';
     45set(handles.figure1,'Units','pixels')
     46FigPos=[100 150 500 50];%default position
     47if 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)
     51end
     52set(handles.OK,'Units','pixels')
     53set(handles.OK,'Position',[100 2 60 30])
     54set(handles.OK,'FontSize',15)
     55set(handles.No,'Units','pixels')
     56set(handles.No,'Position',[200 2 60 30])
     57set(handles.No,'FontSize',15)
     58set(handles.Cancel,'Units','pixels')
     59set(handles.Cancel,'Position',[300 2 60 30])
     60set(handles.Cancel,'FontSize',15)
    4561
    4662% Update handles structure
     
    6985            testCancel=0; %no cancel button
    7086            testinputstring=1;
     87        case 'INPUT_TXT'
     88            testinputstring=1;
    7189        otherwise
    72             testinputstring=1;
     90          %  testinputstring=1;
     91            icontype='';
     92            testinputstring=exist('default_answer','var');
    7393    end
    7494end
     
    7696    set(handles.text1, 'String', display);
    7797end
     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
    78103if testinputstring
     104    % set(handles.figure1,'Position',[40,80,20*length(default_answer),50])
    79105    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])
    80131else
    81132    set(handles.text1, 'Position', [0.15 0.3 0.85 0.7]);
    82133end
    83 if exist('default_answer','var') &&  testinputstring
    84     set(handles.edit_box, 'String', default_answer);
    85 end
    86134% 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);
    103151
    104152% Show a question icon from dialogicons.mat - variables questIconData and questIconMap
  • trunk/src/pivlab.m

    r243 r244  
    9191        %Find the correlation max, at 255
    9292        [y,x] = find(result_conv==255,1);
    93         if ~isnan(y) && ~isnan(x)
     93        if ~isempty(y) && ~isempty(x)
    9494            try
    9595                if subpixfinder==1
  • trunk/src/series.m

    r238 r244  
    6262%default initial parameters
    6363drawnow
    64 
     64set(hObject,'Units','pixels')
     65% set(0,'Units','pixels')
     66% screensize=get(0,'ScreenSize'); %screen size in pixels
     67set(hObject,'Position',[150 100 1000 600] );%position and size in pixels (get adjusted to the screen size in case of excess)
    6568%load the list of previously browsed files in menus Open and Open_1
    6669dir_perso=prefdir;
     
    16721675end
    16731676eval(['h_function=@' ACTION ';']);
    1674 [fid,errormsg] =fopen([ACTION '.m']);
    1675 InputText=textscan(fid,'%s',1,'delimiter','\n');
    1676 fclose(fid)
     1677try
     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})
     1682end
    16771683if ~isequal(path_series,PathName)
    16781684    rmpath(PathName)
    16791685end
    1680 set(handles.ACTION,'ToolTipString',InputText{1}{1})
    16811686varargout=h_function();
    16821687Param_list={};
     
    18541859
    18551860%-----------------------------
    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)
     1861function mouse_up_gui(hObject,eventdata,handles)
     1862if 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')
    18651883end
    18661884
     
    21962214if isequal(mode,'#_ab')
    21972215    dirpair=dir([filebasesub '*_*.nc']);
    2198 elseif isequal(mode,'bursts')|isequal(mode,'series(Dj)') 
     2216elseif isequal(mode,'bursts')||isequal(mode,'series(Dj)') 
    21992217    dirpair=dir([filebasesub '_*_*-*.nc']);
    22002218elseif isequal(mode,'series(Di)')
Note: See TracChangeset for help on using the changeset viewer.