@ -240,6 +240,7 @@ public:
TQPoint dragStartPos ;
TQPoint dragStartPos ;
TQFontMetrics * fm ;
TQFontMetrics * fm ;
int minLeftBearing , minRightBearing ;
int minLeftBearing , minRightBearing ;
int rubberStartX , rubberStartY ;
uint mousePressed : 1 ;
uint mousePressed : 1 ;
uint cleared : 1 ;
uint cleared : 1 ;
@ -259,6 +260,7 @@ public:
uint firstSizeHint : 1 ;
uint firstSizeHint : 1 ;
uint showTips : 1 ;
uint showTips : 1 ;
uint pressedSelected : 1 ;
uint pressedSelected : 1 ;
uint canStartRubber : 1 ;
uint dragging : 1 ;
uint dragging : 1 ;
uint drawActiveSelection : 1 ;
uint drawActiveSelection : 1 ;
uint inMenuMode : 1 ;
uint inMenuMode : 1 ;
@ -2801,6 +2803,7 @@ TQIconView::TQIconView( TQWidget *parent, const char *name, WFlags f )
d - > currentItem = 0 ;
d - > currentItem = 0 ;
d - > highlightedItem = 0 ;
d - > highlightedItem = 0 ;
d - > rubber = 0 ;
d - > rubber = 0 ;
d - > canStartRubber = FALSE ;
d - > backBuffer = 0 ;
d - > backBuffer = 0 ;
d - > scrollTimer = 0 ;
d - > scrollTimer = 0 ;
d - > startDragItem = 0 ;
d - > startDragItem = 0 ;
@ -4642,29 +4645,19 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
setCurrentItem ( item ) ;
setCurrentItem ( item ) ;
d - > canStartRubber = FALSE ;
if ( e - > button ( ) = = LeftButton ) {
if ( e - > button ( ) = = LeftButton ) {
if ( ! item & & ( d - > selectionMode = = Multi | |
if ( ! item & & ( d - > selectionMode = = Multi | | d - > selectionMode = = Extended ) ) {
d - > selectionMode = = Extended ) ) {
d - > canStartRubber = TRUE ;
d - > tmpCurrentItem = d - > currentItem ;
d - > rubberStartX = e - > x ( ) ;
d - > currentItem = 0 ;
d - > rubberStartY = e - > y ( ) ;
repaintItem ( d - > tmpCurrentItem ) ;
if ( d - > rubber )
delete d - > rubber ;
d - > rubber = 0 ;
d - > rubber = new TQRect ( e - > x ( ) , e - > y ( ) , 0 , 0 ) ;
d - > selectedItems . clear ( ) ;
if ( ( e - > state ( ) & ControlButton ) = = ControlButton ) {
for ( TQIconViewItem * i = firstItem ( ) ; i ; i = i - > nextItem ( ) )
if ( i - > isSelected ( ) )
d - > selectedItems . insert ( i , i ) ;
}
}
}
d - > mousePressed = TRUE ;
d - > mousePressed = TRUE ;
}
}
emit_signals :
emit_signals :
if ( ! d - > rubber ) {
if ( ! d - > canStartRubber ) {
emit mouseButtonPressed ( e - > button ( ) , item , e - > globalPos ( ) ) ;
emit mouseButtonPressed ( e - > button ( ) , item , e - > globalPos ( ) ) ;
emit pressed ( item ) ;
emit pressed ( item ) ;
emit pressed ( item , e - > globalPos ( ) ) ;
emit pressed ( item , e - > globalPos ( ) ) ;
@ -4708,6 +4701,7 @@ void TQIconView::contentsMouseReleaseEvent( TQMouseEvent *e )
d - > mousePressed = FALSE ;
d - > mousePressed = FALSE ;
d - > startDragItem = 0 ;
d - > startDragItem = 0 ;
d - > canStartRubber = FALSE ;
if ( d - > rubber ) {
if ( d - > rubber ) {
TQRect r ( d - > rubber - > normalize ( ) ) ;
TQRect r ( d - > rubber - > normalize ( ) ) ;
@ -4793,7 +4787,22 @@ void TQIconView::contentsMouseMoveEvent( TQMouseEvent *e )
if ( d - > tmpCurrentItem )
if ( d - > tmpCurrentItem )
repaintItem ( d - > tmpCurrentItem ) ;
repaintItem ( d - > tmpCurrentItem ) ;
}
}
} else if ( d - > mousePressed & & ! d - > currentItem & & d - > rubber ) {
} else if ( d - > mousePressed & & ( ( ! d - > currentItem & & d - > rubber ) | | d - > canStartRubber ) ) {
if ( d - > canStartRubber ) {
d - > canStartRubber = FALSE ;
d - > tmpCurrentItem = d - > currentItem ;
d - > currentItem = 0 ;
repaintItem ( d - > tmpCurrentItem ) ;
delete d - > rubber ;
d - > rubber = new TQRect ( d - > rubberStartX , d - > rubberStartY , 0 , 0 ) ;
d - > selectedItems . clear ( ) ;
if ( ( e - > state ( ) & ControlButton ) = = ControlButton | |
( e - > state ( ) & ShiftButton ) = = ShiftButton ) {
for ( TQIconViewItem * i = firstItem ( ) ; i ; i = i - > nextItem ( ) )
if ( i - > isSelected ( ) )
d - > selectedItems . insert ( i , i ) ;
}
}
doAutoScroll ( ) ;
doAutoScroll ( ) ;
}
}
}
}