static void background_draw(PANEL *UNUSED(p), int UNUSED(x), int UNUSED(y), int width, int height) { drawrect(0, 0, LIST_RIGHT, LIST_Y - 1, LIST_DARK); drawhline(0, LIST_Y - 1, LIST_RIGHT, LIST_EDGE); drawrect(0, LIST_Y, LIST_RIGHT, height + LIST_BOTTOM, LIST_MAIN); drawrect(0, height + LIST_BOTTOM, LIST_RIGHT, height, LIST_DARK); drawself(); drawrect(LIST_RIGHT, 0, width, height, WHITE); drawvline(LIST_RIGHT, 1, LIST_Y - 1, LIST_EDGE3); drawpixel(LIST_RIGHT, LIST_Y - 1, LIST_EDGE2); drawvline(LIST_RIGHT, LIST_Y, height - SCALE * 15, LIST_EDGE4); drawpixel(LIST_RIGHT, height - SCALE * 15, LIST_EDGE5); drawhline(LIST_RIGHT + 1, LIST_Y - 1, width, C_GRAY); }
static void w32_drawvline(int x, int y, int h, GrxColor color) { RECT Rect; GRX_ENTER(); drawvline(x, y, h, color); Rect.left = x; Rect.top = y; Rect.right = x + 1; Rect.bottom = y + h; InvalidateRect(hGRXWnd, &Rect, FALSE); GRX_LEAVE(); }
static void drawtexth(int x, int y, char_t *str, uint16_t length, int d, int h, int hlen, uint16_t lineheight) { // Draw cursor h -= d; if(h + hlen < 0 || h > length) { drawtext(x, y, str, length); return; } else if(hlen == 0) { drawtext(x, y, str, length); int w = textwidth(str, h + hlen); drawvline(x + w, y, y + lineheight, COLOR_MAIN_TEXT); return; } if(h < 0) { hlen += h; h = 0; if(hlen < 0) { hlen = 0; } } if(h + hlen > length) { hlen = length - h; } int width; width = drawtext_getwidth(x, y, str, h); uint32_t color = setcolor(COLOR_SELECTION_TEXT); int w = textwidth(str + h, hlen); draw_rect_fill(x + width, y, w, lineheight, COLOR_SELECTION_BACKGROUND); drawtext(x + width, y, str + h, hlen); width += w; setcolor(color); drawtext(x + width, y, str + h + hlen, length - (h + hlen)); }
static void drawtexth(int x, int y, char_t *str, uint16_t length, int d, int h, int hlen, uint16_t lineheight) { h -= d; if(h + hlen < 0 || h > length) { drawtext(x, y, str, length); return; } else if(hlen == 0) { drawtext(x, y, str, length); int w = textwidth(str, h + hlen); drawvline(x + w, y, y + lineheight, BLACK); return; } if(h < 0) { hlen += h; h = 0; if(hlen < 0) { hlen = 0; } } if(h + hlen > length) { hlen = length - h; } int width; width = drawtext_getwidth(x, y, str, h); uint32_t color = setcolor(TEXT_HIGHLIGHT); int w = textwidth(str + h, hlen); drawrectw(x + width, y, w, lineheight, TEXT_HIGHLIGHT_BG); drawtext(x + width, y, str + h, hlen); width += w; setcolor(color); drawtext(x + width, y, str + h + hlen, length - (h + hlen)); }