MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->browse_1, SIGNAL(clicked()), this, SLOT(clickBrowse1())); connect(ui->browse_2, SIGNAL(clicked()), this, SLOT(clickBrowse2())); connect(ui->ok, SIGNAL(clicked()), this, SLOT(clickOK())); }
LectureAdd::LectureAdd(QWidget *parent) : QDialog(parent) { QStringList str; str <<"A+"<< "A0"<< "B+"<< "B0"<< "C+"<< "C0"<< "D+"<< "D0"<< "F"; completeEnable = 0; setupUi(this); comboBox_Grade->addItems(str); comboBox_Grade->show(); connect(checkBox_Complete, SIGNAL(stateChanged(int)), this, SLOT(checkedComplete(int))); connect(buttonBox, SIGNAL(accepted()), this, SLOT(clickOK())); }
QThreeInOneDialog::QThreeInOneDialog(QWidget *parent) : QDialog(parent), ui(new Ui::QThreeInOneDialog) { ui->setupUi(this); ui->selectAll->setChecked(true); connect(ui->ok, SIGNAL(clicked()), this, SLOT(clickOK())); connect(ui->clear, SIGNAL(clicked()), this, SLOT(clickClear())); connect(ui->quit, SIGNAL(clicked()), this, SLOT(clickQuit())); connect(ui->selectAll,SIGNAL(stateChanged(int)),this,SLOT(selectAll(int))); this->setAcceptDrops(true); }
bool GuiCombat::CheckUserInput(JButton key) { if (NONE == cursor_pos) return false; DamagerDamaged* oldActive = active; int x,y; if(observer->getInput()->GetLeftClickCoordinates(x, y)) { // determine if OK button was clicked on if (ok.width) { if (didClickOnButton(ok, x, y)) { cursor_pos = OK; } } // position selected card if (BLK == cursor_pos) { DamagerDamaged* selectedCard = closest<True> (activeAtk->blockers, NULL, static_cast<float> (x), static_cast<float> (y)); // find the index into the vector where the current selected card is. int c1 = 0, c2 = 0; int i = 0; for ( vector<DamagerDamaged*>::iterator it = activeAtk->blockers.begin(); it != activeAtk->blockers.end(); ++it) { if ( *it == selectedCard ) c2 = i; else if ( *it == active) c1 = i; i++; } // simulate pressing the "Left/Right D-Pad" control c1 - c2 times if ( c1 > c2 ) // card selected is to the left of the current active card { for (int x = 0; x < c1 - c2; x++) shiftLeft(); } else if ( c1 < c2 ) { for (int x = 0; x < c2 - c1; x++) shiftRight( oldActive ); } } } switch (key) { case JGE_BTN_OK: if (BLK == cursor_pos) { if (ORDER == step) observer->cardClick(active->card); // { activeAtk->card->raiseBlockerRankOrder(active->card); } else { signed damage = activeAtk->card->stepPower(step); for (vector<DamagerDamaged*>::iterator it = activeAtk->blockers.begin(); *it != active; ++it) damage -= (*it)->sumDamages(); signed now = active->sumDamages(); damage -= now; if (damage > 0) addOne(active, step); else if (activeAtk->card->has(Constants::DEATHTOUCH)) for (; now >= 1; --now) removeOne(active, step); else for (now -= active->card->toughness; now >= 0; --now) removeOne(active, step); } } else if (ATK == cursor_pos) { active = activeAtk->blockers.front(); active->zoom = kZoom_level3; cursor_pos = BLK; } else if (OK == cursor_pos) { clickOK(); } break; case JGE_BTN_CANCEL: if (BLK == cursor_pos) { oldActive->zoom = kZoom_level2; active = activeAtk; cursor_pos = ATK; } return true; case JGE_BTN_LEFT: shiftLeft(); break; case JGE_BTN_RIGHT: shiftRight( oldActive ); break; case JGE_BTN_DOWN: if (ORDER == step || BLK != cursor_pos || active->sumDamages() <= 0) break; removeOne(active, step); break; case JGE_BTN_UP: if (ORDER == step || BLK != cursor_pos) break; addOne(active, step); break; case JGE_BTN_PRI: active = activeAtk = NULL; cursor_pos = OK; break; case JGE_BTN_NEXT: if (!options[Options::REVERSETRIGGERS].number) return false; active = activeAtk = NULL; cursor_pos = OK; break; case JGE_BTN_PREV: if (options[Options::REVERSETRIGGERS].number) return false; active = activeAtk = NULL; cursor_pos = OK; break; default: ; } if (oldActive != active) { if (oldActive && oldActive != activeAtk) oldActive->zoom = kZoom_level2; if (active) active->zoom = kZoom_level3; if (ATK == cursor_pos) remaskBlkViews(dynamic_cast<AttackerDamaged*> (oldActive), static_cast<AttackerDamaged*> (active)); } if (OK == cursor_pos) ok.zoom = 1.5; else ok.zoom = kZoom_none; return true; }