void MainWindow::create_mat(){ std::cout <<"Im here" << std::endl; Dialog* newd = new Dialog(rnum, cnum, this); connect(newd, SIGNAL(send_coord(int,int)), this, SLOT(create_new(int,int))); newd->exec(); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; dialog.show(); return app.exec(); }
//öffnet den Dialog für den Verbindungsaufbau void Steuerung::on_actionVerbindung_triggered() { Dialog verbindung; verbindung.setModal(true); QObject::connect(&verbindung,SIGNAL(setServer(QString,int)),this,SLOT(setClient(QString,int))); verbindung.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); Dialog w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForTr(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec);//GB18030 QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); Dialog dialog; #ifdef Q_OS_SYMBIAN dialog.showMaximized(); #else dialog.show(); #endif return app.exec(); }
bool Appearance::terminateDialogs(bool terminateHeldDialogs) { Os::Logger::instance().log(FAC_SAA, PRI_DEBUG, "Appearance::terminateDialogs this = %p, mUri = '%s': terminating %zu dialogs", this, mUri.data(), mDialogs.entries()); UtlHashMapIterator itor(mDialogs); UtlString* handle; bool ret = false; // nothing changed while ( (handle = dynamic_cast <UtlString*> (itor())) ) { Dialog* pDialog = dynamic_cast <Dialog*> (itor.value()); UtlString rendering; UtlString dialogState= STATE_TERMINATED; UtlString event; UtlString code; pDialog->getLocalParameter("+sip.rendering", rendering); pDialog->getState(dialogState, event, code); // unless told otherwise, do not terminate held dialogs: // they can still be picked up by another set if ( terminateHeldDialogs || !((dialogState == STATE_CONFIRMED) && (rendering == "no")) ) { Os::Logger::instance().log(FAC_SAA, PRI_DEBUG, "Appearance::terminateDialogs dialog '%s'", handle->data()); pDialog->setState(STATE_TERMINATED, event, code); ret = true; } } return ret; }
bool Appearance::appearanceIdIsSeized(const UtlString& appearanceId) { Os::Logger::instance().log(FAC_SAA, PRI_DEBUG, "Appearance::appearanceIdIsSeized mUri = '%s', appearance = '%s'", mUri.data(), appearanceId.data()); bool ret = false; UtlHashMapIterator itor(mDialogs); UtlString* handle; while ( !ret && (handle = dynamic_cast <UtlString*> (itor())) ) { Dialog* pDialog = dynamic_cast <Dialog*> (itor.value()); UtlString dialogState= STATE_TERMINATED; UtlString event; UtlString code; UtlString rendering; pDialog->getState(dialogState, event, code); pDialog->getLocalParameter("+sip.rendering", rendering); UtlString myAppearanceId; pDialog->getLocalParameter("x-line-id", myAppearanceId); if ( (myAppearanceId == appearanceId) //&& // (dialogState != STATE_TERMINATED) && // ( !(dialogState == STATE_CONFIRMED) && (rendering == "no") ) // not even sure I need any other conditions for TRYING contention... ) { Os::Logger::instance().log(FAC_SAA, PRI_DEBUG, "Appearance::appearanceIdIsSeized mUri = '%s', appearance = '%s' " "is in state '%s': seized", mUri.data(), appearanceId.data(), dialogState.data()); ret = true; } } return ret; }
extern "C" void Dialog_OkCB(Widget, XtPointer clientData, XtPointer) { Dialog *dialog = (Dialog*)clientData; if (dialog->okCallback(dialog)) dialog->unmanage(); }
extern "C" void Dialog_CancelCB(Widget, XtPointer clientData, XtPointer) { Dialog *dialog = (Dialog*)clientData; dialog->cancelCallback(dialog); dialog->unmanage(); }
INT_PTR Dialog::dlg_proc_proxy(HWND window, UINT message, WPARAM wParam, LPARAM lParam) { Dialog* dlg = Dialog::get_instance(window); switch(message) { case WM_INITDIALOG: dlg = reinterpret_cast<Dialog*>(lParam); assert(dlg); dlg->window = window; Dialog::set_instance(window, dlg); break; case WM_DESTROY: assert(dlg); dlg->dlg_proc(message, wParam, lParam); dlg->window = NULL; Dialog::set_instance(window, NULL); return false; } if(dlg) return dlg->dlg_proc(message, wParam, lParam); else return false; }
/* This function is defined here instead of PyGrxUI.cpp so that the message translations can be edited with one file */ std::string GrxUIMenuView::waitInputMessage(const std::string& message) { Dialog dialog; dialog.setWindowTitle(_("Wait input message")); QVBoxLayout* vbox = new QVBoxLayout(); dialog.setLayout(vbox); vbox->addWidget(new QLabel(message.c_str())); LineEdit* lineEdit = new LineEdit(); connect(lineEdit, SIGNAL(returnPressed()), &dialog, SLOT(accept())); vbox->addWidget(lineEdit); PushButton* okButton = new PushButton(_("&OK")); okButton->setDefault(true); connect(okButton, SIGNAL(clicked()), &dialog, SLOT(accept())); vbox->addWidget(okButton); vbox->addStretch(); dialog.show(); MenuButtonBlock block(instance()->impl); QEventLoop eventLoop; connect(&dialog, SIGNAL(finished(int)), &eventLoop, SLOT(quit())); eventLoop.exec(); return lineEdit->string(); }
void Screen::ShowDialog(Dialog *pDlg, bool fFade) { assert(pDlg); // do place console mode dialogs if (Application.isFullScreen || pDlg->IsViewportDialog()) // exclusive or free dlg: center pos // evaluate own placement proc first if (!pDlg->DoPlacement(this, PreferredDlgRect)) { if (pDlg->IsFreePlaceDialog()) pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2 + pDlg->IsBottomPlacementDialog()*GetHeight()/3); else if (IsExclusive()) pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2); else // non-exclusive mode at preferred viewport pos pDlg->SetPos(PreferredDlgRect.x+30, PreferredDlgRect.y+30); } // add to local component list at correct ordering int32_t iNewZ = pDlg->GetZOrdering(); Element *pEl; Dialog *pOtherDlg; for (pEl = GetFirst(); pEl; pEl = pEl->GetNext()) if (pOtherDlg = pEl->GetDlg()) if (pOtherDlg->GetZOrdering() > iNewZ) break; InsertElement(pDlg, pEl); // set as active, if not fading and on top if (!fFade && !pEl) // but not viewport dialogs! if (!pDlg->IsExternalDrawDialog()) pActiveDlg = pDlg; // show it pDlg->fOK = false; pDlg->fShow = true; // mouse focus might have changed UpdateMouseFocus(); }
void MainWindow::open_dialog_1(){ //when click start ,run no_gui app and show success/fail Dialog d; string temp,temp1; string exe_command = "FE_no_GUI.exe \""; exe_command += ui->label_5->text().toLocal8Bit().constData(); exe_command += "\" \""; exe_command += ui->label_15->text().toLocal8Bit().constData(); exe_command += "/\" \""; temp = ui->lineEdit_8->text().toLocal8Bit().constData(); if(temp!=""){ temp1 = strtok((char*)temp.c_str(),"-"); temp1 += "\" \""; temp1 += strtok(NULL,"-"); exe_command += temp1; } exe_command += "\" "; exe_command += ui->comboBox_5->currentText().toLocal8Bit().constData(); if(system(exe_command.c_str())==0){ d.changeLabel(QApplication::translate("Dialog", "Finish", 0)); } else d.changeLabel(QApplication::translate("Dialog", "Fail", 0)); d.setWindowFlags(Qt::WindowStaysOnTopHint); d.exec(); }
BOOL CALLBACK Dialog::DlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { Dialog* ptr = NULL; if (msg == WM_INITDIALOG) { ptr = (Dialog*) lParam; ASSURE(ptr != NULL) ::SetWindowLong(hwnd, GWL_USERDATA, lParam); ptr->hwnd = hwnd; } else { // retrieve the lParam value which was originally pased // in on the initial creation of the dialog...? ptr = (Dialog*) ::GetWindowLong(hwnd, GWL_USERDATA); } if (ptr != NULL) return ptr->OnMsg(msg, wParam, lParam); else return FALSE; }
void initScene() { world.loadScene(START); dialog.setPosition(10,10); dialog.setText("Controls\nMove with WASD\nSpacebar advances dialogs\nShift and then | quits"); dialog.show(); }
int main(int argc, char *argv[]) { /* QPalette palette; palette.setColor(QPalette::Window, QColor(53,53,53)); palette.setColor(QPalette::WindowText, Qt::white); palette.setColor(QPalette::Base, QColor(15,15,15)); palette.setColor(QPalette::AlternateBase, QColor(53,53,53)); palette.setColor(QPalette::ToolTipBase, Qt::white); palette.setColor(QPalette::ToolTipText, Qt::white); palette.setColor(QPalette::Text, Qt::white); palette.setColor(QPalette::Button, QColor(53,53,53)); palette.setColor(QPalette::ButtonText, Qt::white); palette.setColor(QPalette::BrightText, Qt::red); palette.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray); palette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::darkGray); palette.setColor(QPalette::Highlight, QColor(142,45,197).lighter()); palette.setColor(QPalette::HighlightedText, Qt::black); qApp->setPalette(palette); */ QApplication a(argc, argv); qDebug() << QStyleFactory::keys(); // a.setStyle(QStyleFactory::create("Fusion")); qApp->setStyle(QStyleFactory::create("Fusion")); Dialog w; w.show(); return a.exec(); }
LevelObject* LevelObjectFactory::produceLvlObj(int objID){ switch(objID){ case OBJ1:{ LevelObject* lvlObj = new LevelObject(OBJ1, "Chair"); Dialog* dia = new Dialog(lvlObj); std::shared_ptr<Dialog> ptr = std::shared_ptr<Dialog>(dia); dia->setRunFunc( [ptr](){ LevelObject* parent = (*ptr).lvlObjParent; if(parent->isPresent()){ Tools::printMsg("Hello, I am a chair!"); bool choice = Tools::printQuestion("Do you want to pick me up?"); if(choice){ parent->setPresence(false); Game::instance()->getPlayer()->addItem(ItemFactory::produceItem(ItemFactory::ITEM1)); } } } ); lvlObj->setDialog(dia); return lvlObj; } default:break; } return 0; }
void unhideCallback(GtkObject */*object*/, gpointer dlgPtr) { g_return_if_fail( dlgPtr != NULL ); Dialog *dlg = (Dialog *)dlgPtr; dlg->onShowF12(); }
bool Appearance::appearanceIsBusy() { // we are busy if we are currently managing any non-held dialogs bool ret = false; UtlHashMapIterator itor(mDialogs); UtlString* handle; while ( !ret && (handle = dynamic_cast <UtlString*> (itor())) ) { Dialog* pDialog = dynamic_cast <Dialog*> (itor.value()); UtlString dialogState = STATE_TERMINATED; UtlString event; UtlString code; UtlString rendering; pDialog->getState(dialogState, event, code); pDialog->getLocalParameter("+sip.rendering", rendering); if ( (dialogState != STATE_TERMINATED) && !((dialogState == STATE_CONFIRMED) && (rendering == "no")) ) { ret = true; } Os::Logger::instance().log(FAC_SAA, PRI_DEBUG, "Appearance::appearanceIsBusy mUri = '%s', state %s(%s) returns %d", mUri.data(), dialogState.data(), rendering.data(), ret); } return ret; }
BOOL CALLBACK Dialog::dlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG : { Dialog *pDlg = (Dialog *)(lParam); pDlg->_hWnd = hDlg; ::SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)lParam); pDlg->runProc(uMsg, wParam, lParam); return TRUE; } default : { Dialog *pDlg = reinterpret_cast<Dialog *>(::GetWindowLongPtr(hDlg, GWL_USERDATA)); if (!pDlg) return FALSE; return pDlg->runProc(uMsg, wParam, lParam); } } }
int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; //WhatsNew whatsnew; cout << "starting ... " << endl; if(dialog.exec()!=QDialog::Accepted) { return 0; } cout << "creating main window ..." << endl; MainWindow mainwindow; cout << "creating main window ..." << endl; mainwindow.show(); app.exec(); return 1; /*QApplication app(argc, argv); Dialog dialog; MainWindow mainwindow; //WhatsNew whatsnew; cout << "starting ... " << endl; if(dialog.exec()==QDialog::Accepted) { mainwindow.show(); return app.exec(); } else return 0; */ }
int main(int argc, char *argv[]) { RazorApplication app(argc, argv); bool check=false; bool actionSet=false; RazorPower::Action action; QStringList args = app.arguments(); for (int i=1; i < args.count(); ++i) { QString arg = args.at(i); if (arg == "--help" || arg == "-h" ) { help(); return 0; } if (arg == "--check" ) { check = true; continue; } arg = arg.toLower(); if (arg == "logout" ) { action = RazorPower::PowerLogout; actionSet = true; continue; } if (arg == "hibernate" ) { action = RazorPower::PowerHibernate; actionSet = true; continue; } if (arg == "reboot" ) { action = RazorPower::PowerReboot; actionSet = true; continue; } if (arg == "shutdown" ) { action = RazorPower::PowerShutdown; actionSet = true; continue; } if (arg == "halt" ) { action = RazorPower::PowerShutdown; actionSet = true; continue; } if (arg == "suspend" ) { action = RazorPower::PowerSuspend; actionSet = true; continue; } qWarning() << "Unknown option: " << args.at(i); help(); return 2; } if (actionSet) { RazorPower power; bool res; if (check) res = power.canAction(action); else res = power.doAction(action); if (res) return 0; else return 1; } { TRANSLATE_APP; Dialog w; w.show(); return app.exec(); } }
void enableCheck(Dialog &dialog, int id, bool enable) { if(enable) CheckDlgButton(dialog.getWindowHandle(), id, BST_CHECKED); else CheckDlgButton(dialog.getWindowHandle(), id, BST_UNCHECKED); }
// Main void DisplayDialog() { Dialog dialog; dialog.InitDialog(); dialog.ShowModal(); }
Dialog* SipDialogEvent::getDialogByDialogId(UtlString& dialogId) { mLock.acquire(); UtlSListIterator dialogIterator(mDialogs); Dialog* pDialog; UtlString foundDialogId, foundCallId, foundLocalTag, foundRemoteTag, foundDirection; while ((pDialog = (Dialog *) dialogIterator())) { pDialog->getDialog(foundDialogId, foundCallId, foundLocalTag, foundRemoteTag, foundDirection); if (foundDialogId.compareTo(dialogId) == 0) { Os::Logger::instance().log(FAC_SIP, PRI_DEBUG, "SipDialogEvent::getDialog found Dialog = %p for dialogId = '%s'", pDialog, dialogId.data()); mLock.release(); return pDialog; } } Os::Logger::instance().log(FAC_SIP, PRI_WARNING, "SipDialogEvent::getDialog could not find the Dialog for dialogId = '%s'", dialogId.data()); mLock.release(); return NULL; }
static void unhideCallback(GObject * /*object*/, gpointer dlgPtr) { g_return_if_fail( dlgPtr != NULL ); Dialog *dlg = static_cast<Dialog *>(dlgPtr); dlg->onShowF12(); }
int Iksu2000Plugin::showInfo() { Dialog d; d.setWindowTitle("ИКСУ-2000"); d.setModal(true); return d.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); messageBuffer::init(); /* int initialArray[28] = {0,1,2,6,7,8,23,24,29,30,3,9,25,26,34,35,4,10,31,36,37,38,5,22,27,28,32,33}; for(int i = 0;i < 28;i++) { if(i < 10) shieldCardID << initialArray[i]; else if(i < 16) weakCardID << initialArray[i]; else if(i < 22) poisonCardID << initialArray[i]; else if(i < 28) missileCardID << initialArray[i]; } */ qRegisterMetaType<CardEntity*>("CardEntity*"); qRegisterMetaType<QList<CardEntity*> >("QList<CardEntity*>"); qRegisterMetaType<QList<CardEntity*> >("QList<CardEntity*>&"); Dialog dia; if(dia.exec()==QDialog::Accepted) { MyRoom *test = new MyRoom(dia.getServer()); //test->show(); return a.exec(); } else return 0; }
void MainWindow::on_btnDraw_clicked() { QString it = ui->iterations->text(); ui->iterations->setText(""); int n = it.toInt(); QString ang = ui->angle->text(); ui->angle->setText(""); double rangle = ang.toDouble(); if(n>100 || n < 0 || rangle > 180 || rangle < -180) { Dialog *about = new Dialog(this); //the parent is this about->show(); } else{ scene = new QGraphicsScene(ui->graphicsView); QLineF qline(0,0,300,0); scene->addLine(qline); ui->graphicsView->setScene(scene); int x2 = qline.x2(); int y2 = qline.y2(); int i = 0; drawLine(rangle,i,n,x2,y2,qline.length(), qline.angle(), scene); } }
void AlliesWhiteboard::DrawTextMarker(LPDIRECTDRAWSURFACE DestSurf, int X, int Y, char *cText, char C) { int x = X - *MapX + 128; int y = Y - *MapY + 32; DDBLTFX ddbltfx; DDRAW_INIT_STRUCT(ddbltfx); ddbltfx.ddckSrcColorkey.dwColorSpaceLowValue = 102; ddbltfx.ddckSrcColorkey.dwColorSpaceHighValue = 102; RECT Dest; Dest.left = x-TextMarkerWidth/2; Dest.top = y-TextMarkerHeight/2; Dest.right = Dest.left+TextMarkerWidth; Dest.bottom = Dest.top+TextMarkerHeight; RECT Source; Source.left = C*TextMarkerWidth; Source.top = 0; Source.right = Source.left+TextMarkerWidth; Source.bottom = TextMarkerHeight; if(DestSurf->Blt(&Dest, lpSmallCircle, &Source, DDBLT_ASYNC | DDBLT_KEYSRCOVERRIDE, &ddbltfx)!=DD_OK) { DestSurf->Blt(&Dest, lpSmallCircle, &Source, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &ddbltfx); } Dialog *pDialog = (Dialog*)LocalShare->Dialog; pDialog->DrawText(DestSurf, x+TextMarkerWidth , y-5, cText); }