home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xtoolbar.h < prev    next >
C/C++ Source or Header  |  1998-02-08  |  3KB  |  73 lines

  1. #ifndef __OOL_XTOOLBAR_H__
  2. #define __OOL_XTOOLBAR_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XToolBar                              */
  8. /*                       derived from: XFrameControl                         */
  9. /*                        last update: 11/96                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xfrmcnt.h"
  14. #include "xfrmwnd.h"
  15.  
  16. #define TB_RIPABLE 16
  17. #define TB_NOCLOSE  32
  18.  
  19.  
  20. class XColor;
  21. //class XGraphicDevice;
  22. //class XLine;
  23. class XControlEvent;
  24.  
  25. typedef struct clientWin
  26. {
  27.    LONG xOffset, yOffset;
  28.    BOOL group;
  29.    XWindow * clientWin;
  30. } ___clientWin___;
  31.  
  32. class XSize;
  33. class ToolBarHandler;
  34.  
  35. class _export_ XToolBar: public XFrameControl
  36. {
  37.       friend class XFrame;
  38.       friend class ToolBarParent;
  39.       friend class ToolBarHandler;
  40.    private:
  41.       clientWin ** clientArray;
  42.       USHORT clients;
  43.       USHORT borderSize;
  44.       XFrameWindow * frame, * cutWindow;
  45.       char spacing;
  46.       ToolBarHandler * hdl;
  47.       BOOL border;
  48.       ULONG style;
  49.       XString title;
  50.    protected:
  51.       virtual void Attach( void );
  52.       virtual void Cut( void );
  53.    public:
  54.       XToolBar( const XFrameWindow *, const ULONG style = TB_TOP, const ULONG id=0, const USHORT ySize = 20, const char groupSpacing = 15);
  55.       virtual ~XToolBar();
  56.       void AddWindow( const XWindow * clientWindow, const BOOL newGroup = FALSE, const BOOL adjustSize = FALSE, const XWindow * insertBehind = NULL, const LONG x_offset = 0, LONG y_Offset = 0);
  57.       BOOL DoCommand( LONG);
  58.       void DoControl( XControlEvent*);
  59.       void DoSize( XSize* );
  60.       void Draw(void);
  61.       void GetBackgroundColor( XColor * rgb) const;
  62.       XFrameWindow * GetCutWindow() const { return cutWindow; }
  63.       virtual void GetText( XString * buffer ) const { *buffer = title; }
  64.       BOOL RemoveWindow( const XWindow *, const BOOL redraw = FALSE);
  65.       void ReSize( void );
  66.       void SetBorderSize( const USHORT siz);
  67.       BOOL SetHeight( const USHORT cy);
  68.       virtual void SetText(const char * text) { title = text; if(cutWindow) cutWindow->SetText(title); }
  69.       void Show( const BOOL show = TRUE);
  70. };
  71.  
  72. #endif
  73.