|
|
@ -396,7 +396,7 @@ bool KOAgenda::eventFilter ( TQObject *object, TQEvent *event )
|
|
|
|
case ( TQEvent::Leave ):
|
|
|
|
case ( TQEvent::Leave ):
|
|
|
|
if ( !mActionItem )
|
|
|
|
if ( !mActionItem )
|
|
|
|
setCursor( arrowCursor );
|
|
|
|
setCursor( arrowCursor );
|
|
|
|
if ( TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(viewport()) )
|
|
|
|
if ( object == viewport() )
|
|
|
|
emit leaveAgenda();
|
|
|
|
emit leaveAgenda();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
@ -422,7 +422,7 @@ bool KOAgenda::eventFilter_drag( TQObject *object, TQDropEvent *de )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifndef KORG_NODND
|
|
|
|
#ifndef KORG_NODND
|
|
|
|
TQPoint viewportPos;
|
|
|
|
TQPoint viewportPos;
|
|
|
|
if ( TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport()) && TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(this) ) {
|
|
|
|
if ( object != viewport() && object != this ) {
|
|
|
|
viewportPos = TQT_TQWIDGET( object )->mapToParent( de->pos() );
|
|
|
|
viewportPos = TQT_TQWIDGET( object )->mapToParent( de->pos() );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
viewportPos = de->pos();
|
|
|
|
viewportPos = de->pos();
|
|
|
@ -462,7 +462,7 @@ bool KOAgenda::eventFilter_drag( TQObject *object, TQDropEvent *de )
|
|
|
|
// FIXME: This is a bad hack, as the viewportToContents seems to be off by
|
|
|
|
// FIXME: This is a bad hack, as the viewportToContents seems to be off by
|
|
|
|
// 2000 (which is the left upper corner of the viewport). It works correctly
|
|
|
|
// 2000 (which is the left upper corner of the viewport). It works correctly
|
|
|
|
// for agendaItems.
|
|
|
|
// for agendaItems.
|
|
|
|
if ( TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(this) ) {
|
|
|
|
if ( object == this ) {
|
|
|
|
pos = viewportPos + TQPoint( contentsX(), contentsY() );
|
|
|
|
pos = viewportPos + TQPoint( contentsX(), contentsY() );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
pos = viewportToContents( viewportPos );
|
|
|
|
pos = viewportToContents( viewportPos );
|
|
|
@ -565,7 +565,7 @@ bool KOAgenda::eventFilter_wheel ( TQObject *object, TQWheelEvent *e )
|
|
|
|
TQPoint viewportPos;
|
|
|
|
TQPoint viewportPos;
|
|
|
|
bool accepted=false;
|
|
|
|
bool accepted=false;
|
|
|
|
if ( ( e->state() & ShiftButton) == ShiftButton ) {
|
|
|
|
if ( ( e->state() & ShiftButton) == ShiftButton ) {
|
|
|
|
if ( TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport()) ) {
|
|
|
|
if ( object != viewport() ) {
|
|
|
|
viewportPos = ( (TQWidget *) object )->mapToParent( e->pos() );
|
|
|
|
viewportPos = ( (TQWidget *) object )->mapToParent( e->pos() );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
viewportPos = e->pos();
|
|
|
|
viewportPos = e->pos();
|
|
|
@ -579,7 +579,7 @@ bool KOAgenda::eventFilter_wheel ( TQObject *object, TQWheelEvent *e )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( ( e->state() & ControlButton ) == ControlButton ){
|
|
|
|
if ( ( e->state() & ControlButton ) == ControlButton ){
|
|
|
|
if ( TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport()) ) {
|
|
|
|
if ( object != viewport() ) {
|
|
|
|
viewportPos = ( (TQWidget *)object )->mapToParent( e->pos() );
|
|
|
|
viewportPos = ( (TQWidget *)object )->mapToParent( e->pos() );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
viewportPos = e->pos();
|
|
|
|
viewportPos = e->pos();
|
|
|
@ -597,7 +597,7 @@ bool KOAgenda::eventFilter_wheel ( TQObject *object, TQWheelEvent *e )
|
|
|
|
bool KOAgenda::eventFilter_mouse(TQObject *object, TQMouseEvent *me)
|
|
|
|
bool KOAgenda::eventFilter_mouse(TQObject *object, TQMouseEvent *me)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQPoint viewportPos;
|
|
|
|
TQPoint viewportPos;
|
|
|
|
if (TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport())) {
|
|
|
|
if (object != viewport()) {
|
|
|
|
viewportPos = ((TQWidget *)object)->mapToParent(me->pos());
|
|
|
|
viewportPos = ((TQWidget *)object)->mapToParent(me->pos());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
viewportPos = me->pos();
|
|
|
|
viewportPos = me->pos();
|
|
|
@ -606,7 +606,7 @@ bool KOAgenda::eventFilter_mouse(TQObject *object, TQMouseEvent *me)
|
|
|
|
switch (me->type()) {
|
|
|
|
switch (me->type()) {
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
// kdDebug(5850) << "koagenda: filtered button press" << endl;
|
|
|
|
// kdDebug(5850) << "koagenda: filtered button press" << endl;
|
|
|
|
if (TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport())) {
|
|
|
|
if (object != viewport()) {
|
|
|
|
if (me->button() == Qt::RightButton) {
|
|
|
|
if (me->button() == Qt::RightButton) {
|
|
|
|
mClickedItem = dynamic_cast<KOAgendaItem *>(object);
|
|
|
|
mClickedItem = dynamic_cast<KOAgendaItem *>(object);
|
|
|
|
if (mClickedItem) {
|
|
|
|
if (mClickedItem) {
|
|
|
@ -683,7 +683,7 @@ bool KOAgenda::eventFilter_mouse(TQObject *object, TQMouseEvent *me)
|
|
|
|
// avoid an offset of a few pixels. Don't ask me why...
|
|
|
|
// avoid an offset of a few pixels. Don't ask me why...
|
|
|
|
TQPoint indicatorPos = gridToContents(contentsToGrid(
|
|
|
|
TQPoint indicatorPos = gridToContents(contentsToGrid(
|
|
|
|
viewportToContents( viewportPos )));
|
|
|
|
viewportToContents( viewportPos )));
|
|
|
|
if (TQT_BASE_OBJECT(object) != TQT_BASE_OBJECT(viewport())) {
|
|
|
|
if (object != viewport()) {
|
|
|
|
KOAgendaItem *moveItem = dynamic_cast<KOAgendaItem *>(object);
|
|
|
|
KOAgendaItem *moveItem = dynamic_cast<KOAgendaItem *>(object);
|
|
|
|
if (moveItem && !moveItem->incidence()->isReadOnly() ) {
|
|
|
|
if (moveItem && !moveItem->incidence()->isReadOnly() ) {
|
|
|
|
if (!mActionItem)
|
|
|
|
if (!mActionItem)
|
|
|
@ -722,7 +722,7 @@ bool KOAgenda::eventFilter_mouse(TQObject *object, TQMouseEvent *me)
|
|
|
|
break; }
|
|
|
|
break; }
|
|
|
|
|
|
|
|
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
if (TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(viewport())) {
|
|
|
|
if (object == viewport()) {
|
|
|
|
selectItem(0);
|
|
|
|
selectItem(0);
|
|
|
|
TQPair<ResourceCalendar *, TQString>p = mCalendarView->viewSubResourceCalendar();
|
|
|
|
TQPair<ResourceCalendar *, TQString>p = mCalendarView->viewSubResourceCalendar();
|
|
|
|
emit newEventSignal( p.first, p.second );
|
|
|
|
emit newEventSignal( p.first, p.second );
|
|
|
|