Exemplo n.º 1
0
 public CellRendererWidget(PropertyEditorCell cell, ITypeDescriptorContext context)
 {
     this.cell    = cell;
     this.context = context;
     em           = cell.EditorManager;
     this.ModifyBg(StateType.Normal, this.Style.White);
 }
 public CellRendererWidget(PropertyEditorCell cell)
 {
     this.cell     = cell;
     this.obj      = cell.Instance;
     this.property = cell.Property;
     em            = cell.EditorManager;
     this.ModifyBg(Gtk.StateType.Normal, this.Style.White);
 }
Exemplo n.º 3
0
        public void SetData(object instance, PropertyDescriptor property, PropertyEditorCell editor)
        {
            this.instance = instance;
            this.property = property;
            if (property == null)
            {
                this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal];
                sensitive = true;
            }
            else
            {
                this.CellBackground = null;
                sensitive           = !property.IsReadOnly || (editor != null && editor.EditsReadOnlyObject);
            }

            editorCell = editor;
        }
        public PropertyDialogueEditor(PropertyEditorCell cell)
        {
            this.cell = cell;
            Spacing   = 3;
            PackStart(new CellRendererWidget(cell), true, true, 0);
            Label buttonLabel = new Label();

            buttonLabel.UseMarkup = true;
            buttonLabel.Xpad      = 0; buttonLabel.Ypad = 0;
            buttonLabel.Markup    = "<span size=\"small\">...</span>";
            Button dialogueButton = new Button(buttonLabel);

            dialogueButton.Clicked += new EventHandler(DialogueButtonClicked);
            PackStart(dialogueButton, false, false, 0);
            this.ModifyBg(Gtk.StateType.Normal, this.Style.White);
            ShowAll();
        }
Exemplo n.º 5
0
        void PropertyData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererProperty rc = (CellRendererProperty)cell;
            bool group = (bool)model.GetValue(iter, 2);

            if (group)
            {
                rc.SetData(null, null, null);
            }
            else
            {
                PropertyDescriptor prop     = (PropertyDescriptor)model.GetValue(iter, 1);
                PropertyEditorCell propCell = editorManager.GetEditor(prop);
                InstanceData       idata    = (InstanceData)model.GetValue(iter, 3);
                propCell.Initialize(tree, editorManager, prop, idata.Instance);
                rc.SetData(idata.Instance, prop, propCell);
            }
        }
Exemplo n.º 6
0
        public PropertyEditorCell GetEditor(PropertyDescriptor pd)
        {
            PropertyEditorCell cell = pd.GetEditor(typeof(PropertyEditorCell)) as PropertyEditorCell;

            if (cell != null)
            {
                return(cell);
            }

            Type editorType = GetEditorType(pd);

            if (editorType == null)
            {
                return(Default);
            }

            if (typeof(IPropertyEditor).IsAssignableFrom(editorType))
            {
                if (!typeof(Gtk.Widget).IsAssignableFrom(editorType))
                {
                    throw new Exception("The property editor '" + editorType + "' must be a Gtk Widget");
                }
                return(Default);
            }

            cell = cellCache [editorType] as PropertyEditorCell;
            if (cell != null)
            {
                return(cell);
            }

            if (!typeof(PropertyEditorCell).IsAssignableFrom(editorType))
            {
                throw new Exception("The property editor '" + editorType + "' must be a subclass of Stetic.PropertyEditorCell or implement Stetic.IPropertyEditor");
            }

            cell = (PropertyEditorCell)Activator.CreateInstance(editorType);
            cellCache [editorType] = cell;
            return(cell);
        }
Exemplo n.º 7
0
        public CellRendererWidget(PropertyEditorCell cell)
        {
            this.cell     = cell;
            this.obj      = cell.Instance;
            this.property = cell.Property;
            em            = cell.EditorManager;
            this.ModifyBg(Gtk.StateType.Normal, this.Style.White);

            // HERZUM SPRINT 4.2: TLAB-202
            if (cell != null && cell.Value != null && Buffer != null)
            {
                if ((cell.Value as TraceLabSDK.Component.Config.DirectoryPath) != null)
                {
                    Buffer.Text = (cell.Value as TraceLabSDK.Component.Config.DirectoryPath).Absolute;
                }
                else if ((cell.Value as TraceLabSDK.Component.Config.FilePath) != null)
                {
                    Buffer.Text = (cell.Value as TraceLabSDK.Component.Config.FilePath).Absolute;
                }
            }
            // END HERZUM SPRINT 4.2: TLAB-202
        }
Exemplo n.º 8
0
        // END HERZUM SPRINT 4.2: TLAB-202

		public PropertyDialogueEditor (PropertyEditorCell cell)
		{
			this.cell = cell;
			Spacing = 3;
            // HERZUM SPRINT 4.2: TLAB-202
            // PackStart (new CellRendererWidget (cell), true, true, 0);
            cellRendererWidget = new CellRendererWidget (cell);
            PackStart (cellRendererWidget, true, true, 0);
            // END HERZUM SPRINT 4.2: TLAB-202
			Label buttonLabel = new Label ();
			buttonLabel.UseMarkup = true;
			buttonLabel.Xpad = 0; buttonLabel.Ypad = 0;
			buttonLabel.Markup = "<span size=\"small\">...</span>";
			Button dialogueButton = new Button (buttonLabel);
			dialogueButton.Clicked += new EventHandler (DialogueButtonClicked);
			PackStart (dialogueButton, false, false, 0);
			this.ModifyBg (Gtk.StateType.Normal, this.Style.White);
			ShowAll ();
		}
Exemplo n.º 9
0
		public CellRendererWidget (PropertyEditorCell cell)
		{
			this.cell = cell;
			this.obj = cell.Instance;
			this.property = cell.Property;
			em = cell.EditorManager;
			this.ModifyBg (Gtk.StateType.Normal, this.Style.White);

            // HERZUM SPRINT 4.2: TLAB-202
            if (cell != null && cell.Value != null && Buffer != null){
                if ((cell.Value as TraceLabSDK.Component.Config.DirectoryPath) != null)
                    Buffer.Text = (cell.Value as TraceLabSDK.Component.Config.DirectoryPath).Absolute;
                else if ((cell.Value as TraceLabSDK.Component.Config.FilePath) != null)
                    Buffer.Text = (cell.Value as TraceLabSDK.Component.Config.FilePath).Absolute;
            }
            // END HERZUM SPRINT 4.2: TLAB-202
		}
Exemplo n.º 10
0
		public void SetData (object instance, PropertyDescriptor property, PropertyEditorCell editor)
		{
			this.instance = instance;
			this.property = property;
			if (property == null) {
				this.CellBackgroundGdk = tree.Style.MidColors [(int) Gtk.StateType.Normal];
				sensitive = true;
			}
			else {
				this.CellBackground = null;
				sensitive = !property.IsReadOnly || (editor != null && editor.EditsReadOnlyObject);
			}
			
			editorCell = editor;
		}
Exemplo n.º 11
0
 public CellRendererWidget(PropertyEditorCell cell)
 {
     this.cell = cell;
     this.obj = cell.Instance;
     this.property = cell.Property;
     em = cell.EditorManager;
     this.ModifyBg (Gtk.StateType.Normal, this.Style.White);
 }
		public PropertyDialogueEditor (PropertyEditorCell cell, ITypeDescriptorContext context)
		{
			this.cell = cell;
			Spacing = 3;
			PackStart (new CellRendererWidget (cell, context), true, true, 0);
			Label buttonLabel = new Label ();
			buttonLabel.UseMarkup = true;
			buttonLabel.Xpad = 0; buttonLabel.Ypad = 0;
			buttonLabel.Markup = "<span size=\"small\">...</span>";
			Button dialogueButton = new Button (buttonLabel);
			dialogueButton.Clicked += DialogueButtonClicked;
			PackStart (dialogueButton, false, false, 0);
			this.ModifyBg (StateType.Normal, this.Style.White);
			ShowAll ();
		}
		public CellRendererWidget (PropertyEditorCell cell, ITypeDescriptorContext context)
		{
			this.cell = cell;
			this.context = context;
			em = cell.EditorManager;
			this.ModifyBg (StateType.Normal, this.Style.White);
		}