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

#ifndef Unit3H
#define Unit3H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <Dialogs.hpp>
#include <Menus.hpp>
#include <ImgList.hpp>
#include <NMUDP.hpp>
//---------------------------------------------------------------------------
typedef struct{
	AnsiString figure;
        long int color;
        int style;
        int width;
        double x,y;
	TPoint Origin, MovePt, Previous;
        bool Drawing;
}PEN_TABLE;

class TForm3 : public TForm
{
__published:	// IDE-managed Components
        TPanel *Panel1;
        TSpeedButton *Solid;
        TSpeedButton *Dash;
        TSpeedButton *SpeedButton3;
        TSpeedButton *Dot;
        TSpeedButton *Ellip;
        TSpeedButton *Rectan;
        TSpeedButton *RoundRec;
        TSpeedButton *Eraser;
        TSpeedButton *Draw;
        TSpeedButton *SolidRec;
        TSpeedButton *SolidElli;
        TSpeedButton *SolidRoRec;
        TImage *Image;
        TStatusBar *StatusBar1;
        TColorDialog *ColorDialog1;
        TMainMenu *MainMenu1;
        TMenuItem *F1;
        TMenuItem *N1;
        TMenuItem *O1;
        TMenuItem *E1;
        TOpenDialog *OpenDialog1;
        TUpDown *UpDown1;
        TLabel *Label1;
        TEdit *Edit1;
        TMenuItem *S1;
        TMenuItem *A1;
        TSaveDialog *SaveDialog1;
        TMenuItem *N2;
        TMenuItem *X1;
        TMenuItem *A2;
        TColorBox *ColorBox1;
        TImageList *ImageList1;
        TNMUDP *NMUDP1;
        void __fastcall SolidClick(TObject *Sender);
        void __fastcall ImageMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall ImageMouseUp(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
        void __fastcall ImageMouseMove(TObject *Sender, TShiftState Shift,
          int X, int Y);
        void __fastcall SpeedButton3Click(TObject *Sender);
        void __fastcall O1Click(TObject *Sender);
        void __fastcall UpDown1Changing(TObject *Sender,
          bool &AllowChange);
        void __fastcall S1Click(TObject *Sender);
        void __fastcall A1Click(TObject *Sender);
        void __fastcall N1Click(TObject *Sender);
        void __fastcall X1Click(TObject *Sender);
        void __fastcall A2Click(TObject *Sender);
        void __fastcall ColorBox1Change(TObject *Sender);
	void __fastcall NMUDP1DataReceived(TComponent *Sender, int NumberBytes,
          AnsiString FromIP, int Port);
private:	// User declarations
        void TForm3::DrawLine( TPoint TopLeft, TPoint BottomRight,
          TPenMode AMode);
        bool Drawing1, Drawing2;
        TPoint Origin, MovePt, Previous;
        TPoint Origin1, MovePt1, Previous1;
        TPoint Origin2, MovePt2, Previous2;
        TColor PreCol;
        TObject *Figure;
        int PreWidth;
        bool Saved;
public:		// User declarations
        __fastcall TForm3(TComponent* Owner);
        void mouseDown(int X, int Y, bool my);
        void mouseMove(int X, int Y, bool my);
        void mouseUp(int X, int Y, bool my);
        void setPen( PEN_TABLE *pen );
};

//---------------------------------------------------------------------------
extern PACKAGE TForm3 *Form3;
//---------------------------------------------------------------------------
#endif
