本文整理汇总了C++中scroll_up函数的典型用法代码示例。如果您正苦于以下问题:C++ scroll_up函数的具体用法?C++ scroll_up怎么用?C++ scroll_up使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scroll_up函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: console_putch
void console_putch(u08 ch)
{
// new line
if(ch == '\n') {
pos -= x;
x = 0;
if(y == ( CONSOLE_HEIGHT-1 )) {
scroll_up();
} else {
y++;
pos += CONSOLE_WIDTH;
}
}
// visible char
else if(ch >= ' ') {
buffer[pos] = ch;
display_draw_char(x,y,ch);
x++;
pos++;
if(x == CONSOLE_WIDTH) {
x = 0;
pos -= CONSOLE_WIDTH;
if(y == ( CONSOLE_HEIGHT-1 )) {
scroll_up();
} else {
y++;
pos += CONSOLE_WIDTH;
}
}
}
}
开发者ID:cnvogelg,项目名称:DiskFreezerX,代码行数:32,代码来源:console.c
示例2: view_text
int view_text(const char *title, const char *text)
{
struct view_info info;
const struct button_mapping *view_contexts[] = {
pla_main_ctx,
};
int button;
init_view(&info, title, text);
draw_text(&info);
/* wait for keypress */
while(1)
{
button = pluginlib_getaction(TIMEOUT_BLOCK, view_contexts,
ARRAYLEN(view_contexts));
switch (button)
{
case PLA_UP:
case PLA_UP_REPEAT:
#ifdef HAVE_SCROLLWHEEL
case PLA_SCROLL_BACK:
case PLA_SCROLL_BACK_REPEAT:
#endif
scroll_up(&info, 1);
break;
case PLA_DOWN:
case PLA_DOWN_REPEAT:
#ifdef HAVE_SCROLLWHEEL
case PLA_SCROLL_FWD:
case PLA_SCROLL_FWD_REPEAT:
#endif
scroll_down(&info, 1);
break;
case PLA_LEFT:
scroll_up(&info, info.display_lines);
break;
case PLA_RIGHT:
scroll_down(&info, info.display_lines);
break;
case PLA_LEFT_REPEAT:
scroll_to_top(&info);
break;
case PLA_RIGHT_REPEAT:
scroll_to_bottom(&info);
break;
case PLA_EXIT:
case PLA_CANCEL:
return PLUGIN_OK;
default:
if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED;
break;
}
}
return PLUGIN_OK;
}
开发者ID:HendrikR,项目名称:rockbox,代码行数:58,代码来源:simple_viewer.c
示例3: vidc_rawputchar
static void
vidc_rawputchar(int c)
{
int i;
if (c == '\t')
/* lame tab expansion */
for (i = 0; i < 8; i++)
vidc_rawputchar(' ');
else {
#ifndef TERM_EMU
vidc_biosputchar(c);
#else
/* Emulate AH=0eh (teletype output) */
switch(c) {
case '\a':
vidc_biosputchar(c);
return;
case '\r':
curx = 0;
curs_move(&curx, &cury, curx, cury);
return;
case '\n':
cury++;
if (cury > 24) {
scroll_up(1, fg_c, bg_c);
cury--;
} else {
curs_move(&curx, &cury, curx, cury);
}
return;
case '\b':
if (curx > 0) {
curx--;
curs_move(&curx, &cury, curx, cury);
/* write_char(' ', fg_c, bg_c); XXX destructive(!) */
return;
}
return;
default:
write_char(c, fg_c, bg_c);
curx++;
if (curx > 79) {
curx = 0;
cury++;
}
if (cury > 24) {
curx = 0;
scroll_up(1, fg_c, bg_c);
cury--;
}
}
curs_move(&curx, &cury, curx, cury);
#endif
}
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:56,代码来源:vidconsole.c
示例4: cputchar
static inline void
cputchar (textarea_t *area, char c)
{
char cbuf [2];
cbuf[0] = c;
cbuf[1] = '\0';
if (c == '\n')
{
area->cursor_x = 0;
if (area->cursor_y++ == (area->cpi_height - 1))
{
area->cursor_y--;
scroll_up (area);
}
}
else if (c == '\b')
{
if (area->cursor_x > 0)
area->cursor_x--;
}
else
{
if (area->cursor_x == area->cpi_width)
{
area->cursor_x = 0;
if (area->cursor_y++ == (area->cpi_height - 1))
{
area->cursor_y--;
scroll_up (area);
}
}
cpi_puts (area->selected_font,
area->display->width,
area->display->height,
area->pos_x + area->cursor_x * 8,
area->pos_y + area->selected_font->rows * (area->cursor_y),
area->display->screen->pixels, 4, !(area->bgcolor & 0xff000000), area->color, area->bgcolor, cbuf);
__make_dirty (area->display,
area->pos_x + area->cursor_x * 8,
area->pos_y + area->selected_font->rows * (area->cursor_y));
__make_dirty (area->display,
area->pos_x + area->cursor_x * 8 + 7,
area->pos_y + area->selected_font->rows * (area->cursor_y + 1) - 1);
area->cursor_x++;
}
}
开发者ID:BatchDrake,项目名称:biteye,代码行数:55,代码来源:text.c
示例5: console_putc
static void
console_putc(char c)
{
if (check_escape(c))
return;
switch (c) {
case '\n':
new_line();
return;
case '\r':
pos_x = 0;
return;
case '\b':
if (pos_x == 0)
return;
pos_x--;
return;
}
vram[pos_y * cols + pos_x] = c | (attrib << 8);
pos_x++;
if (pos_x >= cols) {
pos_x = 0;
pos_y++;
if (pos_y >= rows) {
pos_y = rows - 1;
scroll_up();
}
}
}
开发者ID:AndrewD,项目名称:prex,代码行数:32,代码来源:console.c
示例6: move_curitem
void
move_curitem(int direction)
{
list_item tmp;
if(curitem < 0 || curitem > last_item())
return;
tmp = item_create();
item_copy(tmp, db_item_get(curitem));
switch(direction) {
case MOVE_ITEM_UP:
if( curitem < 1 )
goto out_move;
item_copy(db_item_get(curitem),
db_item_get(curitem - 1));
item_copy(db_item_get(curitem-1), tmp);
scroll_up();
break;
case MOVE_ITEM_DOWN:
if(curitem >= last_item())
goto out_move;
item_copy(db_item_get(curitem),
db_item_get(curitem + 1));
item_copy(db_item_get(curitem + 1), tmp);
scroll_down();
break;
}
out_move:
item_free(&tmp);
}
开发者ID:jens-na,项目名称:abook-call,代码行数:34,代码来源:list.c
示例7: console_putc
void console_putc(unsigned c)
{
unsigned short *pixels;
if(c > 127) return;
if(c < 32) {
if(c == '\n') goto newline;
return;
}
pixels = mddi_framebuffer();
drawglyph(pixels + cy * 12 * fb_width + cx * 6, FGCOLOR,
fb_width, font5x12 + (c - 32) * 2);
cx++;
if(cx < cmaxx) return;
newline:
cy++;
cx = 0;
if(cy >= cmaxy) {
cy = cmaxy - 1;
scroll_up();
}
}
开发者ID:ashang,项目名称:boot_tools,代码行数:25,代码来源:mddi_console.c
示例8: esc_press
void Editor::update_keyboard() {
if (!enabled){
return;
}
auto controller = InputManager::current()->get_controller();
if (controller->pressed(Controller::ESCAPE)) {
esc_press();
return;
}
if (controller->hold(Controller::LEFT)) {
scroll_left();
}
if (controller->hold(Controller::RIGHT)) {
scroll_right();
}
if (controller->hold(Controller::UP)) {
scroll_up();
}
if (controller->hold(Controller::DOWN)) {
scroll_down();
}
}
开发者ID:ChristophKuhfuss,项目名称:supertux,代码行数:29,代码来源:editor.cpp
示例9: mon_disassembly_scroll
WORD mon_disassembly_scroll(struct mon_disassembly_private *pmdp,
MON_SCROLL_TYPE ScrollType)
{
switch (ScrollType) {
case MON_SCROLL_NOTHING:
break;
case MON_SCROLL_DOWN:
pmdp->StartAddress = scroll_down(pmdp, pmdp->StartAddress);
break;
case MON_SCROLL_UP:
pmdp->StartAddress = scroll_up(pmdp, pmdp->StartAddress);
break;
case MON_SCROLL_PAGE_DOWN:
pmdp->StartAddress = scroll_down_page(pmdp, pmdp->StartAddress);
break;
case MON_SCROLL_PAGE_UP:
pmdp->StartAddress = scroll_up_page(pmdp, pmdp->StartAddress);
break;
}
return pmdp->StartAddress;
}
开发者ID:martinpiper,项目名称:VICE,代码行数:25,代码来源:mon_ui.c
示例10: kputchar
void kputchar(char c)
{
char *videoram = (char *)__VIDEORAM;
if (c == '\n')
{
__kposX = 0;
__kposY++;
}
else if (c == '\r')
__kposX = 0;
else if (c == '\t')
__kposX += 4;
else
{
*(videoram + __kposY * COLS + __kposX * 2) = c;
*(videoram + __kposY * COLS + __kposX * 2 + 1) = __kattr;
__kposX++;
}
if (__kposX > 79)
{
__kposX = __kposX - 80;
__kposY++;
}
if (__kposY > 24)
{
__kposY = 24;
scroll_up(1);
}
}
开发者ID:faltad,项目名称:Unicorn,代码行数:30,代码来源:screen.c
示例11: up_single_click_handler
void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
if(selected_event) {
scroll_up();
} else {
auto_select_event();
}
}
开发者ID:4levity,项目名称:pricelessx,代码行数:7,代码来源:browse.c
示例12: menu_main
void menu_main(){
switch(current_function)//get current function and make decision based on it
{
case 0: //function 0 log
if(!isShowingLog) show_log(); //if the log isnt showing show it
if(nNxtButtonPressed == 2){ //if we are pressing left
while(nNxtButtonPressed == 2); //must click and release to scroll another line
scroll_down();
}
if(nNxtButtonPressed == 1){ //if we are pressing right
while(nNxtButtonPressed==1); //must click and release to scroll another line
scroll_up();
}
break;
case 1: //function 1 menu
display_menu();
break;
}
if(nNxtButtonPressed==3 && current_function!=1){ //if we press enter and are not on menu
while(nNxtButtonPressed==3); //dont allow double reads. you have to release before anything happens
hide_log(); //hide the menu. cant hurt
previous_function=current_function; //save the old function number
current_function=1; //set the current function to menu
}
}
开发者ID:ograff,项目名称:team_252_11-12,代码行数:25,代码来源:Teleop+menu.c
示例13: screen_putc
// =====================================================================================================================
static void screen_putc(char c)
{
switch (c)
{
case '\r' :
s_x = 0;
break;
case '\n' :
s_x = 0;
s_y++;
break;
default :
{
char* p = (char*)s_base + (s_y * WIDTH + s_x) * 2;
*p = c;
s_x++;
break;
}
}
if (s_x == WIDTH)
{
s_x = 0;
s_y++;
}
if (s_y == HEIGHT)
scroll_up();
update_cursor();
}
开发者ID:giszo,项目名称:urubu,代码行数:34,代码来源:main.c
示例14: move_downwards
static void move_downwards(console_private_t *pcp)
{
if (++pcp->yPos >= pcp->pConsole->console_yres - 1) {
/* we must scroll the window */
scroll_up(pcp);
}
}
开发者ID:AreaScout,项目名称:vice,代码行数:7,代码来源:console.c
示例15: scroll_up
void scrollbar::process_event()
{
if (uparrow_.pressed())
scroll_up();
if (downarrow_.pressed())
scroll_down();
}
开发者ID:ierton,项目名称:wesnoth,代码行数:8,代码来源:scrollbar.cpp
示例16: new_line
void new_line(void)
{
cursor_x = 0;
if ( ++cursor_y >= VGA_TERMINAL_HEIGHT )
{
scroll_up();
cursor_y= 24;
}
}
开发者ID:DevilGladiator,项目名称:XeonOS,代码行数:9,代码来源:tty.c
示例17: cmd_ctrl_y
static void
cmd_ctrl_y(key_info_t key_info, keys_info_t *keys_info)
{
if(fpos_has_hidden_top(view))
{
int new_pos = get_corrected_list_pos_up(view, view->column_count);
scroll_up(view, view->column_count);
goto_pos_force_update(new_pos);
}
}
开发者ID:phantasea,项目名称:vifm,代码行数:10,代码来源:visual.c
示例18: new_line
static void
new_line(void)
{
pos_x = 0;
pos_y++;
if (pos_y >= rows) {
pos_y = rows - 1;
scroll_up();
}
}
开发者ID:AndrewD,项目名称:prex,代码行数:11,代码来源:console.c
示例19: kbd_handler
void kbd_handler() {
char scancode = 0;
if(inb(0x64) & 1)
scancode = inb(0x60);
// kprintf("%X ", scancode);
// return;
if(scancode & 0x80) {
// when key release //
if(scancode == 0x2A || scancode == 0x36) {
shift_pressed = false;
return;
}
} else {
scancode = scancode & 0x7F;
// 0x0E -> backspace
// 0x49 -> page up
// 0x48 -> a up
// 0x4B -> a left
// 0x4D -> a right
// 0x50 -> a down
// 0x51 -> page down
// 0x47 -> home
// 0x4F -> end
serial_debug("%X ", scancode);
if(scancode == 0x48) {
scroll_up();
return;
}
if(scancode == 0x50) {
scroll_down();
return;
}
if (scancode == 0x1) {
kprintf("Shut down\n");
char *c = "Shutdown";
while (*c) {
outb(0x8900, *c++);
}
}
// kprintf("%c", scancode);
// when key pressed //
if(scancode == 0x2A || scancode == 0x36) {
shift_pressed = true;
return;
}
if(shift_pressed) {
kprintf("%c", kbd_map_shift[scancode]);
} else {
kprintf("%c", kbd_map[scancode]);
}
}
return;
}
开发者ID:MrBad,项目名称:cOSiris,代码行数:53,代码来源:kbd.c
示例20: cursor_up
static void cursor_up(struct hexedit *buf)
{
if (buf->cursor_y == 0) {
if (scroll_up(buf)) {
hexedit_refresh(buf);
}
} else {
buf->cursor_y--;
}
calc_cursor_offset(buf);
}
开发者ID:DavidMulder,项目名称:samba,代码行数:12,代码来源:regedit_hexedit.c
注:本文中的scroll_up函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论