Exemplo n.º 1
0
        void AddItem(ComponentIndexFile ifile, ItemToolboxNode co)
        {
            Xwt.Drawing.Image img = co.Icon != null?co.Icon.WithSize(16, 16) : null;

            if (showCategories)
            {
                TreeIter it;
                bool     found = false;
                if (store.GetIterFirst(out it))
                {
                    do
                    {
                        if (co.Category == (string)store.GetValue(it, ColName))
                        {
                            found = true;
                            break;
                        }
                    }while (store.IterNext(ref it));
                }
                if (!found)
                {
                    it = store.AppendValues(false, co.Category, string.Empty, string.Empty, string.Empty, null, null, false, (int)Pango.Weight.Bold);
                }
                store.AppendValues(it, currentItems.ContainsKey(co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
            }
            else
            {
                store.AppendValues(currentItems.ContainsKey(co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
            }
        }
		void AddItem (ComponentIndexFile ifile, ItemToolboxNode co)
		{
			Gdk.Pixbuf img = co.Icon != null ? co.Icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear) : null;
			if (showCategories) {
				TreeIter it;
				bool found = false;
				if (store.GetIterFirst (out it)) {
					do {
						if (co.Category == (string) store.GetValue (it, ColName)) {
							found = true;
							break;
						}
					}
					while (store.IterNext (ref it));
				}
				if (!found)
					it = store.AppendValues (false, co.Category, string.Empty, string.Empty, string.Empty, null, null, false, (int)Pango.Weight.Bold);
				store.AppendValues (it, currentItems.ContainsKey (co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
			}
			else
				store.AppendValues (currentItems.ContainsKey (co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
		}