如何在状态栏中创建上下文菜单?

发布于 2024-10-03 06:28:45 字数 1292 浏览 5 评论 0原文

我有一些问题 1. 如何制作我的状态栏上下文菜单,其中包含 2 个菜单首选项选择和插件状态

我想要制作的上下文菜单示例

“alt

这是我的代码:

<popupset>
  <menupopup id="intransContextMenu">
    <menuitem label="intrans aktif"/>
    <menuitem label="preferensi"/>
  </menupopup>
</popupset>

     <statusbar id="status-bar">
          <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
          <statusbarpanel id="status-bar-intrans"
           label="intrans"
           context="intransContextMenu"
           onclick="alert('okeh cuy')"
       tooltiptext="intrans versi 1.0"
       />
    </statusbar>
  1. 如何在上下文菜单中添加图像?我已经尝试过,但为什么我粘贴的始终出现在标签下方的图片并不像我预期的那样位于标签侧面?

我想要制作的上下文菜单示例 alt text

这是我的代码:

<popup id="contentAreaContextMenu">
      <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
        <menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
        label="Cari Terjemahan"/>
    </popup>

注意: 代码是否用于通过右键单击状态栏来显示菜单并允许将网页制作在一个文件中?

谢谢你的回答..

I have some problems
1. how do I make my statusbar context menu that consists of 2 choices of menu preferences and addons status

example of context menu i want to make

alt text

this is my code :

<popupset>
  <menupopup id="intransContextMenu">
    <menuitem label="intrans aktif"/>
    <menuitem label="preferensi"/>
  </menupopup>
</popupset>

     <statusbar id="status-bar">
          <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
          <statusbarpanel id="status-bar-intrans"
           label="intrans"
           context="intransContextMenu"
           onclick="alert('okeh cuy')"
       tooltiptext="intrans versi 1.0"
       />
    </statusbar>
  1. how to add images in the context menu? I have tried but why do I paste a picture that always appears under the label is not on the side of the label as I expected?

example of context menu i want to make alt text

this is my code :

<popup id="contentAreaContextMenu">
      <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
        <menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
        label="Cari Terjemahan"/>
    </popup>

note :
whether the code used to display the menu by right clicking on the statusbar and allows web pages to be made in one file?

thank you for the answer..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡写薰衣草的香 2024-10-10 06:28:45

我不确定图像是否是您现在唯一的问题?打开上下文菜单应该可以(您正在使用 context 属性正确)。

关于图像,请查看文档。对于 statusbarpanel,您必须设置 image 属性:

<statusbar id="status-bar">
      <statusbarpanel id="status-bar-intrans"
           image="chrome://inlinetrans/skin/imagesOn_kecil.png"
           label="intrans"
           context="intransContextMenu"
           onclick="alert('okeh cuy')"
           tooltiptext="intrans versi 1.0"
      />
</statusbar>

您可能还想看看样式类并使用它们(说实话,我不是 100%确保设置 image 属性是否足够,因此如果这不起作用,请尝试使用样式类)。

menuitem 类似。您必须设置 image 属性 < strong>并为元素指定样式类 menu -iconic

<menuitem class="inlinetrans menu-iconic" 
          id="inlineContext" 
          oncommand= "hadits_mean.startFind(null);"
          label="Cari Terjemahan"
          image="chrome://inlinetrans/skin/imagesOn_kecil.png"/>

注意:据我所知,状态栏将在 Firefox 4 中被删除(至少默认情况下它是禁用的)!

I am not sure if the images are your only problem now? Opening the context menu should work (you are using the context attribute correctly).

Regarding images, have a look at the documentation. For statusbarpanel, you have to set the image attribute:

<statusbar id="status-bar">
      <statusbarpanel id="status-bar-intrans"
           image="chrome://inlinetrans/skin/imagesOn_kecil.png"
           label="intrans"
           context="intransContextMenu"
           onclick="alert('okeh cuy')"
           tooltiptext="intrans versi 1.0"
      />
</statusbar>

You might also want to have a look at the style classes and play with them (to be honest I'm not 100% sure if it is just sufficient to set the image attribute, so if this does not work, try with the style classes).

Similar for the menuitem. You have to set the image attribute and give the element the style class menu-iconic:

<menuitem class="inlinetrans menu-iconic" 
          id="inlineContext" 
          oncommand= "hadits_mean.startFind(null);"
          label="Cari Terjemahan"
          image="chrome://inlinetrans/skin/imagesOn_kecil.png"/>

Note: Afaik the statusbar is going to be removed in Firefox 4 (at least by default it is disabled)!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文