rp.pos(rpanel)
rp.pos()所属R语言包:rpanel
Positioning controls in an rpanel
定位控制的rpanel
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function provides demonstrations of the use of the pos argument in functions to create controls.
此功能提供了演示,使用pos参数,在创建控件的功能。
用法----------Usage----------
rp.pos(layout = "default")
参数----------Arguments----------
参数:layout
the type of panel layout to be demonstrated. Valid options are "default", "pack", "place" and "grid".
面板布局的类型来加以论证。有效的选项是“默认”,“包”,“地点”和“网格”。
Details
详细信息----------Details----------
The various functions to create controls accept a parameter called pos which can be used to specify the layout of the controls. It has various modes of operation and the mode is determined from the type of information provided in the pos argument. The different modes are outlined below.
的各种功能来创建控件接受一个参数,称为pos可用于指定布局的控制。它有不同的操作模式,模式决定从pos参数中提供的信息类型。下面列出了不同的工作模式。
default If pos is not specified, controls are arranged in a column with the most recent added to the bottom. Each control is aligned to the left hand side.
default如果pos是未指定,控制被布置在一列中与最近底部添加。每个控制对齐的左手侧。
pack If pos is set to "left", "right", "top" or "bottom" then the control is aligned to the left/right/top/bottom edge of the window. If there is already a control in that position, the new control is placed beside that control, closer to the centre. (This uses Tk's "pack" layout manager.)
包,如果pos设置为"left","right","top"或"bottom"那么该控件的左/右/上/下边缘对齐窗口。如果在这个位置上已经有一个控制,新的控制,控制放在旁边,向中间靠拢。 (使用Tk的“包”的布局管理器。)
place If pos is set to a vector of four integer values, these are interpreted as c(x, y, width, height) where all dimensions are in pixels. x and y define the coordinates in from the left-hand side and down from the top respectively. When using this mode of laying out objects, it usually helps to specify the size of the panel in rp.control. (This uses Tk's "place" layout manager.)
如果pos设置四个整数值的向量,这些地方被解释为c(x, y, width, height)所有尺寸的单位是像素。 x和y定义的坐标,从左手侧和从顶部向下。当使用这种模式的对象,它通常有助于指定尺寸的面板rp.control。 (使用Tk的“地方”的布局管理器)。
grid This mode provides greater flexibility in layout. The following arguments can be passed to pos in any of the function calls to create controls. Alternatively, pos can be passed a list which has these named components.
电网的布局,这种模式提供了更大的灵活性。以下参数可以传递给pos在任何功能调用来创建控件。另外,pos可以通过一个列表,这些命名的组件。
columnAn integer which specifies the column number. Columns count from 0. This is a mandatory field for grids.
columnAn整数指定的列数。列数从0开始。这是一个强制性的网格领域。
rowAn integer which specifies the row number. Rows count from 0. This is a mandatory field for grids.
罗文整数,指定的行数。行数从0开始。这是一个强制性的网格领域。
gridA string which gives the name of the grid the control has to be placed in. This field is optional. If omitted the default grid belonging to the panel is used.
gridA字符串这给控制具有被置于该字段英寸网格的名称是可选的。如果省略该参数使用默认的网格面板。
columnspanAn integer which specifies how many columns the control should span. Columns are counted to the right from the start column specified by column. This field is optional. If omitted one column is assumed.
columnspanAn整数,指定要跨越多少列控制。从一开始就指定列的列列都算正确的。此字段是可选的。如果省略一列是假定的。
rowspanAn integer which specifies how many rows the control should span. Rows are counted down from the start row specified by row. This field is optional. If omitted one row is assumed.
rowspanAn整数,指定要跨越多少行控制。行从一开始就指定的行由行计数。此字段是可选的。如果省略了一个假设行。
widthAn integer which specifies the width of the control. For controls with writing (buttons, listboxes etc) this is in characters and for images this is in pixels. This field is optional. If omitted the control is sized horizontally to fill the cell the control is placed within.
widthAn整数指定的宽度的控制。对于写作的控件(按钮,列表框等),这是在字符和图像,此方法是(以像素为单位)。此字段是可选的。如果省略该参数控制水平的大小,以控制被放置在填充单元格。
heightAn integer which specifies the height of the control. For controls with writing (buttons, listboxes etc) this is in characters and for images this is in pixels. This field is optional. If omitted the control is sized vertically to fill the cell the control is placed within.
heightAn整数指定的高度的控制。对于写作的控件(按钮,列表框等),这是在字符和图像,此方法是(以像素为单位)。此字段是可选的。如果省略该参数控制垂直控制被放置在填充单元格的大小。
stickyAn string which specifies how the control expands to fill the cell. This is a string with any combination of 'n', 'e', 'w', 's', representing north/east/west/south expansions. An empty string assignment (”) will centre the control. If the argument is not assigned a value then the control is 'w' (west) aligned by default.
stickyAn字符串,它指定了如何控制扩展到填充单元格。这是一个字符串的任意组合N,E,W,S,代表北/东/西/南扩展。一个空字符串赋值(“)将控制中心。如果参数没有被指定值的控制是W(西部)的默认对齐。
bgSpecifies the background colour of the grid. If left blank this defaults to the operating system's standard background colour. </ul>
bgSpecifies网格的背景颜色。如果留空,默认为操作系统的标准背景颜色。 </ ul>
(This uses Tk's "grid" layout manager.)
(使用Tk的“网格”布局管理器)。
The "grid" mode of layout should not be mixed with the other modes.
“网格”的布局模式,不应混为一谈与其他交通工具。
The example below illustrates the use of pos. Try resizing the windows to explore the behaviour.
下面的例子演示了如何使用pos。尝试调整窗口,以探索的行为。
值----------Value----------
Nothing is returned.
不返回任何值。
警告----------Warning----------
This may not work properly on the command line (as opposed to R-GUI) under Mac OS X due to the rp.block function.
这可能无法正常工作在命令行上(而不是R-GUI)在Mac OS X由于rp.block功能的。
参考文献----------References----------
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
参见----------See Also----------
rp.control
rp.control
实例----------Examples----------
if (interactive()) {
# example function with different parameters for "pos" documentation.[例如不同的功能与参数“POS”文件。]
rp.pos("default")
rp.pos("pack")
rp.pos("place")
rp.pos("grid")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|