/*
    CaPriCe Forever - Amstrad CPC 464/664/6128 emulator
    Copyright (C) 2014-2021 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 TFormPokeH
#define TFormPokeH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include "..\Settings\TSettings.h"
//---------------------------------------------------------------------------
class TFormPoke : public TForm
{
__published:	// Composants gérés par l'EDI
	TPanel *PanelFormatAddress;
	TPanel *PanelAddress;
	TEdit *EditAddress;
	TPanel *PanelFormatValue;
	TPanel *PanelValue;
	TEdit *EditValue;
	TLabel *LabelAddress;
	TLabel *LabelValue;
	TPanel *PanelButtonPoke;
	void __fastcall FormShow(TObject *Sender);
	void __fastcall FormHide(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 EditAddressChange(TObject *Sender);
	void __fastcall PanelFormatAddressClick(TObject *Sender);
	void __fastcall PanelFormatValueClick(TObject *Sender);
	void __fastcall EditValueChange(TObject *Sender);
	void __fastcall PanelButtonPokeClick(TObject *Sender);
	void __fastcall FormKeyPress(TObject *Sender, System::WideChar &Key);

private:	// Déclarations utilisateur
  //
  // Members
  //
	TSettings* mSettingsP;
	tULong mAddress;
	tULong mValue;

  //
  // Methods
  //
	void __fastcall WMMove(TMessage &Message);
	void __fastcall SetSettings(TSettings* Value);

public:		// Déclarations utilisateur
	//
	// Properties
	//
  __property TSettings* Settings = { write=SetSettings };

	//
	// API
	//
	__fastcall TFormPoke(TComponent* Owner);

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