// This file is part of the aMule Project
//
// Copyright (c) 2003-2004 aMule Project ( http://www.amule-project.net )
// Copyright (C) 2002 Merkur ( merkur-@users.sourceforge.net / http://www.emule-project.net )
//
// 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 TABCTRL_H
#define TABCTRL_H

#include <gdk/gdktypes.h>	// Needed for GdkEventExpose
#include <wx/defs.h>		// Needed before any other wx/*.h
#include <wx/list.h>		// Needed for WX_DECLARE_LIST
#include <wx/event.h>		// Needed for BEGIN_DECLARE_EVENT_TYPES
#include <wx/control.h>		// Needed for wxControl

class TabItem;
class TabList;

WX_DECLARE_LIST(TabItem,TabList);

const int wxEVT_TABCTRL_FIRST = 10000+6341;

BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_TAB_CHANGED,wxEVT_TABCTRL_FIRST+1)
END_DECLARE_EVENT_TYPES()

class wxTabCtrl : public wxControl
{
  DECLARE_DYNAMIC_CLASS(wxTabCtrl)
public:
  wxTabCtrl() {};
  wxTabCtrl(wxWindow* parent, const wxWindowID id=-1,
	    const wxPoint& pos = wxDefaultPosition,
	    const wxSize& size=wxDefaultSize,
	    const long int style=0)
    { Create(parent,id,pos,size,style); }

  bool Create(wxWindow* parent,const wxWindowID id,const wxPoint& pos,
	      const wxSize& size,const long int style);

  long InsertItem(int nMask,int nItem,wxString title,int nImage,long lpar);

  void OnPaint(GtkWidget* widget,GdkEventExpose* evt);
 private:
  void OnLeftDown(wxMouseEvent& evt);
  void OnMotion(wxMouseEvent& evt);

  int calcTabWidth();
  int tabsVisible();
  DECLARE_EVENT_TABLE()

  TabList m_tabs;
  int currentTab;
  int firstTab;
  bool prelightRight;
  bool prelightLeft;
};

#endif // TABCTRL_H
