示例#1
0
文件: spinbox2.cpp 项目: KDE/kdepim
void SpinBox2::setEnabled(bool enabled)
{
    QFrame::setEnabled(enabled);
    mSpinbox->setEnabled(enabled);
    mUpdown2->setEnabled(enabled);
    updateMirror();
}
示例#2
0
void GameWidget::newGame()
{
	in_pause = false;
	fast_mode = false;

	num_level = 1;
	num_pieces_level = 2;
	num_points = 0;

	bg_sprite = (Sprite)(Sprite_Bg1 + random.getLong(num_bgs));
	screen->setBackgroundSprite(bg_sprite);
	mirror->setBackgroundSprite(bg_sprite);
	next->setBackgroundSprite(bg_sprite);
	for (int i = 0; i < scr_width; ++i)
		mirror_sprites[i] = bg_sprite;
	for (int i = 0; i < 4; ++i)
		next_piece[i] = bg_sprite;
	for (int y = 0; y < scr_height; ++y)
		for (int x = 0; x < scr_width; ++x)
			ref(x, y) = bg_sprite;

	newPiece();
	nextPiece();
	updateMirror();

	in_game = true;
	repaintChilds();
	emit changedStats(num_level, num_points);
	timer_interval = 700;
	timer->start(timer_interval);
}
示例#3
0
void GameWidget::putPiece()
{
	if (piece[0] != bg_sprite) ref(xpos + 0, ypos + 0) = piece[0];
	if (piece[1] != bg_sprite) ref(xpos + 1, ypos + 0) = piece[1];
	if (piece[2] != bg_sprite) ref(xpos + 0, ypos + 1) = piece[2];
	if (piece[3] != bg_sprite) ref(xpos + 1, ypos + 1) = piece[3];
	updateMirror();
	screen->repaint(false);
}