/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#pragma once
#include <QApplication>
#include <QtGui>
#include <QWidget>
#include <QComboBox>
#include <QLineEdit>
#include <QtGui>
#include <QGridLayout>
#include <QGroupBox>
#include <QPushButton>
#include <QLabel>
{
public:
~window();
private:
};
/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#pragma once
#include <QApplication>
#include <QtGui>
#include <QWidget>
#include <QComboBox>
#include <QLineEdit>
#include <QtGui>
#include <QGridLayout>
#include <QGroupBox>
#include <QPushButton>
#include <QLabel>
class window : public QWidget
{
public:
window(QWidget * parent = NULL);
~window();
private:
QLineEdit * nameline;
QLineEdit * typeline;
QLineEdit * answerline;
};
To copy to clipboard, switch view to plain text mode
window.cpp
/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "window.h"
{
/*=================================================
* Settings *
=================================================*/
setWindowTitle("Variable Definer Version 0.1");
/*=================================================
* Name *
=================================================*/
nameline->setFocus();
namelayout->addWidget(namelabel, 0, 0);
namelayout->addWidget(nameline, 1, 0,1,2);
namegroup->setLayout(namelayout);
/*=================================================
* Type *
=================================================*/
typelayout->addWidget(typeLabel, 0, 0);
typelayout->addWidget(typeline, 1,0,1,2);
typegroup->setLayout(typelayout);
/*=================================================
* Specifiers *
=================================================*/
QLabel * speclabel
= new QLabel("Choose the right defenition");
speclay->addWidget(speclabel,0,0);
speclay->addWidget(array,1,0);
speclay->addWidget(pointer,1,1);
speclay->addWidget(function,1,2);
specgroup->setLayout(speclay);
/*=================================================
* Answer *
=================================================*/
QLabel * answerlabel
= new QLabel("The correct defenition:");
anslay->addWidget(answerlabel,0,0);
anslay->addWidget(answerline,1,0,1,2);
answergroup->setLayout(anslay);
/*=================================================
* Global Layout *
=================================================*/
layout->addWidget(namegroup, 0, 0);
layout->addWidget(typegroup, 1, 0);
layout->addWidget(specgroup, 2, 0);
layout->addWidget(answergroup,3, 0);
setLayout(layout);
}
/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "window.h"
window::window(QWidget * var) : QWidget(var)
{
/*=================================================
* Settings *
=================================================*/
setWindowTitle("Variable Definer Version 0.1");
/*=================================================
* Name *
=================================================*/
QGroupBox * namegroup = new QGroupBox("Name");
QLabel * namelabel = new QLabel("Enter variable name:");
nameline = new QLineEdit();
nameline->setFocus();
QGridLayout * namelayout = new QGridLayout;
namelayout->addWidget(namelabel, 0, 0);
namelayout->addWidget(nameline, 1, 0,1,2);
namegroup->setLayout(namelayout);
/*=================================================
* Type *
=================================================*/
QGroupBox * typegroup = new QGroupBox("Type");
QLabel * typeLabel = new QLabel("Enter variable type");
typeline = new QLineEdit();
QGridLayout * typelayout = new QGridLayout();
typelayout->addWidget(typeLabel, 0, 0);
typelayout->addWidget(typeline, 1,0,1,2);
typegroup->setLayout(typelayout);
/*=================================================
* Specifiers *
=================================================*/
QGroupBox * specgroup = new QGroupBox("Specifiers");
QLabel * speclabel = new QLabel("Choose the right defenition");
QPushButton * array = new QPushButton("Array (of)");
QPushButton * pointer = new QPushButton("Pointer (to)");
QPushButton * function = new QPushButton("Function");
QGridLayout * speclay = new QGridLayout();
speclay->addWidget(speclabel,0,0);
speclay->addWidget(array,1,0);
speclay->addWidget(pointer,1,1);
speclay->addWidget(function,1,2);
specgroup->setLayout(speclay);
/*=================================================
* Answer *
=================================================*/
QGroupBox * answergroup = new QGroupBox("Defenition");
QLabel * answerlabel = new QLabel("The correct defenition:");
answerline = new QLineEdit();
QGridLayout * anslay= new QGridLayout();
anslay->addWidget(answerlabel,0,0);
anslay->addWidget(answerline,1,0,1,2);
answergroup->setLayout(anslay);
/*=================================================
* Global Layout *
=================================================*/
QGridLayout * layout = new QGridLayout();
layout->addWidget(namegroup, 0, 0);
layout->addWidget(typegroup, 1, 0);
layout->addWidget(specgroup, 2, 0);
layout->addWidget(answergroup,3, 0);
setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
main.cpp
/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QApplication>
#include "window.h"
int main(int argc, char *argv[])
{
window * newwindow = new window();
newwindow->show();
return (application.exec());
}
/***************************************************************************
* Copyright (C) 2007 by adriaan,,, *
* adriaan@Tornado *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QApplication>
#include "window.h"
int main(int argc, char *argv[])
{
QApplication application (argc, argv);
window * newwindow = new window();
newwindow->show();
return (application.exec());
}
To copy to clipboard, switch view to plain text mode
Bookmarks