summaryrefslogtreecommitdiff
path: root/Scale.txt
blob: 08e24f1ff333745b611f3768f0645b2a736c048a (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

Scale Widget

Header file 		Scale.h
Class			scaleWidgetClass
Class Name		Scale
Superclass		Simple

The Scale widget is an immutable image displayed within a rectangular
region of the screen.  When the widget is selected, it is highlighted, 
and an application callback routine is invoked.  When the
widget is resized the image can be autoscaled to fit new size of the 
widget window.  The widget can also cut and paste its contents.

When creating a Scale widget instance, the following resources are
retrieved from the argument list or from the resource database:

All the Simple Widget resources plus...
-------------------------------------------------------------------------------
 Name                Cass               Type            Default Value
-------------------------------------------------------------------------------
 aspectRatio         AspectRatio        Float           1.0
 autoscale           Autoscale          Boolean         True
 bufferSize          BufferSize         Cardinal        1024
 foreground          Foreground         Pixel           XtDefaultForeground
 gravity             Gravity            XtGravity       ForgetGravity
 image               Image              XImage*         NULL
 internalHeight      Height             Dimension       2
 internalWidth       Width              Dimension       2
 pasteBuffer         PasteBuffer        Boolean         False
 precision           Precision          Float           0.001
 proportional        Proportional       Boolean         True
 resize              Resize             Boolean         True
 scaleX              ScaleFactor        Float           DefaultScaleValue
 scaleY              ScaleFactor        Float           DefaultScaleValue
 exponent            Exponent           integer         -3
-------------------------------------------------------------------------------

 aspectRatio	This resource specifies the aspect ratio of the scaled image
		in the x / y * aspectRatio = 1 form.  It is effective within
		the precision resource only if proportional resource is set 
		to true.  AspectRatio resource can be any positive number 
		greater than zero.

 autoscale	If this resource is set to True then the image will be
		autoscaled to fit the window size within internal width
		and internal height resource values.  If the resource is
		False, the widget will only reposition the image
		according to the gravity resource value.

 bufferSize	This resource specifies the buffer size in XRectangle's for
		buffering the XFillRectangle calls.  It is effective only 
		for XYBitmap image type.

 background	This resource has the same meaning as for the Simple widget.
		However, it is worth mentioning that if the most frequent
		pixel value in the XYPixmap or ZPixmap image is specified
		as background, the scaling process can be speeded up noticeably.

 foreground	The color used to paint the image if in XYBitmap format.
		If the image is XYPixmap or ZPixmap format, the foreground
		resource has no effect.

 gravity	This resource will determine where to put the image if it does 
		not fit the window size minus internal width and height.
		The widget will try to preserve gravity rather than internal
		width and height resources.

 image		This is the image to be displayed in the widget window.
		If no image is desired, the NULL value can be passed.  
		The passed image is copied and set to the resource value.
		Applications should destroy the passed image argument
		if they do not intend to use it at some later time.

 internalHeight	
 internalWidth	These resources specify the minimum distance from the boarder 
		of the widget window to be maintanied when manipulating the 
		image.  If image is too big or small to satisfy given 
		conditions, the	widget will position the image to preserve 
		gravity rather than internalWidth or internalHeight.

 pasteBuffer	If this resource is true then the widget owns the paste
		selection buffer.  This resource can only be queried.

 precision	This resource specifies the precision of the scale factors
		when scaling the image.  The precision resource can be any 
		positive number greater than zero. (For example, if precision
		is 1.0 then the image will be scaled only by integer values.)

 proportional	If this resource is set to true it will make sure that the 
                image proportions, as specified by aspectRatio resource,
                are being kept whenever it is scaled.  
		
 resize		If this resource is true the widget will try to resize when
		addopting a new image thus preserveing the scale values.
		If it is false the scale values will not be preserved unless
		the image can fit in the current window size with the same
		scale values.

 scaleX
 scaleY		These resources specify the scaling values for the widget
		image.  They will be floored to satisfy precision resource
		values.  If uniform resource is true the scale values will
		be only integers.  These resources can be any positive number
		greater than zero.

 shiftFactor	...