//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	//Polecenie dodane, aby zapewnić przenośność aplikacji
	if (FileExists(MediaPlayer1->FileName))
		MediaPlayer1->Open();
	else ShowMessage("Nie znaleziono pliku "+MediaPlayer1->FileName+".\nWybierz inny film korzystając z przycisku \"Przeglądaj...\".");

	MediaPlayer1->DisplayRect=Panel1->ClientRect;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	if (OpenDialog1->Execute())
	{
		MediaPlayer1->Close();
		MediaPlayer1->FileName=OpenDialog1->FileName;
		MediaPlayer1->Open();
		MediaPlayer1->DisplayRect=Panel1->ClientRect;
	}
}
//---------------------------------------------------------------------------
