找回密码
 注册
查看: 1590|回复: 0

R语言 widgetTools包 widget-class()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-26 16:03:13 | 显示全部楼层 |阅读模式
widget-class(widgetTools)
widget-class()所属R语言包:widgetTools

                                        Class "widget" creates a widget with primary widgets contained in
                                         “部件”类创建一个包含在主要部件的部件

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This class takes a list of primary widgets and then creates a
这个类的主要部件的列表,然后创建一个


类的对象----------Objects from the Class----------

Objects can be created by calls of the form new("widget", ...).
创建对象可以通过检测的形式new("widget", ...)。


插槽----------Slots----------




wTitle: Object of class "character" - a
wTitle:对象类的"character" -




pWidgets: Object of class "list" - a list of
pWidgets:Object类的"list" - 一个列表,




env: Object of class "environment" - an R
env:Object类的"environment" - 一个R




funs: Object of class "list" - a list of functions that will be associated with buttons on the widget to be rendered. The name of the function in the list will be the text appears on the button and the function will be executed when the
funs类"list"对象 - 要呈现的构件上的按钮,将相关的功能列表。将执行的功能列表中的名称将是文字上的按钮和功能出现时,




preFun: Object of class "function" - a function
preFun类"function"对象 - 函数




postFun: Object of class "function" - a function
postFun类"function"对象 - 函数


方法----------Methods----------




env<- signature(object = "widget"): set the value for env
ENV < - signature(object = "widget"):设置ENV值




wEnv signature(object = "widget"): get the value for env
wEnvsignature(object = "widget"):得到ENV值




funs<- signature(object = "widget"): set the value for
乐趣< - signature(object = "widget"):设置值




funs signature(object = "widget"): get the value for funs
乐趣signature(object = "widget"):得到乐趣的价值




postFuns<- signature(object = "widget"): set the value
postFuns < - signature(object = "widget"):设定值




postFun signature(object = "widget"): get the value
postFunsignature(object = "widget"):获得的价值




preFuns<- signature(object = "widget"): set the value
preFuns < - signature(object = "widget"):设定值




preFun signature(object = "widget"): get the value for
preFunsignature(object = "widget")“:获得价值




pWidgets<- signature(object = "widget"): set the value
pWidgets < - signature(object = "widget"):设定值




pWidgets signature(object = "widget"): get the value
pWidgetssignature(object = "widget"):获得的价值




updateCheck signature(object = "widget"): update the
的UpdateChecksignature(object = "widget"):更新




updateList signature(object = "widget"): update the
updateListsignature(object = "widget"):更新




updateRadio signature(object = "widget"): update the
updateRadiosignature(object = "widget"):更新




updateText signature(object = "widget"): update the
UPDATETEXTsignature(object = "widget"):更新




wTitle<- signature(object = "widget"): set the value
wTitle < - signature(object = "widget"):设定值




wTitle signature(object = "widget"): get the value of
wTitlesignature(object = "widget"):价值


作者(S)----------Author(s)----------


Jianhua Zhang



参考文献----------References----------

<h3>See Also</h3>

举例----------Examples----------


PWEnv <- new.env(hash = TRUE, parent = parent.frame(1))

label1 <- label(wName = "label1", wValue = "File Name: ", wEnv = PWEnv)
entry1 <- entryBox(wName = "entry1", wValue = "Feed me using browse",
                   wEnv = PWEnv)
browse2Entry1 <- function(){
    tempValue <- fileBrowser()
    temp <- get(wName(entry1), wEnv = PWEnv)
    wValue(temp) <- paste(tempValue, sep = "", collapse = ";")
    assign(wName(entry1), temp, env = PWEnv)
}
button1 <- button(wName = "button1", wValue = "Browse",
                     wFuns = list(command = browse2Entry1), wEnv = PWEnv)
list1 <- listBox(wName = "list1", wValue = c(Option1 = TRUE, Option2 = FALSE,
                                 Option3 = FALSE), wEnv = PWEnv)
text1 <- textBox(wName = "text1", wValue = "Feed me something",
                 wEnv = PWEnv)
label2 <- label(wName = "label2", wValue = "Select one:  ", wEnv = PWEnv)
radios1 <- radioButton(wName = "radios1", wValue = c(radio1 = TRUE,
                       radio2 = FALSE, radio3 = FALSE), wEnv = PWEnv)
label3 <- label(wName = "label3", wValue = "Select one to many: ",
wEnv = PWEnv)
checks1 <- checkButton(wName = "checks1", wValue = c(check1 = TRUE,
                       check22 = FALSE, check3 = FALSE), wEnv = PWEnv)
pWidgets <- list(topRow = list(label1 = label1, entry1 = entry1,
                 button1 = button1), textRow = list(list1 = list1,
                 text1 = text1), radGroup = list(label2 = label2,
                 radios1 = radios1), chkGroup = list(label3 = label3,
                                     checks1 = checks1))

## Not run: [#无法运行:]
## These cannot be run by examples() but should be OK when pasted[#这些不能运行的例子(),但粘贴时,应确定]
## into an interactive R session with the widgetTools package loaded[#进入与互动R会话的widgetTools装载包]

aWidget <- widget(wTitle = "A test widget", pWidgets, funs = list(),
                 preFun = function() print("Hello"),
                 postFun = function() print("Bye"), env = PWEnv)

## End(Not run)[#结束(不运行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-22 19:02 , Processed in 0.041605 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表