public DateEntryBox(string label, DateEntryType dateEntryType = DateEntryType.MonthDateEntry) : base(label) { GardenPlannerSettings settings = GardenPlannerSettings.GetSettings(); VBox mainVBox = new VBox(); Label labelYear = new Label("Year"); spinButtonYear = new SpinButton(settings.MinYear, settings.MaxYear, 1); HBox hBoxYear = new HBox { labelYear, spinButtonYear }; mainVBox.Add(hBoxYear); Label labelDay = new Label("Day"); spinButtonDay = new SpinButton(1, 31, 1); HBox hBoxDay = new HBox { labelDay, spinButtonDay }; Label labelMonth = new Label("Month"); spinButtonMonth = new SpinButton(1, 12, 1); HBox hBoxMonth = new HBox { labelMonth, spinButtonMonth }; mainVBox.Add(hBoxMonth); radioMiddle = new RadioButton("middle"); radioBeginning = new RadioButton(radioMiddle, "beginning"); switch (dateEntryType) { case DateEntryType.MonthDateEntry: break; case DateEntryType.MiddleMonthDateEntry: Label labelMiddleMonth = new Label("Time of month"); HBox hBoxRadios = new HBox { radioMiddle, radioBeginning }; HBox hBoxMiddleMonth = new HBox { labelMiddleMonth, hBoxRadios }; mainVBox.Add(hBoxMiddleMonth); break; case DateEntryType.DayDateEntry: mainVBox.Add(hBoxDay); break; } this.Add(mainVBox); }
public DateEntryBox(string label, DateTime date, DateEntryType dateEntryType = DateEntryType.MonthDateEntry) : this(label, dateEntryType) { SetDate(date); }