Changeset 155


Ignore:
Timestamp:
Jan 24, 2011, 10:22:47 AM (7 years ago)
Author:
tjniskan
Message:
  • Added support for multiple monitor systems

M aedes_inputdlg.m
M aedes_roi_copy_gui.m
A aedes_dialoglocation.m
M aedes_readfidprefs.m
M aedes_rotateflip.m
M aedes_resviewer.m
M aedes.m
M aedes_helpabout.m
M plugins/fat_analysis.m
M plugins/copy_data_to_workspace.m
M aedes_export_gui.m
M aedes_headerbrowser.m
M aedes_revision.m
M aedes_juigetfiles.m
M aedes_editstack.m

Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r150 r155  
    292292GD=aedes_gui_defaults;
    293293GD.col.frame = DefaultColor;
    294 % Get screen size
    295 scrsz=get(0,'ScreenSize');
    296 
    297 % Calculate gui position on the center of the screen
    298 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2-20 fig_w fig_h];
     294
     295% Calculate default position for Aedes window
     296try
     297        % If multiple monitors are connected, draw Aedes on primary monitor
     298        scrsz = get(0,'MonitorPositions');
     299        fig_pos = [scrsz(1,3)/2-fig_w/2 scrsz(1,4)/2-fig_h/2-20 fig_w fig_h];
     300catch
     301        % Get screen size
     302        scrsz=get(0,'ScreenSize');
     303       
     304        % Calculate gui position on the center of the screen
     305        fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2-20 fig_w fig_h];
     306end
    299307
    300308%% Check if other Aedes windows exist
     
    43624370  fig_h = 250;
    43634371  fig_w = 285;
    4364   scrsz = get(0,'screensize');
     4372        fig_location = aedes_dialoglocation([fig_w,fig_h]);
     4373        fig_left = fig_location(1);
     4374        fig_bottom = fig_location(2);
    43654375 
    43664376  % Use previous position for the overlay controls
    43674377  if ispref('Aedes','OverlayControlPos')
    4368         tmp_pos=getpref('Aedes','OverlayControlPos');
    4369         fig_left = tmp_pos(1);
    4370         fig_bottom = tmp_pos(2);
    4371   else
    4372         fig_left = scrsz(3)/2-fig_w/2;
    4373         fig_bottom = scrsz(4)/2-fig_h/2;
     4378                tmp_pos=getpref('Aedes','OverlayControlPos');
     4379               
     4380                % Check that the figure is on the screen
     4381                scrsz = get(0,'Screensize');
     4382                if scrsz(3)>tmp_pos(1) && scrsz(4)>tmp_pos(2)
     4383                        fig_left = tmp_pos(1);
     4384                        fig_bottom = tmp_pos(2);
     4385                end
    43744386  end
    43754387 
     
    59395951  try
    59405952    default_pos = getpref('Aedes','TSfig_position');
     5953                scrsz = get(0,'Screensize');
     5954                if default_pos(1)>scrsz(3) || default_pos(2)>scrsz(4)
     5955                        default_pos = get(0,'defaultfigureposition');
     5956                end
    59415957  catch
    59425958    default_pos = get(0,'defaultfigureposition');
     
    89788994
    89798995% Open results in aedes_resviewer
     8996cMon = aedes_currentmonitor(H.FIG);
    89808997aedes_resviewer(Res)
    89818998
     
    90939110fig_h = 220;
    90949111fig_w = 245;
    9095 scrsz = get(0,'screensize');
     9112fig_location = aedes_dialoglocation([fig_w,fig_h]);
     9113fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    90969114
    90979115H.ROICOMPARISON_FIG = figure('units','pixel',...
    90989116                             'position',...
    9099                              [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 ...
    9100                     fig_w fig_h],...
     9117                             fig_pos,...
    91019118                             'Name','ROI Comparisons',...
    91029119                             'numbertitle','off',...
     
    1053210549    if ( isfield(DATA{Dat.DataInd},'PROCPAR') && ~isempty(DATA{Dat.DataInd}.PROCPAR) ) || ...
    1053310550        ( isfield(DATA{Dat.DataInd},'HDR') && ~isempty(DATA{Dat.DataInd}.HDR) )
    10534       aedes_headerbrowser(DATA{Dat.DataInd});
     10551                        cMon = aedes_currentmonitor(H.FIG);
     10552      aedes_headerbrowser(DATA{Dat.DataInd},cMon);
    1053510553    else
    1053610554      errordlg('Cannot open file header browser. File header not found!','File Header Not Found!','modal');
  • aedes_editstack.m

    r80 r155  
    8989fig_h = 305;
    9090fig_w = 550;
    91 scrsz = get(0,'screensize');
    92 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     91fig_location = aedes_dialoglocation([fig_w,fig_h]);
     92fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    9393
    9494%% The main figure
  • aedes_export_gui.m

    r147 r155  
    120120  GD=aedes_gui_defaults;
    121121 
    122   % Position figure to the center of the screen
    123   scrsz = get(0,'screensize');
     122       
    124123  fig_w = 350;
    125124  fig_h = 585;
    126   fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
    127  
     125        fig_location = aedes_dialoglocation([fig_w,fig_h]);
     126        fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
     127       
    128128  %% Main Figure ----------------------------
    129129  H.MAINFIG = figure('Units','Pixel', ...
  • aedes_headerbrowser.m

    r147 r155  
    3838
    3939% Do some error checking
    40 if nargin ~= 1
     40if nargin < 1
    4141  error('Invalid number of input arguments!')
    4242end
     
    179179    Dat.MatlabVersion = aedes_getmatlabversion;
    180180
    181     % Position figure to the center of the screen
    182     scrsz = get(0,'screensize');
    183181    fig_w = 600;
    184182    fig_h = 700;
    185     fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
    186    
    187    
     183                fig_location = aedes_dialoglocation([fig_w,fig_h]);
     184                fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
     185               
    188186    % Main Figure ----------------------------
    189187    H.Fig = figure('Units','Pixel', ...
  • aedes_helpabout.m

    r148 r155  
    3232GD=aedes_gui_defaults;
    3333
    34 % Position figure to the center of the screen
    35 scrsz = get(0,'screensize');
    3634fig_w = 310;
    3735fig_h = 395;
    38 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     36fig_location = aedes_dialoglocation([fig_w,fig_h]);
     37fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    3938
    4039%% Main Figure ----------------------------
  • aedes_inputdlg.m

    r144 r155  
    4949
    5050Resp = {};
     51callerFig = gcbf;
    5152
    5253%% Dialog figure -------------------
    5354GD = aedes_gui_defaults;
    54 scrsz = get(0,'screensize');
    5555fig_w=215;
    5656fig_h=85;
    57 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
    58 
     57fig_location = aedes_dialoglocation([fig_w,fig_h]);
     58fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    5959
    6060fh=dialog('position',fig_pos,...
  • aedes_juigetfiles.m

    r147 r155  
    7070FigColor = GD.col.mainfig;
    7171
    72 %% Draw main figure
    73 scrsz=get(0,'screensize');
    7472fig_w = 870;%780;
    7573fig_h = 545;%535;
    76 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     74fig_location = aedes_dialoglocation([fig_w,fig_h]);
     75fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    7776fh=figure('position',fig_pos,...
    7877          'Name',ftitle, ...
  • aedes_readfidprefs.m

    r138 r155  
    165165fig_h = 300;
    166166fig_w = 270;
    167 scrsz = get(0,'screensize');
    168 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     167fig_location = aedes_dialoglocation([fig_w,fig_h]);
     168fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    169169
    170170%% The main figure
  • aedes_resviewer.m

    r150 r155  
    4949
    5050% If Res-structure is given as an input argument, go to "single-file" mode
    51 if nargin==1
     51if nargin == 1
    5252  % Check that the Res structure is valid
    5353  if isstruct(Res_in) && isfield(Res_in,'Stat') && ...
     
    5757  else
    5858    error('The Res-structure is not valid!')
    59   end
    60  
    61 elseif nargin>1
     59        end
     60 
     61elseif nargin > 1
    6262  error('Too many input arguments')
    6363end
     64
    6465
    6566l_DrawGUI;
     
    7677 
    7778%% Load default font and colors
    78   GD=aedes_gui_defaults;
    79  
    80   % Position figure to the center of the screen
    81   scrsz = get(0,'screensize');
     79  GD=aedes_gui_defaults;       
     80
    8281  fig_w = 1000;
    8382  fig_h = 600;
    84   fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
    85  
     83        fig_location = aedes_dialoglocation([fig_w,fig_h]);
     84        fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
     85       
    8686  %% Main Figure ----------------------------
    8787  H.MAINFIG = figure('Units','Pixel', ...
  • aedes_revision.m

    r154 r155  
    9393% bash-script every time it is called so that this file "aedes_revision.m" is
    9494% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
    95 % - Svn Hook -
     95% - SVN Hook -
  • aedes_roi_copy_gui.m

    r148 r155  
    7272fig_h = 415;%395;
    7373fig_w = 250;
    74 scrsz = get(0,'screensize');
    75 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     74fig_location = aedes_dialoglocation([fig_w,fig_h]);
     75fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    7676
    7777
  • aedes_rotateflip.m

    r80 r155  
    5959fig_h = 305;
    6060fig_w = 500;
    61 scrsz = get(0,'screensize');
    62 fig_pos = [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 fig_w fig_h];
     61fig_location = aedes_dialoglocation([fig_w,fig_h]);
     62fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    6363
    6464%% The main figure
  • plugins/copy_data_to_workspace.m

    r45 r155  
    3333fig_h = 160;
    3434fig_w = 245;
    35 scrsz = get(0,'screensize');
     35fig_location = aedes_dialoglocation([fig_w,fig_h]);
     36fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    3637
    3738fh = figure('units','pixel',...
    3839            'position',...
    39             [scrsz(3)/2-fig_w/2 scrsz(4)/2-fig_h/2 ...
    40              fig_w fig_h],...
     40            fig_pos,...
    4141            'Name','Copy to workspace',...
    4242            'numbertitle','off',...
  • plugins/fat_analysis.m

    r87 r155  
    186186
    187187% Show results in uitable
    188 scrsz = get(0,'screensize');
    189188fig_h = 150;
    190189fig_w = 350;
     190fig_location = aedes_dialoglocation([fig_w,fig_h]);
     191fig_pos = [fig_location(1) fig_location(2) fig_w fig_h];
    191192fh = figure('units','pixels',...
    192   'position',[scrsz(3)/2-fig_w/2 ...
    193   scrsz(4)/2-fig_h/2 fig_w fig_h],...
     193  'position',fig_pos,...
    194194  'Name','Fat Analysis Results',...
    195195  'IntegerHandle','off',...
Note: See TracChangeset for help on using the changeset viewer.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008