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

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include "Remez.hpp"

//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE 管理のコンポーネント
    TButton *Button1;
    TButton *Button2;
    TButton *Button3;
    TButton *Button4;
    TButton *Button5;
    TComboBox *ComboBox1;
    TEdit *Edit1;
    TEdit *Edit2;
    TEdit *Edit3;
    TEdit *Edit4;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *Label3;
    TLabel *Label4;
    TLabel *Label5;
    TLabel *Label6;
    TLabel *Label7;
    TLabel *Label8;
    TLabel *Label9;
    TLabel *Label10;
    TLabel *Label11;
    TPaintBox *PaintBox1;
    TPaintBox *PaintBox2;
    TPanel *Panel1;
    TRadioGroup *RadioGroup1;
    TRichEdit *RichEdit1;
    TSaveDialog *SaveDialog1;
    TUpDown *UpDown1;
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall Button3Click(TObject *Sender);
    void __fastcall Button4Click(TObject *Sender);
    void __fastcall Button5Click(TObject *Sender);
    void __fastcall ComboBox1Change(TObject *Sender);
    void __fastcall Edit2Change(TObject *Sender);
    void __fastcall Edit3Change(TObject *Sender);
    void __fastcall Edit4KeyPress(TObject *Sender, char &Key);
    void __fastcall PaintBox1Paint(TObject *Sender);
    void __fastcall PaintBox2Paint(TObject *Sender);
    void __fastcall RadioGroup1Click(TObject *Sender);
    void __fastcall PaintBox1MouseMove(TObject *Sender, TShiftState Shift,
          int X, int Y);
    void __fastcall EditNChange(TObject *Sender);
    void __fastcall FormResize(TObject *Sender);
private:        // ユーザー宣言
    void __fastcall WMGetMinMaxInfo(TWMGetMinMaxInfo &Msg);
public:         // ユーザー宣言
    __fastcall TForm1(TComponent* Owner);
    __fastcall ~TForm1();
    void __fastcall LabelOnOff(TObject *Sender);
    void __fastcall SetEdit(TEdit *Ed[], int nBand, int x0, int y0, AnsiString s);
    bool __fastcall InputSpec(VectorD &weights, VectorD &gain);
    void __fastcall CalcAmp(int jtype, int nTaps);
    void __fastcall DispSpec(TCanvas *Cv);
    void __fastcall DispChr(TCanvas *Cv);
    void __fastcall ParmOut(AnsiString as, const VectorD &x, int n1, int dn,
                            double c = 1.0);
    TEdit  *pEditBdL[MAX_BANDS];    // TEdit のポインタの配列
    TEdit  *pEditBdH[MAX_BANDS];    // TEdit のポインタの配列
    TEdit  *pEditGain[MAX_BANDS];   // TEdit のポインタの配列
    TEdit  *pEditWght[MAX_BANDS];   // TEdit のポインタの配列
    TLabel *pLabelBnd[MAX_BANDS];   // TLabel のポインタの配列
    int    nOrder, jtype, nBands, nTaps;
    double fs;
    bool   calc_ok;
    int    X0d, Y0d, Xfr, YdB;
    int    width_of_RichEdit1, height_of_RichEdit1, width_of_Form1, height_of_Form1;

// メッセージマップ
    BEGIN_MESSAGE_MAP
        MESSAGE_HANDLER(WM_GETMINMAXINFO, TWMGetMinMaxInfo, WMGetMinMaxInfo)
    END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
