home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / source / xbutton.cpp < prev    next >
C/C++ Source or Header  |  1998-04-06  |  4KB  |  143 lines

  1. #include "xcheckbx.h"
  2. #include "xpushbtn.h"
  3. #include "xradio.h"
  4. #include "xuserbtn.h"
  5. #include "xstring.h"
  6.  
  7. #include <stdlib.h>
  8.  
  9.  
  10. /*@
  11. @class XButton
  12. @parent XControl
  13. @type overview
  14. @symbol _
  15. */
  16.  
  17. XButton :: XButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *s, const unsigned char *classStyle, const char *font):XControl(rec, style, owner, (const char *) s, (PSZ) classStyle, id, font)
  18. {
  19. }
  20.  
  21.  
  22. /*@
  23. @class XPushButton
  24. @parent XButton
  25. @type overview
  26. @symbol _
  27. */
  28.  
  29. /*@ XPushButton :: XPushButton( const XWindow * owner, const XRect& rec, const USHORT id, const ULONG style, const char * s, const char*font)
  30. @group constructors/destructors
  31. @remarks Constructs a pushbuttom
  32. @parameters <t '°' c=2>
  33.             °XWindow * owner      °the owner
  34.             °XRect * rect         °the rectangle
  35.             °USHORT id            °id of the window
  36.             °ULONG style          °style, valid values are:
  37. <BR>
  38. BU_TEXT
  39. <BR>
  40. BU_HELP
  41. <BR>
  42. BU_DEFAULT
  43. <BR>
  44. BU_NOPOINTERFOCUS
  45. <BR>
  46. BU_NOBORDER
  47. <BR>
  48. BU_NOCURSORSELECT
  49. <BR>
  50. BU_AUTOSIZE
  51. <BR>
  52. (can be or-ed). If BU_ICON or BU_BITMAP is set, an icon/bitmap must be avaible in the programs resources with the id given in id (third parameter).
  53.             °const char * string  °text to display
  54.             </t>
  55. */
  56. XPushButton :: XPushButton(const XWindow * owner, const XRect& rec, const USHORT id, const ULONG style, const char *s, const char *font):XButton(owner, &rec, id, style | BS_PUSHBUTTON, (const char *) s, (unsigned char *) WC_BUTTON, font)
  57. {
  58. }
  59.  
  60.  
  61. /*@
  62. @class XSettingButton
  63. @parent XButton
  64. @type overview
  65. @symbol _
  66. */
  67. XSettingButton :: XSettingButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *s, const unsigned char *classStyle, const char *font):XButton(owner, rec, id, style, (const char *) s, (unsigned char *) classStyle, font)
  68. {
  69. }
  70.  
  71.  
  72. /*@ XSettingButton :: Select( BOOL select)
  73. @group misc
  74. @remarks Select/deselect a XSettingButton
  75. @parameters BOOL select    TRUE=select, FALSE=deselect
  76. */
  77. void XSettingButton::Select(const BOOL select)
  78. {
  79.    WinSendMsg(winhandle, BM_SETCHECK, MPFROMSHORT(select), 0);
  80. }
  81.  
  82.  
  83. /*@ XSettingButton :: IsSelected( void )
  84. @group misc
  85. @remarks Query if a button is selected
  86. @returns BOOL result
  87. */
  88. BOOL XSettingButton::IsSelected(void) const
  89. {
  90.    return SHORT1FROMMR(WinSendMsg(winhandle, BM_QUERYCHECK, 0, 0));
  91. }
  92.  
  93.  
  94. /*@
  95. @class XCheckBox
  96. @parent XSettingButton
  97. @type overview
  98. @symbol _
  99. */
  100.  
  101.  
  102. /*@ XCheckBox::XCheckBox( const XWindow * owner, const XRect& rec, const USHORT id, const LONG style, const char * s, const char*font)
  103. @group constructors/destructors
  104. @remarks Constructs a XCheckBox
  105. @parameters <t '°' c=2>
  106.          °XWindow * owner      °the owner
  107.             °XRect& rect         °the rectangle
  108.             °USHORT id            °id of the window
  109.             °LONG style           °the style
  110.             °const char * string  °text to display
  111.          </t>
  112. */
  113. XCheckBox :: XCheckBox(const XWindow * owner, const XRect& rec, const USHORT id, const LONG style, const char *s, const char *font):XSettingButton(owner, &rec, id, style | BS_AUTOCHECKBOX, (const char *) s, (unsigned char *) WC_BUTTON, font)
  114. {
  115. }
  116.  
  117.  
  118. /*@
  119. @class XRadioButton
  120. @parent XSettingButton
  121. @type overview
  122. @symbol _
  123. */
  124.  
  125.  
  126. /*@ XRadioButton::XRadioButton( const XWindow * owner, const XRect& rec, const USHORT id, const LONG style, const char * s, const char * font)
  127. @group constructors/destructors
  128. @remarks Constructs a XCheckBox
  129. @parameters <t '°' c=2>
  130.             °XWindow * owner      °the owner
  131.             °XRect& rect         °the rectangle
  132.             °USHORT id            °id of the window
  133.             °LONG style           °the style
  134.             °const char * string  °text to display
  135.             </t>
  136. */
  137. XRadioButton :: XRadioButton(const XWindow * owner, const XRect& rec, const USHORT id, const LONG style, const char *s, const char *font):XSettingButton(owner, &rec, id, style | BS_AUTORADIOBUTTON, (const char *) s, (unsigned char *) WC_BUTTON, font)
  138. {
  139. }
  140.  
  141.  
  142.  
  143.