//---------------------------------------------------------------------------
/*
Remote Train Control Program for Windows

© Copyright 2016 by Mark DiVecchio

    This file is part of Remote Train Control.

    Remote Train Control 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.

    Remote Train Control 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 Remote Train Control.  If not, see <http://www.gnu.org/licenses/>.

*/
//---------------------------------------------------------------------------
#ifndef Hot_ComH
#define Hot_ComH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "HideButton.h"
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include "_GClass.hpp"
#include "AbCBitBt.hpp"
#include <Menus.hpp>
//---------------------------------------------------------------------------
#define COMMAND_NAME 0
#define COMMAND_ENGINE 1
#define COMMAND_TIU 2
#define COMMAND_P1 3
#define COMMAND_AIU 3
#define COMMAND_VOLUME 3
#define COMMAND_SOUND 3
#define COMMAND_ROUTESCENE 3
#define COMMAND_P2 4
#define COMMAND_PORT 5
#define COMMAND_P3 5
#define COMMAND_LASHUPSTRING 5
#define COMMAND_FILENAME 5
#define COMMAND_COMMAND 6

#define HC_COUNT 7	// number of items in comma delimited file
//---------------------------------------------------------------------------
class RouteSceneThread;
//---------------------------------------------------------------------------
class THot_Command : public TForm
{
__published:	// IDE-managed Components
	TImage *Copyright;
	THideButton *HideButton;
	TPanel *HotPanel;
	TAbColBitBtn *ESTOP;
	TButton *Button1;
	TButton *Button2;
	TButton *Button3;
	TButton *Button4;
	TButton *Button5;
	TButton *Button6;
	TButton *Button7;
	TButton *Button8;
	TButton *Button9;
	TButton *Button10;
	TButton *Button11;
	TButton *Button12;
	TButton *Button13;
	TButton *Button14;
	TButton *Button15;
	TButton *Button16;
	TButton *Button17;
	TButton *Button18;
	TButton *Button19;
	TButton *Button20;
	TButton *SaveEditsButton;
	TMemo *CommandListMemo;
	TPopupMenu *HotPopupMenu;
	TMenuItem *EditCommandList1;
	TButton *DoneEditButton;
	TMenuItem *TerminateAllPlayback;
	TPanel *Panel1;
	TLabel *Hot_Controls_Label;
	TAbColBitBtn *NextPage;
	TAbColBitBtn *PreviousPage;
	void __fastcall ESTOPClick(TObject *Sender);
	void __fastcall ButtonMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
	void __fastcall SaveEditsButtonClick(TObject *Sender);
	void __fastcall EditCommandList1Click(TObject *Sender);
	void __fastcall DoneEditButtonClick(TObject *Sender);
	void __fastcall CommandListMemoChange(TObject *Sender);
	void __fastcall TerminateAllPlaybackClick(TObject *Sender);
	void __fastcall FormActivate(TObject *Sender);
	void __fastcall FormDeactivate(TObject *Sender);
	void __fastcall Hot_Controls_LabelClick(TObject *Sender);
	void __fastcall NextPageClick(TObject *Sender);
	void __fastcall PreviousPageClick(TObject *Sender);
	void __fastcall CopyrightClick(TObject *Sender);

protected:
	// Message Routines
    void __fastcall CMStopPlayback(TMessage &Message);

    BEGIN_MESSAGE_MAP
       	MESSAGE_HANDLER(CM_STOPPLAYBACK, TMessage, CMStopPlayback)
    END_MESSAGE_MAP(TForm)

private:	// User declarations
	__fastcall THot_Command(TComponent* Owner);
    int EngineNo, TIUNo, RemoteNo, AIUNo, PageNo, FirstButtonNo;
    TStringList * HotCommandDat;
    void __fastcall SaveHotCommandDat(void);
    String HCDataFile;
    bool bHCDataCorrupt, bHCDataLoaded, bHCDataChanged;
    String CmdDataFile;
    bool bCmdDataLoaded, bCmdDataChanged;
    int __fastcall ValidateHCDat(int HCNum);

    bool LocalTransparencyOverride;

public:		// User declarations
    __fastcall THot_Command(TComponent* Owner, int , int , int , int , int Page);
    __fastcall ~THot_Command(void);
   	HWND ParentHandle; 		// accessed by Train_Control.cpp

};
//---------------------------------------------------------------------------
extern PACKAGE THot_Command *Hot_Command;
//---------------------------------------------------------------------------
#endif
