Commit e62cb8c6 authored by m.eik michalke's avatar m.eik michalke
Browse files

added min_rows and min_columns to rk.XML.matrix()

parent 9f2414f2
ChangeLog for package rkwarddev
changes in version 0.07-1 (2015-01-13)
changes in version 0.07-1 (2015-01-20)
fixed:
- rk.XML.optionset() does now allow to re-use objects defined in the same
function call (i.e., refer to optioncolumns in the logic section)
......@@ -45,6 +45,7 @@ added:
rk.XML.vars() to also accept "duplicates"
- new argument "var" in rk.paste.JS() to define whether the JS keyword
"var" should be used or omitted for rk.JS.var objects
- rk.XML.matrix() now also accepts the arguments "min_rows" and "min_columns"
changed:
- function i18n() was changed to be used in JavaScript generation only;
this breaks code using the function introduced with 0.06-4, but that was to
......
......@@ -30,15 +30,17 @@
#' smallest representable value.
#' @param max Maximum acceptable value (if \code{type} is "integer" or "real"). Defaults to the
#' largest representable value.
#' @param min_rows Minimum number of rows, matrix will refuse shrink below this size.
#' @param min_columns Minimum number of columns, matrix will refuse shrink below this size.
#' @param allow_missings Logical, whether missing (empty) values are allowed in the matrix
#' (if \code{type} is "string").
#' @param allow_user_resize_columns Logical, if \code{TRUE}, the user can add columns by typing
#' on the rightmost (inactive) cells.
#' @param allow_user_resize_rows Logical, if \code{TRUE}, the user can add rows by typing on the
#' bottommost (inactive) cells.
#' @param fixed_width Logical, force the GUI element to stay at its initial width. Do not use in
#' combindation with matrices, where the number of columns may change in any way.
#' Useful, esp. when creating a vector input element (rows="1").
#' @param fixed_width Logical, assume the column count will not change. The last (or typically only)
#' column will be stretched to take up the available width. Do not use in combination with matrices,
#' where the number of columns may change in any way. Useful, esp. when creating a vector input element (rows="1").
#' @param fixed_height Logical, force the GUI element to stay at its initial height. Do not use in
#' combindation with matrices, where the number of rows may change in any way.
#' Useful, esp. when creating a vector input element (columns="1").
......@@ -63,7 +65,7 @@
#' @examples
#' test.matrix <- rk.XML.matrix("A matrix")
rk.XML.matrix <- function(label, mode="real", rows=2, columns=2, min=NULL, max=NULL,
rk.XML.matrix <- function(label, mode="real", rows=2, columns=2, min=NULL, max=NULL, min_rows=0, min_columns=0,
allow_missings=FALSE, allow_user_resize_columns=TRUE,
allow_user_resize_rows=TRUE, fixed_width=FALSE, fixed_height=FALSE,
horiz_headers=NULL, vert_headers=NULL, id.name="auto", help=NULL, component=rk.get.comp(), i18n=NULL){
......@@ -102,6 +104,9 @@ rk.XML.matrix <- function(label, mode="real", rows=2, columns=2, min=NULL, max=N
attr.list[["rows"]] <- rows
} else {}
} else {}
if(min_rows != 0){
attr.list[["min_rows"]] <- min_rows
} else {}
if(!isTRUE(allow_user_resize_columns)){
attr.list[["allow_user_resize_columns"]] <- "false"
......@@ -109,6 +114,9 @@ rk.XML.matrix <- function(label, mode="real", rows=2, columns=2, min=NULL, max=N
attr.list[["columns"]] <- columns
} else {}
} else {}
if(min_columns != 0){
attr.list[["min_columns"]] <- min_columns
} else {}
if(isTRUE(fixed_width)){
attr.list[["fixed_width"]] <- "true"
......
Supports Markdown
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