private void FillName(string str_name) { name = createStandardTextBox(PhoenixOTSheetDims.NameInput.TopLeft, LARGE_FONT_SIZE); PageTools.CentreTextBox(name, PhoenixOTSheetDims.NameInput); name.Text = str_name; }
public Sheet_PhoenixOT(PersonalInfo info, List <PremiumCode> range, DateTime startDate, List <work_period> wpData, ref Settings settings) { this.pInfo = info; this.startDate = startDate; this.settings = settings; workPeriods = wpData; textboxes = new List <TextBox>(); this.IsLandscape = true; Debug.WriteLine("PAPER TYPE: " + this.PaperType.ToString()); this.PaperType = System.Drawing.Printing.PaperKind.Letter; this.Image = time.Properties.Resources.Phoenix_Inspectors_Weekly_OT_Template_With_Blank_Form; this.SizeMode = PictureBoxSizeMode.AutoSize; this.Location = new Point(0, 0); this.codes = range; //InitializeComponent(); weekNo = createStandardTextBox(PhoenixOTSheetDims.WeekInput.TopLeft, LARGE_FONT_SIZE); PageTools.CentreTextBox(weekNo, PhoenixOTSheetDims.WeekInput); date = createStandardTextBox(PhoenixOTSheetDims.GlobalDate.TopLeft, LARGE_FONT_SIZE); PageTools.CentreTextBox(date, PhoenixOTSheetDims.GlobalDate); FillDateAndWeek(); FillName(pInfo.GivenNames + " " + pInfo.Surname); FillIndividualDates(); CreateLabelGrid(ref firstWeek, PhoenixOTSheetDims.TableOneStart, PhoenixOTSheetDims.CellSize, PhoenixOTSheetDims.ColumnsPerGrid, PhoenixOTSheetDims.RowsPerGrid, PhoenixOTSheetDims.BorderWidth); CreateLabelGrid(ref secondWeek, PhoenixOTSheetDims.TableTwoStart, PhoenixOTSheetDims.CellSize, PhoenixOTSheetDims.ColumnsPerGrid, PhoenixOTSheetDims.RowsPerGrid, PhoenixOTSheetDims.BorderWidth); addDataToGrid(ref firstWeek, startDate); addDataToGrid(ref secondWeek, startDate.AddDays(7.0)); }
private void CreateLabelGrid(ref TextBox[,] week, Point GridStart, Size CellSize, int NumColumns, int NumRows, int BorderSize) { week = new TextBox[NumRows, NumColumns]; for (int y = 0; y < NumRows; ++y) { for (int x = 0; x < NumColumns; ++x) { int p1X = (GridStart.X + (CellSize.Width - 1 + BorderSize) * x); int p2Y = (GridStart.Y + (CellSize.Height - 1 + BorderSize) * y); Point p1 = new Point(p1X, p2Y); week[y, x] = createStandardTextBox(p1, STANDARD_FONT_SIZE); PageTools.CentreTextBox(week[y, x], new Box(p1, new Point(p1.X + PhoenixOTSheetDims.CellSize.Width - 1, p1.Y + PhoenixOTSheetDims.CellSize.Height - 1))); } } }
private void fillDateRow(ref TextBox[] row, Point startPoint, DateTime startDate) { Size cellSize = PhoenixOTSheetDims.CellSize; int count = 7; for (int n = 0; n < count; ++n) { int p1x = startPoint.X + ((cellSize.Width - 1 + PhoenixOTSheetDims.BorderWidth) * 2) * n; int p1y = startPoint.Y; int p2x = p1x + ((cellSize.Width - 1) * 2) + PhoenixOTSheetDims.BorderWidth; int p2y = p1y + cellSize.Height; Point p1 = new Point(p1x, p1y); Point p2 = new Point(p2x, p2y); row[n] = createStandardTextBox(startPoint, STANDARD_FONT_SIZE - 4); TextBox tb = row[n]; PageTools.CentreTextBox(tb, new Box(p1, p2)); tb.Text = startDate.AddDays(n).ToString("dddd, MMMM dd"); } }