예제 #1
0
            public NodeStoreImplementor(Type node_type)
            {
                // Create a random stamp for the iters
                Random RandomStampGen = new Random();

                this.Stamp = RandomStampGen.Next(int.MinValue, int.MaxValue);

                ScanType(node_type);

                model_adapter = new Gtk.TreeModelAdapter(this);
            }
예제 #2
0
        public CustomTreeModel(ITreeDataSource source)
        {
            this.source = source;
            adapter     = new Gtk.TreeModelAdapter(this);
            colTypes    = source.ColumnTypes;

            source.NodeChanged    += HandleNodeChanged;
            source.NodeDeleted    += HandleNodeDeleted;
            source.NodeInserted   += HandleNodeInserted;
            source.NodesReordered += HandleNodesReordered;
        }
예제 #3
0
		public CustomListModel (IListDataSource source, Gtk.Widget w)
		{
			parent = w;
			this.source = source;
			adapter = new Gtk.TreeModelAdapter (this);
			colTypes = source.ColumnTypes;
			source.RowChanged += HandleRowChanged;
			source.RowDeleted += HandleRowDeleted;
			source.RowInserted += HandleRowInserted;
			source.RowsReordered += HandleRowsReordered;
		}
예제 #4
0
		public CustomTreeModel (ITreeDataSource source)
		{
			this.source = source;
			adapter = new Gtk.TreeModelAdapter (this);
			colTypes = source.ColumnTypes;
			
			source.NodeChanged += HandleNodeChanged;
			source.NodeDeleted += HandleNodeDeleted;
			source.NodeInserted += HandleNodeInserted;
			source.NodesReordered += HandleNodesReordered;
		}
예제 #5
0
		public StatList (ProfilerEventHandler data, DisplayOptions options) : base ()
		{
			store = new StatStore (data, options);
			Model = new TreeModelAdapter (store);
			Selection.SelectPath (new TreePath ("0"));
			AppendColumn ("Percent", new CellRendererText (), "text", 1);
			TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
			AppendColumn (col);
			ExpanderColumn = col;
			options.Changed += delegate { Model = new TreeModelAdapter (new StatStore (data, options)); };
		}
예제 #6
0
 public CustomListModel(IListDataSource source, Gtk.Widget w)
 {
     parent                = w;
     this.source           = source;
     adapter               = new Gtk.TreeModelAdapter(this);
     colTypes              = source.ColumnTypes;
     source.RowChanged    += HandleRowChanged;
     source.RowDeleted    += HandleRowDeleted;
     source.RowInserted   += HandleRowInserted;
     source.RowsReordered += HandleRowsReordered;
 }
예제 #7
0
        public DocTree(string catalog_dir)
        {
            DocNode node = Catalog.Load (catalog_dir);
            if (node == null)
                throw new ArgumentException ("node");

            HeadersVisible = false;
            store = new CatalogStore (node);
            Model = new TreeModelAdapter (store);
            AppendColumn ("Name", new CellRendererText (), "text", 0);
            Selection.Changed += new EventHandler (OnSelectionChanged);
            ExpandToPath (new TreePath ("0"));
        }
예제 #8
0
        public LocationsBox (Locations locations, UIManager uiManager)
		: this(new Builder("locations_box.ui"))
        {
			Locations = locations;
			
			// create the actions
			Gtk.Action create = new Gtk.Action("createLocation","Create Location","",Stock.Add);
			create.Activated += OnCreateLocation;
			Gtk.Action delete = new Gtk.Action("deleteLocation","Delete Location","",Stock.Remove);
			delete.Activated += OnDeleteLocation;
			Gtk.Action gotoItem = new Gtk.Action("gotoLocationItem","Goto Item","",Stock.GoForward);
			gotoItem.Activated += OnGotoLocationItem;
			Gtk.Action action = new Gtk.Action("location","Location");
			
			ActionGroup group = new ActionGroup("location");
			group.Add(create);
			group.Add(delete);
			group.Add(gotoItem);
			group.Add(action);
			uiManager.InsertActionGroup(group,0);
			
			// create item column with id
			TreeViewColumn col = new TreeViewColumn ();
			locationsItemColumn = col;
			col.Title = "Item";
			col.Expand = true;
			CellRenderer render;
			render = new CellRendererPixbuf ();
			col.PackStart (render, false);
			col.AddAttribute (render, "pixbuf", 1);
			render = new CellRendererText ();
			(render as CellRendererText).Editable = true;
			render.EditingStarted += OnStartLocationItemEdit;
			col.PackStart (render, true);
			col.AddAttribute (render, "text", 2);
			locationsView.AppendColumn(col);
			locationsView.AppendColumn ("ID", new Gtk.CellRendererText (), "text", 3);
			
			// create the labeled column
			col = new TreeViewColumn ();
			col.Title = "Labeled";
			render = new CellRendererToggle ();
			(render as CellRendererToggle).Toggled += OnLabeledToggle;
			col.PackStart (render, false);
			col.AddAttribute (render, "active", 4);
			col.AddAttribute (render, "activatable", 5);
			locationsView.AppendColumn(col);
			
			// create the amount column
			col    = new TreeViewColumn ();
			col.Title = "Amount";
			render = new CellRendererSpin ();
			(render as CellRendererText).Editable = true;
			(render as CellRendererText).Edited += OnAmountEdited;		
			Adjustment adj = new Adjustment(0, 0, 0, 0, 0, 0);  //set all limits etc to 0
			adj.Upper = 1000000000;  // assign some special values, that aren't 0
			adj.PageIncrement = 10;
			adj.StepIncrement = 1;
			(render as CellRendererSpin).Adjustment = adj;
			col.PackStart (render, false);
			col.AddAttribute (render, "text", 6);
			locationsView.AppendColumn (col);
			
			//set model etc
			locations.CollectionChanged += OnLocationCreation;
			TreeModelFilter filter = new LocationsFilter ( new LocationsModel( locations ));
			filter.Model.RowInserted += OnRowInserted;
			filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterLocations);
	 		locationsView.Model = filter;
			locationsView.Reorderable = true;
			
			// create the items chooser completion
			locationCompletion = new LocationItemChooser();
			TreeModel compModel = new TreeModelAdapter( new ItemsModel(locations.Inventory.Items));
			locationCompletion.Model = compModel;
			locationCompletion.MatchFunc = LocationItemCompletionMatch;
			locationCompletion.MinimumKeyLength = 0;
			// add the item info cell renderer to the completion	
			render = new CellRendererText ();
			locationCompletion.PackStart (render, true);
			locationCompletion.AddAttribute (render, "text", 2);
			
			// create the popups
			uiManager.AddUiFromResource("locations_box_menues.xml");
			locationPopup = (Menu) uiManager.GetWidget("/locationPopup");
	    }
예제 #9
0
 void OnNodeChanged(object o, EventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowChanged (PathFromNode (o as DocNode), IterFromNode (o as DocNode));
 }
예제 #10
0
 void OnChildRemoved(object o, NodeEventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowDeleted (PathFromNode (args.Node));
 }
예제 #11
0
 void OnChildAdded(object o, NodeEventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowInserted (PathFromNode (args.Node), IterFromNode (args.Node));
 }
예제 #12
0
			public NodeStoreImplementor (Type node_type)
			{
				// Create a random stamp for the iters
				Random RandomStampGen = new Random ();
				this.Stamp = RandomStampGen.Next (int.MinValue, int.MaxValue);

				ScanType (node_type);

				model_adapter = new Gtk.TreeModelAdapter (this);
			}
예제 #13
0
파일: StackView.cs 프로젝트: mono/emveepee
 public StackList(ProfileData data, DisplayOptions options)
     : base()
 {
     store = new Store (data, options);
     Model = new TreeModelAdapter (store);
     Selection.SelectPath (new TreePath ("0"));
     AppendColumn ("Percent", new CellRendererText (), "text", 1);
     TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
     AppendColumn (col);
     ExpanderColumn = col;
     options.Changed += delegate {
         data.FilteredAssemblies = options.Filters.ToArray ();
         store = new Store (data, options);
         Model = new TreeModelAdapter (store);
         Selection.SelectPath (new TreePath ("0"));
     };
 }