/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     2000/02/08
// RCS-ID:		$Id: sizerglyphs.h,v 1.4 2001/04/04 12:42:37 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas (alex@soften.ktu.lt)
// Licence:   	GPL (version 2.0 or later)
/////////////////////////////////////////////////////////////////////////////

#ifndef __SIZERGLYPHS_G__
#define __SIZERGLYPHS_G__

#include "widgeteditor.h"

class BoxSizerNode : public SizerNodeBase
{
public:
	// overrideh method of wxDMNode

	virtual wxDMNode* Clone( bool uniqueCopy, bool cloneChildren = TRUE );

	virtual bool IsVertical();
	
	// overriden method of WidgetNode

	virtual void RecalcPreferredSize( wxDC& dc );

	virtual void DoLayoutChildren( wxDC& dc );

	DECLARE_DYNAMIC_CLASS( BoxSizerNode )
};

class BoxSizerGlyph : public WidgetGlyph
{
public:
	void Draw( wxDC& canvas);

	DECLARE_DYNAMIC_CLASS( BoxSizerGlyph )
};

class SpacerGlyph : public WidgetGlyph
{
public:
	void Draw( wxDC& canvas);

	DECLARE_DYNAMIC_CLASS( SpacerGlyph )
};

class SpacerNode : public WidgetNode
{
public:
	virtual void RecalcPreferredSize( wxDC& dc );

	virtual wxDMNode* Clone( bool uniqueCopy, bool cloneChildren = TRUE );

	DECLARE_DYNAMIC_CLASS( SpacerNode )
};

struct LayoutItemInfo;

class GridSizerNode : public SizerNodeBase
{
public:
	GridSizerNode();
	~GridSizerNode();

	// overrideh method of wxDMNode

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

	virtual void RecalcPreferredSize( wxDC& dc );

	virtual void DoLayoutChildren( wxDC& dc );

	DECLARE_DYNAMIC_CLASS( GridSizerNode )

protected:
	virtual void ExtractGridProps();
	virtual void GetPrefSizeAt( int x, int y, XDim& size );
	virtual void CollectExtraProps();

	virtual void CleanUp();

protected:

	// extracted temporarely
	int mCols;
	int mRows;
	int mHGap;
	int mVGap;
	bool mIsFlex;

	int* mRowHeights;
	int* mColWidths;
	LayoutItemInfo* mItemInfos;
};

#endif // __SIZERGLYPHS_G__