Exemplo n.º 1
0
        private void RowSelected(object sender, System.EventArgs e)
        {
            Gtk.Application.Invoke(delegate
            {
                Gtk.TreeSelection selection = (sender as Gtk.TreeView).Selection;
                Gtk.TreeModel model;
                Gtk.TreeIter iter;

                // THE ITER WILL POINT TO THE SELECTED ROW
                if (selection.GetSelected(out model, out iter))
                {
                    try
                    {
                        string CDPath = "";
                        Gtk.TreeIter parent;
                        Console.WriteLine("Selected Value:" + model.GetValue(iter, 1).ToString());

                        if (model.IterParent(out parent, iter))
                        {
                            CDPath += model.GetValue(parent, 1).ToString();
                        }

                        CDPath += model.GetValue(iter, 1).ToString();

                        Abstraction.GetInstance().WriteText(CDPath);

                        Framework.GetInstance().SendGSPacket(new Core.CString() + (byte)OpenGraal.Common.Connections.Client.GraalServer.PacketOut.RC_FILEBROWSER_CD + CDPath);
                    }
                    catch (Exception ez)
                    { }
                }
            }
                                   );
        }
Exemplo n.º 2
0
	  public TreeViewIListSelection(Gtk.TreeSelection selection)
		{
			if (selection == null)
			{
				throw new ArgumentNullException("selection");
			}
			this._selection = selection;
			_selection.Changed += new EventHandler(OnSelectionChanged);
		}
 void OnCursorChanged(object sender, EventArgs e)
 {
     Gtk.TreeView      treeView  = Utils.dynamic_cast <Gtk.TreeView>(sender);
     Gtk.TreeSelection selection = treeView.Selection;
     Gtk.TreeModel     treeModel = null;
     Gtk.TreeIter      treeIter;
     selection.GetSelected(out treeModel, out treeIter);
     _selectedCommand = treeModel.GetValue(treeIter, 0).ToString();
 }
Exemplo n.º 4
0
 public TreeViewIListSelection(Gtk.TreeSelection selection)
 {
     if (selection == null)
     {
         throw new ArgumentNullException("selection");
     }
     this._selection     = selection;
     _selection.Changed += new EventHandler(OnSelectionChanged);
 }
 public void OnDelTrack(object sender, EventArgs args)
 {
     Gtk.TreeSelection selection = _tracks.Selection;
     Gtk.TreeIter      iter;
     if (selection.GetSelected(out iter))
     {
         _store.Remove(ref iter);
         Renumber();
     }
 }
        void VoteFixed(object o, Gtk.EditedArgs args)
        {
            Gtk.TreeSelection sel = grdVotes.Selection;
            Gtk.TreeIter      iter;
            if (!sel.GetSelected(out iter))
            {
                return;
            }
            String bolded = (String)_votes.GetValue(iter, 6);

            _voteCount.AddVoteAlias(bolded, args.NewText);
            _voteCount.Refresh();
        }
Exemplo n.º 7
0
        private bool ShouldSelectPort(Gtk.TreeSelection selection, Gtk.TreeModel model, Gtk.TreePath path, bool path_currently_selected)
        {
            var shouldSelect = true;

            Gtk.TreeIter iter;
            if (selection.GetSelected(out iter))
            {
                var viewModel = DataContext as SerialPortSelectorViewModel;
                var item      = model.GetValue(iter, 0) as SerialPortViewModel;
                shouldSelect = (item != null) && !viewModel.DisabledSerialPorts.Contains(item.PortName);
            }
            return(shouldSelect);
        }
Exemplo n.º 8
0
        private void HandleSelectionFontFamily(object sender, EventArgs e)
        {
            Gtk.TreeSelection selection = (sender as Gtk.TreeSelection);

            Gtk.TreeModel model;
            Gtk.TreeIter  iter;

            if (selection.GetSelected(out model, out iter))
            {
                fontService.Family = model.GetValue(iter, 1) as Pango.FontFamily;
                preview.QueueDraw();
            }
        }
Exemplo n.º 9
0
        protected void OnTreeThreadsCursorChanged(object sender, EventArgs e)
        {
            Gtk.TreePath       path;
            Gtk.TreeViewColumn column;
            treeThreads.GetCursor(out path, out column);
            Gtk.TreeSelection sel = treeThreads.Selection;
            Gtk.TreeModel     model;
            Gtk.TreeIter      iter;
            sel.GetSelected(out model, out iter);
            String url = (String)model.GetValue(iter, 0);

            txtURL.Text = _url + url;
        }
 public void OnAddTrack(object sender, EventArgs args)
 {
     Gtk.TreeSelection selection = _tracks.Selection;
     Gtk.TreeIter      iter;
     if (selection.GetSelected(out iter))
     {
         iter = _store.InsertBefore(iter);
         _store.SetValues(iter, 0, "-", "-", "-", "-", "00:00:00");
     }
     else
     {
         _store.AppendValues(_store.IterNChildren() + 1, "-", "-", "-", "-", "00:00:00");
     }
     Renumber();
 }
Exemplo n.º 11
0
        void HandleCursorChanged(object sender, EventArgs e)
        {
            if (sender is Gtk.TreeView)
            {
                Gtk.TreeSelection selection = (sender as Gtk.TreeView).Selection;

                Gtk.TreeModel model;
                Gtk.TreeIter  iter;

                // THE ITER WILL POINT TO THE SELECTED ROW
                if (selection.GetSelected(out model, out iter))
                {
                    /*
                     *     String msg = String.Format ("Selected Value:[{0}] {1} {2}",
                     *         model.GetValue(iter, InstanceCountIndex),
                     *         model.GetValue(iter, TypenameIndex).ToString(),
                     *         model.GetValue(iter, DescriptionIndex).ToString());
                     *     Console.WriteLine(msg);
                     *     ComponentManager.MessageWriteLine(msg);
                     */
                }
            }
        }
Exemplo n.º 12
0
        void OnCopy()
        {
            int numColumns = this.View.TvSongsOrg.Columns.Length;
            var destList   = (Gtk.ListStore) this.View.TvSongsDest.Model;
            var orgList    = (Gtk.ListStore) this.View.TvSongsOrg.Model;

            Gtk.TreeSelection selected = this.View.TvSongsOrg.Selection;
            Gtk.TreePath[]    rowPaths = selected.GetSelectedRows();
            string[]          row      = new string[numColumns];

            foreach (Gtk.TreePath rowPath in rowPaths)
            {
                for (int i = 0; i < numColumns; ++i)
                {
                    orgList.GetIter(out Gtk.TreeIter it, rowPath);
                    row[i] = (string)orgList.GetValue(it, i);
                }

                destList.AppendValues(row);
            }

            return;
        }
        bool InvokeNative(Gtk.TreeSelection selection, Gtk.ITreeModel model, Gtk.TreePath path, bool path_currently_selected)
        {
            bool __result = native_cb(selection == null ? IntPtr.Zero : selection.Handle, model == null ? IntPtr.Zero : ((model is GLib.Object) ? (model as GLib.Object).Handle : (model as Gtk.TreeModelAdapter).Handle), path == null ? IntPtr.Zero : path.Handle, path_currently_selected, __data);

            return(__result);
        }
Exemplo n.º 14
0
 static bool DefaultTreeSelectFunction(Gtk.TreeSelection selection, Gtk.TreeModel model, Gtk.TreePath path, bool selected)
 {
     return(true);
 }