Esempio n. 1
0
        public DateComboBox()
        {
            MinDate = DateTime.MinValue;
            MaxDate = DateTime.MaxValue;

            ErrorColor  = Colors.Red;
            NormalColor = Entry.GetTextColor();

            Entry.Changed       += HandleChanged;
            Entry.FocusOutEvent += Entry_FocusOutEvent;

            // called on button press..
            PopupButtonClicked += delegate
            {
                // if we are still up somehow, take the old dialog down..
                if (dlg != null)
                {
                    // this will appear to the user as a click that doesn't
                    // bring up a window..
                    dlg.CloseDialog();
                    CleanDialog();
                }
                else
                {
#if GTKCORE
                    // move the focus to the Entry control so we can detect it moving away..
                    Entry.GrabFocusWithoutSelecting();
#endif
                    dlg               = new DateComboBoxDialog(selectedDate ?? DateTime.Now, this.Mode);
                    dlg.DateChanged  += Dlg_DateChanged;
                    dlg.DialogClosed += Dlg_DialogClosed;
                    dlg.ShowPopup(this);
                }
            };
        }
Esempio n. 2
0
        private void CleanDialog()
        {
            if (dlg == null)
            {
                return;
            }

            dlg.DateChanged  -= Dlg_DateChanged;
            dlg.DialogClosed -= Dlg_DialogClosed;
            dlg = null;
        }
Esempio n. 3
0
        public DateComboBox()
        {
            MinDate = DateTime.MinValue;
            MaxDate = DateTime.MaxValue;

            ErrorColor  = Colors.Red;
            NormalColor = Entry.GetTextColor();

            Entry.Changed      += HandleChanged;
            PopupButtonClicked += delegate
            {
                var dlg = new DateComboBoxDialog(selectedDate ?? DateTime.Now, this.Mode);
                dlg.DateChanged += delegate
                {
                    selectedDate = dlg.SelectedDate;
                    ValidateDateRange();
                    SetValue();
                };
                dlg.ShowPopup(this);
            };
        }
Esempio 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);
            };
        }
Esempio n. 5
0
		public DateComboBox()
		{
			
			MinDate = DateTime.MinValue;
			MaxDate = DateTime.MaxValue;
			
			ErrorColor = Colors.Red;
			NormalColor = Entry.GetTextColor();

			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);
			};
		}
Esempio n. 6
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);
			};
		}