summaryrefslogtreecommitdiffstats
path: root/korganizer/kodaymatrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'korganizer/kodaymatrix.cpp')
-rw-r--r--korganizer/kodaymatrix.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index b749b2227..ff82ada9c 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -26,9 +26,9 @@
without including the source code for Qt in the source distribution.
*/
-#include <qevent.h>
-#include <qpainter.h>
-#include <qptrlist.h>
+#include <tqevent.h>
+#include <tqpainter.h>
+#include <tqptrlist.h>
#include <kglobal.h>
#include <kdebug.h>
@@ -51,7 +51,7 @@
#include "kodaymatrix.moc"
#ifndef NODND
-#include <qcursor.h>
+#include <tqcursor.h>
#include <kpopupmenu.h>
#include <X11/Xlib.h>
#undef FocusIn
@@ -64,29 +64,29 @@
// D Y N A M I C T I P
// ============================================================================
-DynamicTip::DynamicTip( QWidget * parent )
- : QToolTip( parent )
+DynamicTip::DynamicTip( TQWidget * parent )
+ : TQToolTip( parent )
{
mMatrix = static_cast<KODayMatrix *>( parent );
}
-void DynamicTip::maybeTip( const QPoint &pos )
+void DynamicTip::maybeTip( const TQPoint &pos )
{
//calculate which cell of the matrix the mouse is in
- QRect sz = mMatrix->frameRect();
+ TQRect sz = mMatrix->frameRect();
int dheight = sz.height() * 7 / 42;
int dwidth = sz.width() / 7;
int row = pos.y() / dheight;
int col = pos.x() / dwidth;
- QRect rct( col * dwidth, row * dheight, dwidth, dheight );
+ TQRect rct( col * dwidth, row * dheight, dwidth, dheight );
// kdDebug(5850) << "DynamicTip::maybeTip matrix cell index [" <<
// col << "][" << row << "] => " <<(col+row*7) << endl;
//show holiday names only
- QString str = mMatrix->getHolidayLabel( col + row * 7 );
+ TQString str = mMatrix->getHolidayLabel( col + row * 7 );
if ( str.isEmpty() ) return;
tip( rct, str );
}
@@ -99,8 +99,8 @@ void DynamicTip::maybeTip( const QPoint &pos )
const int KODayMatrix::NOSELECTION = -1000;
const int KODayMatrix::NUMDAYS = 42;
-KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
- : QFrame( parent, name ), mCalendar( 0 ), mStartDate(), mPendingChanges( false )
+KODayMatrix::KODayMatrix( TQWidget *parent, const char *name )
+ : TQFrame( parent, name ), mCalendar( 0 ), mStartDate(), mPendingChanges( false )
{
// initialize dynamic arrays
mDays = new QDate[ NUMDAYS ];
@@ -125,9 +125,9 @@ void KODayMatrix::setCalendar( Calendar *cal )
mCalendar->registerObserver( this );
CalendarResources *calres = dynamic_cast<CalendarResources*>( cal );
if ( calres ) {
- connect( calres, SIGNAL(signalResourceAdded(ResourceCalendar *)), SLOT(resourcesChanged()) );
- connect( calres, SIGNAL(signalResourceModified( ResourceCalendar *)), SLOT(resourcesChanged()) );
- connect( calres, SIGNAL(signalResourceDeleted(ResourceCalendar *)), SLOT(resourcesChanged()) );
+ connect( calres, TQT_SIGNAL(signalResourceAdded(ResourceCalendar *)), TQT_SLOT(resourcesChanged()) );
+ connect( calres, TQT_SIGNAL(signalResourceModified( ResourceCalendar *)), TQT_SLOT(resourcesChanged()) );
+ connect( calres, TQT_SIGNAL(signalResourceDeleted(ResourceCalendar *)), TQT_SLOT(resourcesChanged()) );
}
setAcceptDrops( mCalendar );
@@ -135,9 +135,9 @@ void KODayMatrix::setCalendar( Calendar *cal )
updateEvents();
}
-QColor KODayMatrix::getShadedColor( const QColor &color )
+TQColor KODayMatrix::getShadedColor( const TQColor &color )
{
- QColor shaded;
+ TQColor shaded;
int h = 0;
int s = 0;
int v = 0;
@@ -192,7 +192,7 @@ void KODayMatrix::addSelectedDaysTo( DateList &selDays )
}
}
-void KODayMatrix::setSelectedDaysFrom( const QDate &start, const QDate &end )
+void KODayMatrix::setSelectedDaysFrom( const TQDate &start, const TQDate &end )
{
if ( mStartDate.isValid() ) {
mSelStart = mStartDate.daysTo( start );
@@ -211,12 +211,12 @@ void KODayMatrix::recalculateToday()
mToday = -1;
for ( int i = 0; i < NUMDAYS; i++ ) {
mDays[ i ] = mStartDate.addDays( i );
- mDayLabels[ i ] = QString::number( KOGlobals::self()->calendarSystem()->day( mDays[i] ));
+ mDayLabels[ i ] = TQString::number( KOGlobals::self()->calendarSystem()->day( mDays[i] ));
// if today is in the currently displayed month, hilight today
- if ( mDays[ i ].year() == QDate::currentDate().year() &&
- mDays[ i ].month() == QDate::currentDate().month() &&
- mDays[ i ].day() == QDate::currentDate().day() ) {
+ if ( mDays[ i ].year() == TQDate::currentDate().year() &&
+ mDays[ i ].month() == TQDate::currentDate().month() &&
+ mDays[ i ].day() == TQDate::currentDate().day() ) {
mToday = i;
}
}
@@ -228,7 +228,7 @@ void KODayMatrix::recalculateToday()
updateView( mStartDate );
}
-void KODayMatrix::updateView( const QDate &actdate )
+void KODayMatrix::updateView( const TQDate &actdate )
{
kdDebug(5850) << "KODayMatrix::updateView() " << actdate << ", day start="<<mStartDate<< endl;
if ( !actdate.isValid() ) return;
@@ -274,8 +274,8 @@ void KODayMatrix::updateView( const QDate &actdate )
updateEvents();
for( int i = 0; i < NUMDAYS; i++ ) {
//if it is a holy day then draw it red. Sundays are consider holidays, too
- QStringList holidays = KOGlobals::self()->holiday( mDays[ i ] );
- QString holiStr = QString::null;
+ TQStringList holidays = KOGlobals::self()->holiday( mDays[ i ] );
+ TQString holiStr = TQString::null;
if ( ( KOGlobals::self()->calendarSystem()->dayOfWeek( mDays[ i ] ) ==
KOGlobals::self()->calendarSystem()->weekDayOfPray() ) ||
@@ -313,7 +313,7 @@ void KODayMatrix::updateEvents()
mPendingChanges = false;
}
-const QDate& KODayMatrix::getDate( int offset )
+const TQDate& KODayMatrix::getDate( int offset )
{
if ( offset < 0 || offset > NUMDAYS - 1 ) {
kdDebug(5850) << "Wrong offset (" << offset << ") in KODayMatrix::getDate(int)" << endl;
@@ -322,7 +322,7 @@ const QDate& KODayMatrix::getDate( int offset )
return mDays[ offset ];
}
-QString KODayMatrix::getHolidayLabel( int offset )
+TQString KODayMatrix::getHolidayLabel( int offset )
{
if ( offset < 0 || offset > NUMDAYS - 1 ) {
kdDebug(5850) << "Wrong offset (" << offset << ") in KODayMatrix::getHolidayLabel(int)" << endl;
@@ -363,14 +363,14 @@ void KODayMatrix::resourcesChanged()
// M O U S E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
-void KODayMatrix::mousePressEvent( QMouseEvent *e )
+void KODayMatrix::mousePressEvent( TQMouseEvent *e )
{
mSelStart = getDayIndexFrom(e->x(), e->y());
if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
mSelInit = mSelStart;
}
-void KODayMatrix::mouseReleaseEvent( QMouseEvent *e )
+void KODayMatrix::mouseReleaseEvent( TQMouseEvent *e )
{
int tmp = getDayIndexFrom(e->x(), e->y());
if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
@@ -399,7 +399,7 @@ void KODayMatrix::mouseReleaseEvent( QMouseEvent *e )
emit selected((const DateList)daylist);
}
-void KODayMatrix::mouseMoveEvent( QMouseEvent *e )
+void KODayMatrix::mouseMoveEvent( TQMouseEvent *e )
{
int tmp = getDayIndexFrom(e->x(), e->y());
if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
@@ -434,7 +434,7 @@ enum {
DRAG_CANCEL = 2
};
-void KODayMatrix::dragEnterEvent( QDragEnterEvent *e )
+void KODayMatrix::dragEnterEvent( TQDragEnterEvent *e )
{
#ifndef KORG_NODND
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
@@ -449,7 +449,7 @@ void KODayMatrix::dragEnterEvent( QDragEnterEvent *e )
#endif
}
-void KODayMatrix::dragMoveEvent( QDragMoveEvent *e )
+void KODayMatrix::dragMoveEvent( TQDragMoveEvent *e )
{
#ifndef KORG_NODND
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
@@ -461,7 +461,7 @@ void KODayMatrix::dragMoveEvent( QDragMoveEvent *e )
#endif
}
-void KODayMatrix::dragLeaveEvent( QDragLeaveEvent * /*dl*/ )
+void KODayMatrix::dragLeaveEvent( TQDragLeaveEvent * /*dl*/ )
{
#ifndef KORG_NODND
// setPalette(oldPalette);
@@ -469,7 +469,7 @@ void KODayMatrix::dragLeaveEvent( QDragLeaveEvent * /*dl*/ )
#endif
}
-void KODayMatrix::dropEvent( QDropEvent *e )
+void KODayMatrix::dropEvent( TQDropEvent *e )
{
#ifndef KORG_NODND
kdDebug(5850) << "KODayMatrix::dropEvent(e) begin" << endl;
@@ -518,7 +518,7 @@ void KODayMatrix::dropEvent( QDropEvent *e )
}
menu->insertSeparator();
menu->insertItem( KOGlobals::self()->smallIcon("cancel"), i18n("Cancel"), DRAG_CANCEL, 3 );
- action = menu->exec( QCursor::pos(), 0 );
+ action = menu->exec( TQCursor::pos(), 0 );
}
if ( action == DRAG_COPY || action == DRAG_MOVE ) {
@@ -542,20 +542,20 @@ void KODayMatrix::dropEvent( QDropEvent *e )
// P A I N T E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
-void KODayMatrix::paintEvent( QPaintEvent * )
+void KODayMatrix::paintEvent( TQPaintEvent * )
{
// kdDebug(5850) << "KODayMatrix::paintEvent() BEGIN" << endl;
- QPainter p;
- QRect sz = frameRect();
- QPixmap pm( sz.size() );
+ TQPainter p;
+ TQRect sz = frameRect();
+ TQPixmap pm( sz.size() );
int dheight = mDaySize.height();
int dwidth = mDaySize.width();
int row,col;
int selw, selh;
bool isRTL = KOGlobals::self()->reverseLayout();
- QColorGroup cg = palette().active();
+ TQColorGroup cg = palette().active();
p.begin( &pm, this );
pm.fill( cg.base() );
@@ -573,7 +573,7 @@ void KODayMatrix::paintEvent( QPaintEvent * )
// fix larger selections starting in the previous month
if ( row < 0 && mSelEnd > 0 ) row = 0;
col = mSelStart -row*7;
- QColor selcol = KOPrefs::instance()->mHighlightColor;
+ TQColor selcol = KOPrefs::instance()->mHighlightColor;
if ( row < 6 && row >= 0 ) {
if (row == mSelEnd/7) {
@@ -601,11 +601,11 @@ void KODayMatrix::paintEvent( QPaintEvent * )
}
// iterate over all days in the matrix and draw the day label in appropriate colors
- QColor textColor = cg.text();
- QColor textColorShaded = getShadedColor( textColor );
- QColor actcol = textColorShaded;
+ TQColor textColor = cg.text();
+ TQColor textColorShaded = getShadedColor( textColor );
+ TQColor actcol = textColorShaded;
p.setPen(actcol);
- QPen tmppen;
+ TQPen tmppen;
for ( int i = 0; i < NUMDAYS; ++i ) {
row = i/7;
col = isRTL ? 6-(i-row*7) : i-row*7;
@@ -627,11 +627,11 @@ void KODayMatrix::paintEvent( QPaintEvent * )
bool holiday = ! KOGlobals::self()->isWorkDay( mDays[ i ] );
- QColor holidayColorShaded = getShadedColor( KOPrefs::instance()->mHolidayColor );
+ TQColor holidayColorShaded = getShadedColor( KOPrefs::instance()->mHolidayColor );
// if today then draw rectangle around day
if (mToday == i) {
tmppen = p.pen();
- QPen mTodayPen(p.pen());
+ TQPen mTodayPen(p.pen());
mTodayPen.setWidth(mTodayMarginWidth);
//draw red rectangle for holidays
@@ -644,7 +644,7 @@ void KODayMatrix::paintEvent( QPaintEvent * )
}
//draw gray rectangle for today if in selection
if (i >= mSelStart && i <= mSelEnd) {
- QColor grey("grey");
+ TQColor grey("grey");
mTodayPen.setColor(grey);
}
p.setPen(mTodayPen);
@@ -654,7 +654,7 @@ void KODayMatrix::paintEvent( QPaintEvent * )
// if any events are on that day then draw it using a bold font
if (mEvents[i] > 0) {
- QFont myFont = font();
+ TQFont myFont = font();
myFont.setBold(true);
p.setFont(myFont);
}
@@ -671,7 +671,7 @@ void KODayMatrix::paintEvent( QPaintEvent * )
// draw selected days with special color
// DO NOT specially highlight holidays in selection !
if (i >= mSelStart && i <= mSelEnd) {
- p.setPen( QColor( "white" ) );
+ p.setPen( TQColor( "white" ) );
}
p.drawText(col*dwidth, row*dheight, dwidth, dheight,
@@ -683,7 +683,7 @@ void KODayMatrix::paintEvent( QPaintEvent * )
}
// reset bold font to plain font
if (mEvents[i] > 0) {
- QFont myFont = font();
+ TQFont myFont = font();
myFont.setBold(false);
p.setFont(myFont);
}
@@ -696,9 +696,9 @@ void KODayMatrix::paintEvent( QPaintEvent * )
// R E SI Z E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
-void KODayMatrix::resizeEvent( QResizeEvent * )
+void KODayMatrix::resizeEvent( TQResizeEvent * )
{
- QRect sz = frameRect();
+ TQRect sz = frameRect();
mDaySize.setHeight( sz.height() * 7 / NUMDAYS );
mDaySize.setWidth( sz.width() / 7 );
}