private void _tv_ItemClick(object sender, TVItemEventArgs e) { if (e.ModifierKeys != 0 || e.ClickCount != 1) { return; } var t = e.Item as RunningTask; var f = t.f; switch (e.MouseButton) { case MouseButton.Left: App.Model.SetCurrentFile(f); break; case MouseButton.Right: _tv.Select(t); var name = f.DisplayName; var m = new popupMenu { RawText = true }; m["End task '" + name + "'"] = _ => App.Tasks.EndTask(t); m["End all '" + name + "'"] = _ => App.Tasks.EndTasksOf(f); m.Separator(); m["Close\tM-click", disable : null == Panels.Editor.ZGetOpenDocOf(f)] = _ => App.Model.CloseFile(f, selectOther : true); //m.Separator(); //m["Recent tasks and triggers..."] = _ => RecentTT.Show(); //rejected. It is in menu Run. Or would also need to show context menu when rclicked in empty space. m.Show(); break; case MouseButton.Middle: App.Model.CloseFile(f, selectOther: true); break; } }
private void _ItemActivated(object sender, TVItemEventArgs e) { var f = e.Item as FileNode; if (f.IsFolder) { return; } var m = App.Model; if (e.ClickCount == 0 && f == m.CurrentFile) { Panels.Editor.ZActiveDoc?.Focus(); //let Enter set focus = active doc } else { m._SetCurrentFile(f, focusEditor: e.ClickCount switch { 1 => null, 2 => true, _ => false });
private void _tv_ItemClick(object sender, TVItemEventArgs e) { if (e.ModifierKeys != 0 || e.ClickCount != 1) { return; } var f = (e.Item as _Item).f; switch (e.MouseButton) { case MouseButton.Left: App.Model.SetCurrentFile(f); break; case MouseButton.Right: _tv.Select(e.Item); switch (popupMenu.showSimple("Close\tM-click|Close all other|Close all")) { case 1: _CloseFile(); break; case 2: App.Model.CloseEtc(FilesModel.ECloseCmd.CloseAll, dontClose: f); break; case 3: App.Model.CloseEtc(FilesModel.ECloseCmd.CloseAll); break; } break; case MouseButton.Middle: _CloseFile(); break; } void _CloseFile() { App.Model.CloseFile(f, selectOther: true); } }
//private void _Options_Click(object sender, RoutedEventArgs e) { // var m = new popupMenu(); // //m[""] = o => ; //} private void _tv_ItemActivated(object sender, TVItemEventArgs e) { _compl.Commit(_doc, _av[e.Index]); Hide(); }