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

#include "Unit1.h"
#include "GifLZW.hpp"
#include "TIFLZW.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "IEMView"
#pragma link "ImageEnView"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
	TSearchRec sr;
   AnsiString fpath;
	ImageEnMView1->Clear();
	int Found=FindFirst(DirectoryListBox1->Directory+"\\*.*",faArchive,sr);
   while (Found==0) {
   	fpath=DirectoryListBox1->Directory+"\\"+sr.Name;
   	if(FindFileFormat(fpath,true)!=ioUnknown)
         ImageEnMView1->ImageFileName[ ImageEnMView1->AppendImage() ]=fpath;
      Found=FindNext(sr);
   };
   FindClose(sr);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormActivate(TObject *Sender)
{
   DefGIF_LZWDECOMPFUNC=GIFLZWDecompress;
   DefGIF_LZWCOMPFUNC=GIFLZWCompress;
   DefTIFF_LZWDECOMPFUNC=TIFFLZWDecompress;
   DefTIFF_LZWCOMPFUNC=TIFFLZWCompress;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ImageEnMView1MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
	int idx=ImageEnMView1->ImageAtPos(X,Y);
   if(idx>=0)
		StatusBar1->SimpleText=ImageEnMView1->ImageFileName[ idx ];
}
//---------------------------------------------------------------------------
