public DateComboBox() { MinDate = DateTime.MinValue; MaxDate = DateTime.MaxValue; ErrorColor = new Gdk.Color(255, 0, 0); NormalColor = Entry.Style.Text(Gtk.StateType.Normal); Entry.Changed += delegate { Entry.ModifyText(Gtk.StateType.Normal, IsDateValid() ? NormalColor : ErrorColor); OnDateChanged(EventArgs.Empty); }; PopupButton.Clicked += delegate { var dlg = new DateComboBoxDialog(selectedDate ?? DateTime.Now, this.Mode); dlg.DateChanged += delegate { SelectedDate = dlg.SelectedDate; }; dlg.ShowPopup(this); }; }
public DateComboBox() { MinDate = DateTime.MinValue; MaxDate = DateTime.MaxValue; ErrorColor = new Gdk.Color(255, 0, 0); NormalColor = Entry.Style.Text(Gtk.StateType.Normal); Entry.Changed += HandleChanged; PopupButton.Clicked += delegate { var dlg = new DateComboBoxDialog(selectedDate ?? DateTime.Now, this.Mode); dlg.DateChanged += delegate { selectedDate = dlg.SelectedDate; ValidateDateRange(); SetValue(); }; dlg.ShowPopup(this); }; }
public DateComboBox () { MinDate = DateTime.MinValue; MaxDate = DateTime.MaxValue; ErrorColor = new Gdk.Color (255, 0, 0); NormalColor = Entry.Style.Text (Gtk.StateType.Normal); Entry.Changed += delegate { Entry.ModifyText (Gtk.StateType.Normal, IsDateValid () ? NormalColor : ErrorColor); OnDateChanged (EventArgs.Empty); }; PopupButton.Clicked += delegate { var dlg = new DateComboBoxDialog (selectedDate ?? DateTime.Now, this.Mode); dlg.DateChanged += delegate { SelectedDate = dlg.SelectedDate; }; dlg.ShowPopup (this); }; }