public Printout(RoomBookings caller) { callingForm = caller; InitializeComponent(); this.Width = 1280; this.Height = 720; xPixelDiv = dx((int)virtScaleX / (numDivisions + 4)); yPixelDiv = dy((int)virtScaleY / 7); initTimeTable(); bookingList.Clear(); foreach (booking l in RoomBookings.bookingList) { if (l.rect.Parent != null) { TextRectangle t = new TextRectangle(timeTable); t.Width = dx((int)((float)xPixelDiv * (l.endTime - l.startTime)) * 4); t.Height = dy(yPixelDiv); t.Top = py((int)(yPixelDiv * ((float)l.row + 1f))); t.Left = px((int)((l.startTime - 8.75f) * ((float)xPixelDiv * 4f))); t.Text = l.rect.Text; t.FillColor = Color.AliceBlue; t.CornerRadius = 5; t.FillStyle = FillStyle.Solid; //t.drawFont = new Font("Arial", 10); t.BringToFront(); bookingList.Add(t); } } int x = 15; int y = this.Height - 105; foreach (Button b in this.Controls.OfType <Button>()) { b.Height = 25; b.Width = 75; b.Left = x; b.Top = y + 30; x += 75; } //btnPrint.Width = 75; //btnPrint.Height = 25; //btnPrint.Left = (this.Width - btnPrint.Width) / 2; //btnPrint.Top = this.ClientSize.Height - 40; //pageSD.Document = printDoc; //pageSD.AllowPrinter = true; //pageSD.EnableMetric = true; //pageSD.PageSettings = new PageSettings(); //pageSD.PrinterSettings = new PrinterSettings(); printDoc.DefaultPageSettings.Landscape = true; printDoc.DefaultPageSettings.Margins.Left = 30; printDoc.DefaultPageSettings.Margins.Right = 30; printDoc.DefaultPageSettings.Margins.Top = 30; printDoc.DefaultPageSettings.Margins.Bottom = 30; }
public booking() { lesson = ""; day = ""; startTime = 9f; endTime = 10f; year = ""; level = ""; group = ""; room = ""; infillRoom = ""; infill = false; staff = ""; rect = new TextRectangle(); id = idCounter; idCounter++; }
public booking(string les, string d, string sh, string sm, string eh, string em, string y, string lev, string g, string r, string st, string i, bool ifi) { lesson = les; day = d; startTime = timeConvert(sh, sm); endTime = timeConvert(eh, em); year = y; level = lev; group = g; room = r; staff = st; infill = ifi; if (infill) { infillRoom = i; } else { infillRoom = ""; } id = idCounter++; switch (day) { case "Mon": row = 0; break; case "Tue": row = 1; break; case "Wed": row = 2; break; case "Thu": row = 3; break; case "Fri": row = 4; break; } rect = new TextRectangle(); setupRectangle(); }
private void locateRectangle(int x, int y, int width, int height, ref TextRectangle r) { r.Size = new System.Drawing.Size(dx(width), dy(height)); r.Location = new System.Drawing.Point(px(x), py(y)); }