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