Exemplo n.º 1
0
        /// <summary>Puts the current node into edit mode so user can rename it.</summary>
        public void BeginRenamingCurrentNode()
        {
            textRender.Editable = true;
            TreePath       selPath;
            TreeViewColumn selCol;

            treeview1.GetCursor(out selPath, out selCol);
            treeview1.GrabFocus();
            treeview1.SetCursor(selPath, treeview1.GetColumn(0), true);
        }
Exemplo n.º 2
0
        private int GetSelIndex()
        {
            TreePath       selPath;
            TreeViewColumn selCol;

            listview1.GetCursor(out selPath, out selCol);
            return(selPath != null ? selPath.Indices[0] : -1);
        }
Exemplo n.º 3
0
        /// <summary>User has selected a node. Raise event for presenter.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The event arguments instance containing the event data.</param>
        private void OnAfterSelect(object sender, EventArgs e)
        {
            if (SelectedNodeChanged != null)
            {
                NodeSelectedArgs selectionChangedData = new NodeSelectedArgs();
                selectionChangedData.OldNodePath = previouslySelectedNodePath;
                TreePath       selPath;
                TreeViewColumn selCol;
                treeview1.GetCursor(out selPath, out selCol);
                selectionChangedData.NewNodePath = FullPath(selPath);
                if (selectionChangedData.NewNodePath != selectionChangedData.OldNodePath)
                {
                    SelectedNodeChanged.Invoke(this, selectionChangedData);
                }

                previouslySelectedNodePath = selectionChangedData.NewNodePath;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles the item selected event, by setting the curSel variable to the selection index
        /// </summary>
        private void HandleItemSelected()
        {
            TreeViewColumn col;
            TreePath       path;

            soilsView.GetCursor(out path, out col);
            curSel = path.Indices[0];
            selWindow.Destroy();
        }
Exemplo n.º 5
0
        private void OnDirRename(object o, EventArgs args)
        {
            TreePath       treepath;
            TreeViewColumn column;

            performingtask       = PerformingTask.Renaming;
            text_render.Editable = true;

            tv.GetCursor(out treepath, out column);

            tv.SetCursor(treepath, column, true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the currently selected item.
        /// </summary>
        /// <exception cref="Exception">Exception is thrown if no item is selected.</exception>
        /// <returns></returns>
        private string GetSelectedItem()
        {
            TreeViewColumn col;
            TreePath       path;

            completionView.GetCursor(out path, out col);
            if (path != null)
            {
                TreeIter iter;
                completionModel.GetIter(out iter, path);
                return((string)completionModel.GetValue(iter, 1));
            }
            throw new Exception("Unable to get selected intellisense item: no item is selected.");
        }
Exemplo n.º 7
0
        private void lvSupps_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!internalSelect && SupplementSelected != null)
            {
                TreePath       selPath;
                TreeViewColumn selCol;
                lvSupps.GetCursor(out selPath, out selCol);

                TIntArgs args = new TIntArgs();
                args.value = selPath.Indices[0];
                if (SupplementSelected != null)
                {
                    SupplementSelected.Invoke(sender, args);
                }
            }
        }
Exemplo n.º 8
0
 private Gtk.TreePath GetTreePath(TreeView tv)
 {
     Gtk.TreePath treePath;
     Gtk.TreeViewColumn treeColumn;
     tv.GetCursor(out treePath, out treeColumn);
     return treePath;
 }