/*
    CaPriCe Forever - Amstrad CPC 464/664/6128 emulator
    Copyright (C) 2014-2020 by Frédéric Coste

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef TFormActionReplayH
#define TFormActionReplayH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Grids.hpp>
#include "..\Settings\TSettings.h"
#include "..\Emulator\TEmulator.h"
#include "TFormEditValue.h"
//---------------------------------------------------------------------------
class TFormActionReplay : public TForm
{
__published:	// Composants gérés par l'EDI
	TPanel *PanelButtonReset;
	TPanel *PanelButtonFilterEqual;
	TPanel *PanelButtonFilterDiff;
	TGroupBox *GroupBoxMatchResult;
	TPanel *PanelButtonShowResults;
	TStringGrid *StringGridResults;
	TPanel *PanelButtonFilterLess;
	TPanel *PanelButtonFilterMore;
	TGroupBox *GroupBox1;
	TPanel *PanelCheckBank0;
	TPanel *PanelCheckBank1;
	TPanel *PanelCheckBank2;
	TPanel *PanelCheckBank3;
	TPanel *PanelCheckFixed;
	TPanel *PanelFormatValue;
	TPanel *PanelEditValue;
	TPanel *PanelCheckLast;
	TPanel *PanelButtonAddBreakpoint;
	TPanel *PanelButtonShowMemory;
	void __fastcall FormShow(TObject *Sender);
	void __fastcall FormHide(TObject *Sender);
	void __fastcall FormResize(TObject *Sender);
	void __fastcall PanelButtonMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall PanelButtonMouseUp(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall PanelButtonResetClick(TObject *Sender);
	void __fastcall PanelButtonFilterEqualClick(TObject *Sender);
	void __fastcall PanelButtonFilterDiffClick(TObject *Sender);
	void __fastcall PanelButtonShowResultsClick(TObject *Sender);
	void __fastcall StringGridResultsDrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,
          TGridDrawState State);
	void __fastcall PanelButtonFilterLessClick(TObject *Sender);
	void __fastcall PanelButtonFilterMoreClick(TObject *Sender);
	void __fastcall PanelCheckBank0Click(TObject *Sender);
	void __fastcall PanelCheckBank1Click(TObject *Sender);
	void __fastcall PanelCheckBank2Click(TObject *Sender);
	void __fastcall PanelCheckBank3Click(TObject *Sender);
	void __fastcall PanelFormatValueClick(TObject *Sender);
	void __fastcall PanelEditValueClick(TObject *Sender);
	void __fastcall PanelCheckFixedClick(TObject *Sender);
	void __fastcall PanelCheckLastClick(TObject *Sender);
	void __fastcall PanelButtonAddBreakpointClick(TObject *Sender);
	void __fastcall PanelButtonShowMemoryClick(TObject *Sender);
	void __fastcall FormDestroy(TObject *Sender);
private:	// Déclarations utilisateur
  //
  // Members
	//
	TSettings* mSettingsP;
	tULong mMemorySize;
	tULong mMatchFilteringCount;
	tUChar* mBeforePreviousMemory;
	tUChar* mPreviousMemory;
	tUChar* mMatchFiltering;
	bool mUseBank0;
	bool mUseBank1;
	bool mUseBank2;
	bool mUseBank3;
	bool mUseFixedValue;
	tUChar mValue;
	TFormEditValue* mFormEditValue;
	//
	// Methods
	//
	void __fastcall SetSettings(TSettings* Value);
  void __fastcall WMMove(TMessage &Message);
	void __fastcall UpdateMatchingResult(void);

public:		// Déclarations utilisateur
  //
  // Properties
  //
  __property TSettings* Settings = { write=SetSettings };
  //
  // API
  //
	__fastcall TFormActionReplay(TComponent* Owner);

#pragma option push -vi-
BEGIN_MESSAGE_MAP
  MESSAGE_HANDLER(WM_MOVE, TMessage, WMMove);
END_MESSAGE_MAP(TForm)
#pragma option pop
};
//---------------------------------------------------------------------------
extern PACKAGE TFormActionReplay *FormActionReplay;
//---------------------------------------------------------------------------
#endif
