summaryrefslogtreecommitdiffabout
path: root/libkdepim/kdateedit.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/kdateedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/kdateedit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 60bd2cf..5fb948a 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -1,89 +1,89 @@
/*
This file is part of libkdepim.
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qapplication.h>
#include <qevent.h>
#include <qlineedit.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <kdatepicker.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <knotifyclient.h>
#include <qpalette.h>
#include "kdateedit.h"
-#include "kdateedit.moc"
+//#include "kdateedit.moc"
KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
: QHBox(parent, name)
{
dateFormShort = true;
withoutDp = withoutDP;
mDateEdit = new QLineEdit(this);
mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort));
setFocusProxy(mDateEdit);
mDateEdit->installEventFilter(this);
// Highlight Background and Textcolor
QPalette palette = QWidget::palette();
unsigned char red, green, blue;
red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10;
green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10;
blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10;
palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) );
palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) );
mDateEdit->setPalette( palette );
if ( withoutDP ) {
mDateFrame = 0;
mDateButton = 0;
mDatePicker = 0;
} else {
QPixmap pixmap = SmallIcon("smallcal");
mDateButton = new QPushButton(this);
mDateButton->setPixmap(pixmap);
mDateFrame = new QVBox(0,0,WType_Popup);
// mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
mDateFrame->setLineWidth(3);
mDateFrame->hide();
mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate());
connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate)));
connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate)));
connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate)));
connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate)));
connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide()));
connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker()));
//mDateFrame->resize( 400, 300 );
}
connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed()));