home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / APPLAUNC.PAK / APPBTN.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  44 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //----------------------------------------------------------------------------
  4. #if !defined(__APPBTN_H)
  5. #define __APPBTN_H
  6.  
  7. #if !defined(__OWL_BUTTONGA_H)
  8. #  include <owl\buttonga.h>
  9. #endif
  10. class _OWLCLASS TDib;
  11. class _OWLCLASS TBitmap;
  12.  
  13. //
  14. // class TAppButton.  Derived from TButtonGadget.  The only difference
  15. // between this class and its derived class is in the handling of the
  16. // button id.  Every button has an id of CM_DUMMY, which is a place holder
  17. // for the frame's response table.  This class defines a new data member
  18. // called 'RealId' which is different for each button.  The 'ReadId' is
  19. // used by the frame window to determine which button has been pressed.
  20. //
  21. class TAppButton : public TButtonGadget {
  22.   public:
  23.     int         RealId;                   // id of button.
  24.     static int  ButtonPixelSize;          // size of button.
  25.  
  26.     TAppButton(const TBitmap& bitmap, int id);
  27.     TAppButton(HINSTANCE hInst, const string& iconPath, int id);
  28.     ~TAppButton();
  29.  
  30.   protected:
  31.     TDib*     GetGlyphDib();              // Dib to draw on button face.
  32.     HINSTANCE HInst;                      // cached to use in member functions.
  33.  
  34.     void  ReleaseGlyphDib(TDib* glyph);
  35.     void  CreateGlyph(const TBitmap& bitmap);
  36.     void  BitmapFromIconPath(const string& iconPath, TBitmap& bitmap);
  37.  
  38.   private:
  39.     TDib*   Glyph;
  40. };
  41.  
  42. #endif // __APPBTN_H
  43.  
  44.