/////////////////////////////////////////////////////////////////////////////
// Name:        xh_cardc.cpp
// Purpose:     XML resource for wxCardCtrl
// Author:      Aleksandras Gluchovas
// Created:     2000/09/09
// RCS-ID:      $Id: xh_cardc.cpp,v 1.2 2001/04/19 21:09:25 georgetasker Exp $
// Copyright:   (c) 2000 Aleksandras Gluchovas
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////
 
#ifdef __GNUG__
#pragma implementation "xh_.h"
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

#include "wx/wspp/xh_cardc.h"
#include "wx/wspp/cardctrl.h"

wxCardCtrlXmlHandler::wxCardCtrlXmlHandler() 
: wxXmlResourceHandler() 
{
    ADD_STYLE(wxLC_SORT_DESCENDING);
    AddWindowStyles();
}


wxObject *wxCardCtrlXmlHandler::DoCreateResource()
{ 
	wxCardCtrl* cctrl = wxDynamicCast(m_Instance, wxCardCtrl);

	if ( cctrl )

		cctrl->Create( m_ParentAsWindow,
					   GetID(),
					   GetPosition(), GetSize() );
	else
		cctrl = new wxCardCtrl( m_ParentAsWindow,
										GetID(),
										GetPosition(), GetSize(),
										GetStyle(),
										GetName() );
    SetupWindow(cctrl);
    CreateChildren(cctrl);

	cctrl->ShowCard( XMLID( GetParamValue( "shown" ) ) );
    
    return cctrl;
}

bool wxCardCtrlXmlHandler::CanHandle(wxXmlNode *node)
{
    return IsOfClass(node, wxT("wxCardCtrl"));
}
