本文整理汇总了C++中scroll_up函数的典型用法代码示例。如果您正苦于以下问题:C++ scroll_up函数的具体用法?C++ scroll_up怎么用?C++ scroll_up使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scroll_up函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
}
}
示例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;
}
示例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
}
}
示例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++;
}
}
示例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();
}
}
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例11: up_single_click_handler
void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
if(selected_event) {
scroll_up();
} else {
auto_select_event();
}
}
示例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
}
}
示例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();
}
示例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);
}
}
示例15: scroll_up
void scrollbar::process_event()
{
if (uparrow_.pressed())
scroll_up();
if (downarrow_.pressed())
scroll_down();
}