BtAboutDialog::BtAboutDialog(QWidget *parent, Qt::WindowFlags wflags) : QDialog(parent, wflags) { setAttribute(Qt::WA_DeleteOnClose); resize(550, 340); QVBoxLayout *mainLayout = new QVBoxLayout; QWidget *top = new QWidget(this); QHBoxLayout *topLayout = new QHBoxLayout; QLabel *iconLabel = new QLabel(this); iconLabel->setPixmap(QIcon(util::directory::getIconDir().path() + "/bibletime.svg").pixmap(48)); topLayout->addWidget(iconLabel); topLayout->addWidget(new QLabel("<h1>BibleTime " BT_VERSION "</h1>"), 1); top->setLayout(topLayout); mainLayout->addWidget(top, 0, Qt::AlignCenter); m_tabWidget = new QTabWidget(this); mainLayout->addWidget(m_tabWidget); initTab(m_bibletimeTab); initTab(m_contributorsTab); initTab(m_swordTab); initTab(m_qtTab); initTab(m_licenceTab); m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this); mainLayout->addWidget(m_buttonBox); setLayout(mainLayout); connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); retranslateUi(); }
int main(int argc, char **argv, char **env) { //selon les arguments, ascii ou affichage if ((argc == 2) && (atoi(argv[1])==0)){ afficheAsciiMandel(); } else if ((argc == 2) && (atoi(argv[1])==1)){ afficheAsciiJulia(); } else if (argc == 3) { //Dimensions de l'image en pixels largeur = atoi(argv[1]); hauteur = atoi(argv[2]); //Nom de la fenêtre nom="Mandelbrot"; //le code suivant permet de modifier les bornes pour garder un affichage proportionné de l'ensemble dans le cas où largeur et hauteur sont différentes. if(largeur>hauteur){ GLdouble ecart = (maxRe-minRe)*((double)largeur/(double)hauteur-1)/2; minRe -= ecart; maxRe += ecart; }else if(largeur<hauteur){ GLdouble ecart = (maxIm-minIm)*((double)hauteur/(double)largeur-1)/2; minIm-= ecart; maxIm+= ecart; } t=initTab(largeur, hauteur); rempliTab();//Remplissage du tableau //------------------------------------INITIALISATION OPENGL--------------------------------------- glutInit(&argc,argv); glutInitWindowPosition(0,0);//initialisation de la fenêtre glutInitWindowSize(largeur,hauteur); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow(nom); glutDisplayFunc(draw); glutReshapeFunc(draw); glutSpecialFunc(GestionSpecial); glutMouseFunc(GestionSouris); glutKeyboardFunc(GestionClavier); initColorTab(); glutMainLoop(); //--------------------------------------------------------------------------------------- freeTab(largeur, hauteur);//Libération de la mémoire allouée -- fin du programme freeTabColor(); } else { printf("Il faut lancer le programme avec 2 arguments:\n1)La largeur de l'image en pixels\n2)La longueur de l'image en pixels\n"); printf("Arrêt du programme\n"); } return 0; }
object_list * lirePiece(object_list * L) { FILE * ptr_file; ptr_file = fopen("source.txt", "r"); if (!ptr_file){ printf("Error opening file"); exit; } int i, j; object tmp; char c, d; i = 0; j = 0; c = 'a'; initTab(&tmp); do { d = c; c = fgetc(ptr_file); if (c == '#'){ tmp.tab[i][j] = 1; ++j; } else if (c == '\n' && d == '\n'){ L = object_list_cons(tmp, L); initTab(&tmp); i = 0; j = 0; } else if (c == '\n'){ ++i; j = 0; } else{ ++j; } }while (c != EOF); fclose(ptr_file); return L; }
EditConfigWindow::EditConfigWindow(ConfigMapShared a_map, QWidget *parent) : QDialog(parent), m_config(a_map) { ui.setupUi(this); connect(ui.button_cancel, SIGNAL(clicked()), this, SLOT(reject())); connect(ui.button_save, SIGNAL(clicked()), this, SLOT(saveConfig())); connect(ui.button_add_coils, SIGNAL(clicked()), this, SLOT(addCoil())); connect(ui.button_add_input, SIGNAL(clicked()), this, SLOT(addInput())); connect(ui.button_add_output, SIGNAL(clicked()), this, SLOT(addOutput())); connect(ui.button_edit_coils, SIGNAL(clicked()), this, SLOT(editCoil())); connect(ui.button_edit_input, SIGNAL(clicked()), this, SLOT(editInput())); connect(ui.button_edit_output, SIGNAL(clicked()), this, SLOT(editOutput())); connect(ui.button_delete_coils, SIGNAL(clicked()), this, SLOT(deleteCoil())); connect(ui.button_delete_input, SIGNAL(clicked()), this, SLOT(deleteInput())); connect(ui.button_delete_output, SIGNAL(clicked()), this, SLOT(deleteOutput())); connect(ui.table_input, SIGNAL(cellClicked(int, int)), this, SLOT(cellSelectedInput(int, int))); connect(ui.table_output, SIGNAL(cellClicked(int, int)), this, SLOT(cellSelectedOutput(int, int))); connect(ui.table_coils, SIGNAL(cellClicked(int, int)), this, SLOT(cellSelectedCoils(int, int))); connect(ui.table_input, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellEditInput(int, int))); connect(ui.table_output, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellEditOutput(int, int))); connect(ui.table_coils, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellEditCoils(int, int))); m_map = a_map->m_map; m_tables[ConfigMap::INPUT_REGISTER] = ui.table_input; m_tables[ConfigMap::OUTPUT_REGISTER] = ui.table_output; m_tables[ConfigMap::COIL] = ui.table_coils; for (int& a : m_currentIndex) a = 0; initTab(ConfigMap::INPUT_REGISTER); initTab(ConfigMap::OUTPUT_REGISTER); initTab(ConfigMap::COIL); }
BtAboutDialog::BtAboutDialog(QWidget *parent, Qt::WindowFlags wflags) : QDialog(parent, wflags) { setAttribute(Qt::WA_DeleteOnClose); resize(640, 380); QVBoxLayout *mainLayout = new QVBoxLayout; QWidget *top = new QWidget(this); QHBoxLayout *topLayout = new QHBoxLayout; m_iconLabel = new QLabel(this); m_iconLabel->setPixmap(QIcon(util::directory::getIconDir().path() + "/bibletime.svg").pixmap(48)); topLayout->addWidget(m_iconLabel); m_versionLabel = new QLabel(this); QFont font = m_versionLabel->font(); font.setPointSize(font.pointSize()+6); font.setBold(true); m_versionLabel->setFont(font); topLayout->addWidget(m_versionLabel); top->setLayout(topLayout); mainLayout->addWidget(top, 0, Qt::AlignCenter); m_tabWidget = new QTabWidget(this); mainLayout->addWidget(m_tabWidget); initTab(m_bibletimeTab); initTab(m_contributorsTab); initTab(m_swordTab); initTab(m_qtTab); initTab(m_licenceTab); m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this); mainLayout->addWidget(m_buttonBox); setLayout(mainLayout); connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); retranslateUi(); }
void rotatePiece(object * p) { object p2 = *p; int i, j; initTab(p); for(i=0;i<5;i++){ for(j=0;j<5;j++){ if(p2.tab[i][j] == 1){ p->tab[j][4-i] = 1; } } } rognerPiece(p); }
void EditConfigWindow::addNewParameter(ConfigMap::RegisterType type) { ConfigMap::Parameter newParameter; newParameter.m_type = type; QString newName; if (!getNewName(newName)) return; if (editParameter(newParameter)) { m_config->setNewParameter(newName.toStdString(), newParameter); m_tables[type]->clearContents(); m_map = m_config->m_map; initTab(type); } }
int mymain(void) { unsigned int code=0; unsigned char head=0, tail=0; unsigned char scanCode=0, asciiCode=0; disableKey(); if(firstTime==1) { initHeadTail(); initTab(); firstTime=0; } scanCode=getScanCode(); asciiCode=lookupAscii(scanCode); if(asciiCode==0) { /* not printable */ if(scanCode==0x1D) { /* check if ctrl is pressed or not */ isCtrlDown=1; } else if(scanCode==0x9d) { isCtrlDown=0; } } if(scanCode>=0x3b && scanCode<=0x3e && isCtrlDown==1) { setActiveShell((scanCode-0x3b)+1); } code= scanCode; code<<=8; code|=asciiCode; head=getHead(); tail=getTail(); if(!((tail+2)==head || (head==0x1e && tail==0x3c)) ) { /* not full */ setKeyCode(code); if(tail==0x3C) { setTail(0x1e); } else { setTail(tail+2); } } enableKey(); eoi(ss,sp); }
void BrowserDialog::openInNewTab(const QUrl &url) { BrowserView *newView = new BrowserView(this); initTab(newView); newView->setUrl(url); }
StratFact::StratFact() { initTab(); }