Exemplo n.º 1
0
picPunto::picPunto(QWidget *parent) :  QDialog(parent)
{
    cnt = 0;    
    QStringList txtformats;

    QGridLayout *mainLayout = new QGridLayout;
//readSettings();

    QPushButton *filebut = new QPushButton(tr("File..."));
    fileedit = new QLineEdit();

    QDoubleValidator *val = new QDoubleValidator(0);
    val->setBottom ( 0.0 );
    scaleedit = new QLineEdit();
    scaleedit->setValidator(val);

    QFormLayout *flo = new QFormLayout;
    flo->addRow( filebut, fileedit);
    flo->addRow( tr("Scale:"), scaleedit);
    mainLayout->addLayout(flo, 0, 0);

    QHBoxLayout *loacceptcancel = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loacceptcancel->addStretch();
    loacceptcancel->addWidget(acceptbut);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    loacceptcancel->addWidget(cancelbut);
    mainLayout->addLayout(loacceptcancel, 1, 0);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));

    connect(filebut, SIGNAL(clicked()), this, SLOT(dptFile()));
}
Exemplo n.º 2
0
dibPunto::dibPunto(QWidget *parent) :  QDialog(parent)
{
//    setParent(parent);
    setWindowTitle(tr("Read ascii points"));
    QStringList txtformats;

    QGridLayout *mainLayout = new QGridLayout;
//readSettings();

    QPushButton *filebut = new QPushButton(tr("File..."));
    fileedit = new QLineEdit();
    QHBoxLayout *lofile = new QHBoxLayout;
    lofile->addWidget(filebut);
    lofile->addWidget(fileedit);
    mainLayout->addLayout(lofile, 0, 0);

    QLabel *formatlabel = new QLabel(tr("Format:"));
    formatedit = new QComboBox();
    txtformats << tr("Space Separator") << tr("Tab Separator") << tr("Comma Separator") << tr("Space in Columns") << tr("*.odb for Psion 2");
    formatedit->addItems(txtformats);
    connectPoints = new QCheckBox(tr("Connect points"));

    QHBoxLayout *loformat = new QHBoxLayout;
    loformat->addWidget(formatlabel);
    loformat->addWidget(formatedit);
    loformat->addWidget(connectPoints);
    mainLayout->addLayout(loformat, 0, 1);

    pt2d = new pointBox(tr("2D Point"),tr("Draw 2D Point"));
    pt3d = new pointBox(tr("3D Point"),tr("Draw 3D Point"));
    ptnumber = new textBox(tr("Point Number"),tr("Draw point number"));
    ptelev = new textBox(tr("Point Elevation"),tr("Draw point elevation"));
    ptcode = new textBox(tr("Point Code"),tr("Draw point code"));
    ptnumber->setPos(DPT::NO);

    QVBoxLayout *lo2d3d = new QVBoxLayout;

    lo2d3d->addWidget(pt2d);
    lo2d3d->addWidget(pt3d);
    mainLayout->addLayout(lo2d3d, 1, 0);

    mainLayout->addWidget(ptnumber, 1, 1);
    mainLayout->addWidget(ptelev, 2, 0);
    mainLayout->addWidget(ptcode, 2, 1);

    QHBoxLayout *loaccept = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loaccept->addStretch();
    loaccept->addWidget(acceptbut);
    mainLayout->addLayout(loaccept, 3, 0);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    QHBoxLayout *locancel = new QHBoxLayout;
    locancel->addWidget(cancelbut);
    locancel->addStretch();
    mainLayout->addLayout(locancel, 3, 1);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));

    connect(filebut, SIGNAL(clicked()), this, SLOT(dptFile()));
}