Scale.txt revision 9aa228fd
1 2Scale Widget 3 4Header file Scale.h 5Class scaleWidgetClass 6Class Name Scale 7Superclass Simple 8 9The Scale widget is an immutable image displayed within a rectangular 10region of the screen. When the widget is selected, it is highlighted, 11and an application callback routine is invoked. When the 12widget is resized the image can be autoscaled to fit new size of the 13widget window. The widget can also cut and paste its contents. 14 15When creating a Scale widget instance, the following resources are 16retreived from the argument list or from the resource database: 17 18All the Simple Widget resources plus... 19------------------------------------------------------------------------------- 20 Name Cass Type Default Value 21------------------------------------------------------------------------------- 22 aspectRatio AspectRatio Float 1.0 23 autoscale Autoscale Boolean True 24 bufferSize BufferSize Cardinal 1024 25 foreground Foreground Pixel XtDefaultForeground 26 gravity Gravity XtGravity ForgetGravity 27 image Image XImage* NULL 28 internalHeight Height Dimension 2 29 internalWidth Width Dimension 2 30 pasteBuffer PasteBuffer Boolean False 31 precision Precision Float 0.001 32 proportional Proportional Boolean True 33 resize Resize Boolean True 34 scaleX ScaleFactor Float DefaultScaleValue 35 scaleY ScaleFactor Float DefaultScaleValue 36 exponent Exponent integer -3 37------------------------------------------------------------------------------- 38 39 aspectRatio This resource specifies the aspect ratio of the scaled image 40 in the x / y * aspectRatio = 1 form. It is effective within 41 the precision resource only if proportional resource is set 42 to true. AspectRatio resource can be any positive number 43 greater than zero. 44 45 autoscale If this resource is set to True then the image will be 46 autoscaled to fit the window size within internal width 47 and internal height resource values. If the resource is 48 False, the widget will only reposition the image 49 according to the gravity resource value. 50 51 bufferSize This resource specifies the buffer size in XRectangle's for 52 buffering the XFillRectangle calls. It is effective only 53 for XYBitmap image type. 54 55 background This resource has the same meaning as for the Simple widget. 56 However, it is worth mentioning that if the most frequent 57 pixel value in the XYPixmap or ZPixmap image is specified 58 as backgroud, the scaling process can be speeded up noticably. 59 60 foreground The color used to paint the image if in XYBitmap format. 61 If the image is XYPixmap or ZPixmap format, the foreground 62 resource has no effect. 63 64 gravity This resource will determine where to put the image if it does 65 not fit the window size minus internal width and height. 66 The widget will try to preserve gravity rather than internal 67 width and height resources. 68 69 image This is the image to be displayed in the widget window. 70 If no image is desired, the NULL value can be passed. 71 The passed image is copied and set to the resource value. 72 Applications should destroy the passed image argument 73 if they do not intend to use it at some later time. 74 75 internalHeight 76 internalWidth These resources specify the minimum distance from the boarder 77 of the widget window to be maintanied when manipulating the 78 image. If image is too big or small to satisfy given 79 conditions, the widget will position the image to preserve 80 gravity rather than internalWidth or internalHeight. 81 82 pasteBuffer If this resource is true then the widget owns the paste 83 selection buffer. This resource can only be queried. 84 85 precision This resource specifies the precision of the scale factors 86 when scaling the image. The precision resource can be any 87 positive number greater than zero. (For example, if precision 88 is 1.0 then the image will be scaled only by integer values.) 89 90 proportional If this resource is set to true it will make sure that the 91 image proportions, as specified by aspectRatio resource, 92 are being kept whenever it is scaled. 93 94 resize If this resource is true the widget will try to resize when 95 addopting a new image thus preserveing the scale values. 96 If it is false the scale values will not be preserved unless 97 the image can fit in the current window size with the same 98 scale values. 99 100 scaleX 101 scaleY These resources specify the scaling values for the widget 102 image. They will be floored to satisfy precision resource 103 values. If uniform resource is true the scale values will 104 be only integers. These resources can be any positive number 105 greater than zero. 106 107 shiftFactor ... 108