From 8fa33dc3365f0e27a5013748321def4bef937049 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 9 Mar 2008 02:33:23 +0000 Subject: Add Unicode support, enabled with the --enable-unicode flag, which requires libncursesw. Thanks to Sergej Pupykin! --- Panel.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Panel.c') diff --git a/Panel.c b/Panel.c index 14f542bc..00ff4c69 100644 --- a/Panel.c +++ b/Panel.c @@ -265,8 +265,8 @@ void Panel_draw(Panel* this, bool focus) { attrset(attr); mvhline(y, x, ' ', this->w); if (scrollH < this->header.len) { - mvaddchnstr(y, x, this->header.chstr + scrollH, - MIN(this->header.len - scrollH, this->w)); + RichString_printoffnVal(this->header, y, x, scrollH, + MIN(this->header.len - scrollH, this->w)); } attrset(CRT_colors[RESET_COLOR]); y++; @@ -289,12 +289,12 @@ void Panel_draw(Panel* this, bool focus) { RichString_setAttr(&itemRef, highlight); mvhline(y + j, x+0, ' ', this->w); if (amt > 0) - mvaddchnstr(y+j, x+0, itemRef.chstr + scrollH, amt); + RichString_printoffnVal(itemRef, y+j, x+0, scrollH, amt); attrset(CRT_colors[RESET_COLOR]); } else { mvhline(y+j, x+0, ' ', this->w); if (amt > 0) - mvaddchnstr(y+j, x+0, itemRef.chstr + scrollH, amt); + RichString_printoffnVal(itemRef, y+j, x+0, scrollH, amt); } } for (int i = y + (last - first); i < y + this->h; i++) @@ -312,12 +312,14 @@ void Panel_draw(Panel* this, bool focus) { newObj->display(newObj, &newRef); mvhline(y+ this->oldSelected - this->scrollV, x+0, ' ', this->w); if (scrollH < oldRef.len) - mvaddchnstr(y+ this->oldSelected - this->scrollV, x+0, oldRef.chstr + this->scrollH, MIN(oldRef.len - scrollH, this->w)); + RichString_printoffnVal(oldRef, y+this->oldSelected - this->scrollV, x, + this->scrollH, MIN(oldRef.len - scrollH, this->w)); attrset(highlight); mvhline(y+this->selected - this->scrollV, x+0, ' ', this->w); RichString_setAttr(&newRef, highlight); if (scrollH < newRef.len) - mvaddchnstr(y+this->selected - this->scrollV, x+0, newRef.chstr + this->scrollH, MIN(newRef.len - scrollH, this->w)); + RichString_printoffnVal(newRef, y+this->selected - this->scrollV, x, + this->scrollH, MIN(newRef.len - scrollH, this->w)); attrset(CRT_colors[RESET_COLOR]); } this->oldSelected = this->selected; -- cgit v1.2.3