示例#1
0
        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);
            };
        }
示例#2
0
        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);
            };
        }
示例#3
0
		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);
			};
		}
示例#4
0
文件: DateComboBox.cs 项目: Exe0/Eto
		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);
			};
		}