public MassAccrualCreation()
        {
            this.Build ();

            MainClass.ComboAccrualYearsFill (comboYear);

            //Создаем таблицу "Договора"
            ContractsListStore = new Gtk.ListStore (typeof (bool), typeof(int), typeof (string), typeof (string), typeof (string), typeof (string),
                                                    typeof (string), typeof (decimal), typeof (bool), typeof(int));

            CellRendererToggle CellSelect = new CellRendererToggle();
            CellSelect.Activatable = true;
            CellSelect.Toggled += onCellSelectToggled;
            TreeViewColumn SelectColumn = new TreeViewColumn("Выбор", CellSelect, "active", (int)ContractsCol.selected);
            SelectColumn.SetCellDataFunc (CellSelect, new Gtk.TreeCellDataFunc (RenderSelectColumn));

            treeviewContracts.AppendColumn(SelectColumn);
            treeviewContracts.AppendColumn("Номер", new Gtk.CellRendererText (), "text", (int)ContractsCol.number);
            treeviewContracts.AppendColumn("Место", new Gtk.CellRendererText (), "text", (int)ContractsCol.place);
            treeviewContracts.AppendColumn("Арендатор", new Gtk.CellRendererText (), "text", (int)ContractsCol.lessee);
            treeviewContracts.AppendColumn("Дата окончания", new Gtk.CellRendererText (), "text", (int)ContractsCol.end_date);
            treeviewContracts.AppendColumn("Сумма", new Gtk.CellRendererText (), "text", (int)ContractsCol.sum_text);

            ContractsFilter = new Gtk.TreeModelFilter (ContractsListStore, null);
            ContractsFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeContracts);
            treeviewContracts.Model = ContractsFilter;
            treeviewContracts.ShowAll();

            comboMonth.Active = DateTime.Now.Month;
            CalculateSelected ();
        }
        public void Create(List<SimpleColumn> columns)
        {
            try
            {

                System.Type[] columnsTypes = new Type[columns.Count];
                int i = 0;

                foreach (SimpleColumn column in columns)
                {
                    columnsTypes[i++] = column.Type;
                }
                store = new ListStore(columnsTypes);
                filter = new Gtk.TreeModelFilter (store, null);
                filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree);
                treeview.Model = filter;
                //Console.WriteLine("create3");
                i = 0;
                //Console.WriteLine("create4");
                foreach (SimpleColumn column in columns)
                {
                    //Console.WriteLine("COLUMN TYPE=" + column.Type.ToString());
                    if (column.Type == typeof(Gdk.Pixbuf))
                    {
                        //Console.WriteLine("create5 loop");
                        TreeViewColumn tc = treeview.AppendColumn ("", new CellRendererPixbuf (), "pixbuf", i++);
                        //Console.WriteLine("create6 loop");
                        if (tc != null)
                            tc.Visible = column.Visible;
                    }
                    else if (column.Type == typeof(System.Object))
                    {
                        Gtk.TreeViewColumn objColumn = new Gtk.TreeViewColumn ();
                        objColumn.Title = column.Name;
                        Gtk.CellRendererText objCell = new Gtk.CellRendererText ();
                        objColumn.PackStart (objCell, true);
                        objColumn.SetCellDataFunc (objCell, new Gtk.TreeCellDataFunc (RenderObject));

                        treeview.AppendColumn(objColumn);
                        //TreeViewColumn tc = treeview.AppendColumn ("", new CellRendererPixbuf (), "object", i++);
                        //tc.Visible = column.Visible;
                    }
                    else
                    {

                        //Console.WriteLine("create 7 loop:" + column.Name);
                        if (treeview == null)
                            treeview = new Gtk.TreeView();
                        TreeViewColumn tc = treeview.AppendColumn (column.Name, new CellRendererText (), "text", i++);
                        //Console.WriteLine("create8 loop");
                        if (tc != null)
                            tc.Visible = column.Visible;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Create exception:" + ex.Message + ex.StackTrace);
            }
        }
        public QueueableSourceComboBox(string source_name)
        {
            // FIXME: Would probably be nice to use this, but variable
            // width reporting in SourceRowRenderer does not work as
            // I would expect, so currently it's forced to 200px wide
            // which causes quite a problem with a UI like Muinshee
            // and the Media Panel
            //
            // SourceRowRenderer renderer = new SourceRowRenderer ();
            // renderer.ParentWidget = this;

            var renderer = new CellRendererText ();
            PackStart (renderer, true);
            SetCellDataFunc (renderer, new CellLayoutDataFunc (
                (layout, cell, model, iter) => renderer.Text = ((Source)model.GetValue (iter, 0)).Name
            ));

            var store = new SourceModel ();
            filter = new TreeModelFilter (store, null);
            filter.VisibleFunc = (model, iter) => IsQueueable (((SourceModel)model).GetSource (iter));
            Model = filter;

            store.Refresh ();

            SetActiveSource (source_name);

            HasTooltip = true;
            QueryTooltip += HandleQueryTooltip;
        }
Exemple #4
0
        public TaskTree(Builder builder)
        {
            builder.Autoconnect (this);

            filter = new TreeModelFilter (tasksList, null);
            filter.VisibleFunc = TasksTreeFilterFunc;
            tasksTreeView.Model = filter;

            tasksTreeView.Selection.Changed += TasksTreeView_Selection_Changed;

            showDoneCheckButton.Toggled += (sender, e) => filter.Refilter ();

            searchTaskButton.Clicked += (sender, e) => filter.Refilter ();

            searchTaskEntry.Activated += (sender, e) => filter.Refilter ();

            var toggleCell = new CellRendererToggle ();
            toggleCell.Toggled += ToggleCell_Toggled;
            AddColumn ("", toggleCell, null, new object[]{ "active", 1 });

            AddColumn ("Title", new CellRendererText (), RenderCell, new Object [] { "text", 2 });
            AddColumn ("Deadline", new CellRendererText (), RenderCell, new Object [] { "text", 3 });
            AddColumn ("Priority", new CellRendererText (), RenderCell, new Object [] { "text", 4 });

            TaskManager.Instance.TaskChanged += TaskChanged;
        }
Exemple #5
0
        public MediaTree()
            : base()
        {
            filter = new TreeModelFilter (store, null);

            this.Model = filter;
            this.RulesHint = true;

            // custom columns for the media tree
            SortColumn col_title = new SortColumn ("Title", new TreeCellDataFunc (renderTitle), this);
            SortColumn col_artist = new SortColumn ("Artist", new TreeCellDataFunc (renderArtist), this);
            SortColumn col_album = new SortColumn ("Album", new TreeCellDataFunc (renderAlbum), this);

            col_title.Clicked += delegate(object o, EventArgs args) {if (thaw) store.SetSortColumnId (0, col_title.SortOrder);};
            col_artist.Clicked += delegate(object o, EventArgs args) {if (thaw) store.SetSortColumnId (1, col_artist.SortOrder);};
            col_album.Clicked += delegate(object o, EventArgs args) {if (thaw) store.SetSortColumnId (2, col_album.SortOrder);};

            this.AppendColumn (col_title);
            this.AppendColumn (col_artist);
            this.AppendColumn (col_album);

            //events
            this.RowActivated += tree_activated;
            this.ButtonReleaseEvent += tree_button_release;
        }
Exemple #6
0
        private void CreateTable()
        {
            //Создаем таблицу "Справочника"
            //Первая колонка всегда ID
            int count = _OrdinalField != "" ? Columns.Count + 1 : Columns.Count;

            System.Type[] Types = new System.Type[count];
            Types[0] = typeof(int);

            for (int i = 1; i < Columns.Count; i++)
            {
                Types[i] = typeof(string);
            }

            if (_OrdinalField != "")
            {
                OrdinalColumn        = count - 1;
                Types[OrdinalColumn] = typeof(int);
            }

            RefListStore = new Gtk.ListStore(Types);

            for (int i = 0; i < Columns.Count; i++)
            {
                if (Columns[i].Name != "")
                {
                    treeviewref.AppendColumn(Columns[i].Name, new Gtk.CellRendererText(), "text", i);
                }
            }

            filter             = new Gtk.TreeModelFilter(RefListStore, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
            treeviewref.Model  = filter;
            treeviewref.ShowAll();
        }
Exemple #7
0
        private Gtk.TreeModelFilter  LoadTree()
        {
            ListStore mModel = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));

            try
            {
                ds.Clear();

                if (File.Exists(SavePath + "GameData.xml"))
                {
                    ds.ReadXml(SavePath + "GameData.xml");
                }

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables["dtGameData"].Rows.Count < 1)
                    {
                        MessageDialog md = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, "No Games have been saved at this time.");
                        md.Run();
                        md.Destroy();
                        this.Visible = false;
                        this.ShowAll();
                        this.Destroy();
                    }

                    foreach (DataRow dr in ds.Tables["dtGameData"].Rows)
                    {
                        DateTime mDate = DateTime.Parse(dr[3].ToString());
                        mModel.AppendValues(dr.ItemArray[0].ToString(), dr.ItemArray[1].ToString(), dr.ItemArray[2].ToString(), mDate.ToShortDateString(), Convert.ToBoolean(dr.ItemArray[4].ToString()));
                    }

                    // Instead of assigning the ListStore model directly to the TreeStore, we create a TreeModelFilter
                    // which sits between the Model (the ListStore) and the View (the TreeView) filtering what the model sees.
                    // Some may say that this is a "Controller", even though the name and usage suggests that it is still part of
                    // the Model.
                    filter = new Gtk.TreeModelFilter(mModel, null);

                    // Specify the function that determines which rows to filter out and which ones to display
                    filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
                }
                else
                {
                    MessageDialog md = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, "No Games have been saved at this time.");
                    md.Run();
                    md.Destroy();
                    this.Visible = false;
                    this.ShowAll();
                    this.Destroy();
                }
            }
            catch (System.Exception ex)
            {
                frmError eForm = new frmError(ex.ToString());
                eForm.Show();
            }
            return(filter);
        }
 static void Modify_cb(IntPtr inst, IntPtr child_model, IntPtr iter, IntPtr value, int column)
 {
     try {
         TreeModelFilter __obj = GLib.Object.GetObject(inst, false) as TreeModelFilter;
         __obj.OnModify(Gtk.TreeModelAdapter.GetObject(child_model, false), Gtk.TreeIter.New(iter), (GLib.Value)Marshal.PtrToStructure(value, typeof(GLib.Value)), column);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        note_store = new NoteStore(basedir);

        preview.ModifyFont(Pango.FontDescription.FromString("Monospace 12"));

        Gtk.TreeViewColumn titleColumn = new Gtk.TreeViewColumn();
        titleColumn.Title = "Title";
        Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
        titleColumn.PackStart(titleCell, true);
        titleColumn.AddAttribute(titleCell, "text", 0);
        titleColumn.SortColumnId = 0;
        titleColumn.Expand       = true;
        filenames.AppendColumn(titleColumn);

/*
 *      if (false) {
 *          Gtk.TreeViewColumn filenameColumn = new Gtk.TreeViewColumn ();
 *          filenameColumn.Title = "Filename";
 *          Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
 *          filenameColumn.PackStart(filenameCell, true);
 *          filenameColumn.AddAttribute(filenameCell, "text", 1);
 *          filenameColumn.SortColumnId = 1;
 *          filenames.AppendColumn(filenameColumn);
 *      }
 */

        Gtk.TreeViewColumn dateColumn = new Gtk.TreeViewColumn();
        dateColumn.Title = "Date added";
        Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
        dateColumn.PackStart(dateCell, true);
        dateColumn.SetCellDataFunc(dateCell, this.RenderDate);
        dateColumn.SortColumnId = 2;

        filenames.AppendColumn(dateColumn);

        filename_list = new ListStore(typeof(String), typeof(String), typeof(DateTime), typeof(Note));
        UpdateFiles();

        filename_list.SetSortColumnId(0, SortType.Ascending);

        filter = new Gtk.TreeModelFilter(filename_list, null);

        filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);

        TreeModelSort tm = new TreeModelSort(filter);

        tm.SetSortFunc(2, this.SortDates);
        filenames.Model = tm;

        preview.WrapMode = WrapMode.Word;
        preview.ModifyFont(Pango.FontDescription.FromString("Droid Sans Mono 10"));
        preview.Buffer.Changed += new EventHandler(this.WriteToNotefile);
    }
    public void SetupCharacterTrees()
    {
        #region Skills
        charSkillStore.Clear();

        ECM.ItemDatabase.LoadSkills(charSkillStore);

        skillsFilter = new TreeModelFilter(charSkillStore, null);
        skillsFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleCharSkillsFilter);

        TreeModelSort skillsSorted = new TreeModelSort(skillsFilter);
        skillsSorted.SetSortColumnId(SkillNameColumn, SortType.Ascending);

        trvSkills.Model = skillsSorted;

        Console.WriteLine("Skills Loaded");
        #endregion

        #region Certificates

        certStore.Clear();

        ECM.ItemDatabase.LoadCertificateTree(certStore);

        certFilter = new TreeModelFilter(certStore, null);
        certFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleCharCertFilter);

        TreeModelSort sorted = new TreeModelSort(certFilter);
        sorted.SetSortColumnId(0, SortType.Ascending);

        trvCertificates.Model = sorted;

        Console.WriteLine("Certificates Loaded");
        #endregion

        #region Assets
        assetFilter = new TreeModelFilter(assetStore, null);
        assetFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleCharAssetFilter);

        sorted = new TreeModelSort(assetFilter);
        sorted.SetSortColumnId(0, SortType.Ascending);

        trvAssets.Model = sorted;
        #endregion

        #region Standings
        standingFilter = new TreeModelFilter(standingsStore, null);
        standingFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleCharStandingFilter);

        sorted = new TreeModelSort(standingFilter);
        sorted.SetSortColumnId(3, SortType.Descending);

        trvStandings.Model = sorted;
        #endregion
    }
Exemple #11
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();
        note_store = new NoteStore(basedir);

        preview.ModifyFont(Pango.FontDescription.FromString("Monospace 12"));

        Gtk.TreeViewColumn titleColumn = new Gtk.TreeViewColumn ();
        titleColumn.Title = "Title";
        Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
        titleColumn.PackStart(titleCell, true);
        titleColumn.AddAttribute(titleCell, "text", 0);
        titleColumn.SortColumnId = 0;
        titleColumn.Expand = true;
        filenames.AppendColumn(titleColumn);
        /*
        if (false) {
            Gtk.TreeViewColumn filenameColumn = new Gtk.TreeViewColumn ();
            filenameColumn.Title = "Filename";
            Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
            filenameColumn.PackStart(filenameCell, true);
            filenameColumn.AddAttribute(filenameCell, "text", 1);
            filenameColumn.SortColumnId = 1;
            filenames.AppendColumn(filenameColumn);
        }
        */

        Gtk.TreeViewColumn dateColumn = new Gtk.TreeViewColumn ();
        dateColumn.Title = "Date added";
        Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
        dateColumn.PackStart(dateCell, true);
        dateColumn.SetCellDataFunc(dateCell, this.RenderDate);
        dateColumn.SortColumnId = 2;

        filenames.AppendColumn(dateColumn);

        filename_list = new ListStore(typeof(String), typeof(String), typeof(DateTime), typeof(Note));
        UpdateFiles();

        filename_list.SetSortColumnId(0, SortType.Ascending);

        filter = new Gtk.TreeModelFilter (filename_list, null);

        filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);

        TreeModelSort tm = new TreeModelSort(filter);
        tm.SetSortFunc(2, this.SortDates);
        filenames.Model = tm;

        preview.WrapMode = WrapMode.Word;
        preview.ModifyFont(Pango.FontDescription.FromString("Droid Sans Mono 10"));
        preview.Buffer.Changed += new EventHandler(this.WriteToNotefile);
    }
    void PrepareObject()
    {
        ObjectListStore = new Gtk.ListStore (typeof (int),typeof (string), typeof (string));

        treeviewObjects.AppendColumn("Код", new Gtk.CellRendererText (), "text", 0);
        treeviewObjects.AppendColumn("Название", new Gtk.CellRendererText (), "text", 1);
        treeviewObjects.AppendColumn("Адрес", new Gtk.CellRendererText (), "text", 2);

        ObjectFilter = new Gtk.TreeModelFilter (ObjectListStore, null);
        ObjectFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeObject);
        treeviewObjects.Model = ObjectFilter;
        treeviewObjects.ShowAll();
    }
 static bool Visible_cb(IntPtr inst, IntPtr child_model, IntPtr iter)
 {
     try {
         TreeModelFilter __obj = GLib.Object.GetObject(inst, false) as TreeModelFilter;
         bool            __result;
         __result = __obj.OnVisible(Gtk.TreeModelAdapter.GetObject(child_model, false), Gtk.TreeIter.New(iter));
         return(__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Exemple #14
0
/*
 *              /// <summary>
 *              /// Build a new category list setting from all the categories
 *              /// </summary>
 *              /// <param name="?">
 *              /// A <see cref="System.String"/>
 *              /// </param>
 *              List<string> BuildNewCategoryList ()
 *              {
 *                      List<string> list = new List<string> ();
 *                      TreeModel model;
 *                      IBackend backend = Application.Backend;
 *                      if (backend == null)
 *                              return list;
 *
 *                      model = backend.Categories;
 *                      Gtk.TreeIter iter;
 *                      if (model.GetIterFirst (out iter) == false)
 *                              return list;
 *
 *                      do {
 *                              ICategory cat = model.GetValue (iter, 0) as ICategory;
 *                              if (cat == null || cat is AllCategory)
 *                                      continue;
 *
 *                              list.Add (cat.Name);
 *                      } while (model.IterNext (ref iter) == true);
 *
 *                      return list;
 *              }
 */

        void RebuildCategoryTree()
        {
            if (!backendComboMap.ContainsKey(selectedBackend))
            {
                categoriesTree.Model = null;
                return;
            }

            IBackend backend = backendComboMap [selectedBackend];

            filteredCategories             = new TreeModelFilter(backend.Categories, null);
            filteredCategories.VisibleFunc = FilterFunc;
            categoriesTree.Model           = filteredCategories;
        }
    private void OnSwitchPage(object sender, SwitchPageArgs s)
    {
        OnFilterbarCloseClicked(sender, s);
        int pageNum = ((Gtk.Notebook)sender).Page;

        CurrentIconView  = IconViews[pageNum];
        FilterEntry.Text = "";
        switch (pageNum)
        {
        case 0: man.ArtType = CConfiguration.ArtType.atBackground_gnome; break;

        case 1: man.ArtType = CConfiguration.ArtType.atBackground_other; break;

        case 2: man.ArtType = CConfiguration.ArtType.atBackground_nature; break;

        case 3: man.ArtType = CConfiguration.ArtType.atBackground_abstract; break;

        case 4: man.ArtType = CConfiguration.ArtType.atApplication; break;

        case 5: man.ArtType = CConfiguration.ArtType.atWindowDecoration; break;

        case 6: man.ArtType = CConfiguration.ArtType.atIcon; break;

        case 7: man.ArtType = CConfiguration.ArtType.atGdmGreeter; break;

        case 8: man.ArtType = CConfiguration.ArtType.atSplash; break;

        case 9: man.ArtType = CConfiguration.ArtType.atGtkEngine; break;
        }

        Gtk.TreeIter iter;
        CurrentIconView.Model.GetIterFirst(out iter);
        //Falls noch kein gefüllter Store (und damit noch kein gültiger Iterator -> Stamp==0
        if (iter.Stamp == 0)
        {
            man.GetAllThumbs();
            FillStore(pageNum);
            Gtk.TreeModelFilter filter = new Gtk.TreeModelFilter(CurrentIconView.Model, null);
            filter.VisibleFunc    = new Gtk.TreeModelFilterVisibleFunc(onFilter);
            CurrentIconView.Model = filter;
            CurrentIconView.GrabFocus();
        }
        if (CurrentIconView.SelectedItems.Length > 0)
        {
            man.ThemeIndex = int.Parse(CurrentIconView.SelectedItems[0].ToString());
        }
        FillExtendedSection(man.Theme);
    }
Exemple #16
0
 static void rowsreordered_cb(IntPtr tree_model, IntPtr path_ptr, IntPtr iter_ptr, IntPtr new_order)
 {
     try {
         TreeModelFilter store       = GLib.Object.GetObject(tree_model, false) as TreeModelFilter;
         TreePath        path        = GLib.Opaque.GetOpaque(path_ptr, typeof(TreePath), false) as TreePath;
         TreeIter        iter        = TreeIter.New(iter_ptr);
         int             child_cnt   = store.IterNChildren(iter);
         int[]           child_order = new int [child_cnt];
         Marshal.Copy(new_order, child_order, 0, child_cnt);
         store.OnRowsReordered(path, iter, child_order);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call doesn't return
         throw e;
     }
 }
 public iFolderViewGroup(string name, TreeModelFilter model)
 {
     iFolderViewGroup.CheckThread();
        this.name = name;
        this.model = model;
        items = new Hashtable();
        selection = new iFolderViewGroupSelection(this);
        resizeTableTimeoutID = 0;
        rebuildTableTimeoutID = 0;
        currentWidth = 1;
        bFirstTableBuild = true;
        bVisibleWhenEmpty = true;
        emptyWidget = null;
        this.PackStart(CreateWidgets(), true, true, 0);
        this.Realized +=
     new EventHandler(OnWidgetRealized);
 }
		public ListDisplayWidget() {
			historyBack = new CacheStack<Uri>(CommonUtil.HistoryNumItems, CommonUtil.HistoryTrimNum);
			historyForward = new CacheStack<Uri>(CommonUtil.HistoryNumItems, CommonUtil.HistoryTrimNum);
			
			mainTreeView = new TreeView();
			
			mainTreeView.Selection.Mode = SelectionMode.Multiple;
				TreeViewColumn col = new TreeViewColumn();
				col.Title = "";
				col.Sizing = TreeViewColumnSizing.Autosize;
				mainTreeView.AppendColumn(col);
				CellRendererPixbuf iconCell = new CellRendererPixbuf();
				col.PackStart(iconCell, true);
				col.SetCellDataFunc(iconCell, new TreeCellDataFunc(RenderIcon));
				col2=col = new TreeViewColumn();
				col.Title = "Name";
				col.Sizing = TreeViewColumnSizing.Autosize;
				mainTreeView.AppendColumn(col);
				Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
				col.PackStart(nameCell, true);
				col.SetCellDataFunc(nameCell, new TreeCellDataFunc(RenderFileName));
				nameCell.Edited += fileNameCell_Edited;
				rend = nameCell;
				col = new TreeViewColumn();
				col.Title = "Size";
				mainTreeView.AppendColumn(col);
				Gtk.CellRendererText sizeCell = new Gtk.CellRendererText();
				col.PackStart(sizeCell, true);
				col.SetCellDataFunc(sizeCell, new TreeCellDataFunc(RenderFileSize));
				col = new TreeViewColumn();
				col.Title = "Date";
				mainTreeView.AppendColumn(col);
				Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
				col.PackStart(dateCell, true);
				//col.AddAttribute(dateCell, "text", 2);
				col.SetCellDataFunc(dateCell, new TreeCellDataFunc(RenderFileDateModified));
				listStore = new ListStore(typeof(XeFileInfo));
			//mainTreeView.Model = listStore;
			TreeModelFilter filter = new TreeModelFilter(listStore, null);
			filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterList);
			mainTreeView.Model = filter;
			mainTreeView.RowActivated += new RowActivatedHandler(OnRowActivated);
			
			Add(mainTreeView);
		}
Exemple #19
0
        void SetUpTreeModel()
        {
            store_filter             = new Gtk.TreeModelFilter(manager.Tasks, null);
            store_filter.VisibleFunc = FilterTasks;
            store_sort = new Gtk.TreeModelSort(store_filter);
            store_sort.DefaultSortFunc =
                new Gtk.TreeIterCompareFunc(TaskSortFunc);

            tree.Model = store_sort;

            int cnt = tree.Model.IterNChildren();

            task_count.Text = string.Format(
                Catalog.GetPluralString("Total: {0} task",
                                        "Total: {0} tasks",
                                        cnt),
                cnt);
        }
Exemple #20
0
        public DebugWindow(DebugPlugin plugin)
            : base(Assembly.GetAssembly(typeof(DebugWindow)), "debugplugin.glade", "DebugWindow")
        {
            this.plugin = plugin;

            trafficTreeView.Selection.Changed += SelectionChanged;

            trafficTreeView.AppendColumn("", new CellRendererText(), new TreeCellDataFunc(IconFunc));
            trafficTreeView.AppendColumn("To/From", new CellRendererText(), new TreeCellDataFunc(ToFromFunc));
            trafficTreeView.AppendColumn("Type", new CellRendererText(), new TreeCellDataFunc(TypeFunc));

            store = new ListStore(typeof(MessageInfo));

            filter = new TreeModelFilter(store, null);
            filter.VisibleFunc = filter_VisibleFunc;

            trafficTreeView.Model = filter;

            ListStore networkStore = new ListStore(typeof(string), typeof(Network));
            networkStore.AppendValues("All Networks", null);
            networkComboBox.Model = networkStore;
            networkComboBox.Active = 0;

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded(network);
            }

            Core.NetworkAdded += Core_NetworkAdded;
            Core.NetworkRemoved += Core_NetworkRemoved;

            ReloadMessages();

            enableTrafficLogCheckButton.Active = true;
            plugin.EnableTrafficLog = true;

            ((ToolItem)base.GetWidget("toolbutton2")).Expand = true;

            messageSenderToComboBox.Clear();
            messageSenderToComboBox.Model = new ListStore(typeof(string), typeof(Network), typeof(Node));
            CellRendererText textCell = new CellRendererText();
            messageSenderToComboBox.PackStart(textCell, true);
            messageSenderToComboBox.AddAttribute(textCell, "markup", 0);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestWinForms.MainClass"/> class.
        /// </summary>
        public MainClass()
        {
            // using Styles ( OPTIONAL EXPERIMENTAL BUT WORKING )
            Gtk.Rc.Parse(System.IO.Path.Combine("Properties", "ProcessOut.xml"));

            // Normal stuff to create a tree view
            Gtk.Window window = new Gtk.Window("TreeView Example");
            window.SetSizeRequest(800, 600);
            window.Destroyed += On_WindowDestroyed_callback;

            Gtk.TreeView tree = new Gtk.TreeView();
            window.Add(tree);

            // one Part of the Solution to host column index
            tree.AppendColumn(CreateNewColumn(0, "name", false));
            tree.AppendColumn(CreateNewColumn(1, "id", false));
            tree.AppendColumn(CreateNewColumn(2, "type", true));
            tree.AppendColumn(CreateNewColumn(3, "class", true));
            tree.AppendColumn(CreateNewColumn(4, "parameter", true));
            tree.AppendColumn(CreateNewColumn(5, "others", true));
            Type[] TypeList = Enumerable.Repeat(typeof(string), tree.Columns.Length).ToArray();
            musicListStore = new Gtk.TreeStore(TypeList);

            // some XML stuff to make something usefull
            MainXMLElement = XElement.Load("Properties/Process.xml", LoadOptions.PreserveWhitespace);
            XElement   y     = MainXMLElement.Element("processes");
            XAttribute title = y.Attribute("name");
            TreeIter   iter  = musicListStore.AppendValues(title == null ? y.Name.ToString() : title.Value);

            XElementIndexer.Add(iter, y);

            walkThroughXml(y, musicListStore, iter);

            // using row filter  ( OPTIONAL EXPERIMENTAL BUT WORKING )
            Gtk.TreeModelFilter filter = new Gtk.TreeModelFilter(musicListStore, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);

            tree.Model = filter;

            // Now let us see
            window.ShowAll();
        }
Exemple #22
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();
        wordStore = new ListStore(typeof(string), typeof(string));
        var lexColumn = new TreeViewColumn();
        var cellRendererText = new CellRendererText();
        lexColumn.PackStart(cellRendererText, true);
        lexColumn.AddAttribute(cellRendererText, "text", 0);
        lexColumn.Title = "Con Word";
        wordList.AppendColumn(lexColumn);
        wordListFilter = new TreeModelFilter(wordStore, null);
        wordListFilter.VisibleFunc = SearchFilter;
        wordList.Model = wordListFilter;

        statusbar1.Push(0, "No language loaded");
        currentWord.WordChanged += OnCurrentWordChanged;

        langFileFilter = new FileFilter();
        langFileFilter.AddPattern("*.lang");
    }
        public ContractsProlongation()
        {
            this.Build ();

            //Создаем таблицу "Договора"
            ContractsListStore = new Gtk.ListStore (typeof (bool), // 0 - select
                typeof(int), // 1 - id
                typeof (string), // 2 - number
                typeof (string), // 3 - place
                typeof (string), // 4 - lessee
                typeof (DateTime), // 5 - Start date
                typeof (DateTime), // 6 - End date
                typeof (BadContractChecks), //  7 - Conflict checks
                typeof (int), // 8 - place type id
                typeof (string), // 9 - place number
                typeof (DateTime) // 10 - sign date
            );

            CellRendererToggle CellSelect = new CellRendererToggle();
            CellSelect.Activatable = true;
            CellSelect.Toggled += onCellSelectToggled;
            TreeViewColumn SelectColumn = new TreeViewColumn("Выбор", CellSelect, "active", 0);
            SelectColumn.SetCellDataFunc (CellSelect, new Gtk.TreeCellDataFunc (RenderSelectColumn));

            treeviewContracts.AppendColumn(SelectColumn);
            treeviewContracts.AppendColumn("Номер", new Gtk.CellRendererText (), RenderNumberColumn);
            treeviewContracts.AppendColumn("Место", new Gtk.CellRendererText (), "text", 3);
            treeviewContracts.AppendColumn("Арендатор", new Gtk.CellRendererText (), "text", 4);
            treeviewContracts.AppendColumn("Начало аренды", new Gtk.CellRendererText (), RenderStartDateColumn);
            treeviewContracts.AppendColumn("Окончание", new Gtk.CellRendererText (), RenderEndDateColumn);

            ContractsFilter = new Gtk.TreeModelFilter (ContractsListStore, null);
            ContractsFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeContracts);
            treeviewContracts.Model = ContractsFilter;
            treeviewContracts.ShowAll();

            UpdateContracts ();
            radioChangeMode.Active = true;
        }
 public iFolderViewGroup(string name, TreeModelFilter model, Entry searchEntry)
 {
     this.name = name;
        this.model = model;
        this.searchEntry = searchEntry;
        alreadyDisposed = false;
        items = new Hashtable();
        selection = new iFolderViewGroupSelection(this);
        resizeTableTimeoutID = 0;
        rebuildTableTimeoutID = 0;
        currentWidth = 1;
        bFirstTableBuild = true;
        bVisibleWhenEmpty = true;
        emptyWidget = null;
        emptySearchWidget = null;
        searchTimeoutID = 0;
        searchEntry.Changed +=
     new EventHandler(OnSearchEntryChanged);
        this.PackStart(CreateWidgets(), true, true, 0);
        this.Realized +=
     new EventHandler(OnWidgetRealized);
 }
    public void LoadMarket()
    {
        marketStore.Clear();
        itemStore.Clear();

        ECM.ItemDatabase.LoadMarket(marketStore, itemStore);

        TreeModelSort sortedMarket = new TreeModelSort(marketStore);

        sortedMarket.SetSortColumnId(1, SortType.Ascending);

        trvMarket.Model = sortedMarket;

        marketSearchFilter = new TreeModelFilter(itemStore, null);
        marketSearchFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleMarketSearchFilter);

        TreeModelSort sortedFilter = new TreeModelSort(marketSearchFilter);

        sortedFilter.SetSortColumnId(0, SortType.Ascending);

        trvSearchItems.Model = sortedFilter;

        Console.WriteLine("Market Loaded");
    }
Exemple #26
0
        private void CategorySelectionOnChanged(object sender, EventArgs e)
        {
            int curcat = catList.CurrentCategory;

            if (curcat == 0)
            {
                downloadList.Model = nodeModel;
            }

            TreeModelFilter filter = new Gtk.TreeModelFilter(nodeModel, null);

            // Specify the function that determines which rows to filter out and which ones to display
            if (curcat == 1)
            {
                filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterFinished);
            }
            else
            {
                filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterUnfinished);
            }

            // Assign the filter as our tree's model
            downloadList.Model = filter;
        }
Exemple #27
0
        static void RowsReorderedSignalCallback(IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr gch)
        {
            Gtk.RowsReorderedArgs args = new Gtk.RowsReorderedArgs();
            try {
                GLib.Signal sig = ((GCHandle)gch).Target as GLib.Signal;
                if (sig == null)
                {
                    throw new Exception("Unknown signal GC handle received " + gch);
                }

                TreeModelFilter sender = GLib.Object.GetObject(arg0) as TreeModelFilter;
                args.Args    = new object[3];
                args.Args[0] = arg1 == IntPtr.Zero ? null : (Gtk.TreePath)GLib.Opaque.GetOpaque(arg1, typeof(Gtk.TreePath), false);
                args.Args[1] = Gtk.TreeIter.New(arg2);
                int   child_cnt = arg2 == IntPtr.Zero ? sender.IterNChildren() : sender.IterNChildren((TreeIter)args.Args[1]);
                int[] new_order = new int [child_cnt];
                Marshal.Copy(arg3, new_order, 0, child_cnt);
                args.Args[2] = new_order;
                Gtk.RowsReorderedHandler handler = (Gtk.RowsReorderedHandler)sig.Handler;
                handler(sender, args);
            } catch (Exception e) {
                GLib.ExceptionManager.RaiseUnhandledException(e, false);
            }
        }
Exemple #28
0
        protected TagListTab(Builder builder, IntPtr handle) : base(builder, handle)
        {
            builder.Autoconnect(this);

            foreach (var typeValue in Enum.GetValues(typeof(TagDetails.TagType)))
            {
                TagDetails.TagType type = (TagDetails.TagType)typeValue;
                Gtk.RadioButton    button;

                if (this.typeButtons.Count == 0)
                {
                    button = new Gtk.RadioButton("");
                }
                else
                {
                    button = new Gtk.RadioButton(this.typeButtons [0]);
                }
                button.Label = type.ToString();
                this.typeButtons.Add(button);
                this.TagTypeBox.PackStart(button, true, true, 2);
                button.ShowAll();
                button.CanFocus = false;
                button.Toggled += (sender, e) => {
                    if (!this.loadingTag)
                    {
                        this.SetTagType(type);
                    }
                };
            }

            this.ImpliesTreeView.AppendColumn("Tag", new CellRendererText(), "text", 0);
            this.impliesStore          = new ListStore(typeof(string));
            this.ImpliesTreeView.Model = this.impliesStore;

            this.allTagsStore = new ListStore(typeof(int), typeof(string), typeof(float), typeof(int), typeof(string), typeof(TagDetails));

            AddColumnText("ID", 0);
            AddColumnText("Usage", 3);
            AddColumnText("Tag", 1);
            AddColumnText("Score", 2);
            AddColumnText("Type", 4);

            this.filter             = new TreeModelFilter(this.allTagsStore, null);
            this.filter.VisibleFunc = ((ITreeModel model, TreeIter iter) => {
                if (string.IsNullOrWhiteSpace(this.filterString))
                {
                    return(true);
                }

                lock (model) {
                    string tagString = model.GetValue(iter, 1) as string;
                    if (string.IsNullOrEmpty(tagString))
                    {
                        return(true);
                    }

                    return(tagString.Contains(filterString));
                }
            });

            this.TagTreeView.HeadersClickable = true;
            this.TagTreeView.Model            = this.allTagsStore;  //this.filter;

            this.TagTreeView.CursorChanged += OnTagsCursorChanged;

            this.Sensitive = false;
            BooruApp.BooruApplication.EventCenter.DatabaseLoadStarted   += this.OnDatabaseLoadStarted;
            BooruApp.BooruApplication.EventCenter.DatabaseLoadSucceeded += this.OnDatabaseLoadSucceeded;
            BooruApp.BooruApplication.EventCenter.WillQuit += this.OnWillQuit;
        }
    public TreeViewExample(List <List <String> > tokens)
    {
        // Create a Window
        window = new Gtk.Window("Lista De Tokens");
        window.SetSizeRequest(500, 200);

        // Create an Entry used to filter the tree
        filterEntry = new Gtk.Entry();

        // Fire off an event when the text in the Entry changes
        filterEntry.Changed += OnFilterEntryTextChanged;

        // Create a nice label describing the Entry
        Gtk.Label filterLabel = new Gtk.Label("Token:");

        // Put them both into a little box so they show up side by side
        Gtk.HBox filterBox = new Gtk.HBox();
        filterBox.PackStart(filterLabel, false, false, 5);
        filterBox.PackStart(filterEntry, true, true, 5);

        // Create our TreeView
        Gtk.TreeView tree = new Gtk.TreeView();

        // Create a box to hold the Entry and Tree
        Gtk.VBox box = new Gtk.VBox();

        // Add the widgets to the box
        box.PackStart(filterBox, false, false, 5);
        box.PackStart(tree, true, true, 5);

        window.Add(box);

        // Create a column for the artist name
        Gtk.TreeViewColumn tipoTokenColumn = new Gtk.TreeViewColumn();
        tipoTokenColumn.Title = "TIPO";

        // Create the text cell that will display the artist name
        Gtk.CellRendererText tipoTokenDescriptionCell = new Gtk.CellRendererText();

        // Add the cell to the column
        tipoTokenColumn.PackStart(tipoTokenDescriptionCell, true);

        // Create a column for the song title
        Gtk.TreeViewColumn tokenColumn = new Gtk.TreeViewColumn();
        tokenColumn.Title = "Token";

        // Do the same for the song title column
        Gtk.CellRendererText tokenTitleCell = new Gtk.CellRendererText();
        tokenColumn.PackStart(tokenTitleCell, true);

        // Add the columns to the TreeView
        tree.AppendColumn(tipoTokenColumn);
        tree.AppendColumn(tokenColumn);

        // Tell the Cell Renderers which items in the model to display
        tipoTokenColumn.AddAttribute(tipoTokenDescriptionCell, "text", 0);
        tokenColumn.AddAttribute(tokenTitleCell, "text", 1);

        // Create a model that will hold two strings - Artist Name and Song Title
        this.tokenListStore = new Gtk.ListStore(typeof(string), typeof(string));

        // Add some data to the store
        int c = 1;

        tokens.ForEach(lst =>
        {
            lst.ForEach(x => {
                switch (c)
                {
                case 1:

                    tokenListStore.AppendValues("Entero", x);
                    break;

                case 2:

                    tokenListStore.AppendValues("Decimal", x);
                    break;

                case 3:

                    tokenListStore.AppendValues("Palabra", x);
                    break;

                case 4:

                    tokenListStore.AppendValues("Moneda", x);
                    break;
                }
            });
            c++;
        });


        // Instead of assigning the ListStore model directly to the TreeStore, we create a TreeModelFilter
        // which sits between the Model (the ListStore) and the View (the TreeView) filtering what the model sees.
        // Some may say that this is a "Controller", even though the name and usage suggests that it is still part of
        // the Model.
        filter = new Gtk.TreeModelFilter(tokenListStore, null);

        // Specify the function that determines which rows to filter out and which ones to display
        filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);

        // Assign the filter as our tree's model
        tree.Model = filter;

        // Show the window and everything on it
    }
        ListStore CreateStore()
        {
            store = new ListStore (typeof(string), typeof(Pixbuf), typeof(Pixbuf),
                typeof(Pixbuf), typeof(Project), typeof(bool));

            filter = new TreeModelFilter (store, null);
            filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterTree);
            sort = new TreeModelSort (filter);
            sort.SetSortFunc (COL_DISPLAY_NAME, SortFunc);
            sort.SetSortColumnId (COL_DISPLAY_NAME, SortType.Ascending);
            iconview.Model = sort;
            treeview.Model = sort;
            return store;
        }
 private Widget CreateIconViewPane()
 {
     iFoldersScrolledWindow = new ScrolledWindow();
        iFoldersIconView = new iFolderIconView(iFoldersScrolledWindow);
        myiFoldersFilter = new TreeModelFilter(ifdata.iFolders, null);
        myiFoldersFilter.VisibleFunc = SynchronizedFoldersFilterFunc;
        localGroup = new iFolderViewGroup(Util.GS("iFolders on This Computer"), myiFoldersFilter, SearchEntry);
        iFoldersIconView.AddGroup(localGroup);
        VBox emptyVBox = new VBox(false, 0);
        emptyVBox.BorderWidth = 12;
        Table table = new Table(3, 2, false);
        emptyVBox.PackStart(table, true, true, 0);
        table.RowSpacing = 12;
        table.ColumnSpacing = 12;
        Label l = new Label(
     string.Format("<span size=\"large\">{0}</span>",
       Util.GS("There are no iFolders on this computer.  To set up an iFolder, do one of the following:")));
        table.Attach(l,
        0, 2,
        0, 1,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        Image uploadImg = new Image(Util.ImagesPath("upload48.png"));
        table.Attach(uploadImg,
        0, 1,
        1, 2,
        AttachOptions.Shrink | AttachOptions.Fill,
        0, 0, 0);
        l = new Label(
     string.Format("<span>{0}</span>",
       Util.GS("Select an existing folder on this computer to upload to an iFolder Server")));
        table.Attach(l,
        1, 2,
        1, 2,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        Image downloadImg = new Image(Util.ImagesPath("download48.png"));
        table.Attach(downloadImg,
        0, 1,
        2, 3,
        AttachOptions.Shrink | AttachOptions.Fill,
        0, 0, 0);
        l = new Label(
     string.Format("<span>{0}</span>",
       Util.GS("Select an iFolder on the server to download to this computer")));
        table.Attach(l,
        1, 2,
        2, 3,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        localGroup.EmptyWidget = emptyVBox;
        VBox emptySearchVBox = new VBox(false, 0);
        emptySearchVBox.BorderWidth = 12;
        l = new Label(
     string.Format("<span size=\"large\">{0}</span>",
       Util.GS("No matches found")));
        emptySearchVBox.PackStart(l, true, true, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        localGroup.EmptySearchWidget = emptySearchVBox;
        TargetEntry[] targets =
     new TargetEntry[]
     {
          new TargetEntry ("text/uri-list", 0, (uint) DragTargetType.UriList),
          new TargetEntry ("application/x-root-window-drop", 0, (uint) DragTargetType.RootWindow),
          new TargetEntry ("text/ifolder-id", 0, (uint) DragTargetType.iFolderID)
     };
        Drag.DestSet(iFoldersIconView,
        DestDefaults.All,
        targets,
        Gdk.DragAction.Copy | Gdk.DragAction.Move);
        iFoldersIconView.DragMotion +=
     new DragMotionHandler(OnIconViewDragMotion);
        iFoldersIconView.DragDrop +=
     new DragDropHandler(OnIconViewDragDrop);
        iFoldersIconView.DragDataReceived +=
     new DragDataReceivedHandler(OnIconViewDragDataReceived);
        DomainInformation[] domains = domainController.GetDomains();
        foreach (DomainInformation domain in domains)
        {
     AddServerGroup(domain.ID);
        }
        iFoldersIconView.SelectionChanged +=
     new EventHandler(OniFolderIconViewSelectionChanged);
        iFoldersIconView.BackgroundClicked +=
     new iFolderClickedHandler(OniFolderIconViewBackgroundClicked);
        iFoldersIconView.iFolderClicked +=
     new iFolderClickedHandler(OniFolderClicked);
        iFoldersIconView.iFolderActivated +=
     new iFolderActivatedHandler(OniFolderActivated);
        iFoldersIconView.KeyPressEvent +=
     new KeyPressEventHandler(OniFolderIconViewKeyPress);
        iFoldersScrolledWindow.AddWithViewport(iFoldersIconView);
        return iFoldersScrolledWindow;
 }
		void CreateControl ()
		{
			control = new HPaned ();

			store = new Gtk.TreeStore (typeof (Xwt.Drawing.Image), // image - type
									   typeof (bool),       // read?
									   typeof (TaskListEntry),       // read? -- use Pango weight
									   typeof (string));
			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Type", "store__Read", "store__Task", "store__Description");
			TypeDescriptor.AddAttributes (store, modelAttr);

			TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTasks);
			filter = new TreeModelFilter (store, null);
			filter.VisibleFunc = filterFunct;
			
			sort = new TreeModelSort (filter);
			sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort);
			sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort);
			sort.SetSortFunc (VisibleColumns.File, FileIterSort);
			
			view = new PadTreeView (sort);
			view.ShowExpanders = true;
			view.RulesHint = true;
			view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ());
			AddColumns ();
			LoadColumnsVisibility ();
			view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type;
			view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
			view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File;
			
			sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (view);
			TaskService.Errors.TasksRemoved      += ShowResults;
			TaskService.Errors.TasksAdded        += TaskAdded;
			TaskService.Errors.TasksChanged      += TaskChanged;
			TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
			
			IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
			IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
			
			view.RowActivated += new RowActivatedHandler (OnRowActivated);
			
			iconWarning = ImageService.GetIcon (Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
			iconError = ImageService.GetIcon (Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
			iconInfo = ImageService.GetIcon (Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
			iconEmpty = ImageService.GetIcon (Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);
			
			control.Add1 (sw);
			
			outputView = new LogView { Name = "buildOutput" };
			control.Add2 (outputView);
			
			control.ShowAll ();
			
			control.SizeAllocated += HandleControlSizeAllocated;
			
			bool outputVisible = OutputViewVisible;
			if (outputVisible) {
				outputView.Visible = true;
				logBtn.Active = true;
			} else {
				outputView.Hide ();
			}
			
			sw.SizeAllocated += HandleSwSizeAllocated;
			
			// Load existing tasks
			foreach (TaskListEntry t in TaskService.Errors) {
				AddTask (t);
			}

			control.FocusChain = new Gtk.Widget [] { sw };
		}
    public MainWindow(string profilePath) : base(Gtk.WindowType.Toplevel)
    {
        Build();
        notebook1.Page = 1;

        Config = GuiCompare.Config.GetConfig();

        //
        // Configure the GUI
        //
        info_manager = new InfoManager(this, profilePath);

        treeStore = new Gtk.TreeStore(typeof(string),                          // Name
                                      typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf),  // TypeIcon, StatusIcon
                                      typeof(Gdk.Pixbuf), typeof(string),      // MissingIcon, MissingText
                                      typeof(Gdk.Pixbuf), typeof(string),      // ExtraIcon, ExtraText
                                      typeof(Gdk.Pixbuf), typeof(string),      // ErrorIcon, ErrorText
                                      typeof(Gdk.Pixbuf), typeof(string),      // TodoIcon, TodoText
                                      typeof(Gdk.Pixbuf), typeof(string),      // NiexIcon, NiexText
                                      typeof(ComparisonNode), typeof(string)); // Node, Foreground

        treeFilter             = new Gtk.TreeModelFilter(treeStore, null);
        treeFilter.VisibleFunc = FilterTree;
        tree.Model             = treeFilter;

        // Create a column for the node name
        Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
        nameColumn.Title     = "Name";
        nameColumn.Resizable = true;

        Gtk.CellRendererText   nameCell   = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf typeCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf();

        nameColumn.PackStart(statusCell, false);
        nameColumn.PackStart(typeCell, false);
        nameColumn.PackStart(nameCell, true);

        tree.AppendColumn(nameColumn);

        nameColumn.AddAttribute(nameCell, "text", (int)TreeCol.Name);
        nameColumn.AddAttribute(nameCell, "foreground", (int)TreeCol.Foreground);
        nameColumn.AddAttribute(typeCell, "pixbuf", (int)TreeCol.TypeIcon);
        nameColumn.AddAttribute(statusCell, "pixbuf", (int)TreeCol.StatusIcon);

        // Create a column for the status counts
        Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn();
        countsColumn.Title     = "Counts";
        countsColumn.Resizable = true;

        Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   missingTextCell   = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf extraPixbufCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   extraTextCell     = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf errorPixbufCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   errorTextCell     = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf todoPixbufCell    = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   todoTextCell      = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf niexPixbufCell    = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   niexTextCell      = new Gtk.CellRendererText();

        countsColumn.PackStart(missingPixbufCell, false);
        countsColumn.PackStart(missingTextCell, false);
        countsColumn.PackStart(extraPixbufCell, false);
        countsColumn.PackStart(extraTextCell, false);
        countsColumn.PackStart(errorPixbufCell, false);
        countsColumn.PackStart(errorTextCell, false);
        countsColumn.PackStart(todoPixbufCell, false);
        countsColumn.PackStart(todoTextCell, false);
        countsColumn.PackStart(niexPixbufCell, false);
        countsColumn.PackStart(niexTextCell, false);

        tree.AppendColumn(countsColumn);

        countsColumn.AddAttribute(missingPixbufCell, "pixbuf", (int)TreeCol.MissingIcon);
        countsColumn.AddAttribute(missingTextCell, "text", (int)TreeCol.MissingText);
        countsColumn.AddAttribute(extraPixbufCell, "pixbuf", (int)TreeCol.ExtraIcon);
        countsColumn.AddAttribute(extraTextCell, "text", (int)TreeCol.ExtraText);
        countsColumn.AddAttribute(errorPixbufCell, "pixbuf", (int)TreeCol.ErrorIcon);
        countsColumn.AddAttribute(errorTextCell, "text", (int)TreeCol.ErrorText);
        countsColumn.AddAttribute(todoPixbufCell, "pixbuf", (int)TreeCol.TodoIcon);
        countsColumn.AddAttribute(todoTextCell, "text", (int)TreeCol.TodoText);
        countsColumn.AddAttribute(niexPixbufCell, "pixbuf", (int)TreeCol.NiexIcon);
        countsColumn.AddAttribute(niexTextCell, "text", (int)TreeCol.NiexText);

        CreateTags(AdditionalInfoText.Buffer);

        tree.Selection.Changed += delegate(object sender, EventArgs e) {
            Gtk.TreeIter iter;
            if (tree.Selection.GetSelected(out iter))
            {
                List <string>  msgs     = null;
                ComparisonNode n        = tree.Model.GetValue(iter, (int)TreeCol.Node) as ComparisonNode;
                TextBuffer     buffer   = AdditionalInfoText.Buffer;
                bool           showInfo = false;
                TextIter       textIter = TextIter.Zero;

                buffer.Clear();

                if (!String.IsNullOrEmpty(n.ExtraInfo))
                {
                    showInfo = true;
                    textIter = buffer.StartIter;

                    buffer.InsertWithTagsByName(ref textIter, "Additional information:\n", "bold");
                    InsertWithMarkup(buffer, ref textIter, "\t" + n.ExtraInfo + "\n");
                }

                if (n != null)
                {
                    msgs = n.Messages;
                }
                if (msgs != null && msgs.Count > 0)
                {
                    if (!showInfo)
                    {
                        showInfo = true;
                        textIter = buffer.StartIter;
                    }

                    buffer.InsertWithTagsByName(ref textIter, "Errors:\n", "red", "bold");

                    for (int i = 0; i < msgs.Count; i++)
                    {
                        buffer.InsertWithTagsByName(ref textIter, String.Format("\t{0}: ", i + 1), "bold");
                        InsertWithMarkup(buffer, ref textIter, msgs [i]);
                    }
                }

                if (n != null)
                {
                    msgs = n.Todos;
                }
                if (msgs != null && msgs.Count > 0)
                {
                    if (!showInfo)
                    {
                        showInfo = true;
                        textIter = buffer.StartIter;
                    }

                    buffer.InsertWithTagsByName(ref textIter, "TODO:\n", "green", "bold");
                    for (int i = 0; i < msgs.Count; i++)
                    {
                        buffer.InsertWithTagsByName(ref textIter, String.Format("\t{0}: ", i + 1), "bold");
                        buffer.Insert(ref textIter, msgs [i]);
                    }
                }

                if (showInfo)
                {
                    AdditionalInfoWindow.Visible = true;
                }
                else
                {
                    AdditionalInfoWindow.Visible = false;
                }

                string msdnUrl = n != null ? n.MSDNUrl : null;
                if (!String.IsNullOrEmpty(msdnUrl))
                {
                    Status = GetMSDNVersionedUrl(msdnUrl);
                }
                else
                {
                    Status = String.Empty;
                }
            }
        };

        tree.RowActivated += delegate(object sender, RowActivatedArgs args) {
            Gtk.TreeIter iter;
            if (!tree.Model.GetIter(out iter, args.Path))
            {
                return;
            }

            ComparisonNode n = tree.Model.GetValue(iter, (int)TreeCol.Node) as ComparisonNode;
            if (n == null || String.IsNullOrEmpty(n.MSDNUrl))
            {
                return;
            }

            System.Diagnostics.Process browser = new System.Diagnostics.Process();
            browser.StartInfo.FileName        = GetMSDNVersionedUrl(n.MSDNUrl);
            browser.StartInfo.UseShellExecute = true;
            browser.Start();
        };

        //
        // Load configuration
        //
        ShowMissing.Active = Config.ShowMissing;
        ShowErrors.Active  = Config.ShowErrors;
        ShowExtra.Active   = Config.ShowExtra;
        ShowPresent.Active = Config.ShowPresent;
        ShowTodo.Active    = Config.ShowTodo;

        //
        // Legend
        //
        legendImageOK.Pixbuf      = okPixbuf;
        legendImageError.Pixbuf   = errorPixbuf;
        legendImageNIEX.Pixbuf    = niexPixbuf;
        legendImageMissing.Pixbuf = missingPixbuf;
        legendImageTODO.Pixbuf    = todoPixbuf;
        legendImageExtra.Pixbuf   = extraPixbuf;
    }
Exemple #34
0
        private void SetTreeColumns()
        {
            quantity = new TreeViewColumn ();
            quantity.Title = "Nombre";
            quantityNameCell = new CellRendererText ();
            quantity.PackStart (quantityNameCell, true);

            quantityStore = new ListStore (typeof(ENType));

            treeviewquantities.AppendColumn (quantity);

            quantity.SetCellDataFunc (quantityNameCell, new TreeCellDataFunc (RenderTypeName));

            filter = new TreeModelFilter (quantityStore, null);
            filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterTree);
        }
        public Inventory()
        {
            this.Build();

            treeview_inv.AppendColumn("",new CellRendererPixbuf(),"pixbuf",0);

            Gtk.CellRendererText item_name = new Gtk.CellRendererText();
            renderer = item_name;
            item_name.Editable = true;
            item_name.Edited += new EditedHandler(item_name_Edited);

            col = new MyTreeViewColumn("Name", item_name, "text", 1,true);
            col.setmodel(inventory);

            treeview_inv.InsertColumn(col, 1);

            this.treeview_inv.RowExpanded += new Gtk.RowExpandedHandler(onRowExpanded);
            this.treeview_inv.RowCollapsed += new Gtk.RowCollapsedHandler(onRowCollapsed);
            this.treeview_inv.ButtonPressEvent += new ButtonPressEventHandler(treeview_inv_ButtonPressEvent);

            this.treeview_inv.Selection.Mode = SelectionMode.Multiple;

            filter = new Gtk.TreeModelFilter(inventory, null);
            filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
            treeview_inv.Model = filter;
            treeview_inv.HeadersClickable=true;

            this.inventory.SetSortFunc(0, sortinventoryfunc);
            this.inventory.SetSortColumnId(0, SortType.Ascending);
            this.inventory.SetSortFunc(1, sortinventoryfunc);
            this.inventory.SetSortColumnId(1, SortType.Ascending);

            MainClass.onRegister += new MainClass.register(MainClass_onRegister);
            MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
            if(MainClass.client != null ) { MainClass_onRegister(); }

            this.label_aquired.Text="";
            this.label_createdby.Text="";
            this.label_name.Text="";
            this.label_group.Text="";
            this.label_saleprice.Text="";

            if (MainClass.client != null)
            {
                if (MainClass.client.Network.LoginStatusCode == OpenMetaverse.LoginStatus.Success)
                {
                    inventoryloaded = true;
                    inventory.Clear();
                    populate_top_level_inv();
                }
            }
        }
        private void OnTomboyTrayMenuShown(object sender, EventArgs args)
        {
            // Add in the top tasks
            // TODO: Read the number of todo items to show from Preferences
            int max_size  = 5;
            int list_size = 0;

            Gtk.MenuItem item;

            // Filter the tasks to the ones that are incomplete
            Gtk.TreeModelFilter store_filter =
                new Gtk.TreeModelFilter(TasksApplicationAddin.DefaultTaskManager.Tasks, null);
            store_filter.VisibleFunc = FilterTasks;

            // TODO: Sort the tasks to order by due date and priority
            //   store_sort = new Gtk.TreeModelSort (store_filter);
            //   store_sort.DefaultSortFunc =
            //    new Gtk.TreeIterCompareFunc (TaskSortFunc);

            //   tree.Model = store_sort;

            //   int cnt = tree.Model.IterNChildren ();

            //   task_count.Text = string.Format (
            //    Catalog.GetPluralString("Total: {0} task",
            //       "Total: {0} tasks",
            //       cnt),
            //    cnt);


            // List the top "max_size" tasks
            Gtk.TreeIter          iter;
            Gtk.SeparatorMenuItem separator;

            // Determine whether the icon is near the top/bottom of the screen
            int position;

            //if (!Tomboy.Tray.MenuOpensUpward ())
            position = 0;
            //else
            //	position = tomboy_tray_menu.Children.Length - 7;

            separator = new Gtk.SeparatorMenuItem();
            tomboy_tray_menu.Insert(separator, position++);
            separator.Show();
            top_tasks.Add(separator);

            item = new Gtk.MenuItem(Catalog.GetString("To Do List"));
            tomboy_tray_menu.Insert(item, position++);
            item.ShowAll();
            top_tasks.Add(item);
            item.Activated += OnOpenTodoList;

            if (store_filter.GetIterFirst(out iter))
            {
                do
                {
                    Task task = store_filter.GetValue(iter, 0) as Task;
                    item = new TomboyTaskMenuItem(task);
                    tomboy_tray_menu.Insert(item, list_size + position);
                    item.ShowAll();
                    top_tasks.Add(item);
                    list_size++;
                } while (store_filter.IterNext(ref iter) && list_size < max_size);
            }
        }
Exemple #37
0
        public TaskView(Gtk.TreeModel model, IPreferences preferences)
        {
            if (preferences == null)
            {
                throw new ArgumentNullException("preferences");
            }

            TreeView = new TreeView();

                        #if GTK_2_12
            // set up the timing for the tooltips
            TreeView.Settings.SetLongProperty("gtk-tooltip-browse-mode-timeout", 0, "Tasque:TaskTreeView");
            TreeView.Settings.SetLongProperty("gtk-tooltip-browse-timeout", 750, "Tasque:TaskTreeView");
            TreeView.Settings.SetLongProperty("gtk-tooltip-timeout", 750, "Tasque:TaskTreeView");

            ConnectEvents();
                        #endif

            // TODO: Modify the behavior of the TreeView so that it doesn't show
            // the highlighted row.  Then, also tie in with the mouse hovering
            // so that as you hover the mouse around, it will automatically
            // select the row that the mouse is hovered over.  By doing this,
            // we should be able to not require the user to click on a task
            // to select it and THEN have to click on the column item they want
            // to modify.

            filterTaskList = null;

            modelFilter             = new Gtk.TreeModelFilter(model, null);
            modelFilter.VisibleFunc = FilterFunc;

            modelFilter.RowInserted += OnRowInsertedHandler;
            modelFilter.RowDeleted  += OnRowDeletedHandler;
            Refilter();

            //Model = modelFilter

            TreeView.Selection.Mode = Gtk.SelectionMode.Single;
            TreeView.RulesHint      = false;
            TreeView.HeadersVisible = false;
            TreeView.HoverSelection = true;

            // TODO: Figure out how to turn off selection highlight

            columns = new List <ITaskColumn> ();
            var nodeList = AddinManager.GetExtensionNodes(typeof(ITaskColumn)).Cast <TaskColNode> ();
            var nodes    = new List <TaskColNode> (nodeList);
            foreach (var node in nodes)
            {
                AddColumn(node, nodes);
            }

            rowEditingDictionary = new ConcurrentDictionary <ITaskColumn, TaskRowEditingEventArgs> ();
            columns.Sort((x, y) => x.DefaultPosition.CompareTo(y.DefaultPosition));
            foreach (var col in columns)
            {
                col.Initialize(Model, this, preferences);

                col.CellEditingStarted += (sender, e) => {
                    if (rowEditingDictionary.IsEmpty)
                    {
                        IsTaskBeingEdited = true;
                    }

                    if (!rowEditingDictionary.Any(v => v.Value.ITask == e.ITask))
                    {
                        if (RowEditingStarted != null)
                        {
                            RowEditingStarted(this, e);
                        }
                    }
                    rowEditingDictionary.TryAdd((ITaskColumn)sender, e);
                };

                col.CellEditingFinished += (sender, e) => {
                    TaskRowEditingEventArgs args;
                    rowEditingDictionary.TryRemove((ITaskColumn)sender, out args);
                    if (!rowEditingDictionary.Any(v => v.Value.ITask == e.ITask))
                    {
                        if (RowEditingFinished != null)
                        {
                            RowEditingFinished(this, e);
                        }
                    }

                    if (rowEditingDictionary.IsEmpty)
                    {
                        IsTaskBeingEdited = false;
                    }
                };

                TreeView.AppendColumn(col.TreeViewColumn);
            }
        }
Exemple #38
0
 public TreeViewExample ()
 {
 
     // Create a Window
 
     Gtk.Window window = new Gtk.Window ("TreeView Example");
 
     window.SetSizeRequest (500,200);
 
     window.DeleteEvent+=delegate {Application.Quit();};
 
 
 
     // Create an Entry used to filter the tree
 
     filterEntry = new Gtk.Entry ();
 
 
 
     // Fire off an event when the text in the Entry changes
 
     filterEntry.Changed += OnFilterEntryTextChanged;
 
 
 
     // Create a nice label describing the Entry
 
     Gtk.Label filterLabel = new Gtk.Label ("Search:");
 
 
 
     // Put them both into a little box so they show up side by side
 
     Gtk.HBox filterBox = new Gtk.HBox ();
 
     filterBox.PackStart (filterLabel, false, false, 5);
 
     filterBox.PackStart (filterEntry, true, true, 5);
 
 
 
     // Create our TreeView
 
     Gtk.TreeView tv = new Gtk.TreeView ();
 
 
 
     // Create a box to hold the Entry and Tree
 
     Gtk.VBox box = new Gtk.VBox ();
 
 
 
     // Add the widgets to the box
 
     box.PackStart (filterBox, false, false, 5);
 
     box.PackStart (tv, true, true, 5);
 
 
 
     window.Add (box);
 
 
 
 
 
     //setting up columns and renderers
 
 
 
 
 
     Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn{Title="Name"}; 
 
     Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();        
 
     nameColumn.PackStart (nameCell, true);
 
 
 
 
 
 
 
 
 
     Gtk.TreeViewColumn emailColumn = new Gtk.TreeViewColumn {Title="Email"}; 
 
     Gtk.CellRendererText emailCell = new Gtk.CellRendererText ();
 
     emailColumn.PackStart (emailCell, true);
 
 
 
 
 
 
 
     // Add the columns to the TreeView
 
     tv.AppendColumn (nameColumn);
 
     tv.AppendColumn (emailColumn);
 
 
 
 
 
 
 
     // Tell the Cell Renderers which items in the model to display
 
     nameColumn.AddAttribute (nameCell, "text", 0);
 
     emailColumn.AddAttribute (emailCell, "text", 1);
 
 
 
 
 
 
 
     // Create a model that will hold two strings 
 
     Gtk.TreeStore contacts = new Gtk.TreeStore (typeof (string), typeof (string));
 
 
 
 
 
     // Add some hierarchical data
 
 
 
     Gtk.TreeIter treeiter;
 
 
 
 
 
     //first root
 
     treeiter= contacts.AppendValues("testFRIENDS"); 
 
 
 
         // 2 children of first root
 
         contacts.AppendValues(treeiter, "testOgre", "*****@*****.**");
 
         contacts.AppendValues(treeiter, "testBee", "*****@*****.**");
 
 
 
 
 
 
 
     // second root
 
     treeiter= contacts.AppendValues("RELATIVES"); 
 
 
 
         // 3 children of second root
 
         contacts.AppendValues (treeiter,"Mommy","*****@*****.**");
 
         contacts.AppendValues (treeiter,"Daddy", "*****@*****.**");
 
         contacts.AppendValues (treeiter,"tom", "*****@*****.**");
 
 
 
 
 
 
 
 
 
     filter = new Gtk.TreeModelFilter (contacts, null);
 
 
 
     // Specify the function that determines which rows to filter out and which ones to display
 
     filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree);
 
 
 
     // Assign the filter as our treeview's model
 
     tv.Model = filter;
 
 
 
     // Show the window and everything on it
 
     window.ShowAll ();
 
 }
    void PreparePlaces()
    {
        //Заполняем комбобокс
        ComboWorks.ComboFillReference(comboPlaceType,"place_types", ComboWorks.ListMode.WithAll, false);
        ComboWorks.ComboFillReference(comboPlaceOrg,"organizations", ComboWorks.ListMode.WithAll, false);

        mapIcon = new Gdk.Pixbuf(System.Reflection.Assembly.GetExecutingAssembly (), "LeaseAgreement.icons.map.png");

        //Создаем таблицу "Места"
        PlacesListStore = new Gtk.ListStore (typeof(int), typeof (int), typeof (string),typeof (string),
                                             typeof (string), typeof (int),
                                             typeof (string), typeof (int), typeof (decimal),typeof(Gdk.Pixbuf));

        treeviewPlaces.AppendColumn("", new Gtk.CellRendererPixbuf (), "pixbuf", (int)PlaceCol.icon);
        treeviewPlaces.AppendColumn ("Тип", new Gtk.CellRendererText (), "text", (int)PlaceCol.type_place);
        treeviewPlaces.AppendColumn ("Номер", new Gtk.CellRendererText (), "text", (int)PlaceCol.place_no);
        treeviewPlaces.AppendColumn ("Площадь", new Gtk.CellRendererText (), RenderAreaCellLayout);
        treeviewPlaces.AppendColumn ("Арендатор", new Gtk.CellRendererText (), "text", (int)PlaceCol.lessee);
        treeviewPlaces.AppendColumn ("Организация", new Gtk.CellRendererText (), "text", (int)PlaceCol.org);

        Placefilter = new Gtk.TreeModelFilter (PlacesListStore, null);
        Placefilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreePlace);
        PlaceSort = new TreeModelSort (Placefilter);
        PlaceSort.SetSortFunc ((int)PlaceCol.place_no, PlaceNumberSortFunction);
        PlaceSort.SetSortFunc ((int)PlaceCol.area, AreaSortFunction);
        treeviewPlaces.Model = PlaceSort;
        treeviewPlaces.Columns [1].SortColumnId = (int)PlaceCol.type_place;
        treeviewPlaces.Columns [2].SortColumnId = (int)PlaceCol.place_no;
        treeviewPlaces.Columns [3].SortColumnId = (int)PlaceCol.area;
        treeviewPlaces.Columns [4].SortColumnId = (int)PlaceCol.lessee;
        treeviewPlaces.Columns [5].SortColumnId = (int)PlaceCol.org;
        treeviewPlaces.ShowAll();
    }
Exemple #40
0
        //Filter so that only items with required stock are shown
        protected void OnStockCheckEvent(object sender, System.EventArgs e)
        {
            // reate a TreeModelFilter between the Model (the ListStore) and the View (the TreeView) filtering what the model sees.
            filter = new TreeModelFilter (stockListStore, null);

            // Specify the function that determines which rows to filter out and which ones to display
            filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterTree);

            // Assign the filter as the tree's model
            treeview1.Model = filter;

            //Add to window
            this.ShowAll ();
            filter.Refilter ();
        }
		public KeyBindingsPanel ()
		{
			this.Build ();
			
			keyStore = new TreeStore (typeof (Command), typeof (string), typeof (string), typeof (string), typeof (int), typeof(string), typeof(bool), typeof (bool));
			keyTreeView.Model = filterModel = new TreeModelFilter (keyStore, null);
			filterModel.VisibleColumn = visibleCol;
			
			TreeViewColumn col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Command");
			col.Spacing = 4;
			CellRendererImage crp = new CellRendererImage ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "stock-id", iconCol);
			col.AddAttribute (crp, "visible", iconVisibleCol);
			CellRendererText crt = new CellRendererText ();
			col.PackStart (crt, true);
			col.AddAttribute (crt, "text", labelCol);
			col.AddAttribute (crt, "weight", boldCol);
			keyTreeView.AppendColumn (col);
			
			TreeViewColumn bindingTVCol = new TreeViewColumn ();
			bindingTVCol.Title = GettextCatalog.GetString ("Key Binding");
			CellRendererText bindingRenderer = new CellRendererText ();
			bindingTVCol.PackStart (bindingRenderer, false);
			bindingTVCol.SetCellDataFunc (bindingRenderer, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
				string binding = (model.GetValue (iter, bindingCol) as string) ?? "";
				((CellRendererText)cell).Text = binding.Length > 0
					? KeyBindingManager.BindingToDisplayLabel (binding, false)
					: binding;
			});
			keyTreeView.AppendColumn (bindingTVCol);
			
			keyTreeView.AppendColumn (GettextCatalog.GetString ("Description"), new CellRendererText (), "text", descCol);
			
			keyTreeView.Selection.Changed += OnKeysTreeViewSelectionChange;
			
			accelEntry.KeyPressEvent += OnAccelEntryKeyPress;
			accelEntry.KeyReleaseEvent += OnAccelEntryKeyRelease;
			accelEntry.Changed += delegate {
				UpdateWarningLabel ();
			};
			updateButton.Clicked += OnUpdateButtonClick;

			currentBindings = KeyBindingService.CurrentKeyBindingSet.Clone ();

			schemes = new List<KeyBindingScheme> (KeyBindingService.Schemes);
			schemeCombo.AppendText (GettextCatalog.GetString ("Custom"));
			
			foreach (KeyBindingScheme s in schemes)
				schemeCombo.AppendText (s.Name);

			SelectCurrentScheme ();
			schemeCombo.Changed += OnKeyBindingSchemeChanged;

			searchEntry.Ready = true;
			searchEntry.Visible = true;
			searchEntry.Changed += delegate {
				processedFilterTerms = searchEntry.Entry.Text.Split (new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
					.Select (s => s.ToLower ()).ToArray ();;
				filterChanged = true;
				if (!filterTimeoutRunning) {
					filterTimeoutRunning = true;
					GLib.Timeout.Add (50, delegate {
						if (!filterChanged) {
							if (filterTimeoutRunning)
								Refilter ();
							filterTimeoutRunning = false;
							return false;
						}
						filterChanged = false;
						return true;
					});
				};
			};
			
			//HACK: workaround for MD Bug 608021: Stetic loses values assigned to "new" properties of custom widget
			conflicButton.Label = GettextCatalog.GetString ("_View Conflicts");
			conflicButton.UseUnderline = true;
		}
		public void Initialize (IPadWindow window)
		{
			this.window = window;
			window.PadShown += delegate {
				if (needsReload)
					Refresh ();
			};
			
			DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
			
			errorBtn = new ToggleButton ();
			errorBtn.Active = (bool)PropertyService.Get (showErrorsPropertyName, true);
			string errorTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Error) != EnabledLoggingLevel.Error
				&& (InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Fatal) != EnabledLoggingLevel.Fatal) {
				errorBtn.Sensitive = false;
				errorTipText = GettextCatalog.GetString ("Logging of errors is not enabled");
			} else {
				errorTipText = GettextCatalog.GetString ("Show errors");
			}
			errorBtn.Image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorBtn.Image.Show ();
			errorBtn.Toggled += new EventHandler (FilterChanged);
			errorBtn.TooltipText = errorTipText;
			UpdateErrorsNum();
			toolbar.Add (errorBtn);
			
			warnBtn = new ToggleButton ();
			warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
			string warnTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn) {
				warnBtn.Sensitive = false;
				warnTipText = GettextCatalog.GetString ("Logging of warnings is not enabled");
			} else {
				warnTipText = GettextCatalog.GetString ("Show warnings");
			}
			warnBtn.Image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
			warnBtn.Image.Show ();
			warnBtn.Toggled += new EventHandler (FilterChanged);
			warnBtn.TooltipText = warnTipText;
			UpdateWarningsNum();
			toolbar.Add (warnBtn);
			
			msgBtn = new ToggleButton ();
			msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
			string msgTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info) {
				msgBtn.Sensitive = false;
				msgTipText = GettextCatalog.GetString ("Logging of informational messages is not enabled");
			} else {
				msgTipText = GettextCatalog.GetString ("Show messages");
			}
			msgBtn.Image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
			msgBtn.Image.Show ();
			msgBtn.Toggled += new EventHandler (FilterChanged);
			msgBtn.TooltipText = msgTipText;
			UpdateMessagesNum();
			toolbar.Add (msgBtn);
			
			debugBtn = new ToggleButton ();
			debugBtn.Active = (bool)PropertyService.Get (showDebugPropertyName, true);
			string debugTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug) {
				debugBtn.Sensitive = false;
				debugTipText = GettextCatalog.GetString ("Logging of debug messages is not enabled");
			} else {
				debugTipText = GettextCatalog.GetString ("Show debug");
			}
			debugBtn.Image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
			debugBtn.Image.Show ();
			debugBtn.Toggled += new EventHandler (FilterChanged);
			debugBtn.TooltipText = debugTipText;
			UpdateDebugNum();
			toolbar.Add (debugBtn);
			
			toolbar.Add (new SeparatorToolItem ());
			
			Gtk.Button clearBtn = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu));
			clearBtn.Clicked += new EventHandler (OnClearList);
			toolbar.Add (clearBtn);
			toolbar.ShowAll ();

			// Content
			
			store = new Gtk.ListStore (typeof (Gdk.Pixbuf),      // image - type
			                           typeof (string),          // desc
			                           typeof (string),          // time
			                           typeof (string),          // type string
			                           typeof (LogMessage));     // message

			TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
			filter = new TreeModelFilter (store, null);
            filter.VisibleFunc = filterFunct;
			
			view = new MonoDevelop.Ide.Gui.Components.PadTreeView (new Gtk.TreeModelSort (filter));
			view.RulesHint = true;
			view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
			view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
			view.HeadersClickable = true;
			view.Selection.Mode = SelectionMode.Multiple;
			
			AddColumns ();
			
			sw = new Gtk.ScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (view);
			
			LoggingService.AddLogger (this);
						
			iconWarning = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
			iconError = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
			iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
			iconDebug = sw.RenderIcon (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu, "");
			
			control = sw;
			sw.ShowAll ();
			
			Refresh ();

			store.SetSortFunc ((int)Columns.Time, TimeSortFunc);
			((TreeModelSort)view.Model).SetSortColumnId ((int)Columns.Time, SortType.Descending);
		}
        public PersonWidget()
        {
            this.Build ();

            #region Labelstyle
            //projectTitelLabel.Pattern = "________________________________________________________________________________"; //Unterstreichung - Projekttitel
            Gdk.Color bluecolor = new Gdk.Color (255, 100, 50);
            //dateLabel.ModifyFg (Gtk.StateType.Normal, bluecolor);
            PHeaderLabel.ModifyFont (Pango.FontDescription.FromString ("Calibri, Bold 11"));
            PVHeaderLabel.ModifyFont (Pango.FontDescription.FromString ("Calibri, Bold 11"));
            #endregion

            #region TreeView füllen
            // Create a column for the date name
            Gtk.TreeViewColumn fnameColumn = new Gtk.TreeViewColumn ();
            fnameColumn.Title = "Vorname";

            // Create the text cell that will display the date
            Gtk.CellRendererText fnameTitleCell = new Gtk.CellRendererText ();
            fnameColumn.PackStart (fnameTitleCell, true); // Add the cell to the column

            // Create a column for the description
            Gtk.TreeViewColumn lnameColumn = new Gtk.TreeViewColumn ();
            lnameColumn.Title = "Nachname";
            Gtk.CellRendererText lnameTitleCell = new Gtk.CellRendererText ();
            lnameColumn.PackStart (lnameTitleCell, true);

            // Create a column for the description
            Gtk.TreeViewColumn areaColumn = new Gtk.TreeViewColumn ();
            areaColumn.Title = "Abteilung";
            Gtk.CellRendererText areaTitleCell = new Gtk.CellRendererText ();
            areaColumn.PackStart (areaTitleCell, true);

            // Create a column for the description
            Gtk.TreeViewColumn taskColumn = new Gtk.TreeViewColumn ();
            taskColumn.Title = "Aufgabe";
            Gtk.CellRendererText taskTitleCell = new Gtk.CellRendererText ();
            taskColumn.PackStart (taskTitleCell, true);

            // Create a column for the description
            Gtk.TreeViewColumn typColumn = new Gtk.TreeViewColumn ();
            typColumn.Title = "Typ";
            Gtk.CellRendererText typTitleCell = new Gtk.CellRendererText ();
            typColumn.PackStart (typTitleCell, true);

            Gtk.TreeViewColumn timesColumn = new Gtk.TreeViewColumn ();
            timesColumn.Title = "Schicht";
            Gtk.CellRendererText timesTitleCell = new Gtk.CellRendererText ();
            timesColumn.PackStart (timesTitleCell, true);

            Gtk.TreeViewColumn starttimeColumn = new Gtk.TreeViewColumn ();
            starttimeColumn.Title = "Start";
            Gtk.CellRendererText starttimeTitleCell = new Gtk.CellRendererText ();
            starttimeColumn.PackStart (starttimeTitleCell, true);

            Gtk.TreeViewColumn endtimeColumn = new Gtk.TreeViewColumn ();
            endtimeColumn.Title = "Ende";
            Gtk.CellRendererText endtimeTitleCell = new Gtk.CellRendererText ();
            endtimeColumn.PackStart (endtimeTitleCell, true);

            Gtk.TreeViewColumn emailColumn = new Gtk.TreeViewColumn ();
            emailColumn.Title = "email";
            Gtk.CellRendererText emailTitleCell = new Gtk.CellRendererText ();
            emailColumn.PackStart (emailTitleCell, true);

            Gtk.TreeViewColumn mobileColumn = new Gtk.TreeViewColumn ();
            mobileColumn.Title = "Handy";
            Gtk.CellRendererText mobileTitleCell = new Gtk.CellRendererText ();
            mobileColumn.PackStart (mobileTitleCell, true);

            Gtk.TreeViewColumn teleColumn = new Gtk.TreeViewColumn ();
            teleColumn.Title = "Telefon";
            Gtk.CellRendererText teleTitleCell = new Gtk.CellRendererText ();
            teleColumn.PackStart (teleTitleCell, true);

            // Add the columns to the TreeView
            personalTreeView.AppendColumn (fnameColumn);
            personalTreeView.AppendColumn (lnameColumn);
            personalTreeView.AppendColumn (areaColumn);
            personalTreeView.AppendColumn (taskColumn);
            personalTreeView.AppendColumn (typColumn);
            personalTreeView.AppendColumn (timesColumn);
            personalTreeView.AppendColumn (starttimeColumn);
            personalTreeView.AppendColumn (endtimeColumn);
            personalTreeView.AppendColumn (emailColumn);
            personalTreeView.AppendColumn (mobileColumn);
            personalTreeView.AppendColumn (teleColumn);

            // Tell the Cell Renderers which items in the model to display
            fnameColumn.AddAttribute (fnameTitleCell, "text", 0);
            lnameColumn.AddAttribute (lnameTitleCell, "text", 1);
            areaColumn.AddAttribute(areaTitleCell, "text", 2);
            taskColumn.AddAttribute(taskTitleCell, "text", 3);
            typColumn.AddAttribute(typTitleCell, "text", 4);
            timesColumn.AddAttribute(timesTitleCell, "text", 5);
            starttimeColumn.AddAttribute(starttimeTitleCell, "text", 6);
            endtimeColumn.AddAttribute(endtimeTitleCell, "text", 7);
            emailColumn.AddAttribute(emailTitleCell, "text", 8);
            mobileColumn.AddAttribute(mobileTitleCell, "text", 9);
            teleColumn.AddAttribute(teleTitleCell, "text", 10);

            // Create a model that will hold two strings - Artist Name and Song Title

            // Add some data to the store
            //			workerListStore.AppendValues ("Martin", "Bischof", "Wein", "Aufgabe", "Typ", "Schicht", "Startzeit", "Endzeit", "Email", "Mobile", "Telefon");
            //			workerListStore.AppendValues ("Andreas", "Stark", "Abteilung", "Aufgabe", "Typ", "Schicht", "Startzeit", "Endzeit", "Email", "Mobile", "Telefon");

            List<String[]> workerList = SelectWidget.connection.readWorker(); // PARAMETER neu einfügen!

            foreach (string[] s in workerList) {
                workerListStore.AppendValues (s[0], s[1], s[2], s[3], s[4],s[5], s[6], s[7], s[8], s[9], s[10]);
            }

            //			workerListStore.AppendValues ("Martin", "Bischof", "Wein", "Aufgabe", "Typ", "Schicht", "Startzeit", "Endzeit", "Email", "Mobile", "Telefon");
            //			workerListStore.AppendValues ("Andreas", "Stark", "Abteilung", "Aufgabe", "Typ", "Schicht", "Startzeit", "Endzeit", "Email", "Mobile", "Telefon");

            //			// Assign the model to the TreeView

            personalTreeView.Model = workerListStore;

            // Instead of assigning the ListStore model directly to the TreeStore, we create a TreeModelFilter
            // which sits between the Model (the ListStore) and the View (the TreeView) filtering what the model sees.
            // Some may say that this is a "Controller", even though the name and usage suggests that it is still part of
            // the Model.
            filter = new Gtk.TreeModelFilter (workerListStore, null);

            // Specify the function that determines which rows to filter out and which ones to display
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree);

            // Assign the filter as our tree's model
            personalTreeView.Model = filter;

            #endregion

            #region areaComboBox - Fill areas

            List<String> areaList = SelectWidget.connection.readAreas();
            ListStore ls = new ListStore(typeof(string));
            areaCombobox.Model = ls;

            foreach(string s in areaList)
                ls.AppendValues(s);

            ls.AppendValues ("");
            #endregion

            #region typComboBox - Fill Typ
            List<String> typList = SelectWidget.connection.readTyp();
            ListStore typLS = new ListStore(typeof(string));
            typCombobox.Model = typLS;

            foreach(string s in typList)
                typLS.AppendValues(s);

            typLS.AppendValues("");
            #endregion

            #region taskComboBox - Fill Tasks
            int readAreaID = SelectWidget.connection.readAreaID(areaCombobox.ActiveText);
            if(readAreaID != 0)
            {
                List<String> taskList = SelectWidget.connection.readTasks(readAreaID);
                ListStore taskLS = new ListStore(typeof(string));
                taskCombobox.Model = taskLS;

                foreach(string s in taskList)
                    taskLS.AppendValues(s);

                taskLS.AppendValues("");
            }

            #endregion

            #region timesComboBox - Fill Times
            List<String> timeList = SelectWidget.connection.readTime();
            ListStore timeLS = new ListStore(typeof(string));
            timesCombobox.Model = timeLS;

            foreach(string s in timeList)
                timeLS.AppendValues(s);

            timeLS.AppendValues("");
            #endregion
        }
Exemple #44
0
        /*
        private bool FilterTorrentTree (TreeModel model, TreeIter iter)
        {
            TreeIter labelIter;

            if(!labelTreeView.Selection.GetSelected (out labelIter))
                return true;

         		Download manager = (Download) model.GetValue (iter, 0);
         		if(manager == null)
         			return true;

         		TorrentLabel label = (TorrentLabel) labelListStore.GetValue (labelIter, 0);

         		if(label.torrents == null)
         			return true;

         		if(label.torrents.Contains (manager)){
         			return true;
         		}

         		return false;
        }
        */
        private void BuildPeerTreeView()
        {
            peerTreeView = new PeerTreeView ();
            peerListStore = new ListStore (typeof(PeerId));

            peerFilter = new TreeModelFilter (peerListStore, null);
            peerFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterPeerTree);

            peerTreeView.Model = peerFilter;
            peersScrolledWindow.Add (peerTreeView);
            //peerTreeView.Show ();
        }
Exemple #45
0
		void CreateControl ()
		{
			control = new HPaned ();

			store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type
			                           typeof (bool),       // read?
			                           typeof (Task));       // read? -- use Pango weight

			TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
			filter = new TreeModelFilter (store, null);
			filter.VisibleFunc = filterFunct;
			
			sort = new TreeModelSort (filter);
			sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort);
			sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort);
			sort.SetSortFunc (VisibleColumns.File, FileIterSort);
			
			view = new PadTreeView (sort);
			view.RulesHint = true;
			view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ());
			AddColumns ();
			LoadColumnsVisibility ();
			view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type;
			view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
			view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File;
			
			sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (view);
			TaskService.Errors.TasksRemoved      += DispatchService.GuiDispatch<TaskEventHandler> (ShowResults);
			TaskService.Errors.TasksAdded        += DispatchService.GuiDispatch<TaskEventHandler> (TaskAdded);
			TaskService.Errors.TasksChanged      += DispatchService.GuiDispatch<TaskEventHandler> (TaskChanged);
			TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
			
			IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
			IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
			
			view.RowActivated += new RowActivatedHandler (OnRowActivated);
			
			iconWarning = sw.RenderIcon (Stock.Warning, Gtk.IconSize.Menu, "");
			iconError = sw.RenderIcon (Stock.Error, Gtk.IconSize.Menu, "");
			iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
			
			control.Add1 (sw);
			
			outputView = new LogView ();
			control.Add2 (outputView);
			
			Control.ShowAll ();
			
			control.SizeAllocated += HandleControlSizeAllocated;
			
			bool outputVisible = PropertyService.Get<bool> (outputViewVisiblePropertyName, false);
			if (outputVisible) {
				outputView.Visible = true;
				logBtn.Active = true;
			} else {
				outputView.Hide ();
			}
			
			sw.SizeAllocated += HandleSwSizeAllocated;
			
			// Load existing tasks
			foreach (Task t in TaskService.Errors) {
				AddTask (t);
			}

			control.FocusChain = new Gtk.Widget [] { sw };
		}
 private Widget CreateListViewPane()
 {
     ifolderlistview = new ScrolledWindow();
        iFolderFilter = new TreeModelFilter(ifdata.iFolders, null);
                 iFolderFilter.VisibleFunc = AlliFoldersFilterFunc;
        tv = new ListTreeView(this);
        store = ifdata.iFolders;
        viewstore = new ListStore(typeof (Gdk.Pixbuf), typeof (string), typeof (string), typeof (string), typeof (string), typeof (iFolderHolder));
        tv.Model = viewstore;
        UpdateListViewItems();
                 tv.HeadersVisible = true;
        tv.HeadersClickable = true;
        tv.Reorderable = true;
                 tv.RowActivated += OnRowActivated;
                 tv.AppendColumn ("", new CellRendererPixbuf(), "pixbuf", 0);
                 tv.AppendColumn (Util.GS("iFolder"), new CellRendererText (), "text", 1);
        tv.AppendColumn (Util.GS("Size"), new CellRendererText(), "text", 2);
        tv.AppendColumn (Util.GS("Server"), new CellRendererText(), "text", 3);
        tv.AppendColumn (Util.GS("Status"), new CellRendererText(), "text", 4);
        ifolderlistview.Add(tv);
                 ifolderlistview.ShadowType = Gtk.ShadowType.EtchedIn;
        ifolderlistview.Visible = false;
                 ifolderlistview.Show();
                 return ifolderlistview;
 }
 private void AddServerGroup(string domainID)
 {
     Console.WriteLine("iFolderWindow.AddServerGroup(DomainID: {0})", domainID);
        if (serverGroups.ContainsKey(domainID)) return;
        DomainInformation domain = domainController.GetDomain(domainID);
        if (domain == null) return;
        iFolderServerFilter serverFilter =
     new iFolderServerFilter(domainID, SearchEntry);
        TreeModelFilter treeModelFilter = new TreeModelFilter(ifdata.iFolders, null);
        treeModelFilter.VisibleFunc = serverFilter.FilterFunc;
        iFolderViewGroup group =
     new iFolderViewGroup(
      string.Format(
       Util.GS("iFolders on {0}"),
       domain.Name),
      treeModelFilter,
      SearchEntry);
        serverGroups[domainID] = group;
        serverGroupFilters[domainID] = serverFilter;
        group.VisibleWhenEmpty = false;
        if (bAvailableFoldersShowing)
     iFoldersIconView.AddGroup(group);
 }
Exemple #48
0
        // Icon,Show Name, Full Path, TypFile
        public WorkspaceTree()
        {
            treeView = new TreeView();

            treeView.ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            treeView.KeyReleaseEvent    += delegate(object o, KeyReleaseEventArgs args) {
                if (args.Event.Key == Gdk.Key.Delete)
                {
                    MainClass.MainWindow.DeleteFile();
                }
            };

            //treeView.Model = modelStore = store;

            filter             = new Gtk.TreeModelFilter(store, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
            treeView.Model     = filter;

            treeView.HeadersVisible = true;
            //this.ExpandAll();
            treeView.Selection.Mode     = Gtk.SelectionMode.Single;
            treeView.RowActivated      += OnRowActivate;
            treeView.Selection.Changed += OnRowSelection;
            treeView.ShowExpanders      = true;

            //	TreeViewColumn display_column.PackStart (text_render, true);

            CellRendererPixbuf crp = new CellRendererPixbuf();

            crp.Ypad   = 0;
            crp.Yalign = 0;

            Gtk.CellRendererText fileNameRenderer = new Gtk.CellRendererText();
            fileNameRenderer.Ypad = 0;

            TreeViewColumn icon_column = new TreeViewColumn();            //("Icon", crp, "pixbuf", ICO_ROW);

            icon_column.PackStart(crp, false);
            icon_column.AddAttribute(crp, "pixbuf", ICO_ROW);

            icon_column.PackStart(fileNameRenderer, true);
            icon_column.AddAttribute(fileNameRenderer, "markup", NAME_ROW);


            treeView.AppendColumn(icon_column);

            //treeView.AppendColumn("Icon", crp, "pixbuf", ICO_ROW);

            treeView.AppendColumn("Name", fileNameRenderer, "text", NAME_ROW);
            treeView.Columns[NAME_ROW].Visible = false;

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.Ypad = 0;

            treeView.AppendColumn("FullPath", textRenderer, "text", PATH_ROW);
            treeView.Columns[PATH_ROW].Visible = false;
            treeView.HeadersVisible            = false;
            treeView.EnableTreeLines           = true;
            treeView.HoverExpand    = false;
            treeView.HoverSelection = false;

            treeView.Columns[NAME_ROW].SetCellDataFunc(fileNameRenderer, new Gtk.TreeCellDataFunc(RenderFileNme));

            sw.ShadowType = ShadowType.Out;
            sw.Add(treeView);

            this.PackEnd(sw, true, true, 0);

            Toolbar toolbar = new Toolbar();

            refreshButton             = new ToolButton("refresh.png"); //Stock.Home);
            refreshButton.IsImportant = true;
            refreshButton.Label       = MainClass.Languages.Translate("menu_refresh");
            refreshButton.BorderWidth = 1;
            refreshButton.Clicked    += delegate {
                MainClass.MainWindow.RefreshProject();
            };
            toolbar.Insert(refreshButton, -1);

            Gtk.Menu menuAdd = new Gtk.Menu();

            MenuItem mi = new MenuItem(MainClass.Languages.Translate("menu_create_file"));

            mi.Activated += delegate(object sender, EventArgs e) {
                NewAction nw = new NewAction();
                nw.Activate();
            };

            menuAdd.Insert(mi, -1);
            mi            = new MenuItem(MainClass.Languages.Translate("menu_create_dir"));
            mi.Activated += delegate(object sender, EventArgs e) {
                NewDirectoryAction nw = new NewDirectoryAction();
                nw.Activate();
            };

            menuAdd.Insert(mi, -1);
            menuAdd.ShowAll();

            mtbCreate             = new MenusToolButton(menuAdd, "file-new.png");
            mtbCreate.IsImportant = true;
            mtbCreate.Label       = "Create";
            toolbar.Insert(mtbCreate, -1);

            if (MainClass.Settings.LogicalSort == null)
            {
                MainClass.Settings.LogicalSort = LogicalSystem.GetDefaultLogicalSystem();
            }

            Gtk.Menu menuFilter = new Gtk.Menu();

            MenuItem menuItemFilter = new MenuItem(MainClass.Languages.Translate("all_files"));

            menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                activetFilter = null;
                filter.Refilter();
                treeView.QueueDraw();
            };
            menuFilter.Insert(menuItemFilter, -1);


            foreach (LogicalSystem ls in MainClass.Settings.LogicalSort)
            {
                LogicalSystem lsTemp = ls;
                menuItemFilter            = new MenuItem(lsTemp.Display);
                menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                    if (lsTemp != null)
                    {
                        activetFilter = lsTemp;
                    }
                    else
                    {
                        activetFilter = null;
                    }
                    filter.Refilter();
                    treeView.QueueDraw();
                };
                menuFilter.Insert(menuItemFilter, -1);
                //filterModel.AppendValues(ls.Display, "", ls);
            }
            menuFilter.ShowAll();

            MenusToolButton mtbFilter = new MenusToolButton(menuFilter, "filter.png");

            mtbFilter.IsImportant = true;
            mtbFilter.Label       = "Filter";
            toolbar.Insert(mtbFilter, -1);
            this.PackStart(toolbar, false, false, 0);
            //this.PackStart(ComboFilter, false, false, 0);
            //ComboFilter.Active = 0;
        }
    void PrepareContract()
    {
        //Заполняем комбобокс
        ComboWorks.ComboFillReference(comboContractOrg, "organizations", ComboWorks.ListMode.WithAll, false);
        ComboWorks.ComboFillReference(comboContractPlaceT,"place_types", ComboWorks.ListMode.WithAll, false);

        //Создаем таблицу "Договора"
        ContractListStore = new Gtk.ListStore (typeof (int), 	//0 - ID
                                               typeof (bool),	//1 - active
                                               typeof (string),	//2 - number
                                               typeof (int),	//3 - Id org
                                               typeof (string), //4 - org
                                               typeof (int),	//5 - Id place type
                                               typeof (string), //6 - place number
                                               typeof (string), //7 - place
                                               typeof (int), 	//8 - id leesse
                                               typeof (string),	//9 - lesse
                                               typeof (DateTime)	//10 - end date
                                               );

        treeviewContract.AppendColumn("Актив.", new Gtk.CellRendererToggle (), "active", (int)ContractCol.active);
        treeviewContract.AppendColumn("Номер", new Gtk.CellRendererText (), "text", (int)ContractCol.number);
        treeviewContract.AppendColumn("Организация", new Gtk.CellRendererText (), "text", (int)ContractCol.org);
        treeviewContract.AppendColumn("Место", new Gtk.CellRendererText (), "text", (int)ContractCol.place_no);
        treeviewContract.AppendColumn("Арендатор", new Gtk.CellRendererText (), "text", (int)ContractCol.lessee);
        treeviewContract.AppendColumn("Дата окончания", new Gtk.CellRendererText (), RenderContractEndDateColumn);

        Contractfilter = new Gtk.TreeModelFilter (ContractListStore, null);
        Contractfilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeContract);
        ContractSort = new TreeModelSort (Contractfilter);
        ContractSort.SetSortFunc ((int)ContractCol.number, ContractNumberSortFunction);
        ContractSort.SetSortFunc ((int)ContractCol.place_no, ContractPlaceSortFunction);
        ContractSort.SetSortFunc ((int)ContractCol.end_date, ContractEndDateSortFunction);
        treeviewContract.Model = ContractSort;
        treeviewContract.Columns [1].SortColumnId = (int)ContractCol.number;
        treeviewContract.Columns [2].SortColumnId = (int)ContractCol.org;
        treeviewContract.Columns [3].SortColumnId = (int)ContractCol.place_no;
        treeviewContract.Columns [4].SortColumnId = (int)ContractCol.lessee;
        treeviewContract.Columns [5].SortColumnId = (int)ContractCol.end_date;
        treeviewContract.ShowAll();
    }
Exemple #50
0
        public TaskTreeView(Gtk.TreeModel model)
            : base()
        {
                        #if GTK_2_12
            // set up the timing for the tooltips
            this.Settings.SetLongProperty("gtk-tooltip-browse-mode-timeout", 0, "Tasque:TaskTreeView");
            this.Settings.SetLongProperty("gtk-tooltip-browse-timeout", 750, "Tasque:TaskTreeView");
            this.Settings.SetLongProperty("gtk-tooltip-timeout", 750, "Tasque:TaskTreeView");

            ConnectEvents();
                        #endif

            // TODO: Modify the behavior of the TreeView so that it doesn't show
            // the highlighted row.  Then, also tie in with the mouse hovering
            // so that as you hover the mouse around, it will automatically
            // select the row that the mouse is hovered over.  By doing this,
            // we should be able to not require the user to click on a task
            // to select it and THEN have to click on the column item they want
            // to modify.

            filterCategory = null;

            modelFilter             = new Gtk.TreeModelFilter(model, null);
            modelFilter.VisibleFunc = FilterFunc;

            modelFilter.RowInserted += OnRowInsertedHandler;
            modelFilter.RowDeleted  += OnRowDeletedHandler;

            //Model = modelFilter

            Selection.Mode = Gtk.SelectionMode.Single;
            RulesHint      = false;
            HeadersVisible = false;
            HoverSelection = true;

            // TODO: Figure out how to turn off selection highlight

            Gtk.CellRenderer renderer;

            //
            // Checkbox Column
            //
            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            // Title for Completed/Checkbox Column
            column.Title     = Catalog.GetString("Completed");
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;
            column.Clickable = true;

            renderer = new Gtk.CellRendererToggle();
            (renderer as Gtk.CellRendererToggle).Toggled += OnTaskToggled;
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskToggleCellDataFunc));
            AppendColumn(column);

            //
            // Priority Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Priority Column
            column.Title = Catalog.GetString("Priority");
            //column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.Alignment  = 0.5f;
            column.FixedWidth = 30;
            column.Resizable  = false;
            column.Clickable  = true;

            renderer = new Gtk.CellRendererCombo();
            (renderer as Gtk.CellRendererCombo).Editable = true;
            (renderer as Gtk.CellRendererCombo).HasEntry = false;
            SetCellRendererCallbacks((CellRendererCombo)renderer, OnTaskPriorityEdited);
            Gtk.ListStore priorityStore = new Gtk.ListStore(typeof(string));
            priorityStore.AppendValues(Catalog.GetString("1"));               // High
            priorityStore.AppendValues(Catalog.GetString("2"));               // Medium
            priorityStore.AppendValues(Catalog.GetString("3"));               // Low
            priorityStore.AppendValues(Catalog.GetString("-"));               // None
            (renderer as Gtk.CellRendererCombo).Model      = priorityStore;
            (renderer as Gtk.CellRendererCombo).TextColumn = 0;
            renderer.Xalign = 0.5f;
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskPriorityCellDataFunc));
            AppendColumn(column);

            //
            // Task Name Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Task Name Column
            column.Title = Catalog.GetString("Task Name");
//			column.Sizing = Gtk.TreeViewColumnSizing.Fixed;
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Expand    = true;
            column.Resizable = true;

            // TODO: Add in code to determine how wide we should make the name
            // column.
            // TODO: Add in code to readjust the size of the name column if the
            // user resizes the Task Window.
            //column.FixedWidth = 250;

            renderer = new Gtk.CellRendererText();
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskNameTextCellDataFunc));
            ((Gtk.CellRendererText)renderer).Editable = true;
            SetCellRendererCallbacks((CellRendererText)renderer, OnTaskNameEdited);

            AppendColumn(column);


            //
            // Due Date Column
            //

            //  2/11 - Today
            //  2/12 - Tomorrow
            //  2/13 - Wed
            //  2/14 - Thu
            //  2/15 - Fri
            //  2/16 - Sat
            //  2/17 - Sun
            // --------------
            //  2/18 - In 1 Week
            // --------------
            //  No Date
            // ---------------
            //  Choose Date...

            column = new Gtk.TreeViewColumn();
            // Title for Due Date Column
            column.Title      = Catalog.GetString("Due Date");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.Alignment  = 0f;
            column.FixedWidth = 90;
            column.Resizable  = false;
            column.Clickable  = true;

            renderer = new Gtk.CellRendererCombo();
            (renderer as Gtk.CellRendererCombo).Editable = true;
            (renderer as Gtk.CellRendererCombo).HasEntry = false;
            SetCellRendererCallbacks((CellRendererCombo)renderer, OnDateEdited);
            Gtk.ListStore dueDateStore = new Gtk.ListStore(typeof(string));
            DateTime      today        = DateTime.Now;
            dueDateStore.AppendValues(
                today.ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("Today"));
            dueDateStore.AppendValues(
                today.AddDays(1).ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("Tomorrow"));
            dueDateStore.AppendValues(
                today.AddDays(2).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(3).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(4).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(5).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(6).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(7).ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("In 1 Week"));
            dueDateStore.AppendValues(Catalog.GetString("No Date"));
            dueDateStore.AppendValues(Catalog.GetString("Choose Date..."));
            (renderer as Gtk.CellRendererCombo).Model      = dueDateStore;
            (renderer as Gtk.CellRendererCombo).TextColumn = 0;
            renderer.Xalign = 0.0f;
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(DueDateCellDataFunc));
            AppendColumn(column);



            //
            // Notes Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Notes Column
            column.Title      = Catalog.GetString("Notes");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.FixedWidth = 20;
            column.Resizable  = false;

            renderer = new Gtk.CellRendererPixbuf();
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskNotesCellDataFunc));

            AppendColumn(column);

            //
            // Timer Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Timer Column
            column.Title      = Catalog.GetString("Timer");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.FixedWidth = 20;
            column.Resizable  = false;

            renderer        = new Gtk.CellRendererPixbuf();
            renderer.Xalign = 0.5f;
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskTimerCellDataFunc));

            AppendColumn(column);
        }