/*
    CaPriCe Forever - Amstrad CPC 464/664/6128 emulator
    Copyright (C) 2014-2018 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 TFormEditValueH
#define TFormEditValueH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Menus.hpp>
#include <Vcl.Buttons.hpp>
#include "..\Settings\TSettings.h"
//---------------------------------------------------------------------------
class TFormEditValue : public TForm
{
__published:	// Composants gérés par l'EDI
  TLabel *LabelCurrent;
  TLabel *LabelNew;
  TPanel *PanelCurrent;
  TPanel *PanelFormatNew;
  TPanel *PanelNew;
  TEdit *EditNew;
  TLabel *LabelCurrentValue;
  TMainMenu *MainMenu;
  TMenuItem *CopyMenu;
  TMenuItem *PasteMenu;
  TPanel *PanelButtonOK;
  TPanel *PanelButtonCancel;
  TGroupBox *GroupBoxIncrement;
  TPanel *PanelButtonDecrement;
  TPanel *PanelButtonIncrement;
  TPanel *PanelIncrement;
  TEdit *EditIncrement;
  void __fastcall FormShow(TObject *Sender);
  void __fastcall EditNewChange(TObject *Sender);
  void __fastcall PanelFormatNewClick(TObject *Sender);
  void __fastcall EditIncrementChange(TObject *Sender);
  void __fastcall FormKeyPress(TObject *Sender, System::WideChar &Key);
  void __fastcall CopyMenuClick(TObject *Sender);
  void __fastcall PasteMenuClick(TObject *Sender);
  void __fastcall PanelButtonOKClick(TObject *Sender);
  void __fastcall PanelButtonCancelClick(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 PanelButtonIncrementClick(TObject *Sender);
  void __fastcall PanelButtonDecrementClick(TObject *Sender);
  
private:	// Déclarations utilisateur
  //
  // Members
  //
  TSettings* mSettingsP;
  int mCurrentValue;
  int mNewValue;
  bool mHexadecimal;
  int mNbDigitsDecimal;
  int mNbDigitsHexa;
  int mMinValue;
  int mMaxValue;
  int mIncrement;

  //
  // Methods
  //
  inline void __fastcall SetSettings(TSettings* Value) { mSettingsP = Value; };
  inline int __fastcall GetCurrentValue(void) { return mCurrentValue; };
  inline void __fastcall SetCurrentValue(int Value) { mCurrentValue = Value; };
  inline int __fastcall GetNewValue(void) { return mNewValue; };
  inline void __fastcall SetHexadecimal(bool Value) { mHexadecimal = Value; };
  inline bool __fastcall GetHexadecimal(void) { return mHexadecimal; };
  inline void __fastcall SetMinValue(int Value) { mMinValue = Value; };
  inline void __fastcall SetMaxValue(int Value) { mMaxValue = Value; };
  inline int __fastcall GetIncrement(void) { return mIncrement; };
  inline void __fastcall SetIncrement(int Value) { mIncrement = Value; };
  inline void __fastcall SetTitle(AnsiString Value) { Caption = Value; };

public:		// Déclarations utilisateur
  //
  // Properties
  //
  __property TSettings* Settings = { write=SetSettings };
  __property int CurrentValue = { read=GetCurrentValue, write=SetCurrentValue };
  __property int NewValue = { read=GetNewValue };
  __property bool Hexadecimal = { read=GetHexadecimal, write=SetHexadecimal };
  __property int MinValue = { write=SetMinValue };
  __property int MaxValue = { write=SetMaxValue };
  __property int Increment = { read=GetIncrement, write=SetIncrement };
  __property AnsiString Title = { write=SetTitle };

  //
  // API
  //
  __fastcall TFormEditValue(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormEditValue *FormEditValue;
//---------------------------------------------------------------------------
#endif
