如何在单击而不是右键单击时强制显示托盘图标的上下文菜单.
我尝试过使用MouseClick事件,但eventargs的鼠标位置为x0y0.
有没有人知道如何简化Nautilus中的标准上下文(右键单击)菜单?我正在为不经常使用计算机的人制作一个非常简化的界面,我想使用Nautilus作为文件管理器.我已经使用nautilus-action在上下文菜单中添加了一些操作,但我想删除标准的复制/粘贴/创建文件夹/创建链接以及几乎所有其他操作.我没有在我的系统上找到任何XML或其他配置文件,我在Nautilus的资源上使用grep来查找它的位置,因为我怀疑它是硬编码的,但到目前为止还没有任何乐趣.
http://pastebin.com/YyDzQ4Bk这是一个右键单击上下文菜单的插件,任何人都知道为什么它在IE中不起作用?
不仅如此,它打破了我的许多其他jQuery的东西,比如花哨的盒子和一些jQuery悬停功能.
我想做的是:
如果用户没有选择任何内容,则显示菜单项A;
如果用户选择了某些内容,则显示菜单项B.
到目前为止,我能得到的是:
如果用户没有选择任何内容,则显示菜单项A;
如果用户选择了某些内容,则同时显示A和B.
我想知道:
选择时如何使项目A消失?
非常感谢!
以下是我的代码:
var all = chrome.contextMenus.create
({
"title": "A",
"contexts":["page"],
"onclick": doA
});
var selection = chrome.contextMenus.create
({
"title": "B",
"contexts":["selection"],
"onclick": doB
});
Run Code Online (Sandbox Code Playgroud) 基本上,我想在左键单击本身打开上下文菜单.无论如何使用jQuery做到这一点?
当用户右键单击场景的空白部分时,有没有办法显示弹出窗口?
我是Qt的新手,我尝试过插槽和子类,但无济于事.
没有这样的插槽,分别是:
"错误:'QMouseEvent'尚未宣布"
在尝试实施该onMouseRelease事件时.
如何在Primefaces数据表中为每列定义上下文菜单?放在<p:contextMenu>里面<p:column>不能正常工作.我希望上下文菜单不同,具体取决于右键单击的列用户.
这不起作用(为所有列创建的上下文菜单相同):
<p:dataTable value="#{values}" var="value" selectionMode="single" selection="#{selectedValue}" id="table">
<p:column headerText="Col 1">
<h:outputText value="#{value.balance}">
<f:convertNumber type="currency"></f:convertNumber>
</h:outputText>
<p:contextMenu>
<p:menuitem value="Report"></p:menuitem>
<p:menuitem value="Change"></p:menuitem>
</p:contextMenu>
</p:column>
<p:column headerText="col 2" >
<h:outputText value="#{value.balance2}">
<f:convertNumber type="currency"></f:convertNumber>
</h:outputText>
<p:contextMenu>
<p:menuitem value="Something else"></p:menuitem>
</p:contextMenu>
</p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
如何通过使用PF组件,扩展PF组件或添加自定义JavaScript在Primefaces dataTable中添加特定于列的上下文菜单?
所以我有一个Context Menu和其中的一个MenuItem突破到一个名单列表:
<ContextMenu>
<MenuItem Header="Set As Default For" ItemsSource="{Binding Source={StaticResource Names}}">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Header" Value={Binding Name}/>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=MenuItem}, Path=DataContext.DoSomething}" />
<Setter Property="CommandParameter" Value="{Binding }" />
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
</ContextMenu>
Run Code Online (Sandbox Code Playgroud)
现在上面的代码工作文件并显示我的名字列表.现在我想使用包URI在每个名称旁边添加一个图标.所以从这个问题我可以看到最好的方法就是模板化,Header所以我首先尝试了这个问题
<ContextMenu>
<MenuItem Header="Set As Default For" ItemsSource="{Binding Source={StaticResource Names}}">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Header">
<Setter.Value>
<StackPanel>
<Image Width="20" Height="20" Source="/MyProj;component/Resources/MyImg.png" />
<ContentPresenter Content="{Binding Name}" />
</StackPanel>
</Setter.Value>
</Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=MenuItem}, Path=DataContext.DoSomething}" /> …Run Code Online (Sandbox Code Playgroud) 我正在尝试在iOS13的表格视图中实现“上下文菜单”(也尝试了集合视图,它们有相同的问题):
我按照此处的说明进行操作,创建了包含一堆照片的收藏夹视图,当进行3d触摸时,我将获得带有动作列表的预览,如下所示:
UITableView中的委托方法:
- (void)tableView:(UITableView *)tableView willCommitMenuWithAnimator:
(id<UIContextMenuInteractionCommitAnimating>)animator;
Run Code Online (Sandbox Code Playgroud)
并在collectionView中
- (void)collectionView:(UICollectionView *)collectionView willCommitMenuWithAnimator:
(id<UIContextMenuInteractionCommitAnimating>)animator;
Run Code Online (Sandbox Code Playgroud)
两者都没有“ indexPath”;
因此,我无法传递正在查看的当前单元格或索引。
我要实现此委托方法,因此当我点击预览图像时,它将导航到包含绑定到当前单元格的信息的预期页面。
我想要和尝试的是这样的:
func collectionView(_ collectionView: UICollectionView, willCommitMenuWithAnimator animator: UIContextMenuInteractionCommitAnimating) {
animator.addAnimations {
self.show(PreviewViewController(image: UIImage(named: "indexpathString")), sender: self)
}
}
Run Code Online (Sandbox Code Playgroud)
并且indexpathString与当前选定的单元格或集合有关,因此我可以基于它初始化viewController。
请让我知道是否还有其他方法可以做到这一点。
contextmenu ×10
jquery ×2
c# ×1
datatable ×1
ios13 ×1
javascript ×1
jsf ×1
jsf-2 ×1
menuitem ×1
nautilus ×1
primefaces ×1
qmouseevent ×1
qt ×1
swift ×1
uitableview ×1
winforms ×1
wpf ×1