Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        void InitTreeDebaters()
        {
            // Init Store
            store = new ListStore(typeof(EditableDebater));
            foreach (Debater d in Tournament.I.Debaters)
            {
                store.AppendValues(new EditableDebater(d));
            }


            // Setup Treeview
            TreeModelFilter modelDebatersFilter = new TreeModelFilter(store, null);

            modelDebatersFilter.VisibleFunc = FilterDebaters;

            TreeModelSort modelDebatersSort = new TreeModelSort(modelDebatersFilter);

            treeDebaters.Model = modelDebatersSort;

            foreach (var col in columns)
            {
                SetupDebaterColumn(col.Key, col.Value.cellRendererType);
            }
            treeDebaters.HeadersClickable = true;
            treeDebaters.Selection.Mode   = SelectionMode.Multiple;

            treeDebaters.Columns[editDebatersSettings.sortCol].SortIndicator = true;
            treeDebaters.Columns[editDebatersSettings.sortCol].SortOrder     = editDebatersSettings.sortOrder;
            modelDebatersSort.SetSortColumnId(editDebatersSettings.sortCol,
                                              editDebatersSettings.sortOrder);

            UpdateDebatersInfo();
        }
Ejemplo n.º 3
0
        private void InitPacketTypeFiltering()
        {
            _treeStoreFilterFilterPacketType = new TreeModelFilter(_treeStoreFilterPacketType, null)
            {
                VisibleFunc = (model, iter) =>
                {
                    var name  = (string)model.GetValue(iter, 2) ?? "";
                    var pktId = (int)model.GetValue(iter, 1);

                    int.TryParse(name, out var nameAsNum);

                    return(name.ToLower().Contains(_typeFilterSearch) || nameAsNum == pktId);
                }
            };

            for (var i = 0; i < _packetTypeFilter.Length; i++)
            {
                _packetTypeFilter[i] = true;
            }

            _packetTypeFilter[48] = false; // ReplayManagerFile
            _packetTypeFilter[61] = false; // AssetsLoadingProgress
            _packetTypeFilter[62] = false; // AssetsLoadingProgress

            foreach (var(pktId, type) in UNetSerializer.ClientIdsByType
                     .Union(UNetSerializer.ServerIdsByType)
                     .SelectMany(pair => pair.Value.Select(s => new Tuple <short, Type>(s, pair.Key)))
                     .Distinct(new FuncEqualityComparer <Tuple <short, Type> >((a, b) => a.Item1 == b.Item1,
                                                                               tuple => tuple.Item1))
                     .OrderBy(i => i.Item1))
            {
                _packetTypeFilterIters[pktId] = _treeStoreFilterPacketType.AppendValues(
                    _packetTypeFilter[pktId] ? "Shown" : "Hidden",
                    (int)pktId,
                    type.Name
                    );
            }

            _treeFilterPacketType.Model            = _treeStoreFilterFilterPacketType;
            _entrycompletionPacketTypeFilter.Model = _treeStoreFilterPacketType;

            AddColumn(_treeFilterPacketType, 0, "State");
            AddColumn(_treeFilterPacketType, 1, "Id");
            AddColumn(_treeFilterPacketType, 2, "Name");

            _buttonPacketFilter.Activated      += PacketFilter_Activated;
            _buttonPacketFilter.Clicked        += PacketFilter_Activated;
            _popoverPacketFilter.Closed        += PacketFilter_Closed;
            _searchEntryPacketType.Changed     += PacketFilterSearch_Changed;
            _treeFilterPacketType.RowActivated += PacketFilter_RowActivated;

            _buttonFilterShowAll.Activated     += (_, __) => PacketFilterToggleAll(false, true);
            _buttonFilterShowAll.Clicked       += (_, __) => PacketFilterToggleAll(false, true);
            _buttonFilterHideAll.Activated     += (_, __) => PacketFilterToggleAll(false, false);
            _buttonFilterHideAll.Clicked       += (_, __) => PacketFilterToggleAll(false, false);
            _buttonFilterShowUnknown.Activated += (_, __) => PacketFilterToggleAll(true, true);
            _buttonFilterShowUnknown.Clicked   += (_, __) => PacketFilterToggleAll(true, true);
            _buttonFilterHideUnknown.Activated += (_, __) => PacketFilterToggleAll(true, false);
            _buttonFilterHideUnknown.Clicked   += (_, __) => PacketFilterToggleAll(true, false);
        }
Ejemplo n.º 4
0
        protected void InitObject(Window pSourceWindow, XPCollection pXPCollection, Type pXPGuidObjectType, Type pDialogType, List <GenericTreeViewColumnProperty> pColumnProperties, bool pShowStatusBar = false)
        {
            SortProperty sortPropertyPermissionItem = new SortProperty("Ord", DevExpress.Xpo.DB.SortingDirection.Ascending);

            CriteriaOperator criteriaOperatorPermissionItem = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");

            _xpCollectionUserPermissionItem    = new XPCollection(GlobalFramework.SessionXpo, _xpObjectTypeUserPermissionItem, criteriaOperatorPermissionItem, sortPropertyPermissionItem);
            _xpCollectionUserPermissionProfile = new XPCollection(GlobalFramework.SessionXpo, _xpObjectTypeUserPermissionProfile, null);

            //Parameters
            _sourceWindow     = pSourceWindow;
            DialogType        = pDialogType;
            _columnProperties = pColumnProperties;
            _showStatusBar    = pShowStatusBar;
            _dataSource       = pXPCollection;

            //Get First Custom Field Position ex OID
            _modelFirstCustomFieldIndex = (_treeViewMode == GenericTreeViewMode.Default) ? 1 : 2;

            //Sorting
            _dataSource.Sorting = FrameworkUtils.GetXPCollectionDefaultSortingCollection();
            //Prepare listStoreModel
            //_listStoreModel = GenericTreeViewModel.XPCollectionToModel(_dataSource, _columnProperties);
            InitDataModel(_dataSource, _columnProperties, GenericTreeViewMode.Default);

            //Assign ListStoreModelFilter with ListStoreModel
            _listStoreModelFilter = new TreeModelFilter(ListStoreModel, null);
            //Assign ListStoreModelFilterSort with ListStoreModelFilter
            _listStoreModelFilterSort = new TreeModelSort(_listStoreModelFilter);

            InitUI();

            LoadRefreshView();
        }
Ejemplo n.º 5
0
        TreeIter ConvertModelIterToStoreIter(TreeIter iter)
        {
            TreeModelSort   sort   = (TreeModelSort)treeDebaters.Model;
            TreeModelFilter filter = (TreeModelFilter)sort.Model;

            return(filter.ConvertIterToChildIter(sort.ConvertIterToChildIter(iter)));
        }
Ejemplo n.º 6
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;
        }
        private Widget CreateFilterWidget()
        {
            VBox filterBox = new VBox();

            Button addResourceButton = new Button("Add new resource");

            addResourceButton.Clicked += OnAddResourceButtonClicked;

            var labelFilter = new Label("Filter by key:");

            _filterByKeyEntry = new Entry();
            _filterByKeyEntry.KeyReleaseEvent += FilterByKeyEntry_KeyReleaseEvent;;
            _filter = new Gtk.TreeModelFilter(_resourcesListStore, null)
            {
                VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterByKeyVisibleFunc)
            };

            HBox filterKeyBox = new HBox();

            filterKeyBox.PackStart(addResourceButton, false, false, 5);
            filterKeyBox.PackStart(labelFilter, false, false, 5);
            filterKeyBox.PackStart(_filterByKeyEntry, false, false, 5);

            filterBox.PackStart(filterKeyBox, false, false, 0);

            return(filterBox);
        }
Ejemplo n.º 8
0
 protected void OnSearchEntryChanged(object sender, EventArgs e)
 {
     filt                   = new TreeModelFilter(documentListStore, null);
     filt.VisibleFunc       = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
     DocumentTreeView.Model = filt;
     filt.Refilter();
 }
Ejemplo n.º 9
0
        private void setTreeColumns()
        {
            nameFood       = new TreeViewColumn();
            nameFood.Title = "Nombre";
            nameCell       = new CellRendererText();
            nameFood.PackStart(nameCell, true);

            quantityFood       = new TreeViewColumn();;
            quantityFood.Title = "Cantidad";
            quantityCell       = new CellRendererText();
            quantityFood.PackStart(quantityCell, true);

            quantityType       = new TreeViewColumn();
            quantityType.Title = "Tipo";
            typeCell           = new CellRendererText();
            quantityType.PackStart(typeCell, true);

            foodStore = new ListStore(typeof(ENFood));

            treeviewFood.AppendColumn(nameFood);
            treeviewFood.AppendColumn(quantityFood);
            treeviewFood.AppendColumn(quantityType);

            nameFood.SetCellDataFunc(nameCell, new TreeCellDataFunc(RenderNameFood));
            quantityFood.SetCellDataFunc(quantityCell, new TreeCellDataFunc(RenderQuantityFood));
            quantityType.SetCellDataFunc(typeCell, new TreeCellDataFunc(RenderTypeFood));

            treeviewFood.EnableTreeLines = true;

            filter             = new TreeModelFilter(foodStore, null);
            filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);

            fillTree();
        }
Ejemplo n.º 10
0
        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 MeeGo 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;
        }
Ejemplo n.º 11
0
    public ClipboardItemListView()
    {
        HeadersVisible = true;

        Selection.Mode = SelectionMode.Multiple;

        int columnId = -1;

        var renderer = new CellRendererText();

        var textColumn = AppendColumn("Items", renderer, "text", 0);

        InitColumn(textColumn, ++columnId);

        var dateTimeColumn = AppendColumn("Created", renderer, SetDateTimeRendererText);

        InitColumn(dateTimeColumn, ++columnId);

        store = new ClipboardItemStore();

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

        modelSort = new TreeModelSort(modelFilter);
        modelSort.SetSortFunc(1, CompareDateTime);

        Model = modelSort;
    }
Ejemplo n.º 12
0
        private void BuildTorrentPage()
        {
            feedCombobox.Model = filterFeedListStore;
            feedCombobox.SetActiveIter(allIter);

            CellRendererText textRenderer = new CellRendererText();

            feedCombobox.PackStart(textRenderer, true);
            feedCombobox.AddAttribute(textRenderer, "text", 0);

            itemListStore = new ListStore(typeof(RssItem));

            TreeViewColumn itemColumn = new TreeViewColumn();

            Gtk.CellRendererText itemCell = new Gtk.CellRendererText();
            itemColumn.Title = "Item";
            itemColumn.PackStart(itemCell, true);
            itemColumn.SetCellDataFunc(itemCell, new Gtk.TreeCellDataFunc(RenderItem));


            itemTreeView.AppendColumn(itemColumn);

            feedfilter             = new TreeModelFilter(itemListStore, null);
            feedfilter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterItemTree);
            itemTreeView.Model     = feedfilter;

            feedCombobox.Changed += OnFeedComboboxChanged;


            //foreach(RssItem item in rssReader.Items){
            //	itemListStore.AppendValues(item);
            //}
            itemTreeView.ButtonPressEvent  += OnItemTreeViewButtonPressEvent;
            itemTreeView.Selection.Changed += OnItemTreeViewSelectionChanged;
        }
            public TemplateTreeView()
            {
                HeadersVisible          = false;
                templateStore           = new ListStore(typeof(TemplateItem));
                Model                   = filterModel = new TreeModelFilter(templateStore, null);
                filterModel.VisibleFunc = FilterFuncWrapper;

                var col = new TreeViewColumn();
                var crp = new CellRendererIcon()
                {
                    StockSize = (uint)Gtk.IconSize.Dnd,
                    Ypad      = 2,
                };

                col.PackStart(crp, false);
                col.SetCellDataFunc(crp, CellDataFuncIcon);

                var crt = new CellRendererText();

                col.PackStart(crt, false);
                col.SetCellDataFunc(crt, CellDataFuncText);

                AppendColumn(col);
                ShowAll();
            }
Ejemplo n.º 14
0
 public void Initialize(ExchangeViewModel vm)
 {
     viewModel = vm;
     filter    = new TreeModelFilter(store, null)
     {
         VisibleFunc = FilterSmallAssets
     };
     nodeview1.Model = filter;
     viewModel.BalanceManager.Balances.CollectionChanged += Balances_CollectionChanged;
     GLib.Timeout.Add(2000, () =>
     {
         TreeIter iter;
         var result = store.GetIterFirst(out iter);
         while (result)
         {
             var value = store.GetValue(iter, 0);
             store.SetValue(iter, 0, value);
             result = store.IterNext(ref iter);
         }
         if (viewModel.BalanceManager.TotalBtc > decimal.Zero)
         {
             colTotalBtc.Title = $"BTC ({viewModel.BalanceManager.TotalBtc.ToString("N3")})";
             colTotalUsd.Title = $"USD ({viewModel.BalanceManager.TotalUsd.ToString("N0")})";
         }
         return(true);
     });
 }
Ejemplo n.º 15
0
        TreePath ConvertStorePathToModelPath(TreePath path)
        {
            TreeModelSort   sort   = (TreeModelSort)treeDebaters.Model;
            TreeModelFilter filter = (TreeModelFilter)sort.Model;

            return(sort.ConvertChildPathToPath(filter.ConvertChildPathToPath(path)));
        }
Ejemplo n.º 16
0
 protected void CreateFilterAndSort()
 {
     filter             = new TreeModelFilter(store, null);
     filter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleFilter);
     sort = new TreeModelSort(filter);
     sort.SetSortFunc(COL_DATA, HandleSort);
     sort.SetSortColumnId(COL_DATA, SortType.Ascending);
     Model = sort;
 }
Ejemplo n.º 17
0
        ListStore CreateStore()
        {
            store = new ListStore(typeof(string), typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf),
                                  typeof(Gdk.Pixbuf), typeof(ProjectDescription));

            filter             = new Gtk.TreeModelFilter(store, null);
            filter.VisibleFunc = new Gtk.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);
        }
Ejemplo n.º 18
0
 public void Fill(List <ProjectDescription> projects)
 {
     projectsList = projects;
     projectsList.Sort();
     projectsListStore.Clear();
     foreach (ProjectDescription project in projectsList)
     {
         projectsListStore.AppendValues(project);
     }
     filter                      = new Gtk.TreeModelFilter(projectsListStore, null);
     filter.VisibleFunc          = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
     treeview.Model              = filter;
     treeview.Selection.Mode     = SelectionMode.Multiple;
     treeview.Selection.Changed += OnSelectionChanged;
 }
Ejemplo n.º 19
0
 public void Initialize(ExchangeViewModel vm)
 {
     viewModel = vm;
     filter    = new TreeModelFilter(store, null)
     {
         VisibleFunc = FilterSymbols
     };
     sorted = new TreeModelSort(filter);
     sorted.SetSortFunc(0, SortBySymbol);
     sorted.SetSortFunc(2, SortByPrice);
     sorted.SetSortFunc(3, SortByPriceChangePercent);
     sorted.SetSortFunc(4, SortByVolume);
     sorted.SetSortColumnId(4, SortType.Ascending);
     nodeview1.Model = sorted;
     viewModel.MarketSummaries.CollectionChanged += MarketSummaries_CollectionChanged;
 }
Ejemplo n.º 20
0
 void InitFilter()
 {
     if (cbSortable.Active)
     {
         treeModelFilter             = new TreeModelFilter(beneficiarioListStore, null);
         treeModelFilter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
         treeModelSort  = new TreeModelSort(treeModelFilter);
         treeView.Model = treeModelSort;
     }
     else
     {
         treeModelFilter             = new TreeModelFilter(beneficiarioListStore, null);
         treeModelFilter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
         treeView.Model = treeModelFilter;
     }
 }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
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;

            var 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));
            var textCell = new CellRendererText();

            messageSenderToComboBox.PackStart(textCell, true);
            messageSenderToComboBox.AddAttribute(textCell, "markup", 0);
        }
Ejemplo n.º 23
0
        public void InitObject(Window pSourceWindow, TreeView pTreeView, TreeModelFilter pListStoreModelFilter, List <GenericTreeViewColumnProperty> pColumnProperties)
        {
            //ByPass Privileges, that dont use Filter, this way we Hide Search too
            if (pListStoreModelFilter != null)
            {
                //Parameters
                _sourceWindow         = pSourceWindow;
                _treeView             = pTreeView;
                _listStoreModelFilter = pListStoreModelFilter;

                //Init Model
                _listStoreModelFilter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
                _columnProperties = pColumnProperties;
                //Init UI
                InitUI();
            }
        }
Ejemplo n.º 24
0
 public TagsTreeWidget()
 {
     this.Build();
     filterTags         = new List <Tag>();
     model              = new Gtk.ListStore(typeof(Play));
     filter             = new Gtk.TreeModelFilter(model, null);
     filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
     treeview.Model     = filter;
     filtercombobox.InsertText((int)FilterType.OR, Catalog.GetString(orFilter));
     filtercombobox.InsertText((int)FilterType.AND, Catalog.GetString(andFilter));
     filtercombobox.Active         = 0;
     filterType                    = FilterType.OR;
     treeview.TimeNodeChanged     += OnTimeNodeChanged;
     treeview.TimeNodeSelected    += OnTimeNodeSelected;
     treeview.PlayListNodeAdded   += OnPlayListNodeAdded;
     treeview.SnapshotSeriesEvent += OnSnapshotSeriesEvent;
 }
Ejemplo n.º 25
0
        public void RefreshList()
        {
            Store = new ListStore(typeof(int), typeof(string), typeof(string), typeof(string), typeof(string),
                                  typeof(int), typeof(int), typeof(int), typeof(int));

            foreach (var tango in _tangoService.List)
            {
                Store.AppendValues(tango.Id, tango.Namae, tango.Furigana, tango.Romaji, tango.Honyaku,
                                   tango.Seen, tango.Answer, tango.Wrong, tango.Ratio);
            }

            _filter = new TreeModelFilter(Store, null)
            {
                VisibleFunc = FilterKanji
            };
            _sort            = new TreeModelSort(_filter);
            _tangoView.Model = _sort;
        }
Ejemplo n.º 26
0
    private void SetTagTreeView()
    {
        ListStore tagstore = new ListStore(typeof(string));

        _tags.Clear();
        foreach (PersistentInformation.Entry entry in
                 PersistentInformation.GetInstance().GetAllTags())
        {
            string tag     = entry.entry1;
            string numpics = entry.entry2;
            _tags.Add(tag);
            tagstore.AppendValues(tag + "(" + numpics + ")");
        }
        _filter                  = new TreeModelFilter(tagstore, null);
        _filter.VisibleFunc      = new TreeModelFilterVisibleFunc(FilterTags);
        iconview1.Model          = _filter;
        iconview1.TextColumn     = 0;
        iconview1.ItemActivated += new ItemActivatedHandler(OnTagClicked);
    }
Ejemplo n.º 27
0
        protected override void OnDestroyed()
        {
            Log.Verbose($"Destroying {GetType ()}");
            ViewModel = null;
            dictionaryStore.Clear();
            dictionaryNestedParent.Clear();
            if (filter != null)
            {
                filter.Dispose();
                filter = null;
            }
            if (sort != null)
            {
                sort.Dispose();
                sort = null;
            }
            base.OnDestroyed();

            Disposed = true;
        }
Ejemplo n.º 28
0
        private MainWindow(Builder builder) : base(builder.GetObject("MainWindow").Handle)
        {
            builder.Autoconnect(this);

            _treeFilterPackets = new TreeModelFilter(_treeStorePackets, null)
            {
                VisibleFunc = FilterPackets
            };

            _treePackets.Model    = _treeFilterPackets;
            _treePacketInfo.Model = _treeStorePacketInfo;
            _treeNetObjects.Model = _treeStoreNetObjects;

//            AddColumn(_treePackets, 0, "internal", false);
            AddColumn(_treePackets, 1, "Dir");
            AddColumn(_treePackets, 2, "Pkt");
            AddColumn(_treePackets, 3, "Seq");
            AddColumn(_treePackets, 4, "Size");
            AddColumn(_treePackets, 5, "Type");
            AddColumn(_treePackets, 6, "Info", cellData: PacketsCellDataFunc);

            AddColumn(_treePacketInfo, 0, "Key");
            AddColumn(_treePacketInfo, 1, "Type");
            AddColumn(_treePacketInfo, 2, "Value");

            AddColumn(_treeNetObjects, 1, "Id");
            AddColumn(_treeNetObjects, 2, "Type");
            AddColumn(_treeNetObjects, 3, "Info");

            DeleteEvent += Window_DeleteEvent;
            _treePackets.Selection.Changed += TreePackets_SelectionChanged;
            _treeNetObjects.RowActivated   += TreeNetObjects_RowActivated;
            _buttonOpenReplay.Activated    += OpenReplay_Activated;
            _buttonOpenReplay.Clicked      += OpenReplay_Activated;
            _buttonOpenFolder.Activated    += OpenFolder_Activated;
            _buttonOpenFolder.Clicked      += OpenFolder_Activated;
            _buttonSettings.Activated      += ButtonSettings_Activated;
            _buttonSettings.Clicked        += ButtonSettings_Activated;

            InitPacketTypeFiltering();
        }
Ejemplo n.º 29
0
        public EntryDialog(IList <EmojiData> data) :
            base(WindowType.Toplevel)
        {
            this.Build();
            this.StatusIcon            = new StatusIcon("thinking.png");
            this.StatusIcon.Tooltip    = "EmojiBoard is running";
            this.StatusIcon.PopupMenu += StatusIcon_PopupMenu;
            ListStore store = new ListStore(typeof(EmojiData));

            this.EmojiView.AppendColumn("Emoji", new CellRendererText(), RenderEmojiData);
            foreach (var emoji in data)
            {
                store.AppendValues(emoji);
            }
            this.searchFilter             = new TreeModelFilter(store, null);
            this.searchFilter.VisibleFunc = new TreeModelFilterVisibleFunc(HandleTreeModelFilterVisibleFunc);
            this.EmojiView.Model          = searchFilter;
            this.EmojiView.Selection.Mode = SelectionMode.Single;

            UIOHook.OnKeyType += UIOHook_OnKeyType;
        }
Ejemplo n.º 30
0
    private void SetupTree()
    {
        treeviewLocalMods.Selection.Changed += TreeView_SelectionChanged;

        var CellRenderer = new CellRendererToggle();

        AddColumn("Active", treeviewLocalMods, CellRenderer, "active", 0);
        CellRenderer.Activatable = true;
        CellRenderer.Toggled    += StateColumn_Clicked;
        AddColumn("Name", treeviewLocalMods, new CellRendererText(), "markup", 1);
        AddColumn("Description", treeviewLocalMods, new CellRendererText(), "text", 2);
        AddColumn("Author", treeviewLocalMods, new CellRendererText(), "text", 3);
        ModListStoreLocal       = new ListStore(typeof(bool), typeof(string), typeof(string), typeof(string), typeof(ModInfoHolder));
        ModFilterLocal          = new TreeModelFilter(ModListStoreLocal, null);
        ModSortLocal            = new TreeModelSort(ModFilterLocal);
        treeviewLocalMods.Model = ModSortLocal;

        ModFilterLocal.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
        //ModSortLocal.DefaultSortFunc = new TreeIterCompareFunc(SortTree);

        treeviewGithubMods.Selection.Changed += TreeView_SelectionChanged;

        var CellRenderer2 = new CellRendererToggle();

        AddColumn("Installed", treeviewGithubMods, CellRenderer2, "active", 0);
        CellRenderer2.Activatable = true;
        CellRenderer2.Toggled    += StateColumn_Clicked;
        AddColumn("Name", treeviewGithubMods, new CellRendererText(), "markup", 1);
        AddColumn("Description", treeviewGithubMods, new CellRendererText(), "text", 2);
        AddColumn("Author", treeviewGithubMods, new CellRendererText(), "text", 3);
        ModListStoreGithub       = new ListStore(typeof(bool), typeof(string), typeof(string), typeof(string), typeof(ModInfoHolder));
        ModFilterGithub          = new TreeModelFilter(ModListStoreGithub, null);
        ModSortGithub            = new TreeModelSort(ModFilterGithub);
        treeviewGithubMods.Model = ModSortGithub;

        ModFilterGithub.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);
        //ModSortGithub.DefaultSortFunc = new TreeIterCompareFunc(SortTree);
    }
Ejemplo n.º 31
0
            public SearchableGamesListWidget(GameViewerUI viewer)
            {
                HBox box = new HBox ();
                box.PackStart (new
                           Label (Catalog.
                              GetString ("Filter")),
                           false, false, 4);
                searchEntry = new Entry ();
                box.PackStart (searchEntry, true, true, 2);

                PackStart (box, false, true, 2);

                gamesListWidget =
                    new
                    GameViewerGamesListWidget (viewer);

                PackStart (gamesListWidget, true, true, 2);
                ShowAll ();

                filter = new TreeModelFilter (gamesListWidget.
                                  Model, null);
                filter.VisibleFunc = SearchFilterFunc;
                searchEntry.Changed += OnSearch;
            }
Ejemplo n.º 32
0
            private void SetupTree()
            {
                gamesStore = new ListStore (typeof (object));
                tree.Model = gamesStore;
                tree.HeadersVisible = false;
                filter = new TreeModelFilter (gamesStore,
                                  null);
                filter.VisibleFunc = SearchFilterFunc;

                TreeViewColumn col;

                col = new TreeViewColumn ();
                idx_renderer = new CellRendererText ();
                idx_renderer.Yalign = 0;
                info_renderer = new CellRendererText ();
                col.Title = Catalog.GetString ("Games");
                col.PackStart (idx_renderer, false);
                col.SetCellDataFunc (idx_renderer,
                             new
                             TreeCellDataFunc
                             (IdxCellDataFunc));
                col.PackStart (info_renderer, true);
                col.SetCellDataFunc (info_renderer,
                             new
                             TreeCellDataFunc
                             (InfoCellDataFunc));
                col.Resizable = false;
                col.Expand = true;
                tree.AppendColumn (col);
            }
            public ObservableGamesWidget(GameObservationManager
						      observer)
            {
                obManager = observer;
                iters = new TreeIter[3, 4];
                gamesView = new TreeView ();
                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                observer.ObservableGameEvent +=
                    OnObservableGameEvent;

                store = new TreeStore (typeof (string),	// used for filtering
                               typeof (int),	// gameid
                               typeof (string),	// markup
                               typeof (string),	//
                               typeof (string));

                  gamesView.HeadersVisible = true;
                  gamesView.HeadersClickable = true;

                  gamesView.AppendColumn (Catalog.
                              GetString ("Games"),
                              new
                              CellRendererText (),
                              "markup", 2);
                  gamesView.AppendColumn (Catalog.
                              GetString ("Time"),
                              new
                              CellRendererText (),
                              "markup", 3);
                  gamesView.AppendColumn (Catalog.
                              GetString
                              ("Category"),
                              new
                              CellRendererText (),
                              "markup", 4);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (gamesView);

                  UpdateInfoLabel ();

                  filterEntry = new Entry ();
                  filterEntry.Changed += OnFilter;

                  filter = new TreeModelFilter (store, null);
                  filter.VisibleFunc = FilterFunc;
                  gamesView.Model = filter;

                  AddParentIters ();

                  infoLabel.UseMarkup = true;
                Button refreshButton =
                    new Button (Stock.Refresh);
                  refreshButton.Clicked +=
                    delegate (object o, EventArgs args)
                {
                    Clear ();
                    obManager.GetGames ();
                };
                Alignment align = new Alignment (0, 1, 0, 0);
                align.Add (refreshButton);

                HBox hbox = new HBox ();
                hbox.PackStart (infoLabel, true, true, 4);
                hbox.PackStart (align, false, false, 4);

                PackStart (hbox, false, true, 4);

                Label tipLabel = new Label ();
                tipLabel.Xalign = 0;
                tipLabel.Xpad = 4;
                tipLabel.Markup =
                    String.
                    Format ("<small><i>{0}</i></small>",
                        Catalog.
                        GetString
                        ("Press the refresh button to get an updated list of games.\nDouble click on a game to observe it."));
                PackStart (tipLabel, false, true, 4);
                PackStart (filterEntry, false, true, 4);
                PackStart (win, true, true, 4);

                gamesView.RowActivated += OnRowActivated;
                SetSizeRequest (600, 400);
                ShowAll ();
            }