The R Project SVN R

Rev

Rev 26830 | Rev 28840 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26830 Rev 28786
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Langage for Statistical Data Analysis
2
 *  R : A Computer Langage for Statistical Data Analysis
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
4
 *  Copyright (C) 1998--2003  Robert Gentleman, Ross Ihaka and the
4
 *  Copyright (C) 1998--2004  Robert Gentleman, Ross Ihaka and the
5
 *                            R Development Core Team
5
 *                            R Development Core Team
6
 *
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  the Free Software Foundation; either version 2 of the License, or
Line 127... Line 127...
127
static char *bufp;
127
static char *bufp;
128
static int bwidth;			/* width of the border */
128
static int bwidth;			/* width of the border */
129
static int hwidth;			/* width of header  */
129
static int hwidth;			/* width of header  */
130
static int text_offset;
130
static int text_offset;
131
 
131
 
132
static SEXP inputlist;  /* each element is a vector for that row */
-
 
133
static SEXP ssNewVector(SEXPTYPE, int);
132
static SEXP ssNewVector(SEXPTYPE, int);
134
static SEXP ssNA_STRING;
133
static SEXP ssNA_STRING;
135
static double ssNA_REAL;
134
static double ssNA_REAL;
136
 
135
 
137
static Atom _XA_WM_PROTOCOLS, protocol;
136
static Atom _XA_WM_PROTOCOLS, protocol;
Line 417... Line 416...
417
	drawrectangle(0, hwidth + i * box_h, boxw[0], box_h, 1, 1);
416
	drawrectangle(0, hwidth + i * box_h, boxw[0], box_h, 1, 1);
418
     /* so row 0 and col 0 are reserved for labels */
417
     /* so row 0 and col 0 are reserved for labels */
419
    colmax = colmin + (nwide - 2);
418
    colmax = colmin + (nwide - 2);
420
    rowmax = rowmin + (nhigh - 2);
419
    rowmax = rowmin + (nhigh - 2);
421
    printlabs();
420
    printlabs();
422
    if (inputlist != R_NilValue)
-
 
423
	for (i = colmin; i <= colmax; i++) drawcol(i);
421
    for (i = colmin; i <= colmax; i++) drawcol(i);
424
 
422
 
425
    /* draw the quit etc boxes */
423
    /* draw the quit etc boxes */
426
 
424
 
427
    i = textwidth("Quit", 4);
425
    i = textwidth("Quit", 4);
428
    box_coords[0] = st = fullwindowWidth - 6 - bwidth;
426
    box_coords[0] = st = fullwindowWidth - 6 - bwidth;
Line 1697... Line 1695...
1697
    
1695
    
1698
    if (whichrow == 0) {
1696
    if (whichrow == 0) {
1699
	/* won't have  cell here */
1697
	/* won't have  cell here */
1700
    } else {
1698
    } else {
1701
	strcpy(copycontents, "");
1699
	strcpy(copycontents, "");
1702
	if (length(inputlist) >= whichcol) {
1700
	if (length(work) >= whichcol) {
1703
	    tmp = CAR(nthcdr(inputlist, whichcol - 1));
1701
	    tmp = VECTOR_ELT(work, whichcol - 1);
1704
	    if (tmp != R_NilValue &&
1702
	    if (tmp != R_NilValue &&
1705
		(i = whichrow - 1) < (int)LEVELS(tmp) ) {
1703
		(i = whichrow - 1) < LENGTH(tmp) ) {
1706
		PrintDefaults(R_NilValue);
1704
		PrintDefaults(R_NilValue);
1707
		if (TYPEOF(tmp) == REALSXP) {
1705
		if (TYPEOF(tmp) == REALSXP) {
1708
		    if (REAL(tmp)[i] != ssNA_REAL)
1706
		    if (REAL(tmp)[i] != ssNA_REAL)
1709
			strcpy(copycontents, EncodeElement(tmp, i, 0));
1707
			strcpy(copycontents, EncodeElement(tmp, i, 0));
1710
		} else if (TYPEOF(tmp) == STRSXP) {
1708
		} else if (TYPEOF(tmp) == STRSXP) {