home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / source / xbutton.cpp < prev    next >
C/C++ Source or Header  |  1997-04-05  |  4KB  |  140 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.                                             <t '°' c=2>
  38.                                     °BU_TEXT    °
  39.                                     °BU_HELP    °
  40.                                     °BU_DEFAULT    °
  41.                                     °BU_NOPOINTERFOCUS    °
  42.                                     °BU_NOBORDER    °
  43.                                     °BU_NOCURSORSELECT    °
  44.                                     °BU_AUTOSIZE    °
  45.                                             </t>
  46.                                   (can be or-ed). If BU_ICON or BU_BITMAP is set,
  47.                                   an icon/bitmap must be avaible in the programs
  48.                                   resources with the id given in id (third parameter).                                            
  49.             °const char * string  °text to display
  50.                 </t>
  51. */
  52. 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)
  53. {
  54. }
  55.  
  56.  
  57. /*@ 
  58. @class XSettingButton
  59. @parent XButton
  60. @type overview
  61. @symbol _
  62. */
  63.  
  64. 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)
  65. {
  66. }
  67.  
  68.  
  69. /*@ XSettingButton :: Select( BOOL select)
  70. @group misc
  71. @remarks Select/deselect a XSettingButton
  72. @parameters BOOL select    TRUE=select, FALSE=deselect
  73. */
  74. void XSettingButton::Select(BOOL select)
  75. {
  76.     WinSendMsg(winhandle, BM_SETCHECK, MPFROMSHORT(select), 0);
  77. }
  78.  
  79.  
  80. /*@ XSettingButton :: IsSelected( void )
  81. @group misc
  82. @remarks Query if a button is selected
  83. @returns BOOL result
  84. */
  85. BOOL XSettingButton::IsSelected(void) const
  86. {
  87.     return SHORT1FROMMR(WinSendMsg(winhandle, BM_QUERYCHECK, 0, 0));
  88. }
  89.  
  90.  
  91. /*@ 
  92. @class XCheckBox
  93. @parent XSettingButton
  94. @type overview
  95. @symbol _
  96. */
  97.  
  98.  
  99. /*@ XCheckBox::XCheckBox( const XWindow * owner, const XRect * rec, const USHORT id, const LONG style, const char * s, const char*font)
  100. @group constructors/destructors
  101. @remarks Constructs a XCheckBox
  102. @parameters <t '°' c=2>
  103.             °XWindow * owner      °the owner
  104.             °XRect * rect         °the rectangle
  105.             °USHORT id            °id of the window
  106.             °LONG style           °the style
  107.             °const char * string  °text to display
  108.             </t>
  109. */
  110. 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)
  111. {
  112. }
  113.  
  114.  
  115. /*@ 
  116. @class XRadioButton
  117. @parent XSettingButton
  118. @type overview
  119. @symbol _
  120. */
  121.  
  122.  
  123. /*@ XRadioButton::XRadioButton( const XWindow * owner, const XRect * rec, const USHORT id, const LONG style, const char * s, const char * font)
  124. @group constructors/destructors
  125. @remarks Constructs a XCheckBox
  126. @parameters <t '°' c=2>
  127.                 °XWindow * owner      °the owner
  128.             °XRect * rect         °the rectangle
  129.             °USHORT id            °id of the window
  130.             °LONG style           °the style
  131.             °const char * string  °text to display
  132.                 </t>
  133. */
  134. 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)
  135. {
  136. }
  137.  
  138.  
  139.  
  140.