home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / TOOLOW.ZIP / JTOOLS.HPP < prev    next >
C/C++ Source or Header  |  1992-03-01  |  2KB  |  53 lines

  1. #ifndef __JTOOLS_HPP
  2. #define __JTOOLS_HPP
  3.  
  4. _CLASSDEF(TToolItem)
  5. class TToolItem    : public Object
  6. {
  7.   int nID;
  8. public:
  9.   HBITMAP    hBitmap1, hBitmap2;
  10.   BOOL bState, bButton, bBorder, bShadow, bEnabled;
  11.   RECT rect;
  12.  
  13.   TToolItem(PTWindowsObject AParent, Pchar Type, int id, int X,int Y,int W,int H, Pchar lpBitmap1, Pchar lpBitmap2, Pchar Shadow, Pchar Border);
  14.   ~TToolItem();
  15.   void Show(HDC hdc, HBRUSH hButtonBrush, HPEN hShadowPen);
  16.   void SetState(BOOL State){bState = State;}
  17.   BOOL GetState(){return bState;}
  18.   void Enable(BOOL bFlag){bEnabled = bFlag;}
  19.   int  HitTest(int nX,int nY);
  20.   int  GetID(){return nID;}
  21.  
  22.   // Object stuff so it can be stored in container
  23.   virtual classType isA() const { return __firstUserClass; }
  24.   virtual Pchar nameOf() const { return "TToolItem"; }
  25.   virtual hashValueType hashValue() const { return 0; } 
  26.   virtual int isEqual(RCObject AToolItem) const
  27.     { return nID == ((RTToolItem)AToolItem).nID; }
  28.   virtual void printOn(Rostream) const {  }
  29. };
  30.  
  31. _CLASSDEF(TToolBar)
  32. class TToolBar : public TWindow
  33. {
  34. protected:
  35.   HPEN hShadowPen;
  36.   HBRUSH hButtonBrush;
  37.   BOOL bButtonDown;
  38.   PTToolItem SelToolItem;
  39. public:
  40.   PArray ToolItems;
  41.   TToolBar(PTWindowsObject AParent, int nHeight);
  42.   ~TToolBar();
  43.   virtual LPSTR GetClassName() {return "TToolBar";}
  44.   virtual void GetWindowClass(WNDCLASS&);
  45.   void SetItemState(int ID, int bState);
  46.   virtual void Paint(HDC DC, PAINTSTRUCT& PS); 
  47.   virtual void WMLButtonDown(RTMessage Msg)= [WM_FIRST + WM_LBUTTONDOWN];
  48.   virtual void WMLButtonUp(RTMessage Msg)  = [WM_FIRST + WM_LBUTTONUP];
  49.   virtual void WMMouseMove(RTMessage Msg)  = [WM_FIRST + WM_MOUSEMOVE];
  50. };
  51.  
  52. #endif
  53.