这篇教程C++ text_height函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中text_height函数的典型用法代码示例。如果您正苦于以下问题:C++ text_height函数的具体用法?C++ text_height怎么用?C++ text_height使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了text_height函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: draw_spritevoid AWgtCheckbox::draw(){ int tx; int ty; if (checkCheckedBmp) { if (checked) draw_sprite(tguiBitmap, checkCheckedBmp, x, y); else draw_sprite(tguiBitmap, checkUncheckedBmp, x, y); tx = x + checkCheckedBmp->w + checkPadding; ty = y + ((checkCheckedBmp->h - text_height(aWgtFont)) / 2); } else { int w = text_height(aWgtFont); rect(tguiBitmap, x, y, x+w-1, y+w-1, shadowColor); rectfill(tguiBitmap, x+1, y+1, x+w-2, y+w-2, textColor); if (checked) { line(tguiBitmap, x+1, y+1, x+w-2, y+w-2, shadowColor); line(tguiBitmap, x+1, y+w-2, x+w-2, y+1, shadowColor); } tx = x + w + checkPadding; ty = y; } aWgtTextout(tguiBitmap, aWgtFont, text, tx, ty, textColor, shadowColor, shadowType); if (focus) { drawing_mode(DRAW_MODE_MASKED_PATTERN, linePatternBmp, 0, 0); rect(tguiBitmap, tx-2, ty-2, tx+text_length(aWgtFont, text)+2, ty+text_height(aWgtFont)+2, aWgtFocusColor); drawing_mode(DRAW_MODE_SOLID, 0, 0, 0); }}
开发者ID:carriercomm,项目名称:monster,代码行数:35,
示例2: d_abitmap_list_procintd_abitmap_list_proc (int msg, DIALOG *d, int c){ if (msg == MSG_DRAW) { BITMAP *bmp = gui_get_screen(); int height, size, i, len, bar, x, y; char *sel = d->dp2; char s[1024]; int c = 0; if (d->flags & D_GOTFOCUS) c = 1; if (d->flags & D_DISABLED) c = 2; (*(char *(*)(int, int *)) d->dp) (-1, &size); height = (d->h - 4) / text_height (font); bar = (size > height); abitmap_draw_area (d, B_LIST, 0, 0, bar ? d->w - 12 : d->w, d->h, 0, 0); if (bar) abitmap_draw_scroller (d, d->d2, size, height); /* draw the contents */ for (i = 0; i < height; i++) { if (d->d2 + i < size) { int fg = theme->bitmaps[B_LIST][c].color; x = d->x + 2; y = d->y + 2 + i * text_height (font); if (d->d2 + i == d->d1 || ((sel) && (sel[d->d2 + i]))) { abitmap_draw_area (d, B_LIST_ITEM, 0, y - d->y, bar ? d->w - 12 : d->w, text_height (font), 0, 0); fg = theme->bitmaps[B_LIST_ITEM][c].color; } ustrzcpy (s, sizeof (s), (*(char *(*)(int, int *)) d->dp) (i + d->d2, NULL)); x += 8; len = ustrlen (s); while (text_length (font, s) >= MAX (d->w - 1 - (bar ? 22 : 11), 1)) { len--; usetat (s, len, 0); } textout_ex (bmp, font, s, x, y, fg, -1); x += text_length (font, s); } } return D_O_K; } return d_list_proc (msg, d, c);}
开发者ID:argarak,项目名称:tw-light,代码行数:55,
示例3: gtk_draw_menu_itemstatic void gtk_draw_menu_item(MENU *m, int x, int y, int w, int h, int bar, int sel){ BITMAP *bmp = gui_get_screen(); int fg, bg; int i, j; char buf[256], *tok; if (m->flags & D_DISABLED) { fg = nshadow; bg = normal; } else { fg = black; bg = (sel) ? highlight : normal; } rectfill(bmp, x+1, y+1, x+w-3, y+h-4, bg); if (ugetc(m->text)) { i = 0; j = ugetc(m->text); while ((j) && (j != '/t')) { i += usetc(buf+i, j); j = ugetc(m->text+i); } usetc(buf+i, 0); gui_textout_ex(bmp, buf, x+8, y+1, fg, bg, FALSE); if (j == '/t') { tok = m->text+i + uwidth(m->text+i); gui_textout_ex(bmp, tok, x+w-gui_strlen(tok)-10, y+1, fg, bg, FALSE); } if ((m->child) && (!bar)) draw_sprite(bmp, menu_arrow_bmp, x+w-12, y+(h-menu_arrow_bmp->h)/2); } else { hline(bmp, x+4, y+text_height(font)/2+2, x+w-4, nshadow); hline(bmp, x+4, y+text_height(font)/2+3, x+w-4, highlight); } if (m->flags & D_SELECTED) { line(bmp, x+1, y+text_height(font)/2+1, x+3, y+text_height(font)+1, fg); line(bmp, x+3, y+text_height(font)+1, x+6, y+2, fg); }}
开发者ID:ufaith,项目名称:d2imdev,代码行数:49,
示例4: create_bitmapImagen::Imagen(Fuente *fuente, string texto, int r, int g, int b){ if ( !fuente ) { bitmap = NULL ; throw Error::ExcepcionParametro("Graficos::Imagen::Imagen(Fuente *, string)", 1); } // Creamos el bitmap con el tama C++ text_layer_create函数代码示例 C++ text_error函数代码示例
|