home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xuserbtn.h < prev    next >
Text File  |  1998-04-06  |  2KB  |  70 lines

  1. #ifndef __OOL_XUSERBUTTON_H__
  2. #define __OOL_XUSERBUTTON_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XUserButton                           */
  8. /*                       derived from: XSettingButton                        */
  9. /*                        last update: 03/98                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14.  
  15. #include "xsetbtn.h"
  16. #include "xtext.h"
  17. #include "xgraphdv.h"
  18.  
  19. class XBitmap;
  20. class XLine;
  21.  
  22. #ifndef BU_TWOSTATE
  23.    #define BU_TWOSTATE         0x8000
  24. #endif
  25.  
  26. #ifndef BU_NOPOINTERFOCUS
  27.    #define BU_NOPOINTERFOCUS   0x0800
  28. #endif
  29.  
  30. #ifndef BU_NOCURSORSELECT
  31.    #define BU_NOCURSORSELECT   0x1000
  32. #endif
  33.  
  34. #ifndef BU_NOBORDER
  35.    #define BU_NOBORDER         0x2000
  36. #endif
  37.  
  38. class _export_ XUserButton: public XSettingButton
  39. {
  40.       friend XBitmap;
  41.       //for internal use only:
  42.       friend class userbtnhandler;
  43.       friend class userbtnmousehandler;
  44.       char isPressed;
  45.       XText * text;
  46.       XGraphicDevice * graph;
  47.       LONG style;
  48.       char buffer;
  49. //      XLine * line1, *line2, *line3, *line4;
  50.    protected:
  51.       XBitmap * bmp[2];
  52.       void Draw( void );
  53.       void Setup( );
  54.    public:
  55.       XUserButton( const XWindow * w, const XRect& r=XRect(), const LONG id = 0, const LONG style = WIN_VISIBLE, const char * text = NULL, const SHORT yOff = 0);
  56.       virtual ~XUserButton();
  57.       virtual void GetText( XString * buffer ) const;
  58.       XBitmap * GetBitmap( const UCHAR index) const { if(index == 0 || index == 1) return bmp[index]; else return NULL; }
  59.       XGraphicDevice * GetGraphicDevice() const { return graph; }
  60.       XText * GetTextPointer(void) const { return text; }
  61.       virtual BOOL IsSelected( void ) const ;
  62.       void SetBitmap( const XBitmap *, const UCHAR index = 0);
  63.       virtual void Select( const BOOL select = TRUE);
  64.       virtual void SetText( const char * text);
  65.       void SetTextStyle( const LONG t) { ;}
  66.       virtual void Toggle(void);
  67. };
  68.  
  69. #endif
  70.