这篇教程C++ tty_print_string函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tty_print_string函数的典型用法代码示例。如果您正苦于以下问题:C++ tty_print_string函数的具体用法?C++ tty_print_string怎么用?C++ tty_print_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tty_print_string函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: tree_show_mini_infostatic void tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols){ Dlg_head *h = tree->widget.parent; int line; /* Show mini info */ if (tree->is_panel){ if (!show_mini_info) return; line = tree_lines+2; } else line = tree_lines+1; tty_draw_hline (tree->widget.y + line, tree->widget.x + 1, ' ', tree_cols); widget_move (&tree->widget, line, 1); if (tree->searching){ /* Show search string */ tty_setcolor (TREE_NORMALC (h)); tty_setcolor (DLG_FOCUSC (h)); tty_print_char (PATH_SEP); tty_print_string (str_fit_to_term (tree->search_buffer, tree_cols - 2, J_LEFT_FIT)); tty_print_char (' '); tty_setcolor (DLG_FOCUSC (h)); } else { /* Show full name of selected directory */ tty_print_string (str_fit_to_term (tree->selected_ptr->name, tree_cols, J_LEFT_FIT)); }}
开发者ID:sfionov,项目名称:mc-dev,代码行数:32,
示例2: menubar_paint_idxstatic voidmenubar_paint_idx (WMenuBar * menubar, unsigned int idx, int color){ const Menu *menu = g_list_nth_data (menubar->menu, menubar->selected); const menu_entry_t *entry = g_list_nth_data (menu->entries, idx); const int y = 2 + idx; int x = menu->start_x; if (x + menu->max_entry_len + 4 > (gsize) menubar->widget.cols) x = menubar->widget.cols - menu->max_entry_len - 4; if (entry == NULL) { /* menu separator */ tty_setcolor (MENU_ENTRY_COLOR); widget_move (&menubar->widget, y, x - 1); tty_print_alt_char (ACS_LTEE, FALSE); tty_draw_hline (menubar->widget.y + y, menubar->widget.x + x, ACS_HLINE, menu->max_entry_len + 3); widget_move (&menubar->widget, y, x + menu->max_entry_len + 3); tty_print_alt_char (ACS_RTEE, FALSE); } else { int yt, xt; /* menu text */ tty_setcolor (color); widget_move (&menubar->widget, y, x); tty_print_char ((unsigned char) entry->first_letter); tty_getyx (&yt, &xt); tty_draw_hline (yt, xt, ' ', menu->max_entry_len + 2); /* clear line */ tty_print_string (entry->text.start); if (entry->text.hotkey != NULL) { tty_setcolor (color == MENU_SELECTED_COLOR ? MENU_HOTSEL_COLOR : MENU_HOT_COLOR); tty_print_string (entry->text.hotkey); tty_setcolor (color); } if (entry->text.end != NULL) tty_print_string (entry->text.end); if (entry->shortcut != NULL) { widget_move (&menubar->widget, y, x + menu->max_hotkey_len + 3); tty_print_string (entry->shortcut); } /* move cursor to the start of entry text */ widget_move (&menubar->widget, y, x + 1); }}
开发者ID:ryanlee,项目名称:mc,代码行数:57,
示例3: chown_refreshstatic void chown_refresh (void){ common_dialog_repaint (ch_dlg); tty_setcolor (COLOR_NORMAL); dlg_move (ch_dlg, BY - 1, 8); tty_print_string (_("owner")); dlg_move (ch_dlg, BY - 1, 16); tty_print_string (_("group")); dlg_move (ch_dlg, BY - 1, 24); tty_print_string (_("other")); dlg_move (ch_dlg, BY - 1, 35); tty_print_string (_("owner")); dlg_move (ch_dlg, BY - 1, 53); tty_print_string (_("group")); dlg_move (ch_dlg, 3, 4); tty_print_string (_("On")); dlg_move (ch_dlg, BY + 1, 4); tty_print_string (_("Flag")); dlg_move (ch_dlg, BY + 2, 4); tty_print_string (_("Mode")); if (!single_set){ dlg_move (ch_dlg, 3, 54); tty_printf (_("%6d of %d"), files_on_begin - (current_panel->marked) + 1, files_on_begin); } print_flags ();}
开发者ID:sfionov,项目名称:mc-dev,代码行数:34,
示例4: mcview_display_statusstatic voidmcview_display_status (WView * view){ const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); tty_draw_hline (WIDGET (view)->y + top, WIDGET (view)->x + left, ' ', width); file_label = view->filename_vpath != NULL ? vfs_path_get_last_path_str (view->filename_vpath) : view->command != NULL ? view->command : ""; if (width > 40) { widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { char buffer[BUF_TRUNC_LEN + 1]; size_trunc_len (buffer, BUF_TRUNC_LEN, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ",#ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) :#endif ""); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_display_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end);}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:48,
示例5: hotkey_drawvoidhotkey_draw (Widget * w, const hotkey_t hotkey, gboolean focused){ widget_selectcolor (w, focused, FALSE); tty_print_string (hotkey.start); if (hotkey.hotkey != NULL) { widget_selectcolor (w, focused, TRUE); tty_print_string (hotkey.hotkey); widget_selectcolor (w, focused, FALSE); } if (hotkey.end != NULL) tty_print_string (hotkey.end);}
开发者ID:ilia-maslakov,项目名称:mc,代码行数:16,
示例6: groupbox_callbackstatic cb_ret_tgroupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data){ WGroupbox *g = GROUPBOX (w); switch (msg) { case MSG_DRAW: { WDialog *h = w->owner; gboolean disabled; disabled = widget_get_state (w, WST_DISABLED); tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL]); tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE); if (g->title != NULL) { tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_TITLE]); widget_move (w, 0, 1); tty_print_string (g->title); } return MSG_HANDLED; } case MSG_DESTROY: g_free (g->title); return MSG_HANDLED; default: return widget_default_callback (w, sender, msg, parm, data); }}
开发者ID:idispatch,项目名称:mc,代码行数:34,
示例7: tty_print_utf8_string2voidtty_print_utf8_string2 (estream_t fp, const byte *p, size_t n, size_t max_n){ size_t i; char *buf; if (no_terminal && !fp) return; /* we can handle plain ascii simpler, so check for it first */ for(i=0; i < n; i++ ) { if( p[i] & 0x80 ) break; } if( i < n ) { buf = utf8_to_native( (const char *)p, n, 0 ); if( max_n && (strlen( buf ) > max_n )) { buf[max_n] = 0; } /*(utf8 conversion already does the control character quoting)*/ tty_fprintf (fp, "%s", buf); xfree (buf); } else { if( max_n && (n > max_n) ) { n = max_n; } tty_print_string (fp, p, n ); }}
开发者ID:0ndorio,项目名称:gnupg,代码行数:30,
示例8: mcview_display_statusstatic voidmcview_display_status (mcview_t * view){ const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; screen_dimen file_label_width; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); widget_move (view, top, left); tty_draw_hline (-1, -1, ' ', width); file_label = view->filename ? view->filename : view->command ? view->command : ""; file_label_width = str_term_width1 (file_label) - 2; if (width > 40) { char buffer[BUF_TINY]; widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { size_trunc_len (buffer, 5, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ",#ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) : ""#else ""#endif ); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end);}
开发者ID:ilia-maslakov,项目名称:mc,代码行数:47,
示例9: chown_refreshstatic voidchown_refresh (Dlg_head * h){ common_dialog_repaint (h); tty_setcolor (COLOR_NORMAL); dlg_move (h, TY + 1, TX + 2); tty_print_string (_("Name")); dlg_move (h, TY + 3, TX + 2); tty_print_string (_("Owner name")); dlg_move (h, TY + 5, TX + 2); tty_print_string (_("Group name")); dlg_move (h, TY + 7, TX + 2); tty_print_string (_("Size")); dlg_move (h, TY + 9, TX + 2); tty_print_string (_("Permission"));}
开发者ID:ilia-maslakov,项目名称:mc,代码行数:18,
示例10: chmod_refreshstatic voidchmod_refresh (Dlg_head * h){ int y = file_gb->widget.y + 1; int x = file_gb->widget.x + 2; common_dialog_repaint (h); tty_setcolor (COLOR_NORMAL); tty_gotoyx (y, x); tty_print_string (file_info_labels[0]); tty_gotoyx (y + 2, x); tty_print_string (file_info_labels[1]); tty_gotoyx (y + 4, x); tty_print_string (file_info_labels[2]); tty_gotoyx (y + 6, x); tty_print_string (file_info_labels[3]);}
开发者ID:BrEacK,项目名称:mc,代码行数:19,
示例11: tty_printfvoidtty_printf (const char *fmt, ...){ va_list args; char buf[BUF_1K]; /* FIXME: is it enough? */ va_start (args, fmt); g_vsnprintf (buf, sizeof (buf), fmt, args); va_end (args); tty_print_string (buf);}
开发者ID:LubkaB,项目名称:mc,代码行数:11,
示例12: buttonbar_callbackstatic cb_ret_tbuttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data){ WButtonBar *bb = BUTTONBAR (w); int i; const char *text; switch (msg) { case MSG_FOCUS: return MSG_NOT_HANDLED; case MSG_HOTKEY: for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) if (parm == KEY_F (i + 1) && buttonbar_call (bb, i)) return MSG_HANDLED; return MSG_NOT_HANDLED; case MSG_DRAW: if (bb->visible) { buttonbar_init_button_positions (bb); widget_move (w, 0, 0); tty_setcolor (DEFAULT_COLOR); tty_printf ("%-*s", w->cols, ""); widget_move (w, 0, 0); for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) { int width; width = buttonbar_get_button_width (bb, i); if (width <= 0) break; tty_setcolor (BUTTONBAR_HOTKEY_COLOR); tty_printf ("%2d", i + 1); tty_setcolor (BUTTONBAR_BUTTON_COLOR); text = (bb->labels[i].text != NULL) ? bb->labels[i].text : ""; tty_print_string (str_fit_to_term (text, width - 2, J_LEFT_FIT)); } } return MSG_HANDLED; case MSG_DESTROY: for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) g_free (bb->labels[i].text); return MSG_HANDLED; default: return widget_default_callback (w, sender, msg, parm, data); }}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:54,
示例13: chown_refreshstatic voidchown_refresh (WDialog * h){ const int y = 3; const int x = 7 + GW * 2; dlg_default_repaint (h); tty_setcolor (COLOR_NORMAL); widget_move (h, y + 0, x); tty_print_string (_("Name")); widget_move (h, y + 2, x); tty_print_string (_("Owner name")); widget_move (h, y + 4, x); tty_print_string (_("Group name")); widget_move (h, y + 6, x); tty_print_string (_("Size")); widget_move (h, y + 8, x); tty_print_string (_("Permission"));}
开发者ID:LubkaB,项目名称:mc,代码行数:21,
示例14: menubar_drawstatic voidmenubar_draw (WMenuBar * menubar){ Widget *w = WIDGET (menubar); GList *i; /* First draw the complete menubar */ tty_setcolor (menubar->is_active ? MENU_ENTRY_COLOR : MENU_INACTIVE_COLOR); tty_draw_hline (w->y, w->x, ' ', w->cols); /* Now each one of the entries */ for (i = menubar->menu; i != NULL; i = g_list_next (i)) { menu_t *menu = MENU (i->data); gboolean is_selected = (menubar->selected == (gsize) g_list_position (menubar->menu, i)); menubar_set_color (menubar, is_selected, FALSE); widget_move (w, 0, menu->start_x); tty_print_char (' '); tty_print_string (menu->text.start); if (menu->text.hotkey != NULL) { menubar_set_color (menubar, is_selected, TRUE); tty_print_string (menu->text.hotkey); menubar_set_color (menubar, is_selected, FALSE); } if (menu->text.end != NULL) tty_print_string (menu->text.end); tty_print_char (' '); } if (menubar->is_dropped) menubar_draw_drop (menubar); else widget_move (w, 0, MENU (g_list_nth_data (menubar->menu, menubar->selected))->start_x);}
开发者ID:BpArCuCTeMbI,项目名称:mc,代码行数:40,
示例15: tree_show_mini_infostatic voidtree_show_mini_info (WTree * tree, int tree_lines, int tree_cols){ Dlg_head *h = tree->widget.owner; int line; /* Show mini info */ if (tree->is_panel) { if (!panels_options.show_mini_info) return; line = tree_lines + 2; } else line = tree_lines + 1; if (tree->searching) { /* Show search string */ tty_setcolor (INPUT_COLOR); tty_draw_hline (tree->widget.y + line, tree->widget.x + 1, ' ', tree_cols); widget_move (&tree->widget, line, 1); tty_print_char (PATH_SEP); tty_print_string (str_fit_to_term (tree->search_buffer, tree_cols - 2, J_LEFT_FIT)); tty_print_char (' '); } else { /* Show full name of selected directory */ char *tmp_path; tty_setcolor (tree->is_panel ? NORMAL_COLOR : TREE_NORMALC (h)); tty_draw_hline (tree->widget.y + line, tree->widget.x + 1, ' ', tree_cols); widget_move (&tree->widget, line, 1); tmp_path = vfs_path_to_str (tree->selected_ptr->name); tty_print_string (str_fit_to_term (tmp_path, tree_cols, J_LEFT_FIT)); g_free (tmp_path); }}
开发者ID:ryanlee,项目名称:mc,代码行数:39,
示例16: chown_info_updatestatic void chown_info_update (void){ /* display file info */ tty_setcolor (COLOR_NORMAL); /* name && mode */ dlg_move (ch_dlg, 3, 8); tty_print_string (str_fit_to_term (fname, 45, J_LEFT_FIT)); dlg_move (ch_dlg, BY + 2, 9); tty_printf ("%12o", get_mode ()); /* permissions */ update_permissions ();}
开发者ID:sfionov,项目名称:mc-dev,代码行数:14,
示例17: edit_draw_window_iconsstatic inline voidedit_draw_window_icons (const WEdit * edit, int color){ const Widget *w = (const Widget *) edit; char tmp[17]; tty_setcolor (color); if (edit->fullscreen) dlg_move (w->owner, 0, w->owner->cols - 6); else widget_move (w, 0, edit->widget.cols - 8); g_snprintf (tmp, sizeof (tmp), "[%s][%s]", edit_window_state_char, edit_window_close_char); tty_print_string (tmp);}
开发者ID:TomyLobo,项目名称:mc,代码行数:14,
示例18: check_callbackstatic cb_ret_tcheck_callback (Widget * w, widget_msg_t msg, int parm){ WCheck *c = (WCheck *) w; Dlg_head *h = c->widget.owner; switch (msg) { case WIDGET_HOTKEY: if (c->text.hotkey != NULL) { if (g_ascii_tolower ((gchar) c->text.hotkey[0]) == parm) { check_callback (w, WIDGET_KEY, ' '); /* make action */ return MSG_HANDLED; } } return MSG_NOT_HANDLED; case WIDGET_KEY: if (parm != ' ') return MSG_NOT_HANDLED; c->state ^= C_BOOL; c->state ^= C_CHANGE; h->callback (h, w, DLG_ACTION, 0, NULL); check_callback (w, WIDGET_FOCUS, ' '); return MSG_HANDLED; case WIDGET_CURSOR: widget_move (&c->widget, 0, 1); return MSG_HANDLED; case WIDGET_FOCUS: case WIDGET_UNFOCUS: case WIDGET_DRAW: widget_selectcolor (w, msg == WIDGET_FOCUS, FALSE); widget_move (&c->widget, 0, 0); tty_print_string ((c->state & C_BOOL) ? "[x] " : "[ ] "); hotkey_draw (w, c->text, msg == WIDGET_FOCUS); return MSG_HANDLED; case WIDGET_DESTROY: release_hotkey (c->text); return MSG_HANDLED; default: return default_proc (msg, parm); }}
开发者ID:BrEacK,项目名称:mc,代码行数:49,
示例19: check_callbackstatic cb_ret_tcheck_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data){ WCheck *c = CHECK (w); switch (msg) { case MSG_HOTKEY: if (c->text.hotkey != NULL) { if (g_ascii_tolower ((gchar) c->text.hotkey[0]) == parm) { /* make action */ send_message (w, sender, MSG_KEY, ' ', data); return MSG_HANDLED; } } return MSG_NOT_HANDLED; case MSG_KEY: if (parm != ' ') return MSG_NOT_HANDLED; c->state ^= C_BOOL; c->state ^= C_CHANGE; send_message (w, sender, MSG_FOCUS, ' ', data); send_message (WIDGET (w)->owner, w, MSG_NOTIFY, 0, NULL); return MSG_HANDLED; case MSG_CURSOR: widget_move (c, 0, 1); return MSG_HANDLED; case MSG_FOCUS: case MSG_UNFOCUS: case MSG_DRAW: widget_selectcolor (w, msg == MSG_FOCUS, FALSE); widget_move (c, 0, 0); tty_print_string ((c->state & C_BOOL) ? "[x] " : "[ ] "); hotkey_draw (w, c->text, msg == MSG_FOCUS); return MSG_HANDLED; case MSG_DESTROY: release_hotkey (c->text); return MSG_HANDLED; default: return widget_default_callback (w, sender, msg, parm, data); }}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:49,
示例20: draw_history_buttonstatic voiddraw_history_button (WInput * in){ char c; gboolean disabled = (((Widget *) in)->options & W_DISABLED) != 0; c = in->history->next ? (in->history->prev ? '|' : 'v') : '^'; widget_move (&in->widget, 0, in->field_width - HISTORY_BUTTON_WIDTH); tty_setcolor (disabled ? DISABLED_COLOR : in->color[WINPUTC_HISTORY]);#ifdef LARGE_HISTORY_BUTTON { Dlg_head *h; h = in->widget.owner; tty_print_string ("[ ]"); widget_move (&in->widget, 0, in->field_width - HISTORY_BUTTON_WIDTH + 1); }#endif tty_print_char (c);}
开发者ID:ilia-maslakov,项目名称:mc,代码行数:19,
示例21: help_print_wordstatic voidhelp_print_word (WDialog * h, GString * word, int *col, int *line, gboolean add_space){ if (*line >= help_lines) g_string_set_size (word, 0); else { int w; w = str_term_width1 (word->str); if (*col + w >= HELP_WINDOW_WIDTH) { *col = 0; (*line)++; } if (*line >= help_lines) g_string_set_size (word, 0); else { widget_move (h, *line + 2, *col + 2); tty_print_string (word->str); g_string_set_size (word, 0); *col += w; } } if (add_space) { if (*col < HELP_WINDOW_WIDTH - 1) { tty_print_char (' '); (*col)++; } else { *col = 0; (*line)++; } }}
开发者ID:GarothLongint,项目名称:mc,代码行数:41,
示例22: common_dialog_repaint/** Clean the dialog area, draw the frame and the title */voidcommon_dialog_repaint (Dlg_head * h){ int space; if (h->state != DLG_ACTIVE) return; space = (h->flags & DLG_COMPACT) ? 0 : 1; tty_setcolor (h->color[DLG_COLOR_NORMAL]); dlg_erase (h); draw_box (h, space, space, h->lines - 2 * space, h->cols - 2 * space, FALSE); if (h->title != NULL) { tty_setcolor (h->color[DLG_COLOR_TITLE]); dlg_move (h, space, (h->cols - str_term_width1 (h->title)) / 2); tty_print_string (h->title); }}
开发者ID:ryanlee,项目名称:mc,代码行数:22,
示例23: groupbox_callbackstatic cb_ret_tgroupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data){ WGroupbox *g = GROUPBOX (w); switch (msg) { case MSG_INIT: return MSG_HANDLED; case MSG_FOCUS: return MSG_NOT_HANDLED; case MSG_DRAW: { gboolean disabled; disabled = (w->options & W_DISABLED) != 0; tty_setcolor (disabled ? DISABLED_COLOR : COLOR_NORMAL); tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE); if (g->title != NULL) { Widget *wo = WIDGET (w->owner); tty_setcolor (disabled ? DISABLED_COLOR : COLOR_TITLE); widget_move (wo, w->y - wo->y, w->x - wo->x + 1); tty_print_string (g->title); } return MSG_HANDLED; } case MSG_DESTROY: g_free (g->title); return MSG_HANDLED; default: return widget_default_callback (w, sender, msg, parm, data); }}
开发者ID:GarothLongint,项目名称:mc,代码行数:40,
示例24: mcview_display_rulervoidmcview_display_ruler (mcview_t * view){ static const char ruler_chars[] = "|----*----"; const screen_dimen top = view->ruler_area.top; const screen_dimen left = view->ruler_area.left; const screen_dimen width = view->ruler_area.width; const screen_dimen height = view->ruler_area.height; const screen_dimen line_row = (ruler == RULER_TOP) ? 0 : 1; const screen_dimen nums_row = (ruler == RULER_TOP) ? 1 : 0; char r_buff[10]; off_t cl; screen_dimen c; if (ruler == RULER_NONE || height < 1) return; tty_setcolor (VIEW_BOLD_COLOR); for (c = 0; c < width; c++) { cl = view->dpy_text_column + c; if (line_row < height) { widget_move (view, top + line_row, left + c); tty_print_char (ruler_chars[cl % 10]); } if ((cl != 0) && (cl % 10) == 0) { g_snprintf (r_buff, sizeof (r_buff), "%" PRIuMAX, (uintmax_t) cl); if (nums_row < height) { widget_move (view, top + nums_row, left + c - 1); tty_print_string (r_buff); } } } tty_setcolor (NORMAL_COLOR);}
开发者ID:artzub,项目名称:mc,代码行数:40,
示例25: groupbox_callbackstatic cb_ret_tgroupbox_callback (Widget * w, widget_msg_t msg, int parm){ WGroupbox *g = (WGroupbox *) w; switch (msg) { case WIDGET_INIT: return MSG_HANDLED; case WIDGET_FOCUS: return MSG_NOT_HANDLED; case WIDGET_DRAW: { gboolean disabled = (w->options & W_DISABLED) != 0; tty_setcolor (disabled ? DISABLED_COLOR : COLOR_NORMAL); draw_box (g->widget.owner, g->widget.y - g->widget.owner->y, g->widget.x - g->widget.owner->x, g->widget.lines, g->widget.cols, TRUE); if (g->title != NULL) { tty_setcolor (disabled ? DISABLED_COLOR : COLOR_TITLE); dlg_move (g->widget.owner, g->widget.y - g->widget.owner->y, g->widget.x - g->widget.owner->x + 1); tty_print_string (g->title); } return MSG_HANDLED; } case WIDGET_DESTROY: g_free (g->title); return MSG_HANDLED; default: return default_proc (msg, parm); }}
开发者ID:artzub,项目名称:mc,代码行数:38,
示例26: draw_history_buttonstatic voiddraw_history_button (WInput * in){ char c; gboolean disabled = (WIDGET (in)->options & W_DISABLED) != 0; if (g_list_next (in->history.current) == NULL) c = '^'; else if (g_list_previous (in->history.current) == NULL) c = 'v'; else c = '|'; widget_move (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH); tty_setcolor (disabled ? DISABLED_COLOR : in->color[WINPUTC_HISTORY]);#ifdef LARGE_HISTORY_BUTTON tty_print_string ("[ ]"); widget_move (in, 0, WIDGET (in)->cols - HISTORY_BUTTON_WIDTH + 1);#endif tty_print_char (c);}
开发者ID:OsaSoft,项目名称:mc,代码行数:23,
示例27: dlg_default_repaint/** Clean the dialog area, draw the frame and the title */voiddlg_default_repaint (WDialog * h){ Widget *wh = WIDGET (h); int space; if (h->state != DLG_ACTIVE) return; space = (h->flags & DLG_COMPACT) ? 0 : 1; tty_setcolor (h->color[DLG_COLOR_NORMAL]); dlg_erase (h); tty_draw_box (wh->y + space, wh->x + space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE); if (h->title != NULL) { tty_setcolor (h->color[DLG_COLOR_TITLE]); widget_move (h, space, (wh->cols - str_term_width1 (h->title)) / 2); tty_print_string (h->title); }}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:24,
示例28: dlg_default_repaint/** Clean the dialog area, draw the frame and the title */voiddlg_default_repaint (WDialog * h){ Widget *wh = WIDGET (h); int space; if (!widget_get_state (wh, WST_ACTIVE)) return; space = h->compact ? 0 : 1; tty_setcolor (h->color[DLG_COLOR_NORMAL]); dlg_erase (h); tty_draw_box (wh->y + space, wh->x + space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE); if (h->title != NULL) { /* TODO: truncate long title */ tty_setcolor (h->color[DLG_COLOR_TITLE]); widget_move (h, space, (wh->cols - str_term_width1 (h->title)) / 2); tty_print_string (h->title); }}
开发者ID:MidnightCommander,项目名称:mc,代码行数:25,
注:本文中的tty_print_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tty_printf函数代码示例 C++ tty_port_tty_set函数代码示例 |