public DrawArea(TabGraphicPageControl _parent) { printdoc1.PrintPage += new PrintPageEventHandler(printdoc1_PrintPage); PageSetupDialog1.PageSettings = new System.Drawing.Printing.PageSettings(); PageSetupDialog1.PageSettings.PaperSize = new PaperSize(); PageSetupDialog1.PageSettings.PaperSize.RawKind = (int)PaperKind.A3; PageSetupDialog1.PageSettings.Landscape = true; PageSetupDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings(); PageSetupDialog1.ShowNetwork = false; parentTabGraphicPageControl = _parent; // create list of Layers, with one default active visible layer //parent = null; //ActivePageNo = 0; //_pages = new PageList(this); //graphicsList = new List<GraphicsList>(); //graphicsList.Add(new GraphicsList(this)); _panning = false; _panX = 0; _panY = 0; SnapEnable = true; ShowGrid = true; SnapX = Common.BaseSize * Common.UnitSize; //30 SnapY = Common.BaseSize * Common.UnitSize; //30 GridX = Common.BaseSize * Common.UnitSize; //30 GridY = Common.BaseSize * Common.UnitSize; //30 this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DrawArea_MouseWheel); // This call is required by the Windows.Forms Form Designer. InitializeComponent(); //DrawImage o = new DrawImage(0, 0); //DrawTools.ToolObject.AddNewObject(this, new DrawImage(0, 0)); }
public void LoadDisplay(TabGraphicPageControl tabdisplaypagecontrol) { //GraphicsList graphicslist = new Draw.GraphicsList(); Pages = new PageList(tabdisplaypagecontrol); foreach (tblBitmap tblbitmap in m_tblBitmapCollection) { DrawImage obj = new DrawImage(Pages); obj.Load(tblbitmap); Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj); } foreach (tblADText tbladtext in m_tblADTextCollection) { DrawText obj = new DrawText(Pages); obj.Load(tbladtext); Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj); } foreach (tblLine tblline in m_tblLineCollection) { DrawLine obj = new DrawLine(Pages); obj.Load(tblline); Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj); } foreach (tblRect tblrect in m_tblRectCollection) { switch ((STATIC_OBJ_TYPE)tblrect.Type) { case STATIC_OBJ_TYPE.ID_ELLIPS: DrawEllipse drawellipse = new DrawEllipse(Pages); drawellipse.Load(tblrect); Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawellipse); break; case STATIC_OBJ_TYPE.ID_ROUNDRECT: case STATIC_OBJ_TYPE.ID_RECT: DrawRectangle drawrectangle = new DrawRectangle(Pages); drawrectangle.Load(tblrect); Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawrectangle); break; } } foreach (tblPolyline tblpolyline in m_tblPolylineCollection) { DrawPolyLine drawpolyline = new DrawPolyLine(Pages); drawpolyline.Load(tblpolyline); Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawpolyline); } foreach (tblPolygon tblpolygon in m_tblPolygonCollection) { DrawPolygon drawpolygon = new DrawPolygon(Pages); drawpolygon.Load(tblpolygon); Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawpolygon); } foreach (tblCurve tblcurve in m_tblCurveCollection) { DrawCurve drawcurve = new DrawCurve(Pages); drawcurve.Load(tblcurve); Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawcurve); } Pages.GraphicPagesList[Pages.ActivePageNo].SortoIndex(); }