Ejemplo n.º 1
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;
		}
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
        protected override void Render(Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags)
        {
            int width, height;

            GetCellSize(widget, (int)(cell_area.Width - this.Xpad * 2), out width, out height);

            int x = (int)(cell_area.X + this.Xpad);
            int y = cell_area.Y + (cell_area.Height - height) / 2;

            StateType state;

            if (!sensitive)
            {
                state = StateType.Insensitive;
            }
            else if ((flags & CellRendererState.Selected) != 0)
            {
                state = StateType.Selected;
            }
            else
            {
                state = StateType.Normal;
            }

            if (IsGroup)
            {
                TreeGroup grp = new TreeGroup();
                grp.X     = x;
                grp.Y     = y;
                grp.Group = Text;
                grp.State = state;
                InternalTree tree = (InternalTree)widget;
                tree.Groups.Add(grp);
            }
            else
            {
                window.DrawLayout(widget.Style.TextGC(state), x, y, layout);
                int    bx = background_area.X + background_area.Width - 1;
                Gdk.GC gc = new Gdk.GC(window);
                gc.RgbFgColor = tree.Style.MidColors [(int)Gtk.StateType.Normal];
                window.DrawLine(gc, bx, background_area.Y, bx, background_area.Y + background_area.Height);
            }
        }