|
|
|
@ -86,8 +86,8 @@ ItemView::ItemView( ItemDocument * itemDocument, ViewContainer *viewContainer, u
|
|
|
|
|
setXMLFile( "ktechlabitemviewui.rc" );
|
|
|
|
|
|
|
|
|
|
m_pUpdateStatusTmr = new TQTimer(this);
|
|
|
|
|
connect( m_pUpdateStatusTmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(updatetqStatus()) );
|
|
|
|
|
connect( this, TQT_SIGNAL(viewUnfocused()), this, TQT_SLOT(stopUpdatingtqStatus()) );
|
|
|
|
|
connect( m_pUpdateStatusTmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateStatus()) );
|
|
|
|
|
connect( this, TQT_SIGNAL(viewUnfocused()), this, TQT_SLOT(stopUpdatingStatus()) );
|
|
|
|
|
|
|
|
|
|
p_itemDocument = itemDocument;
|
|
|
|
|
m_zoomLevel = 1.;
|
|
|
|
@ -198,7 +198,7 @@ void ItemView::dropEvent( TQDropEvent *event )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TQString text;
|
|
|
|
|
TQDataStream stream( event->tqencodedData(event->format()), IO_ReadOnly );
|
|
|
|
|
TQDataStream stream( event->encodedData(event->format()), IO_ReadOnly );
|
|
|
|
|
stream >> text;
|
|
|
|
|
|
|
|
|
|
TQPoint position = event->pos();
|
|
|
|
@ -278,7 +278,7 @@ void ItemView::contentsMouseMoveEvent( TQMouseEvent *e )
|
|
|
|
|
|
|
|
|
|
p_itemDocument->m_cmManager->mouseMoveEvent( EventInfo( this, e ) );
|
|
|
|
|
if ( !m_pUpdateStatusTmr->isActive() )
|
|
|
|
|
startUpdatingtqStatus();
|
|
|
|
|
startUpdatingStatus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -306,7 +306,7 @@ void ItemView::contentsWheelEvent( TQWheelEvent *e )
|
|
|
|
|
|
|
|
|
|
void ItemView::dragEnterEvent( TQDragEnterEvent *event )
|
|
|
|
|
{
|
|
|
|
|
startUpdatingtqStatus();
|
|
|
|
|
startUpdatingStatus();
|
|
|
|
|
|
|
|
|
|
KURL::List urls;
|
|
|
|
|
if ( KURLDrag::decode( event, urls ) )
|
|
|
|
@ -321,14 +321,14 @@ void ItemView::dragEnterEvent( TQDragEnterEvent *event )
|
|
|
|
|
void ItemView::enterEvent( TQEvent * e )
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(e);
|
|
|
|
|
startUpdatingtqStatus();
|
|
|
|
|
startUpdatingStatus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ItemView::leaveEvent( TQEvent * e )
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(e);
|
|
|
|
|
stopUpdatingtqStatus();
|
|
|
|
|
stopUpdatingStatus();
|
|
|
|
|
|
|
|
|
|
// Cleanup
|
|
|
|
|
setCursor(TQt::ArrowCursor);
|
|
|
|
@ -337,7 +337,7 @@ void ItemView::leaveEvent( TQEvent * e )
|
|
|
|
|
p_ktechlab->slotChangeStatusbar(TQString());
|
|
|
|
|
|
|
|
|
|
if ( p_itemDocument )
|
|
|
|
|
p_itemDocument->m_canvasTip->tqsetVisible(false);
|
|
|
|
|
p_itemDocument->m_canvasTip->setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -347,24 +347,24 @@ void ItemView::slotUpdateConfiguration()
|
|
|
|
|
m_CVBEditor->setEraseColor( TQt::white );
|
|
|
|
|
|
|
|
|
|
if ( m_pUpdateStatusTmr->isActive() )
|
|
|
|
|
startUpdatingtqStatus();
|
|
|
|
|
startUpdatingStatus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ItemView::startUpdatingtqStatus()
|
|
|
|
|
void ItemView::startUpdatingStatus()
|
|
|
|
|
{
|
|
|
|
|
m_pUpdateStatusTmr->stop();
|
|
|
|
|
m_pUpdateStatusTmr->start( int(1000./KTLConfig::refreshRate()) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ItemView::stopUpdatingtqStatus()
|
|
|
|
|
void ItemView::stopUpdatingStatus()
|
|
|
|
|
{
|
|
|
|
|
m_pUpdateStatusTmr->stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ItemView::updatetqStatus()
|
|
|
|
|
void ItemView::updateStatus()
|
|
|
|
|
{
|
|
|
|
|
TQPoint pos = (m_CVBEditor->mapFromGlobal( TQCursor::pos() ) + TQPoint( m_CVBEditor->contentsX(), m_CVBEditor->contentsY() )) / zoomLevel();
|
|
|
|
|
|
|
|
|
@ -456,7 +456,7 @@ void ItemView::updatetqStatus()
|
|
|
|
|
if (p_ktechlab)
|
|
|
|
|
p_ktechlab->slotChangeStatusbar(statusbar);
|
|
|
|
|
|
|
|
|
|
canvasTip->tqsetVisible(displayTip);
|
|
|
|
|
canvasTip->setVisible(displayTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//END class ItemView
|
|
|
|
|