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

#ifndef net_unitH
#define net_unitH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <Graphics.hpp>
#include <Dialogs.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TShape *netarea;
        TStatusBar *Status1;
        TImage *in_off;
        TImage *out_off;
        TImage *or;
        TImage *and;
        TImage *not;
        TImage *in_on;
        TImage *out_on;
        TImage *remove;
        TTimer *Timer1;
        TImage *unlink;
        TOpenDialog *OpenDialog1;
        TSaveDialog *SaveDialog1;
        TMainMenu *MainMenu1;
        TMenuItem *File1;
        TMenuItem *Save1;
        TMenuItem *Rest1;
        TMenuItem *Exit1;
        TMenuItem *Load1;
        void __fastcall FormPaint(TObject *Sender);
        void __fastcall netareaMouseUp(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall netareaMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall netareaMouseMove(TObject *Sender,
          TShiftState Shift, int X, int Y);
        void __fastcall in_offClick(TObject *Sender);
        void __fastcall out_offClick(TObject *Sender);
        void __fastcall orClick(TObject *Sender);
        void __fastcall andClick(TObject *Sender);
        void __fastcall notClick(TObject *Sender);
        void __fastcall selectClick(TObject *Sender);
        void __fastcall toggleClick(TObject *Sender);
        void __fastcall linkClick(TObject *Sender);
        void __fastcall removeClick(TObject *Sender);
        void __fastcall Timer1Timer(TObject *Sender);
        void __fastcall FormKeyPress(TObject *Sender, char &Key);
        void __fastcall unlinkClick(TObject *Sender);
        void __fastcall Save1Click(TObject *Sender);
        void __fastcall Load1Click(TObject *Sender);
        void __fastcall Exit1Click(TObject *Sender);
        void __fastcall Rest1Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);


     void __fastcall do_link(void);


        neural_network_class net;


        enum {_select, _add } cur_mode;
        enum {down, up} mouse_state;

        neuron_class *mouse_on_neuron;

        int has_moved;

        neuron_type cur_add_type;

};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
