//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "TransparentPanelUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)

__fastcall TransparentPanelUnit::TPanel::TPanel(TComponent* AOwner)
	: Vcl::Extctrls::TPanel(AOwner)
{
	ControlStyle >> csOpaque;
}

void __fastcall TransparentPanelUnit::TPanel::CreateWnd(void)
{
	Vcl::Extctrls::TPanel::CreateWnd();

	SetWindowLong( Parent->Handle, GWL_STYLE,
			GetWindowLong(Parent->Handle, GWL_STYLE) & ~WS_CLIPCHILDREN );
}

void __fastcall TransparentPanelUnit::TPanel::CreateParams(Controls::TCreateParams &Params)
{
	Vcl::Extctrls::TPanel::CreateParams(Params);

	Params.ExStyle |= WS_EX_TRANSPARENT;
}

void __fastcall TransparentPanelUnit::TPanel::Paint()
{
	SetBkMode( Canvas->Handle, TRANSPARENT);
	StyleServices()->DrawParentBackground( Handle, Canvas->Handle, NULL, false);
}
