/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     3/01/99
// RCS-ID:      $Id: nbookglyph.h,v 1.3 2001/01/20 14:27:18 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:   	wxWindows license
/////////////////////////////////////////////////////////////////////////////

#ifndef __NBOOKGLYPH_G__
#define __NBOOKGLYHP_G__

#include "widgeteditor.h"
#include "wx/dynarray.h"

class NotebookNode : public MultiFaceNodeBase
{
public:
	NotebookNode();
	~NotebookNode();

	// overriden method of wxDMNode
	virtual wxDMNode* Clone( bool uniqueCopy, bool cloneChildren = TRUE );

	// overriden method of WidgetNode
	virtual void OnChildInserted( wxDMNode* pNode );

	DECLARE_DYNAMIC_CLASS( NotebookNode )
};

class NotebookPageInfo : public wxObject
{
public:
	wxString mLabel;
	wxBitmap mImage;
	XPoint   mLabelPos;
	XPoint   mImagePos;
	XRect	 mTabBounds;
};

WX_DEFINE_ARRAY( NotebookPageInfo*, NotebookPageInfoListT );

class NotebookGlyph : public MultiFaceGlyphBase
{
public:
	NotebookGlyph();
	~NotebookGlyph();

	// overriden methods of WidgetGlyph
	virtual void Draw( wxDC& canvas);
	virtual void SetBounds( const XRect& bounds );
	virtual void SetBoundsSilent( const XRect& bounds );

	// overriden method of XObject
	virtual bool OnMouseDown ( const XPoint& pos );

	// overriden methods of MultiFaceGlyphBase

	virtual void RecalcFaceGeometry( wxDC& dc );

	DECLARE_DYNAMIC_CLASS( NotebookGlyph )

protected:
	void DrawTab( NotebookPageInfo& tab, wxDC& dc, bool isActive );

	friend class NotebookNode;

protected:
	NotebookPageInfoListT mPageInfos;
	XRect				  mActivePageBounds;
	int					  mTabRowHeight; // recalculated
};

#endif // __NBOOKGLYHP_G__