TupExportWizardPage *TupExportWizard::addPage(TupExportWizardPage *newPage) { QString tag = newPage->getTag(); newPage->setParent(k->history); newPage->show(); k->history->addWidget(newPage); if (k->history->count() == 1) { // First Page newPage->setFocus(); k->backButton->setEnabled(false); k->nextButton->setDefault(true); } // k->nextButton->setEnabled(newPage->isComplete()); connect(newPage, SIGNAL(completed()), this, SLOT(pageCompleted())); connect(newPage, SIGNAL(emptyField()), this, SLOT(disableButton())); if (tag.compare("PLUGIN") == 0) { // connect(newPage, SIGNAL(formatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(animatedImageFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(imagesArrayFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(animationFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); }
void Photos::designUI() { //????? QPalette palette; this->setAutoFillBackground(true); palette.setColor(QPalette::Background, QColor(255,255,255)); this->setPalette(palette); disableButton(); /*ui->previous_Button->setStyleSheet("border-style: flat;"); ui->next_Button->setStyleSheet("border-style: flat;"); ui->adjust_pushButton->setStyleSheet("border-style: flat;"); ui->adjust_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/adjust1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/adjust2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/adjust2.jpg);font-size:20px;}"); ui->expand_pushButton->setStyleSheet("border-style: flat;"); ui->expand_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/expand1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/expand2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/expand2.jpg);font-size:20px;}"); ui->narrow_pushButton->setStyleSheet("border-style: flat;"); ui->narrow_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/narrow1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/narrow2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/narrow2.jpg);font-size:20px;}"); ui->previous_pushButton->setStyleSheet("border-style: flat;"); ui->previous_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/previous1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/previous2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/previous2.jpg);font-size:20px;}"); ui->next_pushButton->setStyleSheet("border-style: flat;"); ui->next_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/next1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/next2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/next2.jpg);font-size:20px;}"); ui->open_pushButton->setStyleSheet("border-style: flat;"); ui->open_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/open1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/open2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/open2.jpg);font-size:20px;}"); ui->delete_pushButton->setStyleSheet("border-style: flat;"); ui->delete_pushButton->setStyleSheet("QPushButton{border-image:url(:/Image/delete1.png)}QPushButton:hover:!pressed{border-image:url(:/Image/delete2.jpg);font-size:20px;}QPushButton:hover:pressed {border-image:url(:/Image/delete2.jpg);font-size:20px;}"); */ }
SsScene3010DeadBoltButton::SsScene3010DeadBoltButton(NeverhoodEngine *vm, Scene *parentScene, int buttonIndex, int initCountdown, bool initDisabled) : StaticSprite(vm, 900), _parentScene(parentScene), _buttonLocked(false), _countdown1(0), _countdown2(0), _buttonIndex(buttonIndex) { _buttonEnabled = getSubVar(VA_LOCKS_DISABLED, kScene3010ButtonNameHashes[_buttonIndex]) != 0; createSurface(400, 88, 95); setSprite(kScene3010DeadBoltButtonFileHashes2[_buttonIndex]); if (initDisabled) disableButton(); else if (_buttonEnabled) _countdown1 = initCountdown * 12 + 1; loadSound(0, 0xF4217243); loadSound(1, 0x44049000); loadSound(2, 0x6408107E); SetUpdateHandler(&SsScene3010DeadBoltButton::update); SetMessageHandler(&SsScene3010DeadBoltButton::handleMessage); }
void Photos::closeEvent(QCloseEvent *) { position = 0; original_x = 40; original_y = 18; image_width = 400; image_height = 250; transform_flag = 0; imageList.clear(); imagePath.clear(); disableButton(); pixmap.fill(Qt::white); this->repaint(0, 0, QWidget::width(), QWidget::height()); //update(); emit(closeImage()); this->close(); }
void GameDisplay::mousePressEvent(QMouseEvent *click) { switch(plantType)//switch statement used to place a plant where you click { case 1://pea shooter { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(1,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[0].restart(); emit disableButton(1); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 2: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(2,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[1].restart(); emit disableButton(2); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 3: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(3,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[2].restart(); emit disableButton(3); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 4: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(4,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[3].restart(); emit disableButton(4); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 5: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(5,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[4].restart(); emit disableButton(5); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 6: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(6,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[5].restart(); emit disableButton(6); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 7: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&cellEmpty(click->x(),click->y()))//tracks where you click on the grid, then assigns the plant to be placed on a fixed coordinate for that cell { p = new Plants(7,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[6].restart(); emit disableButton(7); break; } } } grid[click->y()/100][click->x()/90]=false; break; } case 8: { for(int x=0;x<900;x+=90) { for(int y=0;y<500;y+=100) { for(int i=0;i<plantVector.size();i++) { if(click->x()>x&&click->x()<(x+90)&&click->y()>y&&click->y()<(y+100)&&plantVector[i]->getType()==1&&plantVector[i]->getX()==x&&plantVector[i]->getY()==y)//tracks if a peashooter has been placed on the grid. if you click the same spot, a repeater will be placed and the peashooter gets removed { plantVector[i]->setPosition(-1,-1); scene()->removeItem(plantVector[i]); p = new Plants(8,x,y); plantVector.push_back(p); plantType=0; subtractSunPoints(p->getCost()); scene()->addItem(p); cooldowns[7].restart(); emit disableButton(8); break; } } } } grid[click->y()/100][click->x()/90]=false; break; } } for(int i=0;i<sunVector.size();i++) { if(sunVector[i]->areaX(click->x())&&sunVector[i]->areaY(click->y()))//checks if you have clicked on a sun { sunVector[i]->setClicked();//moves the sun so you cant click on it again (if you dont do this, you wont see the sun but you can still get sun points) scene()->removeItem(sunVector[i]); addSunPoints(25); } } }
void ActionsPage::initializePage() { QTimer::singleShot(0, this, SLOT(disableButton())); }// initializePage