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

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //----------------------------------------------------------------------------
  4. #if !defined(__APPBTNBA_H)
  5. #define __APPBTNBA_H
  6.  
  7. #include <owl\toolbox.h>
  8. #include "appbtn.h"
  9.  
  10. //
  11. // button bar that contains application buttons.
  12. //
  13. class TAppButtonBar : public TToolBox {
  14.   public:
  15.     static const int AppButtonIdBase;
  16.  
  17.     TAppButtonBar(TWindow*        parent,
  18.                   int             numColumns = 2,
  19.                   int             numRows = AS_MANY_AS_NEEDED,
  20.                   TTileDirection  direction = Vertical,
  21.                   TModule*        module = 0)
  22.       : TToolBox(parent, numColumns, numRows, direction, module) {}
  23.  
  24.     void          SetupWindow();
  25.     void          MoveButton(int srcLoc, int destLoc, const string& iconPath);
  26.     void          ChangeOrientation(TTileDirection direction);
  27.     void          DestroyButton(int loc);
  28.     TAppButton*   ButtonWithId(int id);
  29.     int           IdFromLoc(int loc) { return AppButtonIdBase + loc; }
  30.     int           LocFromId(int id) { return id - AppButtonIdBase; }
  31.     void          GetSize(TSize& sz) { GetDesiredSize(sz); }
  32.     void          Flush(int del = 0);
  33.     void          ReDraw();
  34.  
  35.   protected:
  36.     void          EvRButtonDown(UINT modKeys, TPoint& point);
  37.     void          EvLButtonUp(UINT modKeys, TPoint& point);
  38.     void          EvLButtonDown(UINT modKeys, TPoint& point);
  39.     void          EvMouseMove(UINT modKeys, TPoint& point);
  40.  
  41.   private:
  42.     int           DragState;
  43.     unsigned      DragButtonId;
  44.     HCURSOR       OrigCursor;
  45.     HCURSOR       DragCursor;
  46.     TPoint        StartDragPoint;
  47.     int           CM_PROPERTIES;
  48.     int           CM_BUTTON_PRESSED;
  49.     int           CM_BUTTON_DRAG;
  50.         
  51.     void          SetDragCursor();
  52.     void          ResetOrigCursor();
  53.  
  54.   DECLARE_RESPONSE_TABLE(TAppButtonBar);
  55. };
  56.  
  57. #endif // __APPBTNBA_H
  58.  
  59.