Changeset 287


Ignore:
Timestamp:
Nov 19, 2011, 10:40:00 AM (13 years ago)
Author:
sommeria
Message:

further cleaning after new GUI civ. The function mouse_alt_gui allows to zoom out a uicontrol and edit it

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r283 r287  
    143143if status==0
    144144    [~,result]=system('svn info');
    145     t=regexp(result,'R[eé]vision\s:\s(?<rev>\d+)','names');
     145    t=regexp(result,'vision\s:\s(?<rev>\d+)','names');
    146146    svn_info.cur_rev=num2str(t.rev);
    147147    [~,result]=system('svn info -r ''HEAD''');
    148     t=regexp(result,'R[eé]vision\s:\s(?<rev>\d+)','names');
     148    t=regexp(result,'vision\s:\s(?<rev>\d+)','names');
    149149    svn_info.rep_rev=num2str(t.rev);
    150150    [~,result]=system('svn status');   
  • trunk/src/civ.m

    r286 r287  
    2323%TODO: search range
    2424
    25 % Last Modified by GUIDE v2.5 18-Nov-2011 15:30:17
     25% Last Modified by GUIDE v2.5 19-Nov-2011 10:00:27
    2626% Begin initialization code - DO NOT EDIT
    2727gui_Singleton = 1;
     
    15291529end
    15301530if isequal(get(handles.CheckMask,'Value'),1)
    1531     maskname=get(handles.mask_fix2,'String');
     1531    maskname=get(handles.txt_MaskName,'String');
    15321532    if ~exist(maskname,'file')
    15331533        get_mask_fix2_Callback(hObject, eventdata, handles);
     
    18501850            param.civ2.filename_nc1=filecell.nc.civ1{ifile,j};
    18511851            param.civ2.filename_nc1(end-2:end)=[]; % remove '.nc'
    1852             test_mask=get(handles.CheckMask,'Value');
    1853             if test_mask==0
    1854                 param.civ2.maskname='noFile use default';
    1855                 param.civ2.maskflag='n';
    1856             else
     1852            if Param.Civ2.CheckMask
    18571853                maskdispl=get(handles.txt_Mask,'String');
    18581854                if exist(maskdispl,'file')
     
    18711867                    end
    18721868                end
     1869            else
     1870                param.civ2.maskname='noFile use default';
     1871                param.civ2.maskflag='n';
    18731872            end
    18741873            gridname=get(handles.txt_GridName,'String');
     
    19171916                maskname=''; %no mask used
    19181917            else
    1919                 maskdispl=get(handles.mask_fix2,'String');
     1918                maskdispl=get(handles.txt_MaskName,'String');
    19201919                maskbase=[filecell.filebase '_' maskdispl]; %
    19211920                nbslice_mask=str2double(maskdispl(1:end-4)); %
     
    20662065                    end
    20672066                    fix1.LowerBoundCorr=thresh_vecC1;
    2068                     if get(handles.inf_sup1,'Value')
     2067                    if get(handles.num_MinVel,'Value')
    20692068                        fix1.UppperBoundVel=thresh_vel1;
    20702069                    else
     
    20942093                if Param.CheckFix2==1
    20952094                    fix2.WarnFlags=[];
    2096                     if get(handles.vec_Fmin2_2,'Value')
     2095                    if get(handles.CheckFmin2,'Value')
    20972096                        fix2.WarnFlags=[fix2.WarnFlags -2];
    20982097                    end
    2099                     if get(handles.vec_F4,'Value')
     2098                    if get(handles.CheckF4,'Value')
    21002099                        fix2.WarnFlags=[fix2.WarnFlags 4];
    21012100                    end
    2102                     if get(handles.vec_F3_2,'Value')
     2101                    if get(handles.CheckF3,'Value')
    21032102                        fix2.WarnFlags=[fix2.WarnFlags 3];
    21042103                    end
    21052104                    fix2.LowerBoundCorr=thresh_vec2C;
    2106                     if get(handles.inf_sup2,'Value')
     2105                    if get(handles.num_MinVel,'Value')
    21072106                        fix2.UppperBoundVel=thresh_vel2;
    21082107                    else
     
    32343233
    32353234%------------------------------------------------------------------------
    3236 % --- Executes on button press in SearchRange: determine the search range num_Sx,num_Sy
     3235% --- Executes on button press in SearchRange: determine the search range num_Searchx,num_Searchy
    32373236function SearchRange_Callback(hObject, eventdata, handles)
    32383237%------------------------------------------------------------------------
     
    32563255
    32573256%------------------------------------------------------------------------
    3258 % ---  determine the search range num_Sx,num_Sy and shift
     3257% ---  determine the search range num_Searchx,num_Searchy and shift
    32593258function get_search_range(hObject, eventdata, handles)
    32603259umin=str2double(get(handles.umin,'String'));
     
    33223321    set(handles.num_Shiftx,'String',num2str(shiftx));
    33233322    set(handles.num_Shifty,'String',num2str(shifty));
    3324     set(handles.num_Sx,'String',num2str(isx));
    3325     set(handles.num_Sy,'String',num2str(isy));
     3323    set(handles.num_Searchx,'String',num2str(isx));
     3324    set(handles.num_Searchy,'String',num2str(isy));
    33263325end
    33273326
     
    34093408%     set(handles.txt_MaskName,'String',mask_displ)
    34103409%     set(handles.txt_Mask,'String',mask_displ)
    3411 %     set(handles.mask_fix2,'String',mask_displ)
     3410%     set(handles.txt_MaskName,'String',mask_displ)
    34123411% end
    34133412% set(handles.CheckMask,'Value',maskval)%update the checkciv2 mask with the same option as checkciv1
     
    34543453    set(handles.txt_MaskName,'String',mask_displ)
    34553454    set(handles.txt_Mask,'String',mask_displ)
    3456     set(handles.mask_fix2,'String',mask_displ)
     3455    set(handles.txt_MaskName,'String',mask_displ)
    34573456end
    34583457
     
    34953494    end
    34963495    set(handles.txt_Mask,'String',mask_displ)
    3497     set(handles.mask_fix2,'String',mask_displ)
     3496    set(handles.txt_MaskName,'String',mask_displ)
    34983497end
    34993498
     
    35043503maskval=get(handles.CheckMask,'Value');
    35053504if isequal(maskval,0)
    3506     set(handles.mask_fix2,'String','')
     3505    set(handles.txt_MaskName,'String','')
    35073506else
    35083507    mask_displ='no mask'; %default
     
    35323531        set(handles.CheckMask,'Value',0)
    35333532    end
    3534     set(handles.mask_fix2,'String',mask_displ)
     3533    set(handles.txt_MaskName,'String',mask_displ)
    35353534end
    35363535
     
    38703869% set(handles.num_Bx,'Visible',state)
    38713870% set(handles.num_By,'Visible',state)
    3872 % set(handles.num_Sx,'Visible',state)
    3873 % set(handles.num_Sy,'Visible',state)
     3871% set(handles.num_Searchx,'Visible',state)
     3872% set(handles.num_Searchy,'Visible',state)
    38743873% set(handles.num_Shiftx,'Visible',state)
    38753874% set(handles.num_Shifty,'Visible',state)
     
    39383937% set(handles.num_MinCorr,'Visible',state)
    39393938% set(handles.thresh_vecC_title,'Visible',state)
    3940 % set(handles.num_MaxVel,'Visible',state)
    3941 % set(handles.thresh_vel_text,'Visible',state)
     3939% set(handles.num_MinVel,'Visible',state)
     3940% set(handles.TitleMinVel,'Visible',state)
    39423941% set(handles.txt_MaskName,'Visible',state)
    39433942% set(handles.CheckMask,'Visible',state)
    39443943% set(handles.get_ref_fix1,'Visible',state)
    39453944% set(handles.ref_fix1,'Visible',state)
    3946 % set(handles.inf_sup1,'Visible',state)
     3945% set(handles.num_MinVel,'Visible',state)
    39473946% set(handles.field_ref1,'Visible',state)
    39483947
     
    40204019
    40214020%
    4022 % set(handles.ibx_civ2,'Visible',state)
    4023 % set(handles.iby_civ2,'Visible',state)
    4024 % set(handles.decimal,'Visible',state)
    4025 % set(handles.deformation,'Visible',state)
    4026 % set(handles.rho_civ2,'Visible',state)
     4021% set(handles.num_Bx,'Visible',state)
     4022% set(handles.num_By,'Visible',state)
     4023% set(handles.CheckDecimal,'Visible',state)
     4024% set(handles.CheckDeformation,'Visible',state)
     4025% set(handles.num_Rho,'Visible',state)
    40274026% set(handles.num_Dx,'Visible',state)
    40284027% set(handles.num_Dy,'Visible',state)
     
    40424041% set(handles.ImaThreshold_title2,'Visible',state)
    40434042% if isequal(state,'off')
    4044 %     set(handles.MinIma2,'Visible','off')
    4045 %     set(handles.MaxIma2,'Visible','off')
     4043%     set(handles.num_MinIma,'Visible','off')
     4044%     set(handles.num_MaxIma,'Visible','off')
    40464045%     set(handles.ImaThreshold2,'Value',0)
    40474046%     if isequal(get(handles.CheckFix2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0)
     
    40914090% set(handles.frame_fix2,'BackgroundColor',[1 1 0])
    40924091% set(handles.REMOVE2,'Visible','on')
    4093 % set(handles.vec_Fmin2_2,'Visible','on')
    4094 % set(handles.vec_F4,'Visible','on')
    4095 % set(handles.vec_F3_2,'Visible','on')
    4096 % set(handles.thresh_vec2C,'Visible','on')
     4092% set(handles.CheckFmin2,'Visible','on')
     4093% set(handles.CheckF4,'Visible','on')
     4094% set(handles.CheckF3,'Visible','on')
     4095% set(handles.num_MinCorr,'Visible','on')
    40974096% set(handles.thresh_vec2C_text,'Visible','on')
    4098 % set(handles.thresh_vel2,'Visible','on')
    4099 % set(handles.thresh_vel2_text,'Visible','on')
    4100 % set(handles.mask_fix2,'Visible','on')
     4097% set(handles.num_MinVel,'Visible','on')
     4098% set(handles.TitleMinVel,'Visible','on')
     4099% set(handles.txt_MaskName,'Visible','on')
    41014100% set(handles.CheckMask,'Visible','on')
    41024101% set(handles.ListPairCiv2,'Visible','on')
     
    41054104% set(handles.get_ref_fix2,'Visible','on')
    41064105% set(handles.ref_fix2,'Visible','on')
    4107 % set(handles.inf_sup2,'Visible','on')
     4106% set(handles.num_MinVel,'Visible','on')
    41084107% set(handles.field_ref2,'Visible','on')
    41094108
     
    41134112% set(handles.frame_fix2,'BackgroundColor',[0.831 0.816 0.784])
    41144113% set(handles.REMOVE2,'Visible','off')
    4115 % set(handles.vec_Fmin2_2,'Visible','off')
    4116 % set(handles.vec_F4,'Visible','off')
    4117 % set(handles.vec_F3_2,'Visible','off')
    4118 % set(handles.thresh_vec2C,'Visible','off')
     4114% set(handles.CheckFmin2,'Visible','off')
     4115% set(handles.CheckF4,'Visible','off')
     4116% set(handles.CheckF3,'Visible','off')
     4117% set(handles.num_MinCorr,'Visible','off')
    41194118% set(handles.thresh_vec2C_text,'Visible','off')
    4120 % set(handles.thresh_vel2,'Visible','off')
    4121 % set(handles.thresh_vel2_text,'Visible','off')
    4122 % set(handles.mask_fix2,'Visible','off')
     4119% set(handles.num_MinVel,'Visible','off')
     4120% set(handles.TitleMinVel,'Visible','off')
     4121% set(handles.txt_MaskName,'Visible','off')
    41234122% set(handles.CheckMask,'Visible','off')
    41244123% set(handles.get_ref_fix2,'Visible','off')
    41254124% set(handles.ref_fix2,'Visible','off')
    4126 % set(handles.inf_sup2,'Visible','off')
     4125% set(handles.num_MinVel,'Visible','off')
    41274126% set(handles.field_ref2,'Visible','off')
    41284127% if isequal(get(handles.CheckCiv2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0)
     
    42114210% iby_val=str2double(get(handles.num_By,'String'));
    42124211% par.iby=num2str(iby_val);
    4213 % isx=get(handles.num_Sx,'String');
    4214 % if isnan(str2double(isx)), isx='41'; set(handles.num_Sx,'String','41'), end; %default
    4215 % if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles.num_Sx,'String',num2str(ibx_val+8)); end
    4216 % isy=get(handles.num_Sy,'String');
    4217 % if isnan(str2double(isy)), isy='41'; set(handles.num_Sy,'String','41'), end;%default
    4218 % if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles.num_Sy,'String',num2str(iby_val+8)); end
    4219 % par.isx=get(handles.num_Sx,'String');
    4220 % par.isy=get(handles.num_Sy,'String');
     4212% isx=get(handles.num_Searchx,'String');
     4213% if isnan(str2double(isx)), isx='41'; set(handles.num_Searchx,'String','41'), end; %default
     4214% if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles.num_Searchx,'String',num2str(ibx_val+8)); end
     4215% isy=get(handles.num_Searchy,'String');
     4216% if isnan(str2double(isy)), isy='41'; set(handles.num_Searchy,'String','41'), end;%default
     4217% if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles.num_Searchy,'String',num2str(iby_val+8)); end
     4218% par.isx=get(handles.num_Searchx,'String');
     4219% par.isy=get(handles.num_Searchy,'String');
    42214220% par.shiftx=get(handles.num_Shiftx,'String');
    42224221% par.shifty=get(handles.num_Shifty,'String');
    42234222% if isnan(str2double(par.isx))
    42244223%     par.isx='41';%default
    4225 %     set(handles.num_Sx,'String','41');
     4224%     set(handles.num_Searchx,'String','41');
    42264225% end
    42274226% if isnan(str2double(par.isy))
    42284227%     par.isy='41'; %default
    4229 %     set(handles.num_Sy,'String','41');
     4228%     set(handles.num_Searchy,'String','41');
    42304229% end
    42314230% if isnan(str2double(par.shiftx))
     
    42874286function par=read_param_civ2(handles,file_ima)
    42884287%------------------------------------------------------------------------
    4289 par.ibx=get(handles.ibx_civ2,'String');
    4290 par.iby=get(handles.iby_civ2,'String');
    4291 par.rho=get(handles.rho_civ2,'String');
    4292 par.decimal=int2str(get(handles.decimal,'Value'));
    4293 par.deformation=int2str(get(handles.deformation,'Value'));
     4288par.ibx=get(handles.num_Bx,'String');
     4289par.iby=get(handles.num_By,'String');
     4290par.rho=get(handles.num_Rho,'String');
     4291par.decimal=int2str(get(handles.CheckDecimal,'Value'));
     4292par.deformation=int2str(get(handles.CheckDeformation,'Value'));
    42944293par.dx=get(handles.num_Dx,'String');
    42954294par.dy=get(handles.num_Dy,'String');
     
    44494448civ2.correlationBoxesSize_Y=par.iby;
    44504449civ2.ro=par.rho;
    4451 %checkciv2.decimalShift=par.decimal;
    4452 %checkciv2.deformation=par.deformation;
     4450%checkciv2.decimalShift=par.CheckDecimal;
     4451%checkciv2.CheckDeformation=par.CheckDeformation;
    44534452if isequal(par.decimal,'1')
    44544453    civ2.decimalShift='y';
     
    47554754set(handles.field_ref1,'String',menu_field);
    47564755set(handles.field_ref1,'Value',length(menu_field));
    4757 set(handles.inf_sup1,'Value',2);
    4758 set(handles.num_MaxVel,'String','1');%default threshold
     4756set(handles.num_MinVel,'Value',2);
     4757set(handles.num_MinVel,'String','1');%default threshold
    47594758set(handles.ref_fix1,'Enable','on')
    47604759
     
    47994798    set(handles.field_ref2,'String',menu_field);
    48004799    set(handles.field_ref2,'Value',length(menu_field));
    4801     set(handles.inf_sup2,'Value',2);
    4802     set(handles.thresh_vel2,'String','1');%default threshold
     4800    set(handles.num_MinVel,'Value',2);
     4801    set(handles.num_MinVel,'String','1');%default threshold
    48034802    set(handles.ref_fix2,'Enable','on')
    48044803    set(handles.ref_fix2,'Visible','on')
     
    48124811function ref_fix1_Callback(hObject, eventdata, handles)
    48134812%------------------------------------------------------------------------
    4814 set(handles.inf_sup1,'Value',1);
     4813set(handles.num_MinVel,'Value',1);
    48154814set(handles.field_ref1,'Value',1)
    48164815set(handles.field_ref1,'String',{' '})
     
    48224821function ref_fix2_Callback(hObject, eventdata, handles)
    48234822%------------------------------------------------------------------------
    4824 set(handles.inf_sup2,'Value',1);
     4823set(handles.num_MinVel,'Value',1);
    48254824set(handles.field_ref2,'Value',1)
    48264825set(handles.field_ref2,'String',{' '})
    48274826set(handles.ref_fix2,'UserData',[]);
    48284827set(handles.ref_fix2,'String','');
    4829 set(handles.thresh_vel2,'String','0');
     4828set(handles.num_MinVel,'String','0');
    48304829
    48314830%------------------------------------------------------------------------
     
    48704869%------------------------------------------------------------------------
    48714870if isequal(get(handles.ImaThreshold2,'Value'),1)
    4872     set(handles.MinIma2,'Visible','on')
    4873     set(handles.MaxIma2,'Visible','on')
    4874 else
    4875     set(handles.MinIma2,'Visible','off')
    4876     set(handles.MaxIma2,'Visible','off')
     4871    set(handles.num_MinIma,'Visible','on')
     4872    set(handles.num_MaxIma,'Visible','on')
     4873else
     4874    set(handles.num_MinIma,'Visible','off')
     4875    set(handles.num_MaxIma,'Visible','off')
    48774876end
    48784877
     
    53015300fprintf(fid,   ['ImageSize ' num2str(Param.Civ1.npx) ' ' num2str(Param.Civ1.npy) '\n' ]);   %VERIFIER CAS GENERAL ?
    53025301fprintf(fid,   ['CorrelationBoxesSize ' num2str(Param.Civ1.Bx) ' ' num2str(Param.Civ1.By) '\n' ]);
    5303 fprintf(fid,   ['SearchBoxeSize ' num2str(Param.Civ1.Sx) ' ' num2str(Param.Civ1.Sy) '\n' ]);
     5302fprintf(fid,   ['SearchBoxeSize ' num2str(Param.Civ1.Searchx) ' ' num2str(Param.Civ1.Searchy) '\n' ]);
    53045303fprintf(fid,   ['RO ' num2str(Param.Civ1.Rho) '\n' ]);
    53055304fprintf(fid,   ['GridSpacing ' num2str(Param.Civ1.Dx) ' ' num2str(Param.Civ1.Dy) '\n' ]);
     
    53485347%%
    53495348filename=regexprep(filename,'.nc','');
     5349MaskName_string='';%default
     5350if Param.(fixname).CheckMask
     5351    MaskName_string=[' -maskName "' Param.(fixname).MaskName];
     5352end
     5353MaxVel_string='';%default
     5354if ~isempty(Param.(fixname).MaxVel)
     5355    MaxVel_string=[' -threshV ' num2str(Param.(fixname).MaxVel)]
     5356end
    53505357if isunix
    5351     cmd=[Param.xml.FixBin ' -f ' filename '.nc -fi1 ' num2str(Param.(fixname).flagindex(1)) ...
    5352         ' -fi2 ' num2str(Param.(fixname).flagindex(2)) ' -fi3 ' num2str(Param.(fixname).flagindex(3)) ...
    5353         ' -threshC ' num2str(Param.(fixname).thresh_vecC)...% ' -threshV ' num2str(Param.(fixname).thresh_vel)...
    5354         ' -maskName ' Param.(fixname).MaskName...
    5355         '" > ' filename '.' lower(fixname) '.log 2>&1'];
     5358    cmd=[Param.xml.FixBin ' -f ' filename '.nc -fi1 ' num2str(Param.(fixname).CheckFmin2) ...
     5359        ' -fi2 ' num2str(Param.(fixname).CheckF2) ' -fi3 ' num2str(Param.(fixname).CheckF3) ...
     5360        ' -threshC ' num2str(Param.(fixname).MinCorr) MaxVel_string MaskName_string...
     5361        ' >' filename '.' lower(fixname) '.log 2>&1'];
    53565362else
    53575363    cmd=['"' Param.xml.FixBin '" -f "' filename '.nc" -fi1 ' num2str(Param.(fixname).CheckFmin2)...
     
    53875393%         ' -max ' thresh_value ' -nopt ' subdomain_patch  '  > ' namelog ' 2>&1']; % redirect standard output to the log file
    53885394% end
     5395
     5396
     5397% --- Executes on button press in CheckStereo.
     5398function CheckStereo_Callback(hObject, eventdata, handles)
     5399% hObject    handle to CheckStereo (see GCBO)
     5400% eventdata  reserved - to be defined in a future version of MATLAB
     5401% handles    structure with handles and user data (see GUIDATA)
     5402
     5403% Hint: get(hObject,'Value') returns toggle state of CheckStereo
  • trunk/src/mouse_alt_gui.m

    r252 r287  
    11%'mouse_alt_gui': function activated when the right mouse button is pressed on a GUI (callback for 'WindowButtonDownFcn')
    2 % it displays a msg box with zoom of the current uicontrol display
     2% it displays an editable msg box with zoom of the current uicontrol display
    33%------------------------------------------------------------------------
    44function mouse_alt_gui(hObject,eventdata,handles)
     
    66if isequal(get(hObject,'SelectionType'),'alt')
    77    set(hObject,'Units','pixels')
    8     series_pos=get(hObject,'Position');%position of the current GUI  (in pixels), as selected by the mouse
     8    GUI_pos=get(hObject,'Position');%position on the screen  (in pixels)  of the GUI selected by the mouse
    99    set(hObject,'Units','normalized')
    10     xy_fig=get(hObject,'CurrentPoint');% current point of the current GUI 
    11     hchild=get(hObject,'Children');%handles of all objects in the current GUI
     10    xy_fig=get(hObject,'CurrentPoint');% current point of the current GUI
     11    hchildren=get(hObject,'Children');%handles of all objects in the current GUI
    1212    %% loop on all the objects in the current figure (selected by the last mouse click)
    13     for ichild=1:length(hchild)
    14         obj_pos=get(hchild(ichild),'Position');%position of the object       
    15         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);         
    16             htype=get(hchild(ichild),'Type');%type of object child of the current figure
    17             %if the mouse is over a uicontrol, look at the data
    18             if isequal(htype,'uicontrol') && isequal(get(hchild(ichild),'Visible'),'on')
    19                 msg_pos(1:2)=series_pos(1:2)+obj_pos(1:2).*series_pos(3:4);
    20                 msgbox_uvmat(['uicontrol: ' get(hchild(ichild),'Tag')],'',get(hchild(ichild),'String'),msg_pos)
    21                 break
     13    for ichild=1:length(hchildren)
     14        hchild=hchildren(ichild);
     15        obj_pos=get(hchild,'Position');%position of the object
     16        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);
     17            htype=get(hchild,'Type');%type of object child of the current figure
     18            switch htype
     19                case 'uicontrol'
     20                    %if the mouse is over a uicontrol, look at the data
     21                    if strcmp(get(hchild,'Visible'),'on')
     22                        msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
     23                        output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
     24                        break
     25                    end
     26                case 'uipanel'
     27                    panel_pos=obj_pos;%position of the panel
     28                    hhchildren=get(hchild,'Children');%handles of all objects in the current GUI
     29                    %% loop on all the objects in the current figure (selected by the last mouse click)
     30                    for iichild=1:length(hhchildren)
     31                        hchild=hhchildren(iichild);
     32                        rel_pos=get(hchild,'Position');%position of the object relative to the uipanel
     33                        obj_pos(1:2)=panel_pos(1:2)+rel_pos(1:2).*panel_pos(3:4);
     34                        obj_pos(3:4)=panel_pos(3:4).*rel_pos(3:4);
     35                        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);
     36                            htype=get(hchild,'Type');%type of object child of the current figure
     37                            %if the mouse is over a uicontrol, look at the data
     38                            if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on')
     39                                msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
     40                                output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
     41                                break
     42                            end
     43                        end
     44                    end
    2245            end
     46           
    2347        end
    2448    end
    2549    set(hObject,'Units','pixels')
     50    set(hchild,'String',output_str)
    2651end
  • trunk/src/read_GUI.m

    r281 r287  
    22% --- read a GUI with handle 'handle' producing a structure 'struct'
    33function struct=read_GUI(handle)
     4struct=[];%default
    45hchild=get(handle,'children');
    56for ichild=1:numel(hchild)
Note: See TracChangeset for help on using the changeset viewer.