File: window_set_size.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (28 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function window_set_size(a)
[lhs,rhs]=argn(0)

  rect=dig_bound(scs_m);
  if rect<>[] then
    xx=rect(1);
    yy=rect(2);
    w=rect(3)-rect(1);
    h=rect(4)-rect(2);
    if rhs==0 then j=1.5;a=max(600/(j*w),400/(j*h),j); end
else
    xx=0;yy=0;w=600;h=400;rect=[xx,yy,w,h];
    if rhs==0 then a=1.5; end
  end


  xbasc()

  xset("wresize",0);
width=%zoom*w*a;height=%zoom*h*a
  xset('wdim',width,height);
  b=(1-1/a)/2;
  xsetech([b,b,1/a,1/a],[rect(1),rect(2),rect(3),rect(4)])
  
  r=xget('wpdim');
  %XSHIFT=max((width-r(1))/2,0)
  %YSHIFT=max((height-r(2))/2,0)
  xset('viewport',%XSHIFT,%YSHIFT)