/**************************************************************************

    This file is part of explorer95, a file manager for fvwm95.
    Copyright (C) 1996, 1997 David Barth, Hector Peraza.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

**************************************************************************/

#ifndef __OXNEWWIDGETS_H
#define __OXNEWWIDGETS_H

#include <X11/Xlib.h>

#include <xclass/OXFrame.h>
#include <xclass/OXWindow.h>
#include <xclass/OXWidgets.h>
#include <xclass/OString.h>

//-------------------------------------------------------------------

class OXStatusBar : public OXFrame {
protected:
  static GC _defaultGC;
  static XFontStruct *_defaultFontStruct;

public:
  OXStatusBar(const OXWindow *p, int w, int h,
              unsigned int options = SUNKEN_FRAME,
              unsigned long back = _defaultFrameBackground);

  virtual void DrawBorder();
  virtual void SetText(OString *text) { 
    if (_status_info) delete _status_info;
    _status_info = text;
    _client->NeedRedraw(this);
  }

  friend class OXExplorerClient;

protected:
  virtual void _DoRedraw() {
    OXFrame::_DoRedraw();
    if (_status_info)
      _status_info->Draw(GetDisplay(), _id, _defaultGC, 5, _yt);
  }

  OString *_status_info;
  int _yt;
};
      
//-------------------------------------------------------------------

class OXToolBar : public OXCompositeFrame {
public:
  OXToolBar(const OXWindow *p, int w, int h,
            unsigned int options = HORIZONTAL_FRAME,
            unsigned long back = _defaultFrameBackground) :
    OXCompositeFrame(p, w, h, options, back) {}
  
//    virtual void DrawBorder() {
//      XDrawLine(GetDisplay(), _id, _shadowGC,  0, 0, _w-1, 0);
//      XDrawLine(GetDisplay(), _id, _hilightGC, 0, 1, _w-1, 1);
//    }

};

//-------------------------------------------------------------------

class OXHorizontal3dLine : public OXFrame {
public:
  OXHorizontal3dLine(const OXWindow *p, int w = 4, int h = 2,
            unsigned int options = CHILD_FRAME,
            unsigned long back = _defaultFrameBackground) :
    OXFrame(p, w, h, options, back) {}

    virtual void DrawBorder() {
      XDrawLine(GetDisplay(), _id, _shadowGC,  0, 0, _w-2, 0);
      XDrawLine(GetDisplay(), _id, _hilightGC, 0, 1, _w-1, 1);
      XDrawLine(GetDisplay(), _id, _hilightGC, _w-1, 0, _w-1, 1);
    }
};

#endif
