home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula
/
nebula.bin
/
SourceCode
/
Palettes
/
CircularSliderPalette
/
wraps.psw
< prev
Wrap
Text File
|
1991-12-16
|
3KB
|
102 lines
/*
* Filename: wraps.psw
* Created : Sat Aug 24 21:25:44 1991
* Author : Vince DeMarco
* <vince@whatnxt.cuc.ab.ca>
*
* Version 1.0.1
*
*/
defineps PSdrawCircSlider(float height; float width; float x; float y; float radius; float angle)
gsave %% save the current graphics state
x 1.5 sub y translate %% translate the current point to the center of the
%% circle
height width gt { %% if the height is greater than the width then
1 height width div scale %% scale the y by height / width
} if
height width lt { %% if height is less than the width then scale
width height div 1 scale %% the x by width / height
} if
%%%%%% Draw the background of the Circular Slider
newpath
0.33333 setgray
0.5 0.5 radius 0 360 arc
closepath
fill
%%%%%% Draw the control portion of Circular Slider
0.5 setgray
newpath
x width div y height div moveto
0.5 0.5 radius 90 angle 90 sub neg arcn
closepath
fill
%%%%%% stroke out an outline
0 setgray
1 setlinewidth
0.5 0.5 radius 0 360 arc
matrix defaultmatrix setmatrix %% create an empty 6x6 element unit matrix
%% replace the currently created matrix with the
%% default matrix for the device then sets up that
%% matrix as the CTM
%%
%% This is done so the stroked lines don't get
%% wider because of the scaling
stroke
grestore
endps
/*********************************
defineps PSdrawRectangle(float x; float y; float width; float height)
%%% Draws a 3D looking (raised) rectangle
gsave
0.66666 setgray
x y width height rectfill
%%%%% left side and top
2 setlinewidth
1 setgray
x y moveto
0 height rlineto
width 0 rlineto
stroke
%%%%% bottom and right light gray
1 setlinewidth
0.33 setgray
x 1 add y 2 add moveto
width 2 sub 0 rlineto
0 height 3 sub rlineto
stroke
%%%%%%%%%%%%%%%%%%%% bottom black
1.5 setlinewidth
0 setgray
x y moveto
width 0 rlineto
stroke
%%%%%%%%%%%%%%%%%%%% right black
1 setlinewidth
0 setgray
x width add y moveto
0 height rlineto
stroke
grestore
endps
**************************/