From ed8057b5a43bcdad59e7ebf4c3d429e38b25836d Mon Sep 17 00:00:00 2001 From: jranke Date: Wed, 4 Sep 2013 15:54:10 +0000 Subject: git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@87 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- inst/GUI/mkinGUItest.RData | Bin 0 -> 169 bytes inst/GUI/simple2.R | 65 +++++++++++++++++++++++++++++++++++++++++++++ inst/GUI/test-simple2.R | 17 ++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 inst/GUI/mkinGUItest.RData create mode 100644 inst/GUI/simple2.R create mode 100644 inst/GUI/test-simple2.R diff --git a/inst/GUI/mkinGUItest.RData b/inst/GUI/mkinGUItest.RData new file mode 100644 index 00000000..82b7086d Binary files /dev/null and b/inst/GUI/mkinGUItest.RData differ diff --git a/inst/GUI/simple2.R b/inst/GUI/simple2.R new file mode 100644 index 00000000..2f725d16 --- /dev/null +++ b/inst/GUI/simple2.R @@ -0,0 +1,65 @@ +# Simple gWidgetsWWW2 GUI for mkin +w <- gwindow("Simple R GUI for kinetic evaluations") +sb <- gstatusbar("Powered by gWidgetsWWW2 and Rook", cont = w) +g <- gframe("Simple R GUI for kinetic evaluations", cont = w, + use.scrollwindow = TRUE, horizontal = FALSE) + +# Project definition {{{1 +prg <- gexpandgroup("Project definition", cont = g) +visible(prg) <- TRUE + +make_observed <- function(observed.df) { + if (!exists("observed.df")) { + n.observed <- 2 + observed.names = c("parent", paste("M", 1:(n.observed - 1), sep="")) + observed.df = data.frame(Index = 1:n.observed, + Name = observed.names, + stringsAsFactors = FALSE) + } + + observed.gdf <- gdf(observed.df, + name = "Names of observed variables", + width = 500, height = 250, cont = prg) + observed.gdf$set_column_width(1, 40) +} + +f <- gfile(text = "Set project file", cont = prg, + handler = function(h, ...) + { + tmpfile <- normalizePath(svalue(h$obj), winslash = "/") + load(tmpfile) + make_observed(observed.df) + }) + +# Editable table of studies {{{1 +stg <- gexpandgroup("Studies", cont = g) +visible(stg) <- FALSE +studies.df <- data.frame(Index = as.integer(1), + Author = "FOCUS kinetics workgroup", + Year = "2006", + Title = "FOCUS Kinetics", + Datasets = as.integer(3), + stringsAsFactors = FALSE) +studies.gdf <- gdf(studies.df, + name = "Editable list of studies in the project", + width = "auto", + cont = stg) +studies.gdf$set_column_width(1, 40) +studies.gdf$set_column_width(2, 200) + +# Table of datasets to select them for editing {{{1 +dsg <- gexpandgroup("Datasets", cont = g) +visible(dsg) <- FALSE +ds.df <- data.frame(Index = 1:3, + Study = as.integer(1), + Title = paste("FOCUS dataset", c("A", "B", "C")), + icon = asIcon(c("editor", "editor", "editor")), + stringsAsFactors = FALSE) +ds.gtable <- gtable(ds.df, width = "auto", cont = dsg) +ds.gtable$set_column_width(1, 40) +ds.gtable$set_column_width(2, 40) +ds.gtable$set_column_width(3, 200) + + +# 1}}} +# vim: set foldmethod=marker ts=2 sw=2 expandtab: diff --git a/inst/GUI/test-simple2.R b/inst/GUI/test-simple2.R new file mode 100644 index 00000000..e33e0774 --- /dev/null +++ b/inst/GUI/test-simple2.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