Commit 505fe698 authored by Yong Liu's avatar Yong Liu

Refs #5700

parent 72b91df3
......@@ -4588,28 +4588,40 @@ compareDataExport <- function(comparedScript, len, ...){
gmessage("Script step not valid.", title="Input not valid", icon="info", parent=scriptEditWindow)
}
}
scriptEditWindow = gwindow("View script", parent=window, width=700, height=400)
scriptEditWindow = gwindow(paste("View script", getd("activescript.file"), SEP=" "), parent=window, width=700, height=400)
scriptWidget = ggroup(horizontal=FALSE)
xscript = gdf(cmdhist, expand=TRUE)
# TODO: find replacement, cause in linux it wouldnt display anything.
#enabled(xscript) <- FALSE
add(scriptWidget, xscript, expand=TRUE)
gseparator(container=scriptWidget)
putd("xscriptpdf", xscript)
leftgdflist <- list()
leftgdflist$"Run until and export dataset"$handler <- function(h,...) {
gdf <- getd("xscriptpdf")
rto <- svalue(gdf, index=TRUE)
cmdhist <- gdf[]
cmdhist <- cmdhist[c(1:rto)]
compareDataExport(cmdhist, rto)
}
leftgdflist$"Undo until"$handler <- function(h,...) {
gdf <- getd("xscriptpdf")
rto <- svalue(gdf, index=TRUE)
if(rto > 3) {
cmdhist <- gdf[]
cmdhist <- cmdhist[c(1:(rto-1))]
Script.run(cmdhist)
gdf[] <- cmdhist
Script(list(cmd=c(cmdhist)))
leftgdf <- getd("leftgdf")
leftgdf[] <- cmdhist
}
}
add3rdmousepopupmenu(xscript, leftgdflist)
add(scriptEditWindow, scriptWidget)
saveCancelGroup = ggroup(container=scriptWidget)
addSpring(saveCancelGroup)
tmp = ggroup(container=saveCancelGroup)
glabel("Delete script step: ", container=tmp)
delRow = gedit(text="", width=3, container=tmp)
gbutton("Delete", container=tmp, handler=function(h,...) delCMDhist() )
addSpring(saveCancelGroup)
tmp = ggroup(container=saveCancelGroup)
glabel("Run script to row: ", container=tmp)
runTo = gedit(text=length(cmdhist), width=3, container=tmp)
gbutton("Run", container=tmp, handler=function(h,...) runCMDhist() )
addSpring(saveCancelGroup)
gbutton("Close", container=saveCancelGroup, handler=function(h,...) quitEditScriptWindow() )
add(scriptEditWindow, scriptWidget)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment