home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / toolba.zip / ATOOLBAR.HPP < prev    next >
Text File  |  1994-09-08  |  3KB  |  57 lines

  1. /************************************************************************
  2. * AToolBar.hpp - toolbar class header                                   *
  3. * --------------------------------------------------------------------- *
  4. * Override ISetCanvas in order to provide a toolbar composed of         *
  5. * graphical pushbuttons.  Support is provided for command actions as    *
  6. * well as "fly-over" micro-help for the buttons.                        *
  7. * --------------------------------------------------------------------- *
  8. * New methods:                                                          *
  9. *                                                                       *
  10. * void setMessageId -   set the message id for the micro-help request   *
  11. *                       to be sent to the frame window.  This should be *
  12. *                       the same as the id set for the AInfoArea.       *
  13. *                                                                       *
  14. * Boolean addButton -   add a button to the toolbar, based on the       *
  15. *                       resource id.                                    *
  16. *                                                                       *
  17. * Boolean addButtons -  add multiple buttons to the toolbar, based on   *
  18. *                       an array of resource ids and a count.           *
  19. *                                                                       *
  20. * Protected methods: -------------------------------------------------- *
  21. *                                                                       *
  22. * Boolean motion -      overridden from AMouseMoveHandler class to      *
  23. *                       intercept mouse move messages for buttons.      *
  24. *                                                                       *
  25. ************************************************************************/
  26.  
  27. #ifndef _ATOOLBAR_HPP_
  28. #define _ATOOLBAR_HPP_
  29.  
  30. #include <isetcv.hpp>
  31.  
  32. #include "ammvehdr.hpp"
  33.  
  34. #define TOOLBAR_TEXT 9999
  35.  
  36. class AToolBar : public ISetCanvas, 
  37.                  public AMouseMoveHandler
  38. {
  39. public:
  40.    AToolBar( unsigned long windowId, IWindow *owner );
  41.    AToolBar( unsigned long windowId, IWindow *owner, const Style style );
  42.  
  43.    void setMessageId( unsigned long id );
  44.    Boolean addButton( unsigned long id );
  45.    Boolean addButtons( unsigned long ids[], unsigned long count );
  46.    Boolean addSpace( unsigned long size );
  47.  
  48. protected:
  49.    virtual Boolean motion( IEvent &evt );
  50.  
  51. private:
  52.    unsigned long messageId;
  53. };
  54.  
  55. #endif /* _ATOOLBAR_HPP_ not defined */
  56.  
  57.