diff options
Diffstat (limited to 'libkdeedu/extdate/extdatetbl.cpp')
-rw-r--r-- | libkdeedu/extdate/extdatetbl.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/libkdeedu/extdate/extdatetbl.cpp b/libkdeedu/extdate/extdatetbl.cpp index ca403a68..91f14395 100644 --- a/libkdeedu/extdate/extdatetbl.cpp +++ b/libkdeedu/extdate/extdatetbl.cpp @@ -28,7 +28,7 @@ // // Copyright (C) 1997 Tim D. Gilman // (C) 1998-2001 Mirko Boehm -// Written using Qt (http://www.troll.no) for the +// Written using TQt (http://www.troll.no) for the // KDE project (http://www.kde.org) // // Modified to use ExtDate by Jason Harris, 2004 @@ -82,8 +82,8 @@ public: }; -ExtDateValidator::ExtDateValidator(TQWidget* parent, const char* name) - : TQValidator(parent, name) +ExtDateValidator::ExtDateValidator(TQWidget* tqparent, const char* name) + : TQValidator(TQT_TQOBJECT(tqparent), name) { } @@ -116,17 +116,17 @@ ExtDateValidator::fixup( TQString& ) const } -ExtDateTable::ExtDateTable(TQWidget *parent, ExtDate date_, const char* name, WFlags f) - : TQGridView(parent, name, f) +ExtDateTable::ExtDateTable(TQWidget *tqparent, ExtDate date_, const char* name, WFlags f) + : TQGridView(tqparent, name, f) { d = new ExtDateTablePrivate; setFontSize(10); if(!date_.isValid()) { kdDebug() << "ExtDateTable ctor: WARNING: Given date is invalid, using current date." << endl; - date_=ExtDate::currentDate(); + date_=ExtDate::tqcurrentDate(); } - setFocusPolicy( TQWidget::StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); @@ -204,7 +204,7 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col) normalday=false; TQBrush brushTitle(); - TQBrush brushInvertTitle(colorGroup().base()); + TQBrush brushInvertTitle(tqcolorGroup().base()); TQColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) ); TQColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) ); if (!normalday) @@ -221,7 +221,7 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col) } painter->drawText(0, 0, w, h-1, AlignCenter, d->calendar->weekDayName(daynum, true), -1, &rect); - painter->setPen(colorGroup().text()); + painter->setPen(tqcolorGroup().text()); painter->moveTo(0, h-1); painter->lineTo(w-1, h-1); // ----- draw the weekday: @@ -235,10 +235,10 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col) text = d->calendar->dayString(pCellDate, true); if( d->calendar->month(pCellDate) != d->calendar->month(date) ) { // we are either - // ° painting a day of the previous month or - // ° painting a day of the following month + // � painting a day of the previous month or + // � painting a day of the following month // TODO: don't hardcode gray here! Use a color with less contrast to the background than normal text. - painter->setPen( colorGroup().mid() ); + painter->setPen( tqcolorGroup().mid() ); // painter->setPen(gray); } else { // paint a day of the current month if ( d->useCustomColors ) @@ -263,9 +263,9 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col) } painter->setPen( mode->fgColor ); } else - painter->setPen(colorGroup().text()); + painter->setPen(tqcolorGroup().text()); } else //if ( firstWeekDay < 4 ) // <- this doesn' make sense at all! - painter->setPen(colorGroup().text()); + painter->setPen(tqcolorGroup().text()); } pen=painter->pen(); @@ -276,19 +276,19 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col) if( ((offset+dy) == (pos+1)) && hasFocus()) { // draw the currently selected date - painter->setPen(colorGroup().highlight()); - painter->setBrush(colorGroup().highlight()); - pen=colorGroup().highlightedText(); + painter->setPen(tqcolorGroup().highlight()); + painter->setBrush(tqcolorGroup().highlight()); + pen=TQPen(tqcolorGroup().highlightedText()); } else { painter->setBrush(paletteBackgroundColor()); painter->setPen(paletteBackgroundColor()); -// painter->setBrush(colorGroup().base()); -// painter->setPen(colorGroup().base()); +// painter->setBrush(tqcolorGroup().base()); +// painter->setPen(tqcolorGroup().base()); } - if ( pCellDate == ExtDate::currentDate() ) + if ( pCellDate == ExtDate::tqcurrentDate() ) { - painter->setPen(colorGroup().text()); + painter->setPen(tqcolorGroup().text()); } if ( paintRect ) painter->drawRect(0, 0, w, h); @@ -347,7 +347,7 @@ ExtDateTable::keyPressEvent( TQKeyEvent *e ) setDate(date.addDays(1)); return; case Key_N: - setDate(ExtDate::currentDate()); + setDate(ExtDate::tqcurrentDate()); return; case Key_Return: case Key_Enter: @@ -386,13 +386,13 @@ ExtDateTable::setFontSize(int size) for(count=0; count<7; ++count) { rect=metrics.boundingRect(d->calendar->weekDayName(count+1, true)); - maxCell.setWidth(QMAX(maxCell.width(), rect.width())); - maxCell.setHeight(QMAX(maxCell.height(), rect.height())); + maxCell.setWidth(TQMAX(maxCell.width(), rect.width())); + maxCell.setHeight(TQMAX(maxCell.height(), rect.height())); } // ----- compare with a real wide number and add some space: - rect=metrics.boundingRect(TQString::fromLatin1("88")); - maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); - maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); + rect=metrics.boundingRect(TQString::tqfromLatin1("88")); + maxCell.setWidth(TQMAX(maxCell.width()+2, rect.width())); + maxCell.setHeight(TQMAX(maxCell.height()+4, rect.height())); } void @@ -494,7 +494,7 @@ ExtDateTable::setDate(const ExtDate& date_) numDaysPrevMonth=d->calendar->daysInMonth(temp); if(changed) { - repaintContents(false); + tqrepaintContents(false); } return true; } @@ -505,28 +505,28 @@ ExtDateTable::getDate() const return date; } -// what are those repaintContents() good for? (pfeiffer) +// what are those tqrepaintContents() good for? (pfeiffer) void ExtDateTable::focusInEvent( TQFocusEvent *e ) { -// repaintContents(false); +// tqrepaintContents(false); TQGridView::focusInEvent( e ); } void ExtDateTable::focusOutEvent( TQFocusEvent *e ) { -// repaintContents(false); +// tqrepaintContents(false); TQGridView::focusOutEvent( e ); } -QSize -ExtDateTable::sizeHint() const +TQSize +ExtDateTable::tqsizeHint() const { if(maxCell.height()>0 && maxCell.width()>0) { return TQSize(maxCell.width()*numCols()+2*frameWidth(), (maxCell.height()+2)*numRows()+2*frameWidth()); } else { - kdDebug() << "ExtDateTable::sizeHint: obscure failure - " << endl; + kdDebug() << "ExtDateTable::tqsizeHint: obscure failure - " << endl; return TQSize(-1, -1); } } @@ -554,7 +554,7 @@ void ExtDateTable::setCustomDatePainting(const ExtDate &date, const TQColor &fgC mode->fgColor=fgColor; mode->bgColor=bgColor; - d->customPaintingModes.replace( date.toString(), mode ); + d->customPaintingModes.tqreplace( date.toString(), mode ); d->useCustomColors=true; update(); } @@ -565,9 +565,9 @@ void ExtDateTable::unsetCustomDatePainting( const ExtDate &date ) } ExtDateInternalWeekSelector::ExtDateInternalWeekSelector -(TQWidget* parent, const char* name) - : KLineEdit(parent, name), - val(new TQIntValidator(this)), +(TQWidget* tqparent, const char* name) + : KLineEdit(tqparent, name), + val(new TQIntValidator(TQT_TQOBJECT(this))), result(0) { TQFont font; @@ -638,8 +638,8 @@ ExtDateInternalMonthPicker::~ExtDateInternalMonthPicker() { } ExtDateInternalMonthPicker::ExtDateInternalMonthPicker -(const ExtDate & date, TQWidget* parent, const char* name) - : TQGridView(parent, name), +(const ExtDate & date, TQWidget* tqparent, const char* name) + : TQGridView(tqparent, name), result(0) // invalid { //FIXME: Can't uncomment the following unless ExtDate is moved to kdelibs @@ -676,8 +676,8 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker } } -QSize -ExtDateInternalMonthPicker::sizeHint() const +TQSize +ExtDateInternalMonthPicker::tqsizeHint() const { return TQSize((max.width()+6)*numCols()+2*frameWidth(), (max.height()+6)*numRows()+2*frameWidth()); @@ -720,7 +720,7 @@ ExtDateInternalMonthPicker::paintCell(TQPainter* painter, int row, int col) void ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { KNotifyClient::beep(); return; @@ -747,7 +747,7 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e) void ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { int row, col; TQPoint mouseCoord; @@ -779,7 +779,7 @@ ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e) updateCell( row, col /*, false */ ); // mark the new active cell } } - if ( tmpRow > -1 ) // repaint the former active cell + if ( tmpRow > -1 ) // tqrepaint the former active cell updateCell( tmpRow, tmpCol /*, true */ ); } } @@ -811,9 +811,9 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(TQMouseEvent *e) ExtDateInternalYearSelector::ExtDateInternalYearSelector -(TQWidget* parent, const char* name) - : TQLineEdit(parent, name), - val(new TQIntValidator(this)), +(TQWidget* tqparent, const char* name) + : TQLineEdit(tqparent, name), + val(new TQIntValidator(TQT_TQOBJECT(this))), result(0), d(new ExtDateInternalYearPrivate()) { @@ -873,8 +873,8 @@ ExtDateInternalYearSelector::setYear(int year) setText(temp); } -KPopupFrame::KPopupFrame(TQWidget* parent, const char* name) - : TQFrame(parent, name, WType_Popup), +KPopupFrame::KPopupFrame(TQWidget* tqparent, const char* name) + : TQFrame(tqparent, name, WType_Popup), result(0), // rejected main(0) { @@ -888,7 +888,7 @@ KPopupFrame::keyPressEvent(TQKeyEvent* e) if(e->key()==Key_Escape) { result=0; // rejected - qApp->exit_loop(); + tqApp->exit_loop(); } } @@ -896,7 +896,7 @@ void KPopupFrame::close(int r) { result=r; - qApp->exit_loop(); + tqApp->exit_loop(); } void @@ -947,8 +947,8 @@ int KPopupFrame::exec(TQPoint pos) { popup(pos); - repaint(); - qApp->enter_loop(); + tqrepaint(); + tqApp->enter_loop(); hide(); return result; } |