Exemplo n.º 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);
            };
        }
Exemplo n.º 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);
            };
        }
Exemplo n.º 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);
			};
		}
Exemplo n.º 4
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);
			};
		}