/********************************************************************************
*                                                                               *
*                        T o o l b a r   W i d g e t                            *
*                                                                               *
*********************************************************************************
* Copyright (C) 2000 by Jeroen van der Zijp.   All Rights Reserved.             *
*********************************************************************************
* This library is free software; you can redistribute it and/or                 *
* modify it under the terms of the GNU Library General Public                   *
* License as published by the Free Software Foundation; either                  *
* version 2 of the License, or (at your option) any later version.              *
*                                                                               *
* This library is distributed in the hope that it will be useful,               *
* but WITHOUT ANY WARRANTY; without even the implied warranty of                *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
* Library General Public License for more details.                              *
*                                                                               *
* You should have received a copy of the GNU Library General Public             *
* License along with this library; if not, write to the Free                    *
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            *
*********************************************************************************
* $Id: FXToolbar.h,v 1.25 2000/08/25 16:03:38 jeroen Exp $                      *
********************************************************************************/
#ifndef FXTOOLBAR_H
#define FXTOOLBAR_H




/**
* Toolbar control.
*/
class FXAPI FXToolbar : public FXPacker {
  FXDECLARE(FXToolbar)
protected:
  FXComposite   *drydock;     // Parent when docked
  FXComposite   *wetdock;     // Parent when floating
protected:
  FXToolbar();
  virtual void layout();
private:
  FXToolbar(const FXToolbar&);
  FXToolbar &operator=(const FXToolbar&);
public:

  /**
  * Construct a floatable toolbar 
  * Normally, the toolbar is docked under window p.
  * When floated, the toolbar can be docked under window q, which is
  * typically an FXToolbarShell window.
  */
  FXToolbar(FXComposite* p,FXComposite* q,FXuint opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);

  /**
  * Construct a non-floatable toolbar.
  * The toolbar can not be undocked.
  */
  FXToolbar(FXComposite* p,FXuint opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=2,FXint pr=3,FXint pt=3,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);

  /// Return parent when docked
  FXComposite* getDryDock() const { return drydock; }

  /// Return parent when floating
  FXComposite* getWetDock() const { return wetdock; }

  /// Return true if toolbar is docked
  FXbool isDocked() const;

  /// Dock the bar
  virtual void dock();
  
  /// Undock the bar
  virtual void undock();

  /// Return default width 
  virtual FXint getDefaultWidth();

  /// Return default height 
  virtual FXint getDefaultHeight();

  /// Return width for given height
  virtual FXint getWidthForHeight(FXint h);

  /// Return height for given width
  virtual FXint getHeightForWidth(FXint w);

  /// Set docking side 
  void setDockingSide(FXuint side=LAYOUT_SIDE_TOP);

  /// Return docking side
  FXuint getDockingSide() const;
  
  /// Save toolbar to a stream
  virtual void save(FXStream& store) const;

  /// Load toolbar from a stream
  virtual void load(FXStream& store);

  /// Destroy
  virtual ~FXToolbar();
  };



#endif
