Beispiel #1
0
        public MeasureFormDialog(int measureId, Gtk.Window parent, Gtk.DialogFlags flags) :
            base("Edit Measure" + measureId, parent, flags)
        {
            this.OnCreate();
            this.OnReceivedMeasured(measureId);

            this.BuildDialog();
        }
        public NoteFormDialog(int noteId, Gtk.Window parent, Gtk.DialogFlags flags) :
            base("Edit note", parent, flags)
        {
            this.OnCreate();
            this.OnReceivedNoteId(noteId);

            this.BuildDialog();
        }
Beispiel #3
0
 // constructor for a HIG confirmation alert with two buttons
 public HigMessageDialog(Gtk.Window parent,
                         Gtk.DialogFlags flags,
                         Gtk.MessageType type,
                         string header,
                         string msg,
                         string ok_caption)
     : this(parent, flags, type, Gtk.ButtonsType.Cancel, header, msg)
 {
     AddButton(ok_caption, Gtk.ResponseType.Ok, false);
 }
        public static Gtk.ResponseType Show(Gtk.Window window, Gtk.DialogFlags dialogflags, MessageType msgType, ButtonsType btnType, string Message, String caption)
        {
            MessageDialog md = new MessageDialog(window, dialogflags, msgType, btnType, Message);

            md.Title = caption;
            ResponseType tp = (Gtk.ResponseType)md.Run();

            md.Destroy();
            return(tp);
        }
Beispiel #5
0
        /// <summary>
        /// show a message dialog
        /// </summary>
        /// <returns>
        /// The message.
        /// </returns>
        /// <param name='message'>
        /// Message.
        /// </param>
        /// <param name='parent'>
        /// Parent.
        /// </param>
        /// <param name='flags'>
        /// Flags.
        /// </param>
        /// <param name='messagetype'>
        /// Messagetype.
        /// </param>
        /// <param name='buttonstype'>
        /// Buttonstype.
        /// </param>
        public static ResponseType ShowMessage(String message, Gtk.Window parent, Gtk.DialogFlags flags, Gtk.MessageType messagetype, ButtonsType buttonstype)
        {
            var dialog = new MessageDialog(parent, flags, messagetype, buttonstype, message, new object[0]);

            try
            {
                int res = dialog.Run();
                return((ResponseType)res);
            }
            finally
            {
                dialog.Destroy();
            }
        }
Beispiel #6
0
        //Run and destroy a standard confirmation dialog
        public static Gtk.ResponseType RunHigConfirmation(Gtk.Window parent,
                                                          Gtk.DialogFlags flags,
                                                          Gtk.MessageType type,
                                                          string header,
                                                          string msg,
                                                          string ok_caption)
        {
            HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, header, msg, ok_caption);

            try {
                return((Gtk.ResponseType)hmd.Run());
            } finally {
                hmd.Destroy();
            }
        }
Beispiel #7
0
    //run and destroy a standard dialog
    public static Gtk.ResponseType RunHigMessageDialog(Gtk.Window parent,
                                                       Gtk.DialogFlags flags,
                                                       Gtk.MessageType type,
                                                       Gtk.ButtonsType buttons,
                                                       string header,
                                                       string msg)
    {
        HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, buttons, header, msg);

        try {
            return((Gtk.ResponseType)hmd.Run());
        } finally {
            hmd.Destroy();
        }
    }
Beispiel #8
0
Datei: Util.cs Projekt: MrJoe/lat
        public HIGMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = "";

            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            accel_group = new Gtk.AccelGroup();
            AddAccelGroup(accel_group);

            Gtk.HBox hbox = new Gtk.HBox(false, 12);
            hbox.BorderWidth = 5;
            hbox.Show();
            VBox.PackStart(hbox, false, false, 0);

            Gtk.Image image = null;

            switch (type)
            {
            case Gtk.MessageType.Error:
                image = new Gtk.Image(Gtk.Stock.DialogError,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Question:
                image = new Gtk.Image(Gtk.Stock.DialogQuestion,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Info:
                image = new Gtk.Image(Gtk.Stock.DialogInfo,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Warning:
                image = new Gtk.Image(Gtk.Stock.DialogWarning,
                                      Gtk.IconSize.Dialog);
                break;
            }

            image.Show();
            hbox.PackStart(image, false, false, 0);

            Gtk.VBox label_vbox = new Gtk.VBox(false, 0);
            label_vbox.Show();
            hbox.PackStart(label_vbox, true, true, 0);

            string title = String.Format("<span weight='bold' size='larger'>{0}" +
                                         "</span>\n",
                                         header);

            Gtk.Label label;

            label           = new Gtk.Label(title);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            label           = new Gtk.Label(msg);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            switch (buttons)
            {
            case Gtk.ButtonsType.None:
                break;

            case Gtk.ButtonsType.Ok:
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;

            case Gtk.ButtonsType.Close:
                AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;

            case Gtk.ButtonsType.Cancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;

            case Gtk.ButtonsType.YesNo:
                AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;

            case Gtk.ButtonsType.OkCancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
            {
                TransientFor = parent;
            }

            if ((int)(flags & Gtk.DialogFlags.Modal) != 0)
            {
                Modal = true;
            }

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
Beispiel #9
0
 public MeasureFormDialog(Gtk.Window parent, Gtk.DialogFlags flags) :
     base("Insert measure", parent, flags)
 {
     this.OnCreate();
     this.BuildDialog();
 }
Beispiel #10
0
		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

			accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

			vbox.PackStart (sw, true, true, 0);

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Due Date
			///
			hbox = new HBox (false, 4);
			due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:"));
			if (task.DueDate != DateTime.MinValue)
				due_date_check_button.Active = true;
			due_date_check_button.Toggled += OnDueDateCheckButtonToggled;
			due_date_check_button.Show ();
			hbox.PackStart (due_date_check_button, false, false, 0);

			due_date_button =
			        new Gtk.Extras.DateButton (task.DueDate, false);
			if (task.DueDate == DateTime.MinValue)
				due_date_button.Sensitive = false;
			due_date_button.Show ();
			hbox.PackStart (due_date_button, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Priority
			///
			hbox = new HBox (false, 4);
			priority_check_button = new CheckButton (Catalog.GetString ("Priority:"));
			if (task.Priority != TaskPriority.Undefined)
				priority_check_button.Active = true;
			priority_check_button.Toggled += OnPriorityCheckButtonToggled;
			priority_check_button.Show ();
			hbox.PackStart (priority_check_button, false, false, 0);

			priority_combo_box = ComboBox.NewText ();
			priority_combo_box.AppendText (Catalog.GetString ("None"));
			priority_combo_box.AppendText (Catalog.GetString ("Low"));
			priority_combo_box.AppendText (Catalog.GetString ("Normal"));
			priority_combo_box.AppendText (Catalog.GetString ("High"));
			if (task.Priority == TaskPriority.Undefined)
				priority_combo_box.Sensitive = false;
			priority_combo_box.Active = (int) task.Priority;
			priority_combo_box.Changed += OnPriorityComboBoxChanged;
			priority_combo_box.Show ();
			hbox.PackStart (priority_combo_box, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);
			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true);

//   if (parent != null)
//    TransientFor = parent;

//   if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
//    Modal = true;

//   if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
//    DestroyWithParent = true;
		}
 public NoteFormDialog(Gtk.Window parent, Gtk.DialogFlags flags) :
     base("Create note", parent, flags)
 {
     this.OnCreate();
     this.BuildDialog();
 }