summaryrefslogtreecommitdiff
path: root/library/datebookmonth.cpp
Side-by-side diff
Diffstat (limited to 'library/datebookmonth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookmonth.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 272c223..4a9dcbd 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -1,49 +1,49 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "config.h"
#include "datebookmonth.h"
#include "datebookdb.h"
#include <qtopia/private/event.h>
#include "resource.h"
-#include "qpeapplication.h"
+#include <qpe/qpeapplication.h>
#include "timestring.h"
#include <qtoolbutton.h>
#include <qspinbox.h>
#include <qcombobox.h>
#include <qdatetime.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qvaluestack.h>
#include <qwhatsthis.h>
DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name )
: QHBox( parent, name )
{
setBackgroundMode( PaletteButton );
begin = new QToolButton( this );
begin->setFocusPolicy(NoFocus);
begin->setPixmap( Resource::loadPixmap( "start" ) );
begin->setAutoRaise( TRUE );
begin->setFixedSize( begin->sizeHint() );
QWhatsThis::add( begin, tr("Show January in the selected year") );
@@ -533,52 +533,52 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg,
p->save();
QColorGroup g( cg );
g.setBrush( QColorGroup::Base, back );
g.setColor( QColorGroup::Text, forg );
if ( selected )
p->setPen( g.highlightedText() );
else
p->setPen( g.text() );
QValueStack<int> normalLine;
QValueStack<int> repeatLine;
QValueStack<int> travelLine;
bool normalAllDay = FALSE;
bool repeatAllDay = FALSE;
bool travelAllDay = FALSE;
QValueListIterator<EffectiveEvent> itDays = d->mDayEvents.begin();
for ( ; itDays != d->mDayEvents.end(); ++itDays ) {
int w = cr.width();
Event ev = (*itDays).event();
- int f = (*itDays).start().hour(); // assume Effective event
+ int f = (*itDays).start().hour(); // assume Effective event
int t = (*itDays).end().hour(); // is truncated.
- if (ev.isAllDay()) {
+ if (ev.isAllDay()) {
if (!ev.hasRepeat())
normalAllDay = TRUE;
else
repeatAllDay = TRUE;
} else {
int sLine, eLine;
if (f == 0)
sLine = 0;
else if (f < 8 )
sLine = 1;
else if (f >= 17)
sLine = w - 4;
else {
sLine = (f - 8) * (w - 8);
if (sLine)
sLine /= 8;
sLine += 4;
}
if (t == 23)
eLine = w;
else if (t < 8)
eLine = 4;
else if (t >= 17)
eLine = w - 1;
@@ -594,51 +594,51 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg,
} else {
repeatLine.push(sLine);
repeatLine.push(eLine);
}
}
}
// draw the background
if (normalAllDay || repeatAllDay || travelAllDay) {
p->save();
if (normalAllDay)
if (repeatAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height() / 2,
colorNormalLight );
p->fillRect( 0, cr.height() / 2, cr.width(), cr.height() / 2,
colorRepeatLight );
} else
p->fillRect( 0, 0, cr.width(), cr.height(),
colorNormalLight );
else if (repeatAllDay)
p->fillRect( 0, 0, cr.width(), cr.height(),
colorRepeatLight );
} else {
- p->fillRect( 0, 0, cr.width(),
- cr.height(), selected
- ? g.brush( QColorGroup::Highlight )
+ p->fillRect( 0, 0, cr.width(),
+ cr.height(), selected
+ ? g.brush( QColorGroup::Highlight )
: g.brush( QColorGroup::Base ) );
}
// The lines
// now for the lines.
int h = 5;
int y = cr.height() / 2 - h;
while(normalLine.count() >= 2) {
int x2 = normalLine.pop();
int x1 = normalLine.pop();
if (x2 < x1 + 2)
x2 = x1 + 2;
p->fillRect(x1, y, x2 - x1, h, colorNormal);
}
y += h;
while(repeatLine.count() >= 2) {
int x2 = repeatLine.pop();
int x1 = repeatLine.pop();
if (x2 < x1 + 2)
x2 = x1 + 2;
p->fillRect(x1, y, x2 - x1, h, colorRepeat);
@@ -712,39 +712,39 @@ void DateButton::pickDate()
void DateButton::gotHide()
{
// we have to redo the button...
setDown( false );
}
// void dateSelected( int year, int month, int day );
void DateButton::setWeekStartsMonday( int b )
{
weekStartsMonday = b;
}
void DateButton::setDate( int y, int m, int d )
{
setDate( QDate( y,m,d) );
}
void DateButton::setDate( QDate d )
{
currDate = d;
setText( longFormat ? TimeString::longDateString( d, df ) :
- TimeString::shortDate( d, df ) );
+ TimeString::shortDate( d, df ) );
}
void DateButton::setDateFormat( DateFormat f )
{
df = f;
setDate( currDate );
}
bool DateButton::customWhatsThis() const
{
return TRUE;
}