//---------------------------------------------------------------------------
#ifndef fMainH
#define fMainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <ExtDlgs.hpp>
#include <Menus.hpp>
#include <DXFConv.hpp>
#include <DXFImage.hpp>
#include <sgDrawingNavigator.hpp>
#include <ActnList.hpp>
//---------------------------------------------------------------------------
class TfmMain : public TForm
{
__published:	// IDE-managed Components
  TPanel *Panel4;
  TSpeedButton *BtnOpen;
  TSpeedButton *BtnPlus;
  TSpeedButton *BtnMinus;
  TSpeedButton *BtnReal;
  TSpeedButton *BtnPrev;
  TSpeedButton *BtnPrint;
  TSpeedButton *BtnSave;
  TSpeedButton *btnLayers;
  TSpeedButton *sb3DOrbit;
  TSpeedButton *sbAddScaledFiles;
  TSpeedButton *BtnPrint1;
  TSpeedButton *sbMergingTest;
  TMemo *Memo1;
  TMemo *memColorToLineWeight;
  TCheckBox *cbShowLineWeight;
  TButton *btnLTypeHalf;
  TPrintDialog *PrintDialog1;
  TOpenPictureDialog *OpenDialog;
  TSavePictureDialog *SavePictureDialog;
  TMainMenu *MainMenu1;
  TMenuItem *MIFile;
  TMenuItem *MIOpen;
  TMenuItem *miSaveAs;
  TMenuItem *MIPrint;
  TMenuItem *MIClose;
  TMenuItem *N4;
  TMenuItem *MIExit;
  TMenuItem *MIView;
  TMenuItem *MiOEM;
  TMenuItem *ImageColors1;
  TMenuItem *Disabled1;
  TMenuItem *Black1;
  TMenuItem *Normal1;
  TMenuItem *N2;
  TMenuItem *MIAbout;
  TMenuItem *SoftGoldHomePage1;
  TPanel *Panel2;
  TProgressBar *ProgressBar1;
  TPanel *Panel1;
  TPanel *Panel3;
  TPanel *pnlCoords;
  TPageControl *PageControl1;
  TTabSheet *tbsImage;
  TTabSheet *TabSheet2;
  TSplitter *Splitter1;
  TTreeView *TreeView1;
  TListBox *ListBox1;
  TSpeedButton *btnFitToScreen;
  TActionList *alMain;
  TAction *actMain;
  void __fastcall FormCreate(TObject *Sender);
  void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
  void __fastcall OpenDialogShow(TObject *Sender);
  void __fastcall OpenDialogClose(TObject *Sender);
  void __fastcall miSaveToDXFClick(TObject *Sender);
  void __fastcall MIExitClick(TObject *Sender);
  void __fastcall MICloseClick(TObject *Sender);
  void __fastcall MiOEMClick(TObject *Sender);
  void __fastcall TreeView1Change(TObject *Sender, TTreeNode *Node);
  void __fastcall MIPrintClick(TObject *Sender);
  void __fastcall BtnPrevClick(TObject *Sender);
  void __fastcall sgPaintBoxProgress(TObject *Sender, TProgressStage Stage,
          BYTE PercentDone, bool RedrawNow, const TRect &R,
          const AnsiString Msg);
  void __fastcall BtnPlusClick(TObject *Sender);
  void __fastcall BtnMinusClick(TObject *Sender);
  void __fastcall PageControl1Changing(TObject *Sender, bool &AllowChange);
  void __fastcall ScrollBox1Resize(TObject *Sender);
  void __fastcall BtnSaveClick(TObject *Sender);
  void __fastcall Disabled1Click(TObject *Sender);
  void __fastcall Black1Click(TObject *Sender);
  void __fastcall Normal1Click(TObject *Sender);
  void __fastcall SoftGoldHomePage1Click(TObject *Sender);
  void __fastcall MIAboutClick(TObject *Sender);
  void __fastcall btnLayersClick(TObject *Sender);
  void __fastcall sb3DOrbitClick(TObject *Sender);
  void __fastcall sgPaintBoxMouseMove(TObject *Sender, TShiftState Shift,
          int X, int Y);
  void __fastcall sbAddScaledFilesClick(TObject *Sender);
  void __fastcall BtnPrintClick(TObject *Sender);
  void __fastcall BtnPrint1Click(TObject *Sender);
  void __fastcall FormDestroy(TObject *Sender);
  void __fastcall cbShowLineWeightClick(TObject *Sender);
  void __fastcall PageControl1Change(TObject *Sender);
  void __fastcall sbMergingTestClick(TObject *Sender);
  void __fastcall btnLTypeHalfClick(TObject *Sender);
  void __fastcall BtnOpenClick(TObject *Sender);
  void __fastcall BtnRealClick(TObject *Sender);
  void __fastcall btnFitToScreenClick(TObject *Sender);
  void __fastcall sgPaintBoxScaling(TObject *Sender);
  void __fastcall FormShow(TObject *Sender);
  void __fastcall actMainUpdate(TObject *Sender);
private:	// User declarations
  TsgDXFImage *FImg;
  TSGDrawingNavigator *FsgPaintBox;
  void _fastcall Time();
  void _fastcall Open(AnsiString FileName);
  void _fastcall MIAutoClick(TObject *Sender);
  void _fastcall LoadStructure();
  void AddTree(TTreeNode * Parent, TsgDXFEntity * E);
  void Scroll(TShiftState Shift, bool Both, WORD Msg, WORD Code1,
              WORD Code2);
  void __fastcall SaveToDXF(AnsiString AFileName);
public:		// User declarations
  __fastcall TfmMain(TComponent* Owner);
  TsgDXFImage * _fastcall TfmMain::GetImg();
  __property TSGDrawingNavigator* sgPaintBox = {read=FsgPaintBox};
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
