免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 793 | 回复: 0
打印 上一主题 下一主题

Fvwm Manual(L2271-L2535) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-20 22:01 |只看该作者 |倒序浏览
By
[email=Cyvins@HUST]Cyvins@HUST[/email]

ItemFormat takes a special string as its argument that determines the layout of the menu items. Think of the format string as if it were a menu item. All you have to do is tell fvwm where to place the different parts of the menu item (i.e. the labels, the triangle denoting a sub menu, the mini icons and the side pic) in the blank area. The string consists of spaces, Tab characters and formatting directives beginning with '%'. Any illegal characters and formatting directives are silently ignored:
ItemFormat使用一个特殊的字符串作为参数,来决定菜单条目的表现形式。看这个字符串作为一个菜单条目。所有你要做的就是告诉fvwm菜单条目每个部分应该被放置的地方(比如,标签,指示子菜单的三角形,图标,以及side pic)。字符串由空格,tab以及以'%'开头的格式指示符。任何不合法的格式指示符都被忽略:
%l, %c and %r
Insert the next item label. Up to three labels can be used. The item column is left-aligned (%l), centered (%c) or right-aligned (%r).
%i
Inserts the mini icon.
%> and %) or to the left (%
%left.rightp
This means: if the object is defined in the menu (e.g. if it is %s and you use a side picture, or it is %l for the third column and there are items defined that actually have a third column), then add left pixels before the object and right pixels after it. You may leave out the left or the .right parts if you don't need them. All values up to the screen width are allowed. Even negative values can be used with care. The p may be replaced with any other formatting directives described above.
Note: Only items defined in the format string are visible in the menus. So if you do not put a %s in there you do not see a side picture, even if one is specified.
Note: The SubmenusLeft style changes the default ItemFormat string, but if it was set manually it is not modified.
Note: If any unformatted title of the menu is wider than the widest menu item, the spaces between the different parts of the menu items are enlarged to match the width of the title. Leading left aligned objects in the format string (%l, %i, %, second %|) stick to the right edge. The gaps between the remaining items are enlarged equally.
Examples:
MenuStyle * ItemFormat \
  "%.4s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|"
Is the default string used by fvwm: (side picture + 4 pixels gap) (beginning of the hilighted area + 1 pixel gap) (mini icon + 5p) (first column left aligned + 5p) (second column left aligned + 5p) (third column right aligned + 5p) (second mini icon + 5p) (2p + sub menu triangle + 3p) (1p + end of hilighted area).
MenuStyle * ItemFormat \
  "%.1|%3.2
VerticalItemSpacing and VerticalTitleSpacing control the vertical spacing of menu items and titles like ItemFormat controls the horizontal spacing. Both take two numeric arguments that may range from -100 to +100. The first is the gap in pixels above a normal menu item (or a menu title), the second is the gap in pixels below it. Negative numbers do not make much sense and may screw up the menu completely. If no arguments are given or the given arguments are invalid, the built-in defaults are used: one pixel above the item or title and two below.
VerticalItemSpacing and VerticalTitleSpacing控制着菜单条目以及标题垂直方向的空间,就像ItemFormat控制水平方向空间一下。它们都带有2个在-100和100之间的数值参数。第一个参数是在正常的菜单条目(或者标题)上方的空隙的象素数目;第二个参数是下面空隙的象素数目。负值不具有意义,只是可能会screw up the menu(??)。如果没有参数给出,或者是无效的参数,使用默认值:上面空出一个象素,下面空出两个象素。
SubmenusLeft mirrors the menu layout and behavior. Sub menus pop up to the left, the sub menu triangle is drawn left and the mini icon and side picture are drawn at the right side of the menu. The default is SubmenusRight. The position hints of a menu are also affected by this setting, i.e. position hints using item or menu as context rectangle and position hints using m offsets.
SubmenusLeft方向除了菜单的形式和表现。子菜单从左边弹出,标识子菜单的三角形在左边,而起小图标和side picture 在菜单的右边。默认的是SubmenusRight。菜单的位置修饰也会影响这儿的设置,比如,使用条目和菜单作为上下文矩形框而且使用m偏移。
AutomaticHotkeys and AutomaticHotkeysOff control the menu's ability to automatically provide hot-keys on the first character of each menu item's label. This behavior is always overridden if an explicit hot-key is assigned in the AddToMenu command.
AutomaticHotkeys and AutomaticHotkeysOff控制菜单的自动设置菜单条目的快捷键的能力(每个菜单的第一个字符)。如果在 AddToMenu中明确的标出快捷键,它就会被覆盖。
Examples:
比如:
MenuStyle * Mwm
MenuStyle * Foreground Black, Background gray40
MenuStyle * Greyed gray70, ActiveFore White
MenuStyle * HilightBackOff, Hilight3DOff
MenuStyle * Font lucidasanstypewriter-14
MenuStyle * MenuFace DGradient 64 darkgray \
  MidnightBlue
MenuStyle red Mwm
MenuStyle red Foreground Yellow
MenuStyle red Background Maroon
MenuStyle red Greyed Red, ActiveFore Red
MenuStyle red HilightBackOff, Hilight3DOff
MenuStyle red Font lucidasanstypewriter-12
MenuStyle red MenuFace DGradient 64 Red Black
Note that all style options could be placed on a single line for each style name.
注意:所有的样式选项都可以为每个样式名字放置在一个单独行中。
MenuStyle forecolor backcolor shadecolor font style [anim]
This is the old syntax of the MenuStyle command. It is obsolete and may be removed in the future. Please use the new syntax as described above.
这是一个旧的MenuStyle命令的语法格式。已经被废弃,并且会在将来被删除,请使用上面描述的新语法格式。
Sets the menu style. When using monochrome the colors are ignored. The shadecolor is the one used to draw a menu-selection which is prohibited (or not recommended) by the Mwm hints which an application has specified. The style option is either Fvwm, Mwm or Win, which changes the appearance and operation of the menus.
Mwm and Win style menus popup sub menus automatically. win menus indicate the current menu item by changing the background to black. fvwm sub menus overlap the parent menu, Mwm and win style menus never overlap the parent menu.
When the anim option is given, sub menus that don't fit on the screen cause the parent menu to be shifted to the left so the sub menu can be seen. See also SetAnimation command.
Popup PopupName [position] [default-action]
This command has two purposes: to bind a menu to a key or mouse button, and to bind a sub menu into a menu. The formats for the two purposes differ slightly. The position arguments are the same as for Menu. The command default-action is invoked if the user clicks a button to invoke the menu and releases it immediately again (or hits the key rapidly twice if the menu is bound to a key). If the default action is not specified, double clicking on the menu does nothing. However, if the menu begins with a menu item (i.e. not with a title or a separator) and the default action is not given, double clicking invokes the first item of the menu (but only if the pointer really was over the item).
这个命令有两个目的:绑到菜单到一个键或者一个鼠标按钮;或者绑到子菜单到一个菜单。两个目的的格式有稍稍区别。位置参数跟Menu的一样。如果用户点击按键激活菜单,并且立即释放掉(或者快速的双击菜单绑定的键),default-action命令就会被激活。如果默认的动作没有被指出,双击就什么都不做。但是如果菜单以一个菜单条目开头(比如,不是以标题或者分隔符开始)并且默认的动作为给出,那么双击就会激活第一个菜单条目(但是必须保证鼠标确实是在这个条目上面)。
To bind a previously defined pop-up menu to a key or mouse button:
绑定一个已定义的菜单到键盘或者鼠标:
The following example binds mouse buttons 2 and 3 to a pop-up called "Window Ops". The menu pops up if the buttons 2 or 3 are pressed in the window frame, side-bar, or title-bar, with no modifiers (none of shift, control, or meta).
下面的例子绑到鼠标的2、3键,调出"Window Ops"菜单。如果鼠标的2、3键在没有修饰键按下的情况下,点击窗口的外框、边框、标题框,菜单就会被调出。
Mouse 2 FST N Popup "Window Ops"
Mouse 3 FST N Popup "Window Ops"
Pop-ups can be bound to keys through the use of the Key command. Pop-ups can be operated without using the mouse by binding to keys and operating via the up arrow, down arrow, and enter keys.
Pop-ups可以通过Key命令绑定到任何键,也可以通过绑定,以及操纵上下和回车键来使用,而不用鼠标。
To bind a previously defined pop-up menu to another menu, for use as a sub menu:
把一个的菜单作为子菜单绑定到另一个菜单:
The following example defines a sub menu "Quit-Verify" and binds it into a main menu, called "RootMenu":
下面的例子定义了一个子菜单"Quit-Verify",并且绑定到主菜单("RootMenu"):
AddToMenu Quit-Verify
+ "Really Quit Fvwm?" Title
+ "Yes, Really Quit"  Quit
+ "Restart Fvwm"      Restart
+ "Restart Fvwm 1.xx" Restart fvwm1 -s
+ ""                  Nop
+ "No, Don't Quit"    Nop
AddToMenu RootMenu "Root Menu" Title
+ "Open XTerm Window" Popup NewWindowMenu
+ "Login as Root"     Exec exec xterm \
                         -fg green -T Root \
                         -n Root -e su -
+ "Login as Anyone"   Popup AnyoneMenu
+ "Remote Hosts"      Popup HostMenu
+ ""                  Nop
+ "X utilities"       Popup Xutils
+ ""                  Nop
+ "Fvwm Modules"      Popup Module-Popup
+ "Fvwm Window Ops"   Popup Window-Ops
+ ""                  Nop
+ "Previous Focus"    Prev (AcceptsFocus) Focus
+ "Next Focus"        Next (AcceptsFocus) Focus
+ ""                  Nop
+ "Refresh screen"    Refresh
+ ""                  Nop
+ "Reset X defaults"  Exec xrdb -load \
                       $HOME/.Xdefaults
+ ""                  Nop
+ ""                  Nop
+ Quit                Popup Quit-Verify
Popup differs from Menu in that pop-ups do not stay up if the user simply clicks. These are popup-menus, which are a little hard on the wrist. Menu menus stay up on a click action. See the Menu command for an explanation of the interactive behavior of menus. A menu can be open up to ten times at once, so a menu may even use itself or any of its predecessors as a sub menu.
Popup与Menu不同:如果用户只是简单的点击,那么弹出的菜单不会保留下来。这些弹出菜单对手腕来说相对要求高一些。Menu菜单会在点击后保留下来。参考Menu菜单中关于菜单的交互行为的解释。一个菜单可以在同一时间开启10次,因此一个菜单甚至可以使用它自己,或者任何它的前者作为子菜单(???)。
TearMenuOff
When assigned to a menu item, it inserts a tear off bar into the menu (a horizontal broken line). Activating that item tears off the menu. If the menu item has a label, it is shown instead of the broken line. If used outside menus, this command does nothing. Examples:
当赋值给一个菜单条目时,它就会在菜单中插入一个tear off bar(a horizontal broken line)。激活那个条目就会tear off 一个菜单。如果这个菜单条目有一个标签的话,它就会取代broken line。如果使用外部菜单(??),这个命令就什么也不做, 比如:
AddToMenu WindowMenu
+ I "" TearMenuOff
AddToMenu RootMenu
+ I "click here to tear me off" TearMenuOff
Title
Does nothing. This is used to insert a title line in a popup or menu.
什么也不做,只是用来在菜单中插入一个标题行。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14381/showart_88376.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP