File: do_load_as_palette.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (31 lines) | stat: -rw-r--r-- 741 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
29
30
31
function [palettes,windows]=do_load_as_palette(palettes,windows)
// Copyright INRIA
[ok,scs_m,cpr,edited]=do_load()
if ~ok then return,end


maxpal=-mini([-200;windows(:,1)]) 
kpal=maxpal+1

lastwin=curwin

curwin=get_new_window(windows)
if or(curwin==winsid()) then
  
  xdel(curwin);
end
windows=[windows;[-kpal curwin]]
palettes(kpal)=scs_m
//
xset('window',curwin),xselect();
xset('alufunction',3)
if pixmap then xset('pixmap',1),end,xbasc();
wsiz=palettes(kpal)(1)(1)
xset('wdim',wsiz(1),wsiz(2))
Xshift=wsiz(3);Yshift=wsiz(4);
xsetech([-1 -1 8 8]/6,[Xshift,Yshift,Xshift+wsiz(1),Yshift+wsiz(2)])
drawobjs(palettes(kpal))
if pixmap then xset('wshow'),end
xinfo('Palette: may be used to copy  blocks or regions')
xset('window',lastwin)