当前位置: 首页>>代码示例>>C++>>正文


C++ scroll函数代码示例

本文整理汇总了C++中scroll函数的典型用法代码示例。如果您正苦于以下问题:C++ scroll函数的具体用法?C++ scroll怎么用?C++ scroll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了scroll函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: interpret

void interpret(Interpreter interp, char* line){

//	for(int i=0; i<1000000000; ){i=hoge(i,1);}
/*	for(int i=0; i<1000000*100; i++){
		if(!pool) fill_pool();
		obj rr=pool;
		pool = cdr(pool);
		rr->refcount = 1;
		rr->type = INT;
		if(rr->type == tNull) continue;
		rr->refcount--;
		cdr(rr) = pool;
		pool = rr;
	}//*/
/*	for(int i=0; i<1000000*100; i++){
		obj rr=alloc();
		rr->type = INT;
		release(rr);	
	}//*/

/*
obj u=Int(1);
obj e=Int(10000000);
obj x=Int(0);
//while(vrInt(compare('<', x, e))){
while(vrInt(LT(x, e))){
	obj r = add(x, u);
	release(x);
	x=r;
}
//*/
	curr_interp = interp;
	env = nil;
	obj stat = parseString(&line);

	obj rr = nil;
//	int t = TickCount();
	if(stat) {
		rr = eval(stat);
		release(stat);
	}
//	myPrintf(" %f sec.", (TickCount()-t)/60.);
	if(rr){
		myPrintf(">> ");
		print(rr);
		release(rr);
		scroll();
	}
}
开发者ID:mogami29,项目名称:cipher-shell,代码行数:49,代码来源:eval.cpp

示例2: test_bug111500

/* GNOME bugzilla bug 111500.  Expand a row and immediately scroll
 * to its first child.  Make sure that expansion happens in currently
 * invisible area.
 */
static void
test_bug111500 (ScrollFixture *fixture,
		gconstpointer  test_data)
{
	int i, len;
	GtkTreeStore *store;
	GtkTreeIter parent;
	GtkTreePath *path;

	g_test_bug ("111500");

	gtk_widget_show_all (fixture->window);

	/* Make sure all events have been processed and the window
	 * is visible.
	 */
	while (gtk_events_pending ())
		gtk_main_iteration ();

	/* Further prepare model */
	store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fixture->tree_view)));

	for (i = 0; i < 15; i++) {
		GtkTreeIter iter;

		gtk_tree_store_append (store, &iter, NULL);
		gtk_tree_store_set (store, &iter, 0, "Other node", -1);
	}

	len = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL);
	gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &parent,
				       NULL, len - 1);

	for (i = 0; i < 5; i++) {
		GtkTreeIter iter;

		gtk_tree_store_append (store, &iter, &parent);
		gtk_tree_store_set (store, &iter, 0, "Row", -1);
	}

	path = gtk_tree_path_new_from_indices (len - 1, -1);
	gtk_tree_view_expand_row (GTK_TREE_VIEW (fixture->tree_view),
				  path, FALSE);

	gtk_tree_path_down (path);

	scroll (fixture, path, FALSE, 0.5);
	gtk_tree_path_free (path);
}
开发者ID:rightpeter,项目名称:gtk,代码行数:53,代码来源:treeview-scrolling.c

示例3: printk

void printk(const char *message, ...)
{
	char *vid = lark_console.vid;
	unsigned char attr = lark_console.attr;
	unsigned int row = lark_console.row;
	unsigned int col = lark_console.col;
	va_list args;
	char *buf = &logbuf[0];
	int i;

	va_start(args, message);
	i = vsprintf(logbuf, message, args);
	va_end(args);

	/* it's important to keep in mind that col is in bytes but for
	 * each character we have 2 bytes. One for the character, and
	 * one for its attributes
	 */	
	while(*buf != 0) {
		/* FIXME: add tab support */
		if(*buf == '\n') {
			row++;
			col = 0;
			*buf++;
		} else if(*buf == '\r') {
		       	col = 0;
			*buf++;
		} else {
			vid[row*LINE_SIZE + col] = *buf;
			*buf++;
			col++;
			vid[row*LINE_SIZE + col] = attr;
			col++;
		}

		if(col >= lark_console.width){
			row++;
			col = 0;
		}
		if(row >= lark_console.height){
			scroll();
			row--;
		}
                
	}
	
	lark_console.row = row;
	lark_console.col = col;
}
开发者ID:jonathanreeves,项目名称:lark,代码行数:49,代码来源:video.c

示例4: main

int main (void) {
    int x = 40, zufall, c = 0 , i;
    srand(79);

    initscr();

    keypad(stdscr, TRUE);
    noecho();
    scrollok(stdscr, TRUE);
    scroll(stdscr);
    
    while (c != QUIT) {
        scrl(1);
        
        for (i = 0; i < 5; ++i) {
            zufall = rand() % 79;
            mvaddch(20, zufall, '*');
            mvprintw(0, 0, "'q' druecken fuer Quit | "
                     "Taste fuer Start | "
                     "<- nach links -> nach rechts");
            mvprintw(1,0, "Position Raumschiff %d", x);
        }
        
        c = getch();
        halfdelay(3);
        
        switch (c) {
            case LEFT:
                if (x < 1)
                    x = 79;
                else
                    --x;
                break;
            case RIGHT:
                if (x > 79)
                    x = 1;
                else
                    ++x;
                break;
            default:
                break;
        }
        print_raumschiff(x);
    }

    endwin();
    
    return 0;
}
开发者ID:LukasWoodtli,项目名称:LinuxDevelopment,代码行数:49,代码来源:cur10.c

示例5: newline

void
newline(void)
{
	nbacklines--;
	if(y >= yscrmax) {
		y = yscrmax;
		if(pagemode && olines >= yscrmax) {
			blocked = 1;
			return;
		}
		scroll(yscrmin+1, yscrmax+1, yscrmin, yscrmax);
	} else
		y++;
	olines++;
}
开发者ID:dancrossnyc,项目名称:harvey,代码行数:15,代码来源:main.c

示例6: scroll

void LCDST7565::menuDown()
{
	buty++;
	bool atBottom = false;
	do {
		if ((_current_line < N_LINES-2) & (_current_line < _n_items-1)) _current_line++;
		else scroll(1); // We're at the bottom line, scroll down if possible
		if (_item_index < _n_items-1)
		{
			_item_index++;
		}
		else atBottom = true;
	} while( _menu_items[_item_index].type == MENU_ITEM_TYPE_LINE && ! atBottom);
	update();
}
开发者ID:nakoustix,项目名称:ThereMIDIn,代码行数:15,代码来源:LCDST7565.cpp

示例7: scroll

void Camera::followCinematic(Character& character, float dt)
{
	const float camX = _view.getCenter().x;
	const float camY = _view.getCenter().y;

	//lerp : V(t) = A + (B-A) * t
	//Linear Interpolation from Camera's center to Character's center
	const sf::Vector2f pos = character.getPosition();
	int x, y;
	x = (int)( camX + (pos.x - camX) * _speed.x*dt );
	y = (int)( camY + (pos.y - camY) * _speed.y*dt );

	scroll(x, y, x, y);
	_view.setCenter(x, y);
}
开发者ID:kevenv,项目名称:shinypanda,代码行数:15,代码来源:Camera.cpp

示例8: if

void VGA_Text_Buffer::put(char c) {
  if (c == '\n') {
    col = -1; // The column get incremented at the end, need to counteract that
    ++row;
  } else if (c == '\t') {
    col = col - (col % tab_width) + tab_width - 1;
  } else {
    at(row,col) = make_entry(c);
  }
  if (++col >= cols) {
    ++row;
    col = 0;
  }
  if (row >= rows) scroll();
}
开发者ID:joelwilliamson,项目名称:AMD64,代码行数:15,代码来源:vga.cpp

示例9: moverowdown

void moverowdown(void)
/* Moves down one row */
{
 displaycell(curcol, currow, NOHIGHLIGHT, NOUPDATE);
 if (currow < bottomrow)
  currow++;
 else if (bottomrow < (MAXROWS - 1))
 {
  scroll(UP, 1, LEFTMARGIN + 1, 3, 80, SCREENROWS + 2, WHITE);
  toprow++;
  currow++;
  setbottomrow();
  displayrow(bottomrow, NOUPDATE);
 }
} /* moverowdown */
开发者ID:EstebanAO,项目名称:Subir,代码行数:15,代码来源:TCOMMAND.C

示例10: constraintCanvas

void ExampleView::dragExampleView(QMouseEvent* ev)
      {
      QPoint d = ev->pos() - _matrix.map(startMove).toPoint();
      int dx   = d.x();
      if (dx == 0)
            return;

      constraintCanvas(&dx);

      // Perform the actual scrolling
      _matrix.setMatrix(_matrix.m11(), _matrix.m12(), _matrix.m13(), _matrix.m21(),
         _matrix.m22(), _matrix.m23(), _matrix.dx()+dx, _matrix.dy(), _matrix.m33());
      imatrix = _matrix.inverted();
      scroll(dx, 0);
      }
开发者ID:IsaacWeiss,项目名称:MuseScore,代码行数:15,代码来源:exampleview.cpp

示例11: switch

bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent)
{
    if (keyboardEvent.type() != WebEvent::KeyDown && keyboardEvent.type() != WebEvent::RawKeyDown)
        return false;

    switch (keyboardEvent.windowsVirtualKeyCode()) {
    case VK_LEFT:
        scroll(m_page.get(), ScrollLeft, ScrollByLine);
        break;
    case VK_RIGHT:
        scroll(m_page.get(), ScrollRight, ScrollByLine);
        break;
    case VK_UP:
        scroll(m_page.get(), ScrollUp, ScrollByLine);
        break;
    case VK_DOWN:
        scroll(m_page.get(), ScrollDown, ScrollByLine);
        break;
    case VK_HOME:
        logicalScroll(m_page.get(), ScrollBlockDirectionBackward, ScrollByDocument);
        break;
    case VK_END:
        logicalScroll(m_page.get(), ScrollBlockDirectionForward, ScrollByDocument);
        break;
    case VK_PRIOR:
        logicalScroll(m_page.get(), ScrollBlockDirectionBackward, ScrollByPage);
        break;
    case VK_NEXT:
        logicalScroll(m_page.get(), ScrollBlockDirectionForward, ScrollByPage);
        break;
    default:
        return false;
    }

    return true;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:36,代码来源:WebPageQt.cpp

示例12: int

void BrowCtx::center_object( GlowArrayElem *object, double factor)
{
  double ll_x, ll_y, ur_x, ur_y;
  int new_offset_y;
  int y_pix;

  ((GlowNode *)object)->measure( &ll_x, &ll_y, &ur_x, &ur_y);
  new_offset_y = int(ll_y * mw.zoom_factor_y - factor * mw.window_height);
  if ( new_offset_y <= 0)
    y_pix = mw.offset_y;
  else
    y_pix = - (new_offset_y - mw.offset_y);
  scroll( 0, y_pix);
  change_scrollbar();
}
开发者ID:Strongc,项目名称:proview,代码行数:15,代码来源:glow_browctx.cpp

示例13: scroll

void CNOutBarCtrl::OnTimer(UINT nIDEvent) 
{
	if (nIDEvent == IDT_SCROLL) {
		if (HITOBJ(pressedHit) == HT_SCROLL)
			scroll(HITINDEX(pressedHit));

	} else if (nIDEvent == IDT_DBLCLK) {
		KillTimer(IDT_DBLCLK);
		if (listener && lastHit == MAKEHIT(HT_ITEM, clickedItem))
			listener->itemClicked(clickedItem);
		clickedItem = -1;

	} else
		CWnd::OnTimer(nIDEvent);
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:15,代码来源:OutBarCtrl.cpp

示例14: kprint_raw

// Prints raw text
void kprint_raw(const char text[]) {
    int i;

    for(i = 0; text[i] != '\0'; i++) {
        if(column >= 80) {
            row++;
            column = 0;

            if(row > TERM_ROWS)
                scroll();
        }

        if(text[i] == '\n') {
            row++;
            column = 0;

            if(row > TERM_ROWS)
                scroll();
        } else {
            kprintc(text[i], 0x07, column, row);
            column++;
        }
    }
}
开发者ID:LFUnion,项目名称:LFOS,代码行数:25,代码来源:vga.c

示例15: cputc

void cputc(char c)
{
    static unsigned short scan_x,x,y;
    LIN_ADDR v = (LIN_ADDR)(0xB8000 + active_page*(2*PAGE_SIZE));
    x = bios_x;
    y = bios_y;
    switch (c) {
	case '\t' : x += 8;		
    		    if (x >= 80) {
			x = 0;
			if (y == 24) scroll();
			else y++;
    		    } else {
			scan_x = 0;
			while ((scan_x+8) < x) scan_x += 8;
			x = scan_x;
		    }
		    break;
	case '\n' : x = 0;
		    if (y == 24) scroll();
		    else y++;
		    break;
	case '\b' : x--;
		    lmempokeb((LIN_ADDR)(v + 2*(x + y*80)),' ');
		    x++;
		    break;
	default   : lmempokeb((LIN_ADDR)(v + 2*(x + y*80)),c);
		    x++;
    		    if (x > 80) {
			x = 0;
			if (y == 24) scroll();
			else y++;
    		    }
    }
    place(x,y);
}
开发者ID:svn2github,项目名称:freedos-32,代码行数:36,代码来源:cons1.c


注:本文中的scroll函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。