public SongDetail(MainWindow parent) : base(Gtk.WindowType.Toplevel) { this.Build (); this.Shown+= OnShown; this.WidgetEvent+=OnWidgetEvent; DeleteEvent += delegate(object o, DeleteEventArgs args) { // hide instead of delete args.RetVal = true; Hide (); }; this. MainWin = parent; _framesTreeViewData = new TreeViewData(treeViewFrames); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Logger.Logger.WriteToLog("Starting new application instance"); Build (); Lng = new Language(); _treeView1Data = new TreeViewData(tree); _treeView2Data = new TreeViewData(tree2); progressWin = new MP3Tagger.ProgressBarWindow(this); progressWin.Hide(); EditingModeActive = false; ActualSelectionMode = SelectionMode.Multiple; CreateGridColumns(); _multiSelectSong = new Song(); editWindow = new SongDetail(this); editWindow.Hide(); toolBarWin = new ToolBarWin(this); toolBarWin.Hide(); infoWin = new InfoWin(); infoWin.Hide(); tree.Selection.Changed+=new EventHandler(OnSelectionChanged); tree2.Selection.Changed+=new EventHandler(OnSelectionChanged); tree.ButtonPressEvent += tree_ButtonPressEvent; tree2.ButtonPressEvent += tree_ButtonPressEvent; this.Show(); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build (); // iapp icon var sep = System.IO.Path.DirectorySeparatorChar; var buffer = System.IO.File.ReadAllBytes (System.IO.Path.Combine(SupportMethods.AppPath+sep+"Icons" + sep + "ico.ico")); var pixbuf = new Gdk.Pixbuf (buffer); Icon = pixbuf; // Loading configuration MediaConvertGUIConfiguration.Load("config.xml"); TestPrerequisites(); ReloadSchemes(); _fileTreeViewData = new TreeViewData(tree); CreateGridColumns(); widgetTargetMovieTrack.Editable = true; widgetTargetContainer.Editable = true; widgetSourceContainer.Editable = false; _proressWindow = new ProgressWin(); _proressWindow.Hide(); tree.Selection.Mode = SelectionMode.Multiple; comboScheme1.Changed+= OnSchemeChanged; tree.CursorChanged += OnTreeCursorChanged; buttonApply.Clicked+=OnButtonApplyClicked; tree.ButtonPressEvent+=OnTreeButtonPressEvent; FillTree(); }
public int ActualSelectedSongIndex(TreeViewData data) { Gtk.TreeIter iter; var ok = data.Tree.Selection.GetSelected(out iter); if (!ok) { return -1; } foreach (KeyValuePair<int,Gtk.TreeIter> kvp in data.TreeIters) { if (kvp.Value.UserData == iter.UserData) { var selectedDataIndex = kvp.Key; if (MP3List.Count>selectedDataIndex) { return selectedDataIndex; } } } return -1; }
public Song ActualSelectedSong(TreeViewData data) { var index = ActualSelectedSongIndex(data); if (index == -1) return null; return MP3List[index]; }
private List<Song> GetSelectedSongs(TreeViewData data) { var selectedSongs = new List<Song>(); foreach(Gtk.TreePath selectedItem in data.Tree.Selection.GetSelectedRows()) { var indicies = selectedItem.Indices; if (indicies.Length>0) { var selectedIndex = indicies[0]; if (MP3List.Count>selectedIndex) { selectedSongs.Add(MP3List[selectedIndex]); } } } return selectedSongs; }