From 1718d434efae26de02754c6622c43f4dc9e624b9 Mon Sep 17 00:00:00 2001 From: jranke Date: Thu, 15 Mar 2012 15:54:14 +0000 Subject: Update kinfit and mkin to the latest version published on BerliOS. git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@17 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- inst/GUI/.RData | Bin 0 -> 17960 bytes inst/GUI/.Rhistory | 3 +++ inst/GUI/gdf-test.R | 12 +++++++++ inst/GUI/simple-Gtk.R | 33 ++++++++++++++++++++++++ inst/GUI/simple.R | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ inst/GUI/test.R | 17 +++++++++++++ 6 files changed, 133 insertions(+) create mode 100644 inst/GUI/.RData create mode 100644 inst/GUI/.Rhistory create mode 100644 inst/GUI/gdf-test.R create mode 100644 inst/GUI/simple-Gtk.R create mode 100644 inst/GUI/simple.R create mode 100644 inst/GUI/test.R (limited to 'inst/GUI') diff --git a/inst/GUI/.RData b/inst/GUI/.RData new file mode 100644 index 00000000..2e82ef7b Binary files /dev/null and b/inst/GUI/.RData differ diff --git a/inst/GUI/.Rhistory b/inst/GUI/.Rhistory new file mode 100644 index 00000000..0704745c --- /dev/null +++ b/inst/GUI/.Rhistory @@ -0,0 +1,3 @@ +require(gWidgetsWWW) +localServerStart("simple.R") +quit("yes") diff --git a/inst/GUI/gdf-test.R b/inst/GUI/gdf-test.R new file mode 100644 index 00000000..b1ec20ae --- /dev/null +++ b/inst/GUI/gdf-test.R @@ -0,0 +1,12 @@ +w <- gwindow("gdf test") +g <- ggroup(horizontal=FALSE, cont=w) +d <- gdf(data.frame(a=c(1.1, 2.2, 3.3), b= c("one", "two", "three"), stringsAsFactors=FALSE), + name = "Test for editing character columns", cont=g) +size(d) <- c(400,400) +gbutton("Change [1,2]", handler=function(h,...) { + d[1,2] <- "test" +}, container=g) +gbutton("Value of [1,2]", handler=function(h,...) { + galert(d[1,2], parent=d) +}, cont=g) +visible(w) <- TRUE diff --git a/inst/GUI/simple-Gtk.R b/inst/GUI/simple-Gtk.R new file mode 100644 index 00000000..8affdccc --- /dev/null +++ b/inst/GUI/simple-Gtk.R @@ -0,0 +1,33 @@ +# Work in progress - simple Gtk2 GUI for mkin +require(gWidgets) +options("guiToolkit"="RGtk2") + +w <- gwindow("Simple R GUI for kinetic evaluations", + width=800, height=500) + +# Project definition expanding group +pr <- gexpandgroup("Project definition", container=w) + +n.observed <- 1 +max.n.observed <- 9 +observed.names = c("parent", paste("M", 1:(max.n.observed - 1), sep="")) + +prg <- ggroup(horizontal=FALSE, cont = w) +prl <- glayout(cont = prg) +prl[1,1] <- glabel("Number of observed variables", cont=prl) +prl[1,2] <- (n.observed.gw = gcombobox( + 1:max.n.observed, + handler = function(h, ...) { + n.observed <- svalue(n.observed.gw) + visible(observed.gw) <- c( + rep(TRUE, svalue(n.observed)), + rep(FALSE, max.n.observed - n.observed)) + }, + cont=prl)) + +observed.gw <- gdf( + items = data.frame(Index = 1:max.n.observed, + Name = observed.names, stringsAsFactors=FALSE), + name = "Names of observed variables", + cont=prg) + diff --git a/inst/GUI/simple.R b/inst/GUI/simple.R new file mode 100644 index 00000000..c1874145 --- /dev/null +++ b/inst/GUI/simple.R @@ -0,0 +1,68 @@ +# Work in progress - simple GUI for mkin +w <- gwindow('Simple R GUI for kinetic evaluations', visible=FALSE) +# Project definition {{{ +pr <- gexpandgroup("Project", cont=w) + +n.observed <- 1 +max.n.observed <- 9 +observed.names = c("parent", paste("M", 1:(max.n.observed - 1), sep="")) + +prg <- ggroup(horizontal=FALSE, cont = pr) +prl <- glayout(cont = prg) +prl[1,1] <- glabel("Number of observed variables", cont=prl) +prl[1,2] <- (n.observed.gw = gcombobox( + 1:max.n.observed, + handler = function(h, ...) { + n.observed <<- svalue(n.observed.gw) + filter.expression <- paste("^[1-", n.observed, "]$", sep="") + observed.gw$filter("Index", filter.expression) + }, + cont=prl)) + +observed.gw <- gdf( + items = data.frame(Index = 1:max.n.observed, + Name = observed.names, stringsAsFactors=FALSE), + name = "Names of observed variables", + width = 500, height=250, cont=prg) + +addSpace(prg, 15) +prf <- gfile("Project file in binary R format (preferably use .RData as extension)", + container = prg) +addSpring(prg) +addSpace(prg, 15) +pr.ok <- gbutton("save", + handler=function(h,...) { + galert(svalue(prf), parent=w) + }, container=prg) + +gbutton("ok", handler = function(h, ...) { + observed <- observed.gw[1:n.observed,2] + save(observed, file="observed.RData") + visible(pr) <- FALSE + }, + cont=prg +) + +visible(pr) <- TRUE +# }}} + +# Dataset definition +ds <- gexpandgroup("Datasets", cont=w) +s <- gdf(data.frame( Author = c("Meier"), Year = "3", Title = "4"), + name = "Studies", +cont=ds) + +size(s) <- c(800,200) +visible(ds) <- TRUE + +# Model definition +ms <- gexpandgroup("Models", cont=w) +visible(ms) <- FALSE + +# Evaluation window +mw <- gframe("Evaluations", cont=w) + +# Status bar +gstatusbar("Powered by gWidgetsWWW", cont = w) +visible(w) <- TRUE +# vim: set foldmethod=marker: diff --git a/inst/GUI/test.R b/inst/GUI/test.R new file mode 100644 index 00000000..e33e0774 --- /dev/null +++ b/inst/GUI/test.R @@ -0,0 +1,17 @@ +require(gWidgetsWWW) +localServerStart("simple.R") + +localServerStart("gdf-test.R") +localServerStart("gdf-test-john.R") + +localServerStart("Examples/ex-actions.R", package="gWidgetsWWW") +localServerStart("Examples/ex-add-widget-dynamically.R", package="gWidgetsWWW") +localServerStart("Examples/ex-clt.R", package="gWidgetsWWW") +localServerStart("Examples/ex-form.R", package="gWidgetsWWW") +localServerStart("Examples/ex-gcombobox.R", package="gWidgetsWWW") +localServerStart("Examples/ex-gtable.R", package="gWidgetsWWW") +localServerStart("Examples/ex-index.R", package="gWidgetsWWW") +localServerStart("Examples/ex-layouts.R", package="gWidgetsWWW") +localServerStart("Examples/ex-simple-gui.R", package="gWidgetsWWW") +localServerStart("Examples/ex-widgets.R", package="gWidgetsWWW") +localServerStart("Examples/ex-windows.R", package="gWidgetsWWW") -- cgit v1.2.1