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

#include "MainUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{                   
}

void __fastcall TForm1::CreateParams(TCreateParams &Params)
{
       TForm::CreateParams(Params);  // call base class first
       Params.Style &= ~WS_CAPTION;  // then clear caption bit

}
//---------------------------------------------------------------------------



void TForm1::SetDefaultBtn()
{
   DSRTTYWinInstall->Color = clNavy;
   DSRTTYWinManual->Color = clNavy;
   Exit->Color = clNavy;
}

void __fastcall TForm1::DSRTTYWinInstallClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./INSTALL/SETUP.EXE";
   WinExec(file.c_str(), SW_SHOW);
}


void __fastcall TForm1::FirmwareRunClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./INSTALL/FIRMWARE LOADER/LOADER.EXE";
   WinExec(file.c_str(), SW_SHOW);
}

void __fastcall TForm1::CLOVERMailInstallClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./INSTALL/CLOVER MAIL INSTALL/SETUP.EXE";
   WinExec(file.c_str(), SW_SHOW);
}

void __fastcall TForm1::DSRTTYWinManualClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./MANUAL/DSRTTY-WIN.pdf";
   if (ShellExecute( Application->Handle,"open",file.c_str(),"","",SW_SHOWNORMAL)== (HINSTANCE) SE_ERR_NOASSOC)
   {
      if (Application->MessageBox("Acrobat Reader not found.\n\nInstall Acrobat Reader 4.0?", "Install Acrobat", MB_ICONINFORMATION | MB_OKCANCEL) != IDCANCEL)
      {
         String file = "./ACR4/Acrobat.exe";
         WinExec(file.c_str(), SW_SHOW);
      }
   }
}

void __fastcall TForm1::DSP4100TechClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./INSTALL/DSP4100 TECHNICAL MANUAL/DSP4100.PDF";
   if (ShellExecute( Application->Handle,"open",file.c_str(),"","",SW_SHOWNORMAL)== (HINSTANCE) SE_ERR_NOASSOC)
   {
      if (Application->MessageBox("Acrobat Reader not found.\n\nInstall Acrobat Reader 4.0?", "Install Acrobat", MB_ICONINFORMATION | MB_OKCANCEL) != IDCANCEL)
      {
         String file = "./ACR4/Acrobat.exe";
         WinExec(file.c_str(), SW_SHOW);
      }


   }
}

void __fastcall TForm1::CLOVERMailManualClick(TObject *Sender)
{
   //launch the dspwin installation program
   String file = "./INSTALL/CLOVER MAIL MANUAL/CLOVER MAIL MANUAL.PDF";
   if (ShellExecute( Application->Handle,"open",file.c_str(),"","",SW_SHOWNORMAL)== (HINSTANCE) SE_ERR_NOASSOC)
   {
      if (Application->MessageBox("Acrobat Reader not found.\n\nInstall Acrobat Reader 4.0?", "Install Acrobat", MB_ICONINFORMATION | MB_OKCANCEL) != IDCANCEL)
      {
         String file = "./ACR4/Acrobat.exe";
         WinExec(file.c_str(), SW_SHOW);
      }
   }
}



void __fastcall TForm1::DSRTTYWinInstallMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
   if (DSRTTYWinInstall->Color == clNavy)
   {
      SetDefaultBtn();
      DSRTTYWinInstall->Color = clGray;
   }

}
//---------------------------------------------------------------------------



void __fastcall TForm1::DSRTTYWinManualMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
   if (DSRTTYWinManual->Color == clNavy)
   {
      SetDefaultBtn();
      DSRTTYWinManual->Color = clGray;
   }
}
//---------------------------------------------------------------------------



void __fastcall TForm1::Panel13MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
   SetDefaultBtn();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ExitMouseMove(TObject *Sender, TShiftState Shift,
      int X, int Y)
{
   if (Exit->Color == clNavy)
   {
      SetDefaultBtn();
      Exit->Color = clGray;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ExitClick(TObject *Sender)
{
   Close();
}
//---------------------------------------------------------------------------

