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

© Copyright 2024 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/>.

*/
// Home Page : http://www.silogic.com/trains/RTC_Running.html
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef EngineListPopOutH
#define EngineListPopOutH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Grids.hpp>
#include "HideButton.h"
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <Graphics.hpp>
//---------------------------------------------------------------------------
class TPopOutEngineList : public TForm
{
__published:	// IDE-managed Components
    TStringGrid *EngineData;
    TLabel *Engine_List_Label;
    TPanel *Panel1;
    THideButton *HideButton1;
    TPopupMenu *EngineDataPopOutMenu;
    TMenuItem *SetEnginesintoCommandMode;
    TMenuItem *SetEnginesintoLegacyMode;
    TMenuItem *SetEnginesintoConventionalMode;
    TMenuItem *SetEnginesActive;
    TMenuItem *SetEnginesInactive;
    TMenuItem *SetEnginesPS2;
    TMenuItem *SetEnginesPS3;
    TMenuItem *StartUpSelectedEngines1;
    TMenuItem *ShutdownSelectedEngines1;
    TImage *Copyright;
    TButton *AllEngineButton;
    TCheckBox *ActEngChckBox;
    TStringGrid *ActEngLst;
    TMenuItem *RestorethescrollbarontheEngineList1;
    void __fastcall EngineDataDrawCell(TObject *Sender, int ACol, int ARow,
          TRect &Rect, TGridDrawState State);
    void __fastcall SetEnginesActiveClick(TObject *Sender);
    void __fastcall SetEnginesInactiveClick(TObject *Sender);
    void __fastcall SetEnginesintoCommandModeClick(TObject *Sender);
    void __fastcall SetEnginesintoConventionalModeClick(TObject *Sender);
    void __fastcall SetEnginesintoLegacyModeClick(TObject *Sender);
    void __fastcall SetEnginesPS2Click(TObject *Sender);
    void __fastcall SetEnginesPS3Click(TObject *Sender);
    void __fastcall StartUpSelectedEngines1Click(TObject *Sender);
    void __fastcall ShutdownSelectedEngines1Click(TObject *Sender);
    void __fastcall EngineDataClick(TObject *Sender);
    void __fastcall HideButton1Click(TObject *Sender);
    void __fastcall EngineDataDblClick(TObject *Sender);
    void __fastcall EngineDataKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
    void __fastcall CopyrightClick(TObject *Sender);
    void __fastcall AllEngineButtonClick(TObject *Sender);
    void __fastcall ActEngLstClick(TObject *Sender);
    void __fastcall ActEngLstDblClick(TObject *Sender);
    void __fastcall ActEngLstDrawCell(TObject *Sender, int ACol, int ARow,
          TRect &Rect, TGridDrawState State);
    void __fastcall ActEngLstKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
    void __fastcall ActEngChckBoxClick(TObject *Sender);
    void __fastcall EngineDataPopOutMenuPopup(TObject *Sender);
    void __fastcall ActEngLstMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall EngineDataMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall RestorethescrollbarontheEngineList1Click(
          TObject *Sender);
private:	// User declarations
    String RegFileRootKey;
    void __fastcall FillActEngLst(void);

public:		// User declarations
    __fastcall TPopOutEngineList(TComponent* Owner);
    __fastcall ~TPopOutEngineList(void);
    int EngineNo, RemoteNo;
    void __fastcall SetConsistState(int Consist, int State);
    void __fastcall RefreshClick(TObject *Sender);
    
};
//---------------------------------------------------------------------------
extern PACKAGE TPopOutEngineList *PopOutEngineList;
//---------------------------------------------------------------------------
#endif
