The R Project SVN R

Rev

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

Rev 45070 Rev 45528
Line 272... Line 272...
272
			       coerceVector(VECTOR_ELT(DE->work, i), type));
272
			       coerceVector(VECTOR_ELT(DE->work, i), type));
273
	}
273
	}
274
    }
274
    }
275
 
275
 
276
    /* scale scrollbars as needed */
276
    /* scale scrollbars as needed */
-
 
277
    DE->xScrollbarScale = DE->yScrollbarScale = 1;
277
    if (DE->xmaxused > 10000) DE->xScrollbarScale = DE->xmaxused/1000;
278
    if (DE->xmaxused > 10000) DE->xScrollbarScale = DE->xmaxused/1000;
278
    if (DE->ymaxused > 10000) DE->yScrollbarScale = DE->ymaxused/1000;
279
    if (DE->ymaxused > 10000) DE->yScrollbarScale = DE->ymaxused/1000;
279
 
280
 
280
    /* start up the window, more initializing in here */
281
    /* start up the window, more initializing in here */
281
    if (initwin(DE, G_("Data Editor")))
282
    if (initwin(DE, G_("Data Editor")))
Line 668... Line 669...
668
	gchangescrollbar(DE->de, VWINSB, (DE->rowmin - 1)/DE->yScrollbarScale,
669
	gchangescrollbar(DE->de, VWINSB, (DE->rowmin - 1)/DE->yScrollbarScale,
669
			 DE->ymaxused/DE->yScrollbarScale,
670
			 DE->ymaxused/DE->yScrollbarScale,
670
			 max(DE->nhigh/DE->yScrollbarScale, 1), 0);
671
			 max(DE->nhigh/DE->yScrollbarScale, 1), 0);
671
	break;
672
	break;
672
    case DOWN:
673
    case DOWN:
673
	if (DE->rowmax >= 65535) return;
674
	// if (DE->rowmax >= 65535) return;
674
	DE->rowmin++;
675
	DE->rowmin++;
675
	DE->rowmax++;
676
	DE->rowmax++;
676
	copyarea(DE, 0, DE->hwidth + 2 * DE->box_h, 0, DE->hwidth + DE->box_h);
677
	copyarea(DE, 0, DE->hwidth + 2 * DE->box_h, 0, DE->hwidth + DE->box_h);
677
	drawrow(DE, DE->rowmax);
678
	drawrow(DE, DE->rowmax);
678
	gchangescrollbar(DE->de, VWINSB, (DE->rowmin - 1)/DE->yScrollbarScale,
679
	gchangescrollbar(DE->de, VWINSB, (DE->rowmin - 1)/DE->yScrollbarScale,
Line 1358... Line 1359...
1358
 
1359
 
1359
    DE->de = newdataeditor(DE, title);
1360
    DE->de = newdataeditor(DE, title);
1360
    if(!DE->de) return TRUE;
1361
    if(!DE->de) return TRUE;
1361
    DE->oldWIDTH = DE->oldHEIGHT = 0;
1362
    DE->oldWIDTH = DE->oldHEIGHT = 0;
1362
    DE->nboxchars = 5;
1363
    DE->nboxchars = 5;
1363
    DE->xScrollbarScale = DE->yScrollbarScale = 1;
-
 
1364
 
1364
 
1365
    DE->nboxchars = asInteger(GetOption(install("de.cellwidth"), R_GlobalEnv));
1365
    DE->nboxchars = asInteger(GetOption(install("de.cellwidth"), R_GlobalEnv));
1366
    if (DE->nboxchars == NA_INTEGER || DE->nboxchars < 0) DE->nboxchars = 0;
1366
    if (DE->nboxchars == NA_INTEGER || DE->nboxchars < 0) DE->nboxchars = 0;
1367
    if (DE->nboxchars > 0) check(DE->de_mvw);
1367
    if (DE->nboxchars > 0) check(DE->de_mvw);
1368
    DE->box_w = ((DE->nboxchars >0)?DE->nboxchars:FIELDWIDTH)*(DE->p->fw) + 8;
1368
    DE->box_w = ((DE->nboxchars >0)?DE->nboxchars:FIELDWIDTH)*(DE->p->fw) + 8;
Line 1545... Line 1545...
1545
	DE->colmin = min(DE->xmaxused, -pos*DE->xScrollbarScale);
1545
	DE->colmin = min(DE->xmaxused, -pos*DE->xScrollbarScale);
1546
    } else {
1546
    } else {
1547
	DE->rowmin = 1 + pos*DE->yScrollbarScale;
1547
	DE->rowmin = 1 + pos*DE->yScrollbarScale;
1548
	if(DE->rowmin > DE->ymaxused - DE->nhigh + 2)
1548
	if(DE->rowmin > DE->ymaxused - DE->nhigh + 2)
1549
	    DE->rowmin = max(1,DE->ymaxused - DE->nhigh + 2);
1549
	    DE->rowmin = max(1,DE->ymaxused - DE->nhigh + 2);
-
 
1550
	printf("pos %d, rowmin %d, scale %d\n", pos, DE->rowmin, DE->yScrollbarScale);
1550
    }
1551
    }
1551
    drawwindow(DE);
1552
    drawwindow(DE);
1552
}
1553
}
1553
 
1554
 
1554
static checkbox varwidths;
1555
static checkbox varwidths;
Line 1836... Line 1837...
1836
	if (type != STRSXP && type != REALSXP)
1837
	if (type != STRSXP && type != REALSXP)
1837
	    errorcall(call, G_("invalid argument"));
1838
	    errorcall(call, G_("invalid argument"));
1838
    }
1839
    }
1839
 
1840
 
1840
    /* scale scrollbars as needed */
1841
    /* scale scrollbars as needed */
-
 
1842
    DE->xScrollbarScale = DE->yScrollbarScale = 1;
1841
    if (DE->xmaxused > 10000) DE->xScrollbarScale = DE->xmaxused/1000;
1843
    if (DE->xmaxused > 10000) DE->xScrollbarScale = DE->xmaxused/1000;
1842
    if (DE->ymaxused > 10000) DE->yScrollbarScale = DE->ymaxused/1000;
1844
    if (DE->ymaxused > 10000) DE->yScrollbarScale = DE->ymaxused/1000;
1843
 
1845
 
1844
    /* start up the window, more initializing in here */
1846
    /* start up the window, more initializing in here */
1845
    if (initwin(DE, CHAR(STRING_ELT(stitle, 0))))
1847
    if (initwin(DE, CHAR(STRING_ELT(stitle, 0))))