home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / source / xspinbtn.cpp < prev    next >
C/C++ Source or Header  |  1997-03-07  |  3KB  |  113 lines

  1. #include "xspinbtn.h"
  2.  
  3.  
  4. /*@ XSpinButton :: XSpinButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *string, const char *font)
  5. @group constructors/destructors
  6. @remarks Constructs a XSpinButton
  7. @parameters <t '°' c=2>
  8.                 °XWindow * owner      °the owner of the XSlider
  9.             °XRect * rect         °the rectangle
  10.             °USHORT id            °id of the window
  11.             °ULONG style          °style, valid values are:
  12.                                             <t '°' c=1>
  13.                                                 °SP_LEFT
  14.                                                 °SP_RIGHT
  15.                                                 °SP_CENTER
  16.                                                 °SP_NOBORDER
  17.                                                 °SP_FAST
  18.                                                 °SP_MASTER
  19.                                                 °SP_SERVANT
  20.                                                 °SP_READONLY
  21.                                                 °SP_NUMERIC
  22.                                                 °SP_CHAR
  23.                                                 °SP_FILLZERO
  24.                                             </t>
  25.                                 (can be or-ed)
  26.                 °char * font                °font to use, e.g. "8.Helv"
  27.                 </t>
  28. */
  29. XSpinButton :: XSpinButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *string, const char *font):XControl(rec, style, owner, string, WC_SPINBUTTON, id, font)
  30. {
  31. }
  32.  
  33.  
  34. /*@ XSpinButton::SpinDown(const LONG units)
  35. @group misc
  36. @remarks Spin down window-content
  37. @parameters LONG units     units to spin down
  38. */
  39. void XSpinButton::SpinDown(const LONG units) const
  40. {
  41.     WinSendMsg(winhandle, SPBM_SPINDOWN, (MPARAM) units, 0);
  42. }
  43.  
  44.  
  45. /*@ XSpinButton::SpinUp(const LONG units)
  46. @group misc
  47. @remarks Spin up window-content
  48. @parameters LONG units     units to spin up
  49. */
  50. void XSpinButton::SpinUp(const LONG units) const
  51. {
  52.     WinSendMsg(winhandle, SPBM_SPINUP, (MPARAM) units, 0);
  53. }
  54.  
  55.  
  56. /*@ XSpinButton::SetTextLimit(const SHORT limit)
  57. @group misc
  58. @remarks Set maximum textlength
  59. @parameters SHORT limit    maximum length
  60. */
  61. void XSpinButton::SetTextLimit(const SHORT limit) const
  62. {
  63.     WinSendMsg(winhandle, SPBM_SPINDOWN, MPFROMSHORT(limit), 0);
  64. }
  65.  
  66.  
  67. /*@ XSpinButton::SetMaster(const XWindow * master)
  68. @group misc
  69. @remarks
  70. @parameters XWindow* master
  71. @returns BOOL result
  72. */
  73. BOOL XSpinButton::SetMaster(const XWindow * master) const
  74. {
  75.     return (BOOL) WinSendMsg(winhandle, SPBM_SETMASTER, (MPARAM) master->GetHandle(), 0);
  76. }
  77.  
  78.  
  79. /*@ XSpinButton::GetValue(void)
  80. @group set/query values
  81. @remarks Returns the current value of the spinbutton
  82. */
  83. LONG XSpinButton::GetValue(void)
  84. {
  85.     LONG l;
  86.  
  87.     WinSendMsg(winhandle, SPBM_QUERYVALUE, MPFROMP((VOID *) & l), 0);
  88.     return l;
  89. }
  90.  
  91.  
  92. /*@ XSpinButton::SetLimits(const LONG lowerLimit, const LONG upperLimit)
  93. @group limits
  94. @remarks Set limits of the spinbutton
  95. @parameters LONG lowerLimit   the lower limit<BR>
  96.             LONG upperLimit   the upper limit
  97. */
  98. void XSpinButton::SetLimits(const LONG lowerLimit, const LONG upperLimit) const
  99. {
  100.     WinSendMsg(winhandle, SPBM_SETLIMITS, (MPARAM) upperLimit, (MPARAM) lowerLimit);
  101. }
  102.  
  103.  
  104. /*@ XSpinButton::SetValue(const LONG val)
  105. @group set/query values
  106. @remarks Set the value of the spinbutton
  107. @parameters LONG value     the new value
  108. */
  109. void XSpinButton::SetValue(const LONG val) const
  110. {
  111.     WinSendMsg(winhandle, SPBM_SETCURRENTVALUE, (MPARAM) val, 0);
  112. }
  113.