예제 #1
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);
 }
예제 #2
0
        public PropertyGridTree(EditorManager editorManager, PropertyGrid parentGrid)
        {
            this.editorManager = editorManager;
            this.parentGrid = parentGrid;

            propertyRows = new Hashtable ();

            store = new TreeStore (typeof (string), typeof(object), typeof(bool), typeof(object));

            tree = new InternalTree (this, store);

            CellRendererText crt;

            TreeViewColumn col;

            col = new TreeViewColumn ();
            col.Title = Catalog.GetString("Property");
            crt = new CellRendererPropertyGroup (tree);
            crt.Xpad = 0;
            col.PackStart (crt, true);
            col.SetCellDataFunc (crt, new TreeCellDataFunc (GroupData));
            col.Resizable = true;
            col.Expand = false;
            col.Sizing = TreeViewColumnSizing.Fixed;
            col.FixedWidth = 180;
            tree.AppendColumn (col);

            editorColumn = new TreeViewColumn ();
            editorColumn.Title = Catalog.GetString("Value");

            CellRendererProperty crp = new CellRendererProperty (tree);

            editorColumn.PackStart (crp, true);
            editorColumn.SetCellDataFunc (crp, new TreeCellDataFunc (PropertyData));
            editorColumn.Sizing = TreeViewColumnSizing.Fixed;
            editorColumn.Resizable = false;
            editorColumn.Expand = true;
            tree.AppendColumn (editorColumn);

            tree.HeadersVisible = false;
            this.ShadowType = Gtk.ShadowType.None;

            this.HscrollbarPolicy = Gtk.PolicyType.Never;

            Add (tree);

            ShowAll ();

            tree.Selection.Changed += OnSelectionChanged;
        }
        public PropertyGridTree(EditorManager editorManager, PropertyGrid parentGrid)
        {
            this.editorManager = editorManager;
            this.parentGrid    = parentGrid;

            propertyRows = new Hashtable();

            store = new TreeStore(typeof(string), typeof(object), typeof(bool), typeof(object));

            tree = new InternalTree(this, store);

            CellRendererText crt;

            TreeViewColumn col;

            col       = new TreeViewColumn();
            col.Title = "Property";
            crt       = new CellRendererPropertyGroup(tree);
            crt.Xpad  = 0;
            col.PackStart(crt, true);
            col.SetCellDataFunc(crt, new TreeCellDataFunc(GroupData));
            col.Resizable  = true;
            col.Expand     = false;
            col.Sizing     = TreeViewColumnSizing.Fixed;
            col.FixedWidth = 180;
            tree.AppendColumn(col);

            editorColumn       = new TreeViewColumn();
            editorColumn.Title = "Value";

            CellRendererProperty crp = new CellRendererProperty(tree);

            editorColumn.PackStart(crp, true);
            editorColumn.SetCellDataFunc(crp, new TreeCellDataFunc(PropertyData));
            editorColumn.Sizing    = TreeViewColumnSizing.Fixed;
            editorColumn.Resizable = false;
            editorColumn.Expand    = true;
            tree.AppendColumn(editorColumn);

            tree.HeadersVisible = false;
            this.ShadowType     = Gtk.ShadowType.None;

            this.HscrollbarPolicy = Gtk.PolicyType.Never;

            Add(tree);

            ShowAll();

            tree.Selection.Changed += OnSelectionChanged;
        }
예제 #4
0
        internal void Initialize(Widget container, EditorManager editorManager, PropertyDescriptor property, object obj)
        {
            this.container     = container;
            this.editorManager = editorManager;

            layout       = new Pango.Layout(container.PangoContext);
            layout.Width = -1;

            Pango.FontDescription des = container.Style.FontDescription.Copy();
            layout.FontDescription = des;

            this.property = property;
            this.obj      = obj;
            Initialize();
        }
예제 #5
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar ();
            base.PackStart (tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton ((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief = ReliefStyle.None;
            Gdk.Pixbuf pixbuf = null;
            //			try {
            //				pixbuf = new Gdk.Pixbuf (typeof (PropertyGrid).Assembly, "MonoDevelop.Components.PropertyGrid.SortByCat.png");
            //			} catch {}
            //(Exception e) {
                //LoggingService.LogError ("Can't create pixbuf from resource: MonoDevelop.Components.PropertyGrid.SortByCat.png", e);
            //}
            if (pixbuf != null) {
                catButton.Image = new Gtk.Image (pixbuf);
                catButton.Image.Show ();
            }
            catButton.TooltipText = "Sort in categories";
            catButton.Toggled += new EventHandler (toolbarClick);
            toolbar.Insert (catButton, 0);

            alphButton = new RadioButton (catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief = ReliefStyle.None;
            alphButton.Image = new Gtk.Image (Stock.SortAscending, IconSize.Menu);
            alphButton.Image.Show ();
            alphButton.TooltipText = "Sort alphabetically";
            alphButton.Clicked += new EventHandler (toolbarClick);
            toolbar.Insert (alphButton, 1);

            catButton.Active = true;

            toolbar.Insert (new SeparatorToolItem (), 2);
            helpButton = new ToggleButton ();
            helpButton.Relief = ReliefStyle.None;
            helpButton.Image = new Gtk.Image (Gtk.Stock.Help, IconSize.Menu);
            helpButton.TooltipText = "Show help panel";
            helpButton.Clicked += delegate {
                ShowHelp = helpButton.Active;
                //MonoDevelop.Core.PropertyService.Set (PROP_HELP_KEY, helpButton.Active);
            };
            toolbar.Insert (helpButton, 3);

            #endregion

            vpaned = new VPaned ();

            tree = new PropertyGridTree (editorManager, this);
            tree.Changed += delegate {
                Update ();
            };

            VBox tbox = new VBox ();
            toolbarSeparator = new HSeparator ();
            toolbarSeparator.Visible = true;
            tbox.PackStart (toolbarSeparator, false, false, 0);
            tbox.PackStart (tree, true, true, 0);
            helpSeparator = new HSeparator ();
            tbox.PackStart (helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1 (tbox, true, true);

            AddPropertyTab (new DefaultPropertyTab ());
            AddPropertyTab (new EventPropertyTab ());

            base.PackEnd (vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            //helpButton.Active = ShowHelp = MonoDevelop.Core.PropertyService.Get<bool> (PROP_HELP_KEY, true);

            Populate ();
            UpdateTabs ();
        }
 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);
 }
        internal void Initialize(Widget container, EditorManager editorManager, PropertyDescriptor property, object obj)
        {
            this.container = container;
            this.editorManager = editorManager;

            layout = new Pango.Layout (container.PangoContext);
            layout.Width = -1;

            Pango.FontDescription des = container.Style.FontDescription.Copy();
            layout.FontDescription = des;

            this.property = property;
            this.obj = obj;
            Initialize ();
        }
예제 #8
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
            Gdk.Pixbuf pixbuf = null;
//			try {
//				pixbuf = new Gdk.Pixbuf (typeof (PropertyGrid).Assembly, "MonoDevelop.Components.PropertyGrid.SortByCat.png");
//			} catch {}
            //(Exception e) {
            //LoggingService.LogError ("Can't create pixbuf from resource: MonoDevelop.Components.PropertyGrid.SortByCat.png", e);
            //}
            if (pixbuf != null)
            {
                catButton.Image = new Gtk.Image(pixbuf);
                catButton.Image.Show();
            }
            catButton.TooltipText = "Sort in categories";
            catButton.Toggled    += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton = new RadioButton(catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new Gtk.Image(Stock.SortAscending, IconSize.Menu);
            alphButton.Image.Show();
            alphButton.TooltipText = "Sort alphabetically";
            alphButton.Clicked    += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            toolbar.Insert(new SeparatorToolItem(), 2);
            helpButton             = new ToggleButton();
            helpButton.Relief      = ReliefStyle.None;
            helpButton.Image       = new Gtk.Image(Gtk.Stock.Help, IconSize.Menu);
            helpButton.TooltipText = "Show help panel";
            helpButton.Clicked    += delegate {
                ShowHelp = helpButton.Active;
                //MonoDevelop.Core.PropertyService.Set (PROP_HELP_KEY, helpButton.Active);
            };
            toolbar.Insert(helpButton, 3);

            #endregion

            vpaned = new VPaned();

            tree          = new PropertyGridTree(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(tree, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            //helpButton.Active = ShowHelp = MonoDevelop.Core.PropertyService.Get<bool> (PROP_HELP_KEY, true);

            Populate();
            UpdateTabs();
        }
예제 #9
0
 public void AddPropertyEditor(Type editType, Type editorType)
 {
     EditorManager.AddEditor(editType, editorType);
 }