void ScrollListWidget::render(void* param) { setclip(); if (DoClear) gps.erasescreen_clip(); int X=x; int Y=y; int i=PageStart; gps.locate(Y,X); char store[256]; while (i<PageEnd) { if (i==count) break; const char* str=ListSrc->ListItem(i,param,store); if (i==selected) { if (HasFocus) gps.changecolor(FSelColorF, FSelColorB, FSelColorH); else gps.changecolor(SelColorF, SelColorB, SelColorH); } else gps.changecolor(ColorF, ColorB, ColorH); while (1) { gps.addchar(*str,1); if (*str) { str++; if (!(*str)) if (!ColorBlanks) break; } if (gps.screenx==x2) break; } ++i; gps.locate(++Y,X); } releaseclip(); }
void TabBarWidget::render(void* param) { setclip(); if (DoClear) gps.erasescreen_clip(); int X=x; int Y=y; int i=PageStart; gps.locate(Y,X); char store[256]; while (i<PageEnd) { if (i==count) break; const char* str=ListSrc->ListItem(i,param,store); int len=spacing; if (X+len>=x2) { X=x; ++Y; if (Y>y2) break; gps.locate(Y,X); } if (i==selected) { if (HasFocus) gps.changecolor(FSelColorF, FSelColorB, FSelColorH); else gps.changecolor(SelColorF, SelColorB, SelColorH); } else gps.changecolor(ColorF, ColorB, ColorH); while (len) { gps.addchar(*str,1); if (*str) { str++; if (!*str) if (!ColorBlanks) { X=gps.screenx; gps.locate(Y,X+len); break; } } --len; } ++i; X=gps.screenx; } releaseclip(); }