Changeset 644 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 28, 2013, 11:30:01 PM (8 years ago)
Author:
sommeria
Message:

various improvements: resize GUI uvmat, projection on lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r641 r644  
    194194
    195195%UvData.OpenParam.PosColorbar=[0.8450    0.0900    0.0190    0.3600];
    196 UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445];
     196UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445];
    197197%UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
    198198UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
     
    210210set(hObject,'WindowButtonUpFcn',{'mouse_up',handles})
    211211set(hObject,'DeleteFcn',{@closefcn})%
     212set(hObject,'ResizeFcn',{@ResizeFcn,handles})%
    212213
    213214%% initialisation
     
    334335    set(hhh,'enable','off')
    335336end
     337
     338%------------------------------------------------------------------------
     339%--- activated when resizing the GUI view_field
     340 function ResizeFcn(gcbo,eventdata,handles)
     341%------------------------------------------------------------------------     
     342set(handles.uvmat,'Units','pixels')
     343size_fig=get(handles.uvmat,'Position');
     344ColumnWidth=max(150,0.18*size_fig(3));
     345ColumnWidth=min(ColumnWidth,250); % width of the right side display column, between 150 and 250, depending on the fig width
     346% Data=get(handles.uvmat,'UserData');
     347% Data.GUISize=size_fig;
     348% set(handles.uvmat,'UserData',Data)
     349
     350
     351%% position of panel InputFile
     352%set(handles.InputFile,'Units','pixels')
     353pos_InputFile=get(handles.InputFile,'Position');% [lower x lower y width height] for text_display
     354pos_InputFile(1)=0;
     355pos_InputFile(2)=size_fig(4)-pos_InputFile(4);             % set frame InputFile to the top of the fig
     356pos_InputFile(3)=size_fig(3);
     357
     358set(handles.InputFile,'Position',pos_InputFile);% [lower x lower y width height] for text_display
     359
     360%% reset position of text_display or TableDisplay
     361if strcmp(get(handles.TableDisplay,'Visible'),'off')
     362    pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display
     363        pos_1(3)=1.2*ColumnWidth;
     364    pos_1(1)=size_fig(3)-pos_1(3);             % set text display to the right of the fig
     365    pos_1(2)=size_fig(4)-pos_InputFile(4)-pos_1(4);             % set text display to the top of the fig
     366    set(handles.text_display,'Position',pos_1)
     367    % reset position of TableDisplay
     368else
     369    pos_1=get(handles.TableDisplay,'Position');
     370    pos_1(3)=1.2*ColumnWidth;
     371    pos_1(1)=size_fig(3)-pos_1(3);
     372    pos_1(2)=size_fig(4)-pos_InputFile(4)-pos_1(4);
     373    set(handles.TableDisplay,'Position',pos_1)
     374end
     375
     376%% reset position of CheckHold
     377% pos_CheckHold=get(handles.CheckHold,'Position');% [lower x lower y width height] for CheckHold
     378% pos_CheckHold(1)=size_fig(3)-pos_CheckHold(3);       % set 'CheckHold' to the right of the fig
     379% pos_CheckHold(2)=pos_1(2)-pos_CheckHold(4);          % set 'CheckHold' to the lower edge of text display
     380% set(handles.CheckHold,'Position',pos_CheckHold)
     381
     382%% reset position of Coordinates
     383pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates'
     384pos_2(3)=ColumnWidth;
     385pos_2(1)=size_fig(3)-pos_2(3);       % set 'Coordinates' to the right of the fig
     386pos_2(2)=pos_1(2)-pos_2(4);          % set 'Coordinates' to the lower edge of text display, allowing a margin for CheckHold
     387set(handles.Coordinates,'Position',pos_2)
     388
     389%% reset position of  Scalar
     390pos_3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar'
     391pos_3(3)=ColumnWidth;
     392pos_3(1)=size_fig(3)-pos_3(3);         % set 'Scalar' to the right of the fig
     393if strcmp(get(handles.Scalar,'Visible'),'on')
     394    pos_3(2)=pos_2(2)-pos_3(4); % set 'Scalar' to the lower edge of frame 'Coordinates' if visible
     395else
     396    pos_3(2)=pos_2(2);% set 'Scalar' to the lower edge of frame 'text display' if  unvisible
     397end
     398set(handles.Scalar,'Position',pos_3)
     399
     400%% reset position of  Vectors
     401set(handles.Vectors,'Units','pixels')
     402pos_4=get(handles.Vectors,'Position');
     403pos_4(3)=ColumnWidth;
     404pos_4(1)=size_fig(3)-pos_4(3);
     405if strcmp(get(handles.Vectors,'visible'),'on')
     406    pos_4(2)=pos_3(2)-pos_4(4);
     407else
     408    pos_4(2)=pos_3(2);
     409end
     410set(handles.Vectors,'Position',pos_4)
     411
     412%% reset position and scale of axis
     413pos(1)=0.2*size_fig(3)+35;
     414pos(2)=35;
     415pos(3)=0.77*size_fig(3)-1.2*ColumnWidth;
     416pos(4)=size_fig(4)-60;
     417set(handles.PlotAxes,'Position',pos)
     418
    336419
    337420%------------------------------------------------------------------------
     
    11031186set(handles.j2,'Visible',state_j)
    11041187set(handles.last_j,'Visible',state_j);
    1105 set(handles.frame_j,'Visible',state_j);
     1188%set(handles.frame_j,'Visible',state_j);
    11061189set(handles.j_text,'Visible',state_j);
    11071190if ~isempty(i2_series)||~isempty(j2_series)
     
    27492832    end
    27502833end
     2834ResizeFcn(handles.uvmat,[],handles)
    27512835
    27522836%------------------------------------------------------------------------
     
    29843068    if strcmp(transform_fct,'sub_field')
    29853069        set(handles.TransformName,'Value',1)%suppress the sub_field transform
    2986         transform_fct_Callback(hObject, eventdata, handles);
     3070        T
     3071       
     3072       
     3073        ransformName_Callback(hObject, eventdata, handles);
    29873074    else
    29883075        run0_Callback(hObject, eventdata, handles)
     
    41754262        set(hview_field,'UserData',Data);% restore the previously stored GUI position after GUI resizing
    41764263    else
    4177         set(hview_field,'Position',Data.GUISize)% return to the previously stored GUI position and size
     4264%         set(hview_field,'Position',Data.GUISize)% return to the previously stored GUI position and size
    41784265    end
    41794266end
     
    43494436    else
    43504437        Data=get(hview_field,'UserData');
    4351         set(hview_field,'Position',Data.GUISize)% restore the size of view_field for plots
     4438%         set(hview_field,'Position',Data.GUISize)% restore the size of view_field for plots
    43524439    end
    43534440else
Note: See TracChangeset for help on using the changeset viewer.