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