Scale.txt 4.9 KB

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