Exemplo n.º 1
0
        private void ButtonPressed(object sender, ButtonPressEventArgs args)
        {
            TreePath       path = null;
            TreeViewColumn col  = null;

            if (grid.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path, out col))
            {
                DataGridColumn dgCol = col as DataGridColumn;
                TreeIter       iter;
                if (store.GetIter(out iter, path))
                {
                    clickedCellObject = store.GetValue(iter, dgCol.ColumnIndex);
                }
                else
                {
                    return;
                }
            }
            else
            {
                return;
            }

            if (args.Event.Button == 3)
            {
                IdeApp.CommandService.ShowContextMenu("/MonoDevelop/Database/ContextMenu/DataGrid");
                args.RetVal = true;
            }
        }
Exemplo n.º 2
0
        void HandleButtonPressEvent(object sender, ButtonPressEventArgs args)
        {
            TreeViewColumn col;
            CellRenderer   cr;
            TreePath       path;
            TreeIter       iter;

            if (args.Event.Button != 1 || !GetCellAtPos((int)args.Event.X, (int)args.Event.Y, out path, out col, out cr))
            {
                return;
            }

            if (!store.GetIter(out iter, path))
            {
                return;
            }

            if (cr == refresh)
            {
                var options = DebuggingService.DebuggerSession.Options.EvaluationOptions.Clone();
                options.AllowMethodEvaluation = true;
                options.AllowToStringCalls    = true;

                var frame  = (StackFrame)store.GetValue(iter, FrameColumn);
                var method = EvaluateMethodName(frame, options);

                store.SetValue(iter, MethodColumn, method);
                store.SetValue(iter, CanRefreshColumn, false);
            }
        }
        private void OnImagesIVSelectionChanged(object s, EventArgs a)
        {
            removeImageBtn.Sensitive = imagesIV.SelectedItems.Length > 0;

            TreeIter selectedIter;

            if (imagesIV.SelectedItems.Length > 0)
            {
                TreePath selectedImagePath = imagesIV.SelectedItems[0];

                imagesStore.GetIter(out selectedIter, selectedImagePath);

                Gdk.Pixbuf orig = (Gdk.Pixbuf)(imagesStore.GetValue(selectedIter, 1));

                mtb = new MathTextBitmap(orig);
                mtb.ProcessImage(database.Processes);

                imageAreaOriginal.Image  = orig;
                imageAreaProcessed.Image = mtb.LastProcessedImage.CreatePixbuf();
            }
            else
            {
                imageAreaOriginal.Image  = null;
                imageAreaProcessed.Image = null;
            }
        }
Exemplo n.º 4
0
        private void ButtonPressed(object sender, ButtonPressEventArgs args)
        {
            TreePath       path = null;
            TreeViewColumn col  = null;

            if (grid.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path, out col))
            {
                DataGridColumn dgCol = col as DataGridColumn;
                TreeIter       iter;
                if (store.GetIter(out iter, path))
                {
                    clickedCellObject = store.GetValue(iter, dgCol.ColumnIndex);
                }
                else
                {
                    return;
                }
            }
            else
            {
                return;
            }

            if (args.Event.TriggersContextMenu())
            {
                DoPopupMenu(args.Event);
                args.RetVal = true;
            }
        }
Exemplo n.º 5
0
        void SelectNearest(TreeView view)
        {
            ListStore store = (ListStore)view.Model;

            TreePath[] paths = view.Selection.GetSelectedRows();
            if (paths.Length == 0)
            {
                return;
            }
            TreeIter it;

            store.GetIter(out it, paths [paths.Length - 1]);
            if (store.IterNext(ref it))
            {
                view.Selection.UnselectAll();
                view.Selection.SelectIter(it);
                return;
            }
            store.GetIter(out it, paths [0]);
            if (store.IterNext(ref it))
            {
                view.Selection.UnselectAll();
                view.Selection.SelectIter(it);
                return;
            }
        }
Exemplo n.º 6
0
    // ----EDIT EVENTS---
    void AnswerTextEdited(object o, EditedArgs args)
    {
        TreeIter iter;

        testAnswers.GetIter(out iter, new Gtk.TreePath(args.Path));
        var answer = (testAnswers.GetValue(iter, 0) as TestAnswer);

        answer.Text = args.NewText;
    }
Exemplo n.º 7
0
    void QuestionTextEdited(object o, EditedArgs args)
    {
        TreeIter iter;

        testQuestions.GetIter(out iter, new Gtk.TreePath(args.Path));
        var question = (testQuestions.GetValue(iter, 0) as TestQuestion);

        question.Text = args.NewText;
    }
Exemplo n.º 8
0
        public void SelectItem(int index)
        {
            TreeIter iter;

            if (completionModel.GetIter(out iter, new TreePath(index.ToString())))
            {
                completionView.Selection.SelectIter(iter);
                completionView.SetCursor(new TreePath(index.ToString()), null, false);
            }
        }
		void KeyEdited (object o, EditedArgs args)
		{
			TreeIter iter;
			if (KeyExists (args.NewText)) {
				MessageDialogWorks.RunWarningDialog ("Параметр с таким названием уже существует.");
				return;
			}
			parametersListStore.GetIter (out iter, new TreePath (args.Path));
			parametersListStore.SetValue (iter, 0, args.NewText);
		}
        void OnBuildToggled(object sender, ToggledArgs args)
        {
            TreeIter iter;

            if (store.GetIter(out iter, new TreePath(args.Path)))
            {
                SolutionConfigurationEntry entry = (SolutionConfigurationEntry)store.GetValue(iter, 0);
                entry.Build = !entry.Build;
                store.SetValue(iter, 2, entry.Build);
            }
        }
Exemplo n.º 11
0
        protected virtual void OnViewClick(object sender, System.EventArgs e)
        {
            TreeIter iter;

            if (imagesView.SelectedItems[0] != null)
            {
                m_model.GetIter(out iter, imagesView.SelectedItems[0]);
                string      file = (string)m_model.GetValue(iter, 2);
                ImageDialog dlg  = new ImageDialog(file);
                dlg.Run();
            }
        }
Exemplo n.º 12
0
        public void OnRecentFileIconActivated(object o, ItemActivatedArgs e)
        {
            TreeIter iter;

            if (recentFileList.GetIter(out iter, e.Path))
            {
                EventHandler OnClick = (EventHandler)recentFileList.GetValue(iter, 3);
                if (OnClick != null)
                {
                    OnClick(this, e);
                }
            }
        }
Exemplo n.º 13
0
		/// <summary>
		/// Updates the greyed out state of the up and down buttons
		/// depending on the currently selected item.
		/// </summary>
		protected void UpdatePriorityButtons ()
		{
			TreePath[] paths = treeview.Selection.GetSelectedRows ();
			if (paths.Length > 0) {
				TreePath p = paths [0];
				TreeIter it;
				listStore.GetIter (out it, p);
				buttonDown.Sensitive = listStore.IterNext (ref it);
				buttonUp.Sensitive = p.Prev ();
			} else {
				buttonDown.Sensitive = buttonUp.Sensitive = false;
			}
		}
Exemplo n.º 14
0
 public void SetTableRow(int index, ArrayList Values, bool fill)
 {
     if (fill)
     {
         TreeViewTable.AppendValues(Values[0], Values[1], Values[2], Values[3], Values[4], Values[5], Values[6]);
     }
     else
     {
         TreeIter it;
         TreeViewTable.GetIter(out it, new TreePath(new int[] { index }));
         TreeViewTable.SetValues(it, Values[0], Values[1], Values[2], Values[3], Values[4], Values[5], Values[6]);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Called when a visibility checkbox has changed.
        /// </summary>
        private void OnVisibleToggled(object o, ToggledArgs args)
        {
            TreePath path = new TreePath(args.Path);
            TreeIter iter;

            if (m_listStore.GetIter(out iter, path))
            {
                ModifyMeshInfosOperation op = new ModifyMeshInfosOperation();
                m_ignoreListSelection = true;
                m_indexToMesh[path.Indices[0]].IsVisible = !(bool)m_listStore.GetValue(iter, 0);
                op.Complete();
            }
        }
        private object[] DequeueSelectedRows(TreeView treeView)
        {
            ListStore listStore = (ListStore)treeView.Model;

            TreePath[] selectedRows  = treeView.Selection.GetSelectedRows();
            TreeIter[] treeIterators = new TreeIter[selectedRows.Length];
            object[]   reternValues  = new object[selectedRows.Length];

            for (int index = 0; index < selectedRows.Length; index++)
            {
                listStore.GetIter(out treeIterators[index], selectedRows[index]);

                int i = 0;

                do
                {
                    reternValues[index] = listStore.GetValue(treeIterators[index], i++);
                } while (reternValues[index].GetType() != typeof(string));
            }

            for (int index = 0; index < treeIterators.Length; index++)
            {
                listStore.Remove(ref treeIterators[index]);
            }

            return(reternValues);
        }
Exemplo n.º 17
0
        public void ReloadStats()
        {
            TreeIter iter;
            TreePath selected = null;

            pstats.UpdateStats();

            treeview.Selection.GetSelected(out iter);
            if (store.IterIsValid(iter))
            {
                selected = store.GetPath(iter);
            }

            store.Clear();
            foreach (EventTypeStats cstats in pstats.EventTypeStats)
            {
                store.AppendValues(cstats, cstats.Name);
            }

            /* Keep the selected category for when we reload the stats changing players */
            if (selected != null)
            {
                store.GetIter(out iter, selected);
            }
            else
            {
                store.GetIterFirst(out iter);
            }
            treeview.Selection.SelectIter(iter);
            categoryviewer1.LoadStats(store.GetValue(iter, 0) as EventTypeStats);
        }
Exemplo n.º 18
0
        public void OnRemoveGroupClicked(object o, EventArgs args)
        {
            TreeModel model;
            TreeIter  iter;

            TreePath[] tp = memberOfTreeview.Selection.GetSelectedRows(out model);

            for (int i = tp.Length; i > 0; i--)
            {
                _memberOfStore.GetIter(out iter, tp[(i - 1)]);

                string name = (string)_memberOfStore.GetValue(iter, 0);

                _memberOfStore.Remove(ref iter);

                if (_memberOfGroups.ContainsKey(name))
                {
                    _memberOfGroups.Remove(name);
                }

                LdapAttribute    attr = new LdapAttribute("memberUid", conn.Data.GetAttributeValueFromEntry(currentEntry, "uid"));
                LdapModification lm   = new LdapModification(LdapModification.DELETE, attr);

                _modsGroup.Add(name, lm);

                updateGroupMembership();

                _modsGroup.Clear();
            }
        }
Exemplo n.º 19
0
        void OnRowActivated(object o, RowActivatedArgs args)
        {
            TreePath path = args.Path;
            TreeIter iter;

            if (store.GetIter(out iter, path))
            {
                string name = null;
                name = (string)store.GetValue(iter, 0);

                foreach (AttributeViewPlugin avp in Global.Plugins.AttributeViewPlugins)
                {
                    foreach (string an in avp.AttributeNames)
                    {
                        if (an.ToLower() == name.ToLower())
                        {
                            if (conn.AttributeViewers.Contains(avp.GetType().ToString()))
                            {
                                RunViewerPlugin(avp, name);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 20
0
        public MonoDroidBuildOptionsWidget()
        {
            this.Build();

            linkerCombo.AppendText("Don't link");               //MtouchLinkMode.None
            linkerCombo.AppendText("Link SDK assemblies only"); //MtouchLinkMode.SdkOnly
            linkerCombo.AppendText("Link all assemblies");      //MtouchLinkMode.All

            i18NTreeView.Model = i18nStore;

            var toggle = new CellRendererToggle();

            i18NTreeView.AppendColumn("", toggle, "active", 1);
            i18NTreeView.AppendColumn("", new CellRendererText(), "text", 0);
            i18NTreeView.HeadersVisible = false;
            toggle.Toggled += delegate(object o, ToggledArgs args) {
                TreeIter iter;
                if (i18nStore.GetIter(out iter, new TreePath(args.Path)))
                {
                    i18nStore.SetValue(iter, 1, !(bool)i18nStore.GetValue(iter, 1));
                }
            };

            ShowAll();
        }
Exemplo n.º 21
0
        void OnAttributeViewerToggled(object o, ToggledArgs args)
        {
            TreeIter iter;

            if (attrPluginStore.GetIter(out iter, new TreePath(args.Path)))
            {
                bool old = (bool)attrPluginStore.GetValue(iter, 0);

                string name            = (string)attrPluginStore.GetValue(iter, 1);
                AttributeViewPlugin vp = Global.Plugins.FindAttributeView(name);

                if (!conn.AttributeViewers.Contains(vp.GetType().ToString()))
                {
                    conn.AttributeViewers.Add(vp.GetType().ToString());
                }
                else
                {
                    conn.AttributeViewers.Remove(vp.GetType().ToString());
                }

                Global.Connections [conn.Settings.Name] = conn;

                attrPluginStore.SetValue(iter, 0, !old);
            }
        }
Exemplo n.º 22
0
        protected void OnBtnEliminarServClicked(object sender, EventArgs e)
        {
            TreeModel model;
            string    smonto = "";
            double    monto  = 0;
            TreeIter  iter;

            if (TvServiciosPagar.Selection.GetSelected(out model, out iter))
            {
                smonto = (string)model.GetValue(iter, 4);
            }

            smonto = smonto.Remove(smonto.Length - 4);
            monto  = Convert.ToDouble(smonto);

            ListStore ls = cod.GetDetFact();

            TreePath[] tp = TvServiciosPagar.Selection.GetSelectedRows();
            ls.GetIter(out iter, tp[0]);
            ls.Remove(ref iter);
            TvServiciosPagar.Model = ls;
            cod.SetDetFact(ls);
            cod.ReducirAcumSubtotal(monto);
            LimpiarValidarEntServicios();
            EntSubtotal.Text = cod.GetSst().ToString("N") + " Bs.";
            CalcularPrecios();
            ValidarBoton.Enabled = true;
        }
Exemplo n.º 23
0
    private void foo(object sender, EventArgs arg)
    {
        TreeIter iter;

        TreePath[] treePath = treeview3.Selection.GetSelectedRows();

        for (int i = treePath.Length; i > 0; i--)
        {
            myList.GetIter(out iter, treePath[(i - 1)]);
            string value = (string)myList.GetValue(iter, 0);
            label1.Text = value;
            //Console.WriteLine("Removing: " + value);

            myList.Remove(ref iter);
        }
    }
Exemplo n.º 24
0
        private void on_filesList_row_activated(object o, RowActivatedArgs e)
        {
            try {
                TreeIter iter;
                if (filesListStore.GetIter(out iter, e.Path) == true)
                {
                    IDirectoryItem thisItem = (IDirectoryItem)filesListStore.GetValue(iter, 0);

                    if (thisItem is IDirectory)
                    {
                        /*
                         * if (selectedRows [currentPath] == null)
                         *      selectedRows.Add (currentPath, e.Path.ToString ());
                         * else
                         *      selectedRows [currentPath] = e.Path.ToString ();
                         */

                        NavigateTo(PathUtil.Join(currentPath, thisItem.Name));
                    }
                    else
                    {
                        DownloadItem(thisItem);
                    }
                }
            } catch (Exception ex) {
                Core.LoggingService.LogError(ex);
                Gui.ShowErrorDialog(ex.Message);
            }
        }
Exemplo n.º 25
0
        public IPhoneBuildOptionsWidget()
        {
            this.Build();
            extraArgsEntry.AddOptions(menuOptions);

            linkCombo.AppendText("Don't link");               //MtouchLinkMode.None
            linkCombo.AppendText("Link SDK assemblies only"); //MtouchLinkMode.SdkOnly
            linkCombo.AppendText("Link all assemblies");      //MtouchLinkMode.All

            foreach (var v in IPhoneFramework.InstalledSdkVersions)
            {
                sdkComboEntry.AppendText(v.ToString());
            }

            sdkComboEntry.Changed += HandleSdkComboEntryChanged;

            store = new ListStore(typeof(string), typeof(bool));
            i18nTreeView.Model = store;

            var toggle = new CellRendererToggle();

            i18nTreeView.AppendColumn("", toggle, "active", 1);
            i18nTreeView.AppendColumn("", new CellRendererText(), "text", 0);
            i18nTreeView.HeadersVisible = false;
            toggle.Toggled += delegate(object o, ToggledArgs args) {
                TreeIter iter;
                if (store.GetIter(out iter, new TreePath(args.Path)))
                {
                    store.SetValue(iter, 1, !(bool)store.GetValue(iter, 1));
                }
            };

            this.ShowAll();
        }
        private void OnSynRulesTreeButtonPressEvent(object sender,
                                                    ButtonPressEventArgs args)
        {
            // Have the user pressed the right mouse button?
            if (args.Event.Button == 3)
            {
                // Yeah, so let's see if there is something under the mouse pointer.
                TreePath path;
                synRulesTree.GetPathAtPos((int)args.Event.X,
                                          (int)args.Event.Y,
                                          out path);

                // There seems to exist a rule there,
                // it is the default one?
                TreeIter iter;
                if (synRulesModel.GetIter(out iter, path))
                {
                    selectedRule = iter;

                    TreeIter first;
                    synRulesModel.GetIterFirst(out first);
                    if (synRulesModel.GetPath(iter).ToString() !=
                        synRulesModel.GetPath(first).ToString())
                    {
                        // We show the contextual menu.
                        synRuleMenu.Popup();
                    }
                }
            }
        }
Exemplo n.º 27
0
        private void WavesTree_ButtonReleaseEvent(object o, ButtonReleaseEventArgs args)
        {
            TreePath       path;
            TreeViewColumn column;
            int            x = Convert.ToInt32(args.Event.X);
            int            y = Convert.ToInt32(args.Event.Y);

            if (!WavesTree.GetPathAtPos(x, y, out path, out column))
            {
                throw new Exception("Could not find WaveModel at " + x + "," + y.ToString());
            }

            TreeIter iter;

            if (!WavesModel.GetIter(out iter, path))
            {
                throw new Exception("Could not find WaveModel at " + x + "," + y.ToString());
            }

            int row = (int)WavesModel.GetValue(iter, 0);

            if (column == SaveSolutionColumn)
            {
                SaveSolutionClicked(iter);
            }
            else if (column == LoadSolutionColumn)
            {
                LoadSolutionClicked(iter);
            }
        }
Exemplo n.º 28
0
    private void getAllStocksCallback(IEnumerable <string> stocks)
    {
        foreach (string s in stocks)
        {
            listStocks.AppendValues(true, s);
            this.selectedStocks.Add(s);
        }
        historicalStockListTreeview.Model = listStocks;

        CellRendererToggle chkBox = new CellRendererToggle();

        chkBox.Activatable = true;
        chkBox.Toggled    += delegate(object o, ToggledArgs args) {
            TreeIter iter;
            if (listStocks.GetIter(out iter, new TreePath(args.Path)))
            {
                bool old = (bool)listStocks.GetValue(iter, 0);
                listStocks.SetValue(iter, 0, !old);
                if (!old)
                {
                    this.selectedStocks.Add((string)listStocks.GetValue(iter, 1));
                }
                else
                {
                    this.selectedStocks.Remove((string)listStocks.GetValue(iter, 1));
                }
            }
        };

        //TreeViewColumn chkColumn = new TreeViewColumn("Sel", chkBox, "toggled");
        //TreeViewColumn descColumn = new TreeViewColumn("Description", new CellRendererText(), "text");
        historicalStockListTreeview.HeadersVisible = false;
        historicalStockListTreeview.AppendColumn("Sel", chkBox, "active", 0);
        historicalStockListTreeview.AppendColumn("Description", new CellRendererText(), "text", 1);
    }
        public void ReloadStats(LMPlayer player)
        {
            PlayerStats playerStats;
            TreeIter    iter;
            TreePath    selected = null;

            playerStats = pstats.GetPlayerStats(player);

            treeview.Selection.GetSelected(out iter);
            if (store.IterIsValid(iter))
            {
                selected = store.GetPath(iter);
            }

            store.Clear();
            foreach (PlayerEventTypeStats petats in playerStats.PlayerEventStats)
            {
                store.AppendValues(petats, petats.EventType.Name);
            }

            /* Keep the selected category for when we reload the stats changing players */
            if (selected != null)
            {
                store.GetIter(out iter, selected);
            }
            else
            {
                store.GetIterFirst(out iter);
            }
            treeview.Selection.SelectIter(iter);
            categoryviewer.LoadStats(store.GetValue(iter, 0) as PlayerEventTypeStats);
        }
Exemplo n.º 30
0
        /// <summary>
        /// Invoked when the selected row is changed.
        /// Navigates to the selected node in the simulations tree.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="args">Event arguments.</param>
        private void OnSelectionChanged(object sender, EventArgs args)
        {
            try
            {
                // Get the the first selected row.
                TreePath path = tree.Selection?.GetSelectedRows()?.FirstOrDefault();
                if (path == null)
                {
                    return;
                }

                TreeIter iter;
                data.GetIter(out iter, path);
                string nodePath = data.GetValue(iter, 2) as string;
                if (nodePath == null)
                {
                    throw new Exception("Unable to navigate to selected item in 'Find All References' window.");
                }

                // Select this node in the tree.
                explorerPresenter.SelectNode(nodePath);
            }
            catch (Exception err)
            {
                explorerPresenter.MainPresenter.ShowError(err);
            }
        }