Exemplo n.º 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);
            }
Exemplo n.º 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;
        }
Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 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)); };
		}
Exemplo n.º 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;
 }
Exemplo n.º 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"));
        }
Exemplo n.º 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");
	    }
Exemplo n.º 9
0
 void OnNodeChanged(object o, EventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowChanged (PathFromNode (o as DocNode), IterFromNode (o as DocNode));
 }
Exemplo n.º 10
0
 void OnChildRemoved(object o, NodeEventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowDeleted (PathFromNode (args.Node));
 }
Exemplo n.º 11
0
 void OnChildAdded(object o, NodeEventArgs args)
 {
     TreeModelAdapter adapter = new TreeModelAdapter (this);
     adapter.EmitRowInserted (PathFromNode (args.Node), IterFromNode (args.Node));
 }
Exemplo n.º 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);
			}
Exemplo n.º 13
0
 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"));
     };
 }