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

#include <vcl.h>
#pragma hdrstop

#include "MonsterFrame.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TframeMonster *frameMonster;
//---------------------------------------------------------------------------
__fastcall TframeMonster::TframeMonster(TComponent* Owner) : TFrame(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::chkArachnotronClick(TObject *Sender)
{
  if (chkArachnotron->Checked)
    ShowMessage("You have selected the Arachnotron. Good move!");
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::chkMancubusClick(TObject *Sender)
{
  if (chkMancubus->Checked)
    ShowMessage("You have selected the Mancubus. Everyone's favorite!");
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::chkSpectreClick(TObject *Sender)
{
  if (chkSpectre->Checked)
    ShowMessage("You have selected the Spectre. Nice choice!");
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::edtDescriptionChange(TObject *Sender)
{
  theMainForm->Caption = edtTitle->Text + " - " + edtDescription->Text;
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::edtTitleChange(TObject *Sender)
{
  theMainForm->Caption = edtTitle->Text + " - " + edtDescription->Text;
}
//---------------------------------------------------------------------------
void __fastcall TframeMonster::grpColorsClick(TObject *Sender)
{
  if (grpColors->ItemIndex == 0)
    ChangeColor(clRed);
  else if (grpColors->ItemIndex == 1)
    ChangeColor(clGreen);
  else if (grpColors->ItemIndex == 2)
    ChangeColor(clBlue);
}
//-------------------------------------------------------------------------

/*
  Helper function to change colors. This won't work with component templates.
*/
void TframeMonster::ChangeColor(TColor color)
{
  theMainForm->Color = color;
}