测试帖
- 523066680
- Administrator
- 帖子: 573
- 注册时间: 2016年07月19日 12:14
- 联系:
Re: 测试帖
Win32::GUI::Reference::Options - 通用选项
- 翻译说明
- 1. 还未搞清楚的部分暂时保留原文
2. [TBD] == TO BE DECIDED,待定
3. Control 翻译为 控件
4. OEM (old event model) 旧事件模型
- 这里将介绍所有 packages 共用的参数,这些参数大部分用在对象的 new() 方法和 Change() 方法中。(这里 packages 也可以理解为组件,Label, Button, ListBox ...)
对于某个组件的专有参数,请参考对应组件下的帮助说明
- -acceptfiles
- -acceptfiles => 0/1
允许拖放文件到当前控件(Control)中
- -addexstyle => NUMBER
参考 -pushexstyle
- -addstyle => NUMBER
参考 -pushexstyle
- -background => COLOR
设置控件的背景颜色。注意,所有控件都可以设置背景色和前景色
- -caption => STRING
参考 -text
- -class => CLASS
Specifies the window class (有别于Perl 的对象类型,例如 Win32::GUI::Button) for the window; all the predefined
objects have hardcoded class names (eg. "BUTTON" for
Win32::GUI::Button), so you shouldn't want to pick a different one
unless you are familiar with window classes and you want to subclass an
existing one. 相关技术可以参考 Microsoft Platform SDK
Reference. The CLASS parameter can be either a name or a reference to a
Win32::GUI::Class object.
- -container => 0/1
[TBD]
- -cursor = CURSOR
设置控件的默认光标,CURSOR 必须是一个 Win32::GUI::Cursor 对象,或 windows HCURSOR 句柄
- --disabled => 0/1
设置控件是否允许交互;缺省值为0(允许交互)。
- -eventmodel => STRING
Sets the event model from the window or control. Can be one of the
following values: "byname" - the default. Set the OEM (old event model)
where events cause callback to the subroutine named
OBJECTNAME_EVENTNAME() "byref" - Set automatically when one of the -on*
event handlers is used. Sets the NEM (new event model) where the -on*
option is used to specify the callback subroutine explicitly. "both" -
Sets both OEM and NEM. USeful if you want to handle one event with the
NEM, and another event with OEM.
Sets the event model from the window or control. Can be one of the
following values: "byname" - the default. Set the OEM (old event model)
where events cause callback to the subroutine named
OBJECTNAME_EVENTNAME() "byref" - Set automatically when one of the -on*
event handlers is used. Sets the NEM (new event model) where the -on*
option is used to specify the callback subroutine explicitly. "both" -
Sets both OEM and NEM. USeful if you want to handle one event with the
NEM, and another event with OEM.
- -events => NUMBER
[TBD]
- -exstyle => NUMBER
Sets the extended style for the window. Use of this option is
deprecated. Use -pushexstyle or -popexstyle (or one of their
alternatives) instead.
- -font => FONT
设置默认字体,FONT 必须是一个 Win32::GUI::Font 对象,或者 windows HFONT 句柄
- -foreground => COLOR
设置前景色
- -group => 0/1
[TBD]
- -height => NUMBER
设置窗口高度(像素单位)
- -hscroll => 0/1
关闭/开启 横向滚动条,默认为 0
- -instance => HINSTANCE
[TBD]
- -left => NUMBER
设定窗口的 X 坐标,以窗口左边为起点。
对于窗体和对话框来说是屏幕位置,对于控件来说是它们所属窗体的区域位置。
- -menu => MENU
将窗口菜单关联到 Win32::GUI::Menu 对象(或 Windows HMENU 句柄)。只有顶层峰窗口能够显示菜单
- -name => STRING
为控件定义名称,该名称可以用来间接操作控件的子函数和回调函数(某些参数设定、事件循环处理),在自定义模式下必须指派控件名称,否则系统将自动为其设定值。注意,提供的控件名不能与其他控件名冲突。
示例:
$Window->AddButton( -name => "Button1", # ... ); 调用该控件的子例程 $Window->Button1->Hide(); 事件处理/回调函数 sub Button1_Click { # ... }
- -negexstyle => NUMBER
参考 -popexstyle
- -negstyle => NUMBER
参考 -popstyle
- -notexstyle => NUMBER
参考 -popexstyle
- -notstyle => NUMBER
参考 -popstyle
- -onEVENT => SUB
为 NEM (new event model 新事件模型) 指定一个回调函数,当事件触发时调用该函数。
SUB 是一个函数名或者是函数引用。
EVENT 必须是窗口或控件支持的事件名称。例如 Click, Terminate, ...
设定此选项将代替对应事件的默认回调函数 [ 对象名_事件名() ], 参考 -eventmodel
当事件触发时,对象本身的引用将作为第一个参数传递到回调函数中
示例:
#... my $button = Win32::GUI::Button->new( -text = "Click me!", -onClick => sub { print "Button Clicked\n"; }, ); #...
- -parent => WINDOW
为窗体/控件绑定父级窗口。WINDOW 参数必须是 Win32::GUI窗体 或 控件 对象,或者 windows HWND 句柄
- -popexstyle => NUMBER
Remove the specified extended styles from the window's extended style
mask. This option can be repeated multiple times, or values can be
'or'ed together.
- -popstyle => NUMBER
Remove the specified styles from the window's style mask. This option
can be repeated multiple times, or values can be 'or'ed together.
- -pos => [ X, Y ]
设置窗口或控件的坐标,注意 X 和 Y 值必须通过数组引用的形式传递,例如:
-pos => [ 100, 100 ], # 正确 -pos => 100, 100, # 错误 -pos => @coords, # 错误 -pos => \@coors, # 正确
- -pushexstyle => NUMBER
Add the specified extended styles to the window's extended style mask.
This option can be repeated multiple times, or values can be 'or'ed
together.
- -pushstyle => NUMBER
Add the specified styles to the window's style mask. This option can be
repeated multiple times, or values can be 'or'ed together.
- -remexstyle => NUMBER
参考 -popexstyle
- -remstyle => NUMBER
参考 -popstyle
- -size => [ X, Y ]
设置窗口或控件的尺寸,宽度和高度值必须通过数组引用的形式传递,例如:
-size => [ 100, 100 ], # 正确 -size => 100, 100, # 错误 -size => @coords, # 错误 -size => \@coors, # 错误
- -style => NUMBER
设置窗体风格,不建议使用。
请使用 -pushstyle 或 -popstyle(或其他替代选项)替代
- -tabstop => 0/1
如果设为1,支持通过 TAB 键在该控件与其他控件之间切换。注意此功能只对 Dialog Object(对话框对象)有效,所以设定的控件必须是一个对话框或者带有 "-dialogui" 选项的窗体对象。
- -text => STRING
为窗体标题或者控件内容设置字符串值(例如 标签文本,按钮文本,一段文本content 等)。具体情况依赖于控件的类型;对于某些控件类型完全无效,例如进度条。
- -tip => STRING
当鼠标停留在当前窗体/控件时候显示帮助提示。
该参数简单地实现帮助提示,但不够灵活。更灵活的方式参考 Win32::GUI::Tooltip
- -title => STRING
参考 -text
- -top => NUMBER
为窗体指定 Y 坐标(像素单位)。
对于窗体和对话框来说是屏幕位置,对于控件来说是它们所属窗体的区域位置。
- -visible => 0/1
设置指定窗体/控件(包括子窗体/控件)的状态为可见/不可见
- -vscroll => 0/1
关闭/开启 垂直滚动条
- -width => NUMBER
设定窗体/控件的宽度
- -acceptfiles => 0/1
- Documentation for Win32::GUI v1.13 created 22 Apr 2017
- Homepage: <http://perl-win32-gui.sourceforge.net/>.
For further support join the users mailing list from the website at
<http://lists.sourceforge.net/lists/list ... -gui-users>.
There is a searchable list archive at
<http://sourceforge.net/p/perl-win32-gui ... gui-users/>.
- Copyright (c) 1997..2017 Aldo Calpini. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
- 1. 还未搞清楚的部分暂时保留原文
- 523066680
- Administrator
- 帖子: 573
- 注册时间: 2016年07月19日 12:14
- 联系:
Re: 测试帖
⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿
在线用户
正浏览此版面之用户: zzz19760225 和 5 访客