/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     2000/02/10
// RCS-ID:      $Id: propedit.cpp,v 1.4 2001/04/04 12:42:37 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifdef __GNUG__
    #pragma implementation "minimal.cpp"
    #pragma interface "minimal.cpp"
#endif

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

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

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

#include "propedit.h"
#include "dmbrowser.h"

#include "mimetypes.h"

/***** Implementation for class wxDMNodePropertyPanel *****/

IMPLEMENT_DYNAMIC_CLASS( wxDMNodePropertyPanel, wxPMPane )

BEGIN_EVENT_TABLE( wxDMNodePropertyPanel, wxPMPane )

END_EVENT_TABLE()

wxDMNodePropertyPanel::wxDMNodePropertyPanel()

	: mpEditor( NULL )
{
	// FOR NOW:: hack

	mDocTypes.Add( wxwMIME_MENUBAR_RESOURCE );
	mDocTypes.Add( wxwMIME_WIDGET_RESOURCE );
}

wxDMNodePropertyPanel::~wxDMNodePropertyPanel()
{}

// 2 overriden methods of wxPMService
bool wxDMNodePropertyPanel::Start()
{
	SetPaneName( "Item Properties" );

	return TRUE;
}

bool wxDMNodePropertyPanel::Stop()
{
	if ( mpEditor ) 
		
		mpEditor->Destroy();

	mpEditor = NULL;

	return TRUE;
}

wxWindow* wxDMNodePropertyPanel::GetPaneWindow()
{
	return mpEditor;
}

void wxDMNodePropertyPanel::CreatePaneWindow( wxWindow* pParent )
{
	mpEditor = new wxDMNodePropertyGroupEditor( pParent );
	//wxWindow* pWnd = new wxPanel( pParent );
	//pWnd->SetBackgroundColour( *wxRED );
	//mpEditor = (wxDMNodePropertyGroupEditor*)pWnd;
}

void wxDMNodePropertyPanel::AddDocumentType( const wxString& type )
{
	if ( !mDocTypes.Find( type ) )

		mDocTypes.Add( type );
}

void wxDMNodePropertyPanel::RemoveDocumentType( const wxString& type )
{
	mDocTypes.Delete( type );
}

wxStringList* wxDMNodePropertyPanel::GetDocumentTypes()
{
	return &mDocTypes;
}

wxDMNodePropertyGroupEditor* wxDMNodePropertyPanel::GetGroupEditor()
{
	return mpEditor;
}
