karm Library API Documentation

printdialog.cpp

00001 /* 00002 * This file only: 00003 * Copyright (C) 2003 Mark Bucciarelli <mark@hubcapconsutling.com> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the 00017 * Free Software Foundation, Inc. 00018 * 59 Temple Place - Suite 330 00019 * Boston, MA 02111-1307 USA. 00020 * 00021 */ 00022 00023 #include <qbuttongroup.h> 00024 #include <qcheckbox.h> 00025 #include <qhbox.h> 00026 #include <qlabel.h> 00027 #include <qlayout.h> 00028 #include <qlineedit.h> 00029 #include <qpixmap.h> 00030 #include <qpushbutton.h> 00031 #include <qstring.h> 00032 #include <qwidget.h> 00033 #include <qwhatsthis.h> 00034 00035 #include <kiconloader.h> 00036 #include <klocale.h> // i18n 00037 #include <kwinmodule.h> 00038 00039 #include "printdialog.h" 00040 #include <libkdepim/kdateedit.h> 00041 00042 00043 PrintDialog::PrintDialog() 00044 : KDialogBase(0, "PrintDialog", true, i18n("Print Dialog"), Ok|Cancel, 00045 Ok, true ) 00046 { 00047 QWidget *page = new QWidget( this ); 00048 setMainWidget(page); 00049 int year, month; 00050 00051 QVBoxLayout *layout = new QVBoxLayout(page); 00052 00053 layout->addSpacing(10); 00054 layout->addStretch(1); 00055 00056 // Date Range 00057 QGroupBox *rangeGroup = new QGroupBox(1, Horizontal, i18n("Date Range"), 00058 page); 00059 layout->addWidget(rangeGroup); 00060 00061 QWidget *rangeWidget = new QWidget(rangeGroup); 00062 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget, 0, spacingHint()); 00063 00064 rangeLayout->addWidget(new QLabel(i18n("From:"), rangeWidget)); 00065 _from = new KDateEdit(rangeWidget); 00066 00067 // Default from date to beginning of the month 00068 year = QDate::currentDate().year(); 00069 month = QDate::currentDate().month(); 00070 _from->setDate(QDate(year, month, 1)); 00071 rangeLayout->addWidget(_from); 00072 rangeLayout->addWidget(new QLabel(i18n("To:"), rangeWidget)); 00073 _to = new KDateEdit(rangeWidget); 00074 rangeLayout->addWidget(_to); 00075 00076 layout->addSpacing(10); 00077 layout->addStretch(1); 00078 00079 layout->addSpacing(10); 00080 layout->addStretch(1); 00081 } 00082 00083 QDate PrintDialog::from() const 00084 { 00085 return _from->date(); 00086 } 00087 00088 QDate PrintDialog::to() const 00089 { 00090 return _to->date(); 00091 } 00092 00093 #include "printdialog.moc"
KDE Logo
This file is part of the documentation for karm Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:50:57 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003