The R Project SVN R

Rev

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

Rev 32677 Rev 34294
Line 607... Line 607...
607
	lab = STRING_ELT(names, col - 1);
607
	lab = STRING_ELT(names, col - 1);
608
	if(lab != NA_STRING) strp = CHAR(lab); else strp = "var12";
608
	if(lab != NA_STRING) strp = CHAR(lab); else strp = "var12";
609
	PrintDefaults(R_NilValue);
609
	PrintDefaults(R_NilValue);
610
	w = textwidth(strp, strlen(strp));
610
	w = textwidth(strp, strlen(strp));
611
	for (i = 0; i < INTEGER(lens)[col - 1]; i++) {
611
	for (i = 0; i < INTEGER(lens)[col - 1]; i++) {
612
	    strp = EncodeElement(tmp, i, 0);
612
	    strp = EncodeElement(tmp, i, 0, '.');
613
	    w1 = textwidth(strp, strlen(strp));
613
	    w1 = textwidth(strp, strlen(strp));
614
	    if (w1 > w) w = w1;
614
	    if (w1 > w) w = w1;
615
	}
615
	}
616
	if(w < 0.5*box_w) w = 0.5*box_w;
616
	if(w < 0.5*box_w) w = 0.5*box_w;
617
	if(w < 0.8*box_w) w+= 0.1*box_w;
617
	if(w < 0.8*box_w) w+= 0.1*box_w;
Line 703... Line 703...
703
{
703
{
704
    char *strp;
704
    char *strp;
705
    PrintDefaults(R_NilValue);
705
    PrintDefaults(R_NilValue);
706
    if (TYPEOF(invec) == REALSXP) {
706
    if (TYPEOF(invec) == REALSXP) {
707
	if (REAL(invec)[vrow] != ssNA_REAL) {
707
	if (REAL(invec)[vrow] != ssNA_REAL) {
708
	    strp = EncodeElement(invec, vrow, 0);
708
	    strp = EncodeElement(invec, vrow, 0, '.');
709
	    printstring(strp, strlen(strp), ssrow, sscol, 0);
709
	    printstring(strp, strlen(strp), ssrow, sscol, 0);
710
	}
710
	}
711
    }
711
    }
712
    else if (TYPEOF(invec) == STRSXP) {
712
    else if (TYPEOF(invec) == STRSXP) {
713
	if (!streql(CHAR(STRING_ELT(invec, vrow)),
713
	if (!streql(CHAR(STRING_ELT(invec, vrow)),
714
		    CHAR(STRING_ELT(ssNA_STRING, 0)))) {
714
		    CHAR(STRING_ELT(ssNA_STRING, 0)))) {
715
	    strp = EncodeElement(invec, vrow, 0);
715
	    strp = EncodeElement(invec, vrow, 0, '.');
716
	    printstring(strp, strlen(strp), ssrow, sscol, 0);
716
	    printstring(strp, strlen(strp), ssrow, sscol, 0);
717
	}
717
	}
718
    }
718
    }
719
    else
719
    else
720
	error("dataentry: internal memory error");
720
	error("dataentry: internal memory error");
Line 1853... Line 1853...
1853
	    if (tmp != R_NilValue &&
1853
	    if (tmp != R_NilValue &&
1854
		(i = whichrow - 1) < LENGTH(tmp) ) {
1854
		(i = whichrow - 1) < LENGTH(tmp) ) {
1855
		PrintDefaults(R_NilValue);
1855
		PrintDefaults(R_NilValue);
1856
		if (TYPEOF(tmp) == REALSXP) {
1856
		if (TYPEOF(tmp) == REALSXP) {
1857
		    if (REAL(tmp)[i] != ssNA_REAL)
1857
		    if (REAL(tmp)[i] != ssNA_REAL)
1858
			strcpy(copycontents, EncodeElement(tmp, i, 0));
1858
			strcpy(copycontents, EncodeElement(tmp, i, 0, '.'));
1859
		} else if (TYPEOF(tmp) == STRSXP) {
1859
		} else if (TYPEOF(tmp) == STRSXP) {
1860
		    if (!streql(CHAR(STRING_ELT(tmp, i)),
1860
		    if (!streql(CHAR(STRING_ELT(tmp, i)),
1861
				CHAR(STRING_ELT(ssNA_STRING, 0))))
1861
				CHAR(STRING_ELT(ssNA_STRING, 0))))
1862
			strcpy(copycontents, EncodeElement(tmp, i, 0));
1862
			strcpy(copycontents, EncodeElement(tmp, i, 0, '.'));
1863
		}
1863
		}
1864
	    }
1864
	    }
1865
	}
1865
	}
1866
    }
1866
    }
1867
    highlightrect();
1867
    highlightrect();