From 628b0bb74c3fc327efff8add9c73ada04b1cbea2 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 7 Jul 2024 13:06:00 +0900 Subject: Rename drag-n-drop nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/dirview-example.html | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'doc/html/dirview-example.html') diff --git a/doc/html/dirview-example.html b/doc/html/dirview-example.html index 8a04e9cef..b48f054c5 100644 --- a/doc/html/dirview-example.html +++ b/doc/html/dirview-example.html @@ -130,10 +130,10 @@ protected slots: void openFolder(); protected: - void contentsDragEnterEvent( TQDragEnterEvent *e ); - void contentsDragMoveEvent( TQDragMoveEvent *e ); - void contentsDragLeaveEvent( TQDragLeaveEvent *e ); - void contentsDropEvent( TQDropEvent *e ); + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDragMoveEvent( TQDragMoveEvent *e ); + void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + void contentsDropEvent( TQDropEvent *e ); void contentsMouseMoveEvent( TQMouseEvent *e ); void contentsMousePressEvent( TQMouseEvent *e ); void contentsMouseReleaseEvent( TQMouseEvent *e ); @@ -176,8 +176,8 @@ can be used in any other trees. #include <ntqevent.h> #include <ntqpoint.h> #include <ntqmessagebox.h> -#include <ntqdragobject.h> -#include <ntqmime.h> +#include <tqdragobject.h> +#include <tqmime.h> #include <tqstrlist.h> #include <tqstringlist.h> #include <ntqapplication.h> @@ -477,16 +477,16 @@ void DirectoryView::openFolder() static const int autoopenTime = 750; -void DirectoryView::contentsDragEnterEvent( TQDragEnterEvent *e ) +void DirectoryView::contentsDragEnterEvent( TQDragEnterEvent *e ) { if ( !TQUriDrag::canDecode(e) ) { - e->ignore(); + e->ignore(); return; } oldCurrent = currentItem(); - TQListViewItem *i = itemAt( contentsToViewport(e->pos()) ); + TQListViewItem *i = itemAt( contentsToViewport(e->pos()) ); if ( i ) { dropItem = i; autoopen_timer->start( autoopenTime ); @@ -494,10 +494,10 @@ static const int autoopenTime = 750; } -void DirectoryView::contentsDragMoveEvent( TQDragMoveEvent *e ) +void DirectoryView::contentsDragMoveEvent( TQDragMoveEvent *e ) { if ( !TQUriDrag::canDecode(e) ) { - e->ignore(); + e->ignore(); return; } @@ -505,32 +505,32 @@ static const int autoopenTime = 750; TQListViewItem *i = itemAt( vp ); if ( i ) { setSelected( i, TRUE ); - e->accept(); + e->accept(); if ( i != dropItem ) { autoopen_timer->stop(); dropItem = i; autoopen_timer->start( autoopenTime ); } - switch ( e->action() ) { + switch ( e->action() ) { case TQDropEvent::Copy: break; case TQDropEvent::Move: - e->acceptAction(); + e->acceptAction(); break; case TQDropEvent::Link: - e->acceptAction(); + e->acceptAction(); break; default: ; } } else { - e->ignore(); + e->ignore(); autoopen_timer->stop(); dropItem = 0; } } -void DirectoryView::contentsDragLeaveEvent( TQDragLeaveEvent * ) +void DirectoryView::contentsDragLeaveEvent( TQDragLeaveEvent * ) { autoopen_timer->stop(); dropItem = 0; @@ -539,35 +539,35 @@ static const int autoopenTime = 750; setSelected( oldCurrent, TRUE ); } -void DirectoryView::contentsDropEvent( TQDropEvent *e ) +void DirectoryView::contentsDropEvent( TQDropEvent *e ) { autoopen_timer->stop(); if ( !TQUriDrag::canDecode(e) ) { - e->ignore(); + e->ignore(); return; } - TQListViewItem *item = itemAt( contentsToViewport(e->pos()) ); + TQListViewItem *item = itemAt( contentsToViewport(e->pos()) ); if ( item ) { TQStrList lst; - TQUriDrag::decode( e, lst ); + TQUriDrag::decode( e, lst ); TQString str; - switch ( e->action() ) { + switch ( e->action() ) { case TQDropEvent::Copy: str = "Copy"; break; case TQDropEvent::Move: str = "Move"; - e->acceptAction(); + e->acceptAction(); break; case TQDropEvent::Link: str = "Link"; - e->acceptAction(); + e->acceptAction(); break; default: str = "Unknown"; @@ -575,10 +575,10 @@ static const int autoopenTime = 750; str += "\n\n"; - e->accept(); + e->accept(); for ( uint i = 0; i < lst.count(); ++i ) { - TQString filename = TQDir::convertSeparators(TQUriDrag::uriToLocalFile(lst.at(i))); + TQString filename = TQDir::convertSeparators(TQUriDrag::uriToLocalFile(lst.at(i))); str += filename + "\n"; } str += TQString( "\nTo\n\n %1" ) @@ -586,7 +586,7 @@ static const int autoopenTime = 750; TQMessageBox::information( this, "Drop target", str, "Not implemented" ); } else - e->ignore(); + e->ignore(); } @@ -613,14 +613,14 @@ TQString DirectoryView::fullPath(TQListViewItem* item) void DirectoryView::contentsMousePressEvent( TQMouseEvent* e ) { TQListView::contentsMousePressEvent(e); - TQPoint p( contentsToViewport( e->pos() ) ); + TQPoint p( contentsToViewport( e->pos() ) ); TQListViewItem *i = itemAt( p ); if ( i ) { // if the user clicked into the root decoration of the item, don't try to start a drag! if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) + treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() || p.x() < header()->cellPos( header()->mapToActual( 0 ) ) ) { - presspos = e->pos(); + presspos = e->pos(); mousePressed = TRUE; } } @@ -628,15 +628,15 @@ TQString DirectoryView::fullPath(TQListViewItem* item) void DirectoryView::contentsMouseMoveEvent( TQMouseEvent* e ) { - if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { + if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { mousePressed = FALSE; TQListViewItem *item = itemAt( contentsToViewport(presspos) ); if ( item ) { TQString source = fullPath(item); if ( TQFile::exists(source) ) { - TQUriDrag* ud = new TQUriDrag(viewport()); - ud->setFileNames( source ); - if ( ud->drag() ) + TQUriDrag* ud = new TQUriDrag(viewport()); + ud->setFileNames( source ); + if ( ud->drag() ) TQMessageBox::information( this, "Drag source", TQString("Delete ") + TQDir::convertSeparators(source), "Not implemented" ); } -- cgit v1.2.3