Example #1
0
        public void Initialize(PropertyDescriptor prop)
        {
            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Enumeration editor does not support editing values of type " + prop.PropertyType);
            }

            ebox = new Gtk.EventBox();
            ebox.Show();
            PackStart(ebox, true, true, 0);

            combo                     = Gtk.ComboBoxEntry.NewText();
            combo.Changed            += combo_Changed;
            combo.Entry.IsEditable    = false;
            combo.Entry.HasFrame      = false;
            combo.Entry.HeightRequest = combo.SizeRequest().Height;                     // The combo does not set the entry to the correct size when it does not have a frame
            combo.Show();
            ebox.Add(combo);

            tips = new Gtk.Tooltips();

            enm = Registry.LookupEnum(prop.PropertyType.FullName);
            foreach (Enum value in enm.Values)
            {
                combo.AppendText(enm[value].Label);
            }
        }
Example #2
0
 public override void Initialize()
 {
     var w = new Gtk.EventBox ();
     w.VisibleWindow = false;
     Widget = w;
     Widget.Show ();
 }
Example #3
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task = task;
            this.Title = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
            this.HasSeparator = false;
            this.SetSizeRequest(500,320);
            this.Icon = Utilities.GetIcon ("tasque", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;

            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus = true;
            sw.Show ();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;

            targetVBox = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show ();
            innerEb.Add(targetVBox);
            innerEb.Show ();

            if(task.Notes != null) {
                foreach (var note in task.Notes) {
                    NoteWidget noteWidget = new NoteWidget (note);
                    noteWidget.TextChanged += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled += OnEditCanceled;
                    noteWidget.Show ();
                    targetVBox.PackStart (noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show ();

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

            if(task.NoteSupport == NoteSupport.Multiple) {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate (object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide ();
            };
        }
Example #4
0
        public void Initialize(EditSession session)
        {
            editSession = session;
            prop        = session.Property;

            ICollection valuesCollection = prop.Converter.GetStandardValues();

            values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count];
            valuesCollection.CopyTo(values, 0);

            //values = System.Enum.GetValues (prop.PropertyType);
            Hashtable names = new Hashtable();

            foreach (FieldInfo f in prop.PropertyType.GetFields())
            {
                DescriptionAttribute att = (DescriptionAttribute)Attribute.GetCustomAttribute(f, typeof(DescriptionAttribute));
                if (att != null)
                {
                    names [f.Name] = att.Description;
                }
                else
                {
                    names [f.Name] = f.Name;
                }
            }


            ebox = new Gtk.EventBox();
            ebox.Show();
            PackStart(ebox, true, true, 0);

            combo                     = Gtk.ComboBoxEntry.NewText();
            combo.Changed            += combo_Changed;
            combo.Entry.IsEditable    = false;
            combo.Entry.CanFocus      = false;
            combo.Entry.HasFrame      = false;
            combo.Entry.HeightRequest = combo.SizeRequest().Height;
            combo.Show();
            ebox.Add(combo);

            foreach (TraceLab.Core.Components.EnumValue value in values)
            {
                string str = prop.Converter.ConvertToString(value);
                if (names.Contains(str))
                {
                    str = (string)names [str];
                }
                combo.AppendText(str);
            }
        }
Example #5
0
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Enumeration editor does not support editing values of type " + prop.PropertyType);
            }

            values = System.Enum.GetValues(prop.PropertyType);
            Hashtable names = new Hashtable();

            foreach (FieldInfo f in prop.PropertyType.GetFields())
            {
                DescriptionAttribute att = (DescriptionAttribute)Attribute.GetCustomAttribute(f, typeof(DescriptionAttribute));
                if (att != null)
                {
                    names [f.Name] = att.Description;
                }
                else
                {
                    names [f.Name] = f.Name;
                }
            }


            ebox = new Gtk.EventBox();
            ebox.Show();
            PackStart(ebox, true, true, 0);

            combo                     = Gtk.ComboBoxEntry.NewText();
            combo.Changed            += combo_Changed;
            combo.Entry.IsEditable    = false;
            combo.Entry.CanFocus      = false;
            combo.Entry.HasFrame      = false;
            combo.Entry.HeightRequest = combo.SizeRequest().Height;
            combo.Show();
            ebox.Add(combo);

            foreach (object value in values)
            {
                string str = prop.Converter.ConvertToString(value);
                if (names.Contains(str))
                {
                    str = (string)names [str];
                }
                combo.AppendText(str);
            }
        }
		public void Initialize (PropertyDescriptor prop)
		{
			if (!prop.PropertyType.IsEnum)
				throw new ApplicationException ("Enumeration editor does not support editing values of type " + prop.PropertyType);
				
			ebox = new Gtk.EventBox ();
			ebox.Show ();
			PackStart (ebox, true, true, 0);

			combo = Gtk.ComboBoxEntry.NewText ();
			combo.Changed += combo_Changed;
			combo.Entry.IsEditable = false;
			combo.Entry.HasFrame = false;
			combo.Entry.HeightRequest = combo.SizeRequest ().Height;	// The combo does not set the entry to the correct size when it does not have a frame
			combo.Show ();
			ebox.Add (combo);

			enm = Registry.LookupEnum (prop.PropertyType.FullName);
			foreach (Enum value in enm.Values)
				combo.AppendText (enm[value].Label);
		}
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
                throw new ApplicationException (Catalog.GetString("Enumeration editor does not support editing values of type ") + prop.PropertyType);

            values = System.Enum.GetValues (prop.PropertyType);
            Hashtable names = new Hashtable ();
            foreach (FieldInfo f in prop.PropertyType.GetFields ()) {
                DescriptionAttribute att = (DescriptionAttribute) Attribute.GetCustomAttribute (f, typeof(DescriptionAttribute));
                if (att != null)
                    names [f.Name] = att.Description;
                else
                    names [f.Name] = f.Name;
            }

            ebox = new Gtk.EventBox ();
            ebox.Show ();
            PackStart (ebox, true, true, 0);

            combo = Gtk.ComboBoxEntry.NewText ();
            combo.Changed += combo_Changed;
            combo.Entry.IsEditable = false;
            combo.Entry.CanFocus = false;
            combo.Entry.HasFrame = false;
            combo.Entry.HeightRequest = combo.SizeRequest ().Height;
            combo.Show ();
            ebox.Add (combo);

            foreach (object value in values) {
                string str = prop.Converter.ConvertToString (value);
                if (names.Contains (str))
                    str = (string) names [str];
                combo.AppendText (str);
            }
        }
Example #8
0
 public override void Initialize()
 {
     Widget = new Gtk.EventBox();
     Widget.Show();
 }
Example #9
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task         = task;
            this.Title        = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
            this.HasSeparator = false;
            this.SetSizeRequest(500, 320);
            this.Icon = Utilities.GetIcon("tasque", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;


            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;


            targetVBox             = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show();
            innerEb.Add(targetVBox);
            innerEb.Show();

            if (task.Notes != null)
            {
                foreach (var note in task.Notes)
                {
                    NoteWidget noteWidget = new NoteWidget(note);
                    noteWidget.TextChanged         += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled        += OnEditCanceled;
                    noteWidget.Show();
                    targetVBox.PackStart(noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show();

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

            if (task.NoteSupport == NoteSupport.Multiple)
            {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate(object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide();
            };
        }
Example #10
0
		public override void Initialize ()
		{
			Widget = new Gtk.EventBox ();
			Widget.Show ();
		}
		public void Initialize (EditSession session)
		{
            editSession = session;
            prop = session.Property;
           
            ICollection valuesCollection = prop.Converter.GetStandardValues();
            values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count];
            valuesCollection.CopyTo(values, 0);

			//values = System.Enum.GetValues (prop.PropertyType);
			Hashtable names = new Hashtable ();
			foreach (FieldInfo f in prop.PropertyType.GetFields ()) {
				DescriptionAttribute att = (DescriptionAttribute) Attribute.GetCustomAttribute (f, typeof(DescriptionAttribute));
				if (att != null)
					names [f.Name] = att.Description;
				else
					names [f.Name] = f.Name;
			}
				       
			
			ebox = new Gtk.EventBox ();
			ebox.Show ();
			PackStart (ebox, true, true, 0);

			combo = Gtk.ComboBoxEntry.NewText ();
			combo.Changed += combo_Changed;
			combo.Entry.IsEditable = false;
			combo.Entry.CanFocus = false;
			combo.Entry.HasFrame = false;
			combo.Entry.HeightRequest = combo.SizeRequest ().Height;
			combo.Show ();
			ebox.Add (combo);

            foreach (TraceLab.Core.Components.EnumValue value in values) {
				string str = prop.Converter.ConvertToString (value);
				if (names.Contains (str))
					str = (string) names [str];
				combo.AppendText (str);
			}
		}
Example #12
0
 public DesignerSurfaceBackend()
 {
     box = new DesignerBox();
     box.Show();
     Widget = box;
 }
Example #13
0
		public DesignerSurfaceBackend ()
		{
			box = new DesignerBox ();
			box.Show ();
			Widget = box;
		}