annotate aim-mat/gui/aim_resize_function.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % procedure for 'aim-mat'
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
bleeck@3 8 %
tomwalters@0 9 % (c) 2011, University of Southampton
bleeck@3 10 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 11 % download of current version is on the soundsoftware site:
bleeck@3 12 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 13 % documentation and everything is on http://www.acousticscale.org
tomwalters@0 14
tomwalters@0 15
tomwalters@0 16 function aim_resize_function(obj,eventdata,handles)
tomwalters@0 17
tomwalters@0 18 fig = gcbo;%returns the handle of the graphics object whose callback is executing.
tomwalters@0 19 old_units = get(fig,'Units');
tomwalters@0 20 set(fig,'Units','pixels');
tomwalters@0 21 global figpos
tomwalters@0 22 figpos = get(fig,'Position');
tomwalters@0 23
tomwalters@0 24 % if figpos(3) < 640 & figpos(3) >0
tomwalters@0 25 % figpos(3)=640;
tomwalters@0 26 % set(fig,'Position',figpos);
tomwalters@0 27 % end
tomwalters@0 28 %
tomwalters@0 29 % if figpos(4) < 400
tomwalters@0 30 % figpos(4)=400;
tomwalters@0 31 % set(fig,'Position',figpos);
tomwalters@0 32 % end
tomwalters@0 33
tomwalters@0 34 cur_axis=gca; % this is the full size axis with the full size area
tomwalters@0 35 set(cur_axis,'units','pixel');
tomwalters@0 36 fax=get(gcf,'Position'); % the size of the figure
tomwalters@0 37 relative_axis(1)=10/fax(3); % bottom fixed
tomwalters@0 38 relative_axis(2)=111/fax(4); % bottom right fixed
tomwalters@0 39 relative_axis(3)=(fax(3)-40)/fax(3); % height
tomwalters@0 40 relative_axis(4)=(fax(4)-220)/fax(4); % height
tomwalters@0 41
tomwalters@0 42 [myaxes1,myaxes2,myaxes3,myaxes4]=aim_define_plot_areas(handles,relative_axis);
tomwalters@0 43
tomwalters@0 44 % screens=get(0,'ScreenSize');
tomwalters@0 45 % if figpos(1)+figpos(3)>screens(3)
tomwalters@0 46 % figpos(1)=screens(3)-figpos(3)-5;
tomwalters@0 47 % set(fig,'Position',figpos);
tomwalters@0 48 % end
tomwalters@0 49 % if figpos(2)+figpos(4)>screens(4)
tomwalters@0 50 % figpos(2)=screens(4)-figpos(4)-30;
tomwalters@0 51 % set(fig,'Position',figpos);
tomwalters@0 52 % end
tomwalters@0 53
tomwalters@0 54 % keep everything on top
tomwalters@0 55 dist1=46;
tomwalters@0 56 dist3=74;
tomwalters@0 57 dist4=104;
tomwalters@0 58 dist5=110;
tomwalters@0 59
tomwalters@0 60 distr1=107;
tomwalters@0 61 keepontop('frame7',dist5);
tomwalters@0 62 keepontop('frame10',dist5);
tomwalters@0 63 % keepontopright('frame10',dist5,distr1+10);
tomwalters@0 64
tomwalters@0 65 % keepontop('pushbutton10',dist1-1);
tomwalters@0 66 keepontop('pushbutton0',dist1);
tomwalters@0 67 keepontop('pushbutton2',dist1);
tomwalters@0 68 keepontop('pushbutton3',dist1);
tomwalters@0 69 keepontop('pushbutton4',dist1);
tomwalters@0 70 keepontop('pushbutton5',dist1);
tomwalters@0 71 keepontop('pushbutton6',dist1);
tomwalters@0 72 % keepontopright('pushbutton6',dist1,distr1);
tomwalters@0 73 keepontop('pushbutton21',dist1);
tomwalters@0 74
tomwalters@0 75 % keepontop('pushbutton11',dist3+2);
tomwalters@0 76 % keepontop('pushbutton8',dist4+3);
tomwalters@0 77 % keepontopright('pushbutton9',179,distr1-6);
tomwalters@0 78
tomwalters@0 79 keepontop('listbox1',dist3);
tomwalters@0 80 keepontop('listbox2',dist3);
tomwalters@0 81 keepontop('listbox0',dist3);
tomwalters@0 82 keepontop('listbox3',dist3);
tomwalters@0 83 keepontop('listbox4',dist3);
tomwalters@0 84 keepontop('listbox5',dist3);
tomwalters@0 85 % keepontopright('listbox5',dist3,distr1-1);
tomwalters@0 86 keepontop('listbox6',dist3);
tomwalters@0 87
tomwalters@0 88 keepontop('checkbox0',dist4-5);
tomwalters@0 89 keepontop('checkbox1',dist4-5);
tomwalters@0 90 keepontop('checkbox2',dist4-5);
tomwalters@0 91 keepontop('checkbox3',dist4-5);
tomwalters@0 92 keepontop('checkbox4',dist4-5);
tomwalters@0 93 keepontop('checkbox8',dist4-5);
tomwalters@0 94 keepontop('checkbox5',dist4-5);
tomwalters@0 95 % keepontopright('checkbox5',dist4-5,distr1-38);
tomwalters@0 96
tomwalters@0 97
tomwalters@0 98 distr2=101;
tomwalters@0 99 distr3=85;
tomwalters@0 100 distr4=95;
tomwalters@0 101
tomwalters@0 102 % keeponbottomright('text13',distr2);
tomwalters@0 103 % keeponbottomright('edit1',distr2);
tomwalters@0 104 % keeponbottomright('pushbuttonautoscale',distr2);
tomwalters@0 105 % keeponbottomright('slider1',distr3);
tomwalters@0 106 % keeponbottomright('frame5',distr4);
tomwalters@0 107
tomwalters@0 108
tomwalters@0 109 % set the axes to nice sizes:
tomwalters@0 110 hoben=107; % soviel muss oben freibleiben
tomwalters@0 111 hunten=110; % soviel muss unten freibleiben
tomwalters@0 112 hv=figpos(4)-hunten-hoben; % soviel ist verfügbar in der Mitte
tomwalters@0 113 % davon bekommen das Profile und das signal je 14% und das SAI 72%:
tomwalters@0 114 h1=hv*0.14;
tomwalters@0 115 h2=hv*0.72;
tomwalters@0 116 h3=hv*0.14;
tomwalters@0 117
tomwalters@0 118
tomwalters@0 119 b1=20; % soweit weg vom linken Rand
tomwalters@0 120 b2=38;% soweit weg vom rechten Rand
tomwalters@0 121 bv=figpos(3)-b1-b2; % soviel Breite ist verfügbar
tomwalters@0 122 % davon bekommen die linken 89% und das Profile 11%
tomwalters@0 123 b3=bv*0.11;
tomwalters@0 124 b4=bv*0.89;
tomwalters@0 125
tomwalters@0 126 ax1 = findobj('Tag','axes1');
tomwalters@0 127 ax2 = findobj('Tag','axes2');
tomwalters@0 128 ax3 = findobj('Tag','axes3');
tomwalters@0 129 ax4 = findobj('Tag','axes4');
tomwalters@0 130 set(ax1,'Position',[b1-1 hunten+h1+h2+2 b4 h1]);
tomwalters@0 131 set(ax2,'Position',[b1 hunten+h1+1 b4 h2]);
tomwalters@0 132 set(ax3,'Position',[b1 hunten b4 h3]);
tomwalters@0 133 set(ax4,'Position',[b1+b4+1 hunten+h1+1 b3 h2]);
tomwalters@0 134
tomwalters@0 135
tomwalters@0 136
tomwalters@0 137 set(fig,'Units',old_units);
tomwalters@0 138
tomwalters@0 139 aim_savecurrentstate(handles);% save the state of the project and the window to a file
tomwalters@0 140 % handles=replotgraphic(handles);
tomwalters@0 141
tomwalters@0 142
tomwalters@0 143 function keepontop(name,dist)
tomwalters@0 144 global figpos
tomwalters@0 145 u = findobj('Tag',name);
tomwalters@0 146 correct=+9;
tomwalters@0 147 upos=get(u,'Position');
tomwalters@0 148 upos = [upos(1), figpos(4) - dist+correct, upos(3), upos(4)];
tomwalters@0 149 set(u,'Position',upos);
tomwalters@0 150
tomwalters@0 151 function keepontopright(name,disttop,distright)
tomwalters@0 152 global figpos
tomwalters@0 153 u = findobj('Tag',name);
tomwalters@0 154 correct=+9;
tomwalters@0 155 upos=get(u,'Position');
tomwalters@0 156 upos = [figpos(3)-distright, figpos(4) - disttop+correct, upos(3), upos(4)];
tomwalters@0 157 set(u,'Position',upos);
tomwalters@0 158
tomwalters@0 159 function keeponbottomright(name,distright)
tomwalters@0 160 global figpos
tomwalters@0 161 u = findobj('Tag',name);
tomwalters@0 162 upos=get(u,'Position');
tomwalters@0 163 upos = [figpos(3)-distright, upos(2), upos(3), upos(4)];
tomwalters@0 164 set(u,'Position',upos);