//---------------------------------------------------------------------------

#ifndef TablZagrH
#define TablZagrH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Grids.hpp>
#include "MultiSupportBeam.h"
#include <Vcl.ComCtrls.hpp>

//---------------------------------------------------------------------------
class TTablZagrForm : public TForm
{
__published:	// IDE-managed Components
	TLabel *Label_zagr;
	TBitBtn *BitBtn_Apply;
	TBitBtn *BitBtnCancel;
	TComboBox *ComboBox_type_zagr;
	TPageControl *PageControl_zagr;
	TTabSheet *TabSheet_q;
	TTabSheet *TabSheet_N;
	TTabSheet *TabSheet_loads;
	TLabel *Label_header;
	TStringGrid *StringGrid_Loads;
	TStringGrid *StringGrid_N;
	TStringGrid *StringGrid_q;
	TSpeedButton *SpeedButton_Add;
	TSpeedButton *SpeedButtonDelete;
	TSpeedButton *SpeedButtonPasteFromClipboard;
	TSpeedButton *SpeedButtonCopyToCipboard;
	TLabel *Label_gamma_f;
	TLabel *Label_koef_low;
	TEdit *Edit_gamma_f;
	TEdit *Edit_koef_low;
	void __fastcall BitBtnCancelClick(TObject *Sender);
	void __fastcall PutLoadRegion(double Lengh_balka, int k_balka, int *type_zagr, int length_q, BeamRegion *Aq, int length_N, BeamRegion *AN,
									int length_loads, Load *Aloads, TObject *Sender);
	void __fastcall BitBtn_ApplyClick(TObject *Sender);
	void __fastcall SpeedButton_AddClick(TObject *Sender);
	void __fastcall SpeedButtonDeleteClick(TObject *Sender);
	void __fastcall StringGrid_qSelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect);
	void __fastcall StringGrid_NSelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect);
	void __fastcall StringGrid_LoadsSelectCell(TObject *Sender, int ACol, int ARow,
          bool &CanSelect);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall StringGrid_LoadsFixedCellClick(TObject *Sender, int ACol, int ARow);
	void __fastcall PasteExcelDataFromClipboard(TStringGrid* StringGrid);
	void __fastcall StringGrid_LoadsKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
	void __fastcall SpeedButtonPasteFromClipboardClick(TObject *Sender);





private:	// User declarations
	int NRow_N;
	int NRow_q;
	int NRow_Load;
	TStringGrid *StringGridCurrent;

public:		// User declarations
	__fastcall TTablZagrForm(TComponent* Owner);
	int length_q0;
	BeamRegion *Aq0;
	int length_N0;
	BeamRegion *AN0;
	int length_loads0;
	Load *Aloads0;
	int type_zagr0;
	double Length_beam0;
	double Koeff_gamma_f;  // Коэффициенты надежности
	double Koeff_low;  // Понижающий коэффициент

};
//---------------------------------------------------------------------------
extern PACKAGE TTablZagrForm *TablZagrForm;
//---------------------------------------------------------------------------
#endif
