author | leseb <leseb> | 2002-06-13 16:43:16 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-13 16:43:16 (UTC) |
commit | 54de91b66a2f0f985ff89503e919f85713d1f22c (patch) (side-by-side diff) | |
tree | 55df26ca5f08584beb4e033a1fee4510a8e2d45c /noncore/graphics/drawpad/pageinformationdialog.cpp | |
parent | 6a178f4ad2c3a9b92224c3506165cf03df41202e (diff) | |
download | opie-54de91b66a2f0f985ff89503e919f85713d1f22c.zip opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.gz opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.bz2 |
Starting to implement page attributes
Diffstat (limited to 'noncore/graphics/drawpad/pageinformationdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/pageinformationdialog.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/pageinformationdialog.cpp b/noncore/graphics/drawpad/pageinformationdialog.cpp new file mode 100644 index 0000000..54cf89d --- a/dev/null +++ b/noncore/graphics/drawpad/pageinformationdialog.cpp @@ -0,0 +1,70 @@ +/*************************************************************************** + * * + * DrawPad - a drawing program for Opie Environment * + * * + * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * + * * + * 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. * + * * + ***************************************************************************/ + +#include "pageinformationdialog.h" + +#include "page.h" + +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlineedit.h> + +PageInformationDialog::PageInformationDialog(Page* page, QWidget* parent, const char* name) + : QDialog(parent, name, true) +{ + m_pPage = page; + + setCaption(tr("Page Information")); + + QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this); + + QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox); + m_pTitleLineEdit = new QLineEdit(generalGroupBox); + + QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this); + + QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox); + QLabel* widthValueLabel = new QLabel(QString::number(m_pPage->width()), sizeGroupBox); + + QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox); + QLabel* heightValueLabel = new QLabel(QString::number(m_pPage->height()), sizeGroupBox); + + QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); + generalGroupBox->layout()->setSpacing(4); + sizeGroupBox->layout()->setSpacing(4); + QGridLayout* generalLayout = new QGridLayout(generalGroupBox->layout(), 1, 1); + QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2); + + generalLayout->addWidget(titleLabel, 0, 0); + generalLayout->addWidget(m_pTitleLineEdit, 0, 1); + + sizeLayout->addWidget(widthLabel, 0, 0); + sizeLayout->addWidget(widthValueLabel, 0, 1); + sizeLayout->addWidget(heightLabel, 1, 0); + sizeLayout->addWidget(heightValueLabel, 1, 1); + + sizeLayout->setColStretch(1, 1); + + mainLayout->addWidget(generalGroupBox); + mainLayout->addWidget(sizeGroupBox); +} + +PageInformationDialog::~PageInformationDialog() +{ +} + +QString PageInformationDialog::selectedTitle() +{ + return (m_pTitleLineEdit->text()); +} |