|
|
@ -107,9 +107,9 @@ class CardViewSeparator
|
|
|
|
cg.brush(TQColorGroup::Button) );
|
|
|
|
cg.brush(TQColorGroup::Button) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void tqrepaintSeparator()
|
|
|
|
void repaintSeparator()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mView->tqrepaintContents( mRect );
|
|
|
|
mView->repaintContents( mRect );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
@ -448,16 +448,16 @@ CardViewItem *CardViewItem::nextItem() const
|
|
|
|
return item;
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardViewItem::tqrepaintCard()
|
|
|
|
void CardViewItem::repaintCard()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( mView )
|
|
|
|
if ( mView )
|
|
|
|
mView->tqrepaintItem( this );
|
|
|
|
mView->repaintItem( this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardViewItem::setCaption( const TQString &caption )
|
|
|
|
void CardViewItem::setCaption( const TQString &caption )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->mCaption = caption;
|
|
|
|
d->mCaption = caption;
|
|
|
|
tqrepaintCard();
|
|
|
|
repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString CardViewItem::fieldValue( const TQString &label ) const
|
|
|
|
TQString CardViewItem::fieldValue( const TQString &label ) const
|
|
|
@ -653,9 +653,9 @@ void CardView::setCurrentItem( CardViewItem *item )
|
|
|
|
CardViewItem *it = d->mCurrentItem;
|
|
|
|
CardViewItem *it = d->mCurrentItem;
|
|
|
|
d->mCurrentItem = item;
|
|
|
|
d->mCurrentItem = item;
|
|
|
|
if ( it )
|
|
|
|
if ( it )
|
|
|
|
it->tqrepaintCard();
|
|
|
|
it->repaintCard();
|
|
|
|
|
|
|
|
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! d->mOnSeparator )
|
|
|
|
if ( ! d->mOnSeparator )
|
|
|
@ -692,9 +692,9 @@ void CardView::ensureItemVisible( const CardViewItem *item )
|
|
|
|
ensureVisible( item->d->x + d->mItemWidth, item->d->y, d->mItemSpacing, 0 );
|
|
|
|
ensureVisible( item->d->x + d->mItemWidth, item->d->y, d->mItemSpacing, 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardView::tqrepaintItem( const CardViewItem *item )
|
|
|
|
void CardView::repaintItem( const CardViewItem *item )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tqrepaintContents( TQRect( item->d->x, item->d->y, d->mItemWidth, item->height() ) );
|
|
|
|
repaintContents( TQRect( item->d->x, item->d->y, d->mItemWidth, item->height() ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardView::setSelectionMode( CardView::SelectionMode mode )
|
|
|
|
void CardView::setSelectionMode( CardView::SelectionMode mode )
|
|
|
@ -716,7 +716,7 @@ void CardView::selectAll( bool state )
|
|
|
|
for ( iter.toFirst(); iter.current(); ++iter ) {
|
|
|
|
for ( iter.toFirst(); iter.current(); ++iter ) {
|
|
|
|
if ( (*iter)->isSelected() ) {
|
|
|
|
if ( (*iter)->isSelected() ) {
|
|
|
|
(*iter)->setSelected( false );
|
|
|
|
(*iter)->setSelected( false );
|
|
|
|
(*iter)->tqrepaintCard();
|
|
|
|
(*iter)->repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -743,7 +743,7 @@ void CardView::setSelected( CardViewItem *item, bool selected )
|
|
|
|
CardViewItem *it = d->mCurrentItem;
|
|
|
|
CardViewItem *it = d->mCurrentItem;
|
|
|
|
d->mCurrentItem = item;
|
|
|
|
d->mCurrentItem = item;
|
|
|
|
if ( it )
|
|
|
|
if ( it )
|
|
|
|
it->tqrepaintCard();
|
|
|
|
it->repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( d->mSelectionMode == CardView::Single ) {
|
|
|
|
if ( d->mSelectionMode == CardView::Single ) {
|
|
|
@ -754,7 +754,7 @@ void CardView::setSelected( CardViewItem *item, bool selected )
|
|
|
|
|
|
|
|
|
|
|
|
if ( selected ) {
|
|
|
|
if ( selected ) {
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged( item );
|
|
|
|
emit selectionChanged( item );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -763,7 +763,7 @@ void CardView::setSelected( CardViewItem *item, bool selected )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ( d->mSelectionMode == CardView::Multi ) {
|
|
|
|
} else if ( d->mSelectionMode == CardView::Multi ) {
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
} else if ( d->mSelectionMode == CardView::Extended ) {
|
|
|
|
} else if ( d->mSelectionMode == CardView::Extended ) {
|
|
|
|
bool b = signalsBlocked();
|
|
|
|
bool b = signalsBlocked();
|
|
|
@ -772,7 +772,7 @@ void CardView::setSelected( CardViewItem *item, bool selected )
|
|
|
|
blockSignals( b );
|
|
|
|
blockSignals( b );
|
|
|
|
|
|
|
|
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->setSelected( selected );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1048,12 +1048,12 @@ void CardView::contentsMousePressEvent( TQMouseEvent *e )
|
|
|
|
blockSignals( b );
|
|
|
|
blockSignals( b );
|
|
|
|
|
|
|
|
|
|
|
|
item->setSelected( true );
|
|
|
|
item->setSelected( true );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged( item );
|
|
|
|
emit selectionChanged( item );
|
|
|
|
} else if ( d->mSelectionMode == CardView::Multi ) {
|
|
|
|
} else if ( d->mSelectionMode == CardView::Multi ) {
|
|
|
|
// toggle the selection
|
|
|
|
// toggle the selection
|
|
|
|
item->setSelected( !item->isSelected() );
|
|
|
|
item->setSelected( !item->isSelected() );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
} else if ( d->mSelectionMode == CardView::Extended ) {
|
|
|
|
} else if ( d->mSelectionMode == CardView::Extended ) {
|
|
|
|
if ( (e->button() & Qt::LeftButton) && (e->state() & TQt::ShiftButton) ) {
|
|
|
|
if ( (e->button() & Qt::LeftButton) && (e->state() & TQt::ShiftButton) ) {
|
|
|
@ -1079,13 +1079,13 @@ void CardView::contentsMousePressEvent( TQMouseEvent *e )
|
|
|
|
for ( ; from <= to; from++ ) {
|
|
|
|
for ( ; from <= to; from++ ) {
|
|
|
|
aItem = d->mItemList.at( from );
|
|
|
|
aItem = d->mItemList.at( from );
|
|
|
|
aItem->setSelected( s );
|
|
|
|
aItem->setSelected( s );
|
|
|
|
tqrepaintItem( aItem );
|
|
|
|
repaintItem( aItem );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
} else if ( (e->button() & Qt::LeftButton) && (e->state() & TQt::ControlButton) ) {
|
|
|
|
} else if ( (e->button() & Qt::LeftButton) && (e->state() & TQt::ControlButton) ) {
|
|
|
|
item->setSelected( !item->isSelected() );
|
|
|
|
item->setSelected( !item->isSelected() );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
} else if ( e->button() & Qt::LeftButton ) {
|
|
|
|
} else if ( e->button() & Qt::LeftButton ) {
|
|
|
|
bool b = signalsBlocked();
|
|
|
|
bool b = signalsBlocked();
|
|
|
@ -1094,7 +1094,7 @@ void CardView::contentsMousePressEvent( TQMouseEvent *e )
|
|
|
|
blockSignals( b );
|
|
|
|
blockSignals( b );
|
|
|
|
|
|
|
|
|
|
|
|
item->setSelected( true );
|
|
|
|
item->setSelected( true );
|
|
|
|
item->tqrepaintCard();
|
|
|
|
item->repaintCard();
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1202,13 +1202,13 @@ void CardView::focusInEvent( TQFocusEvent* )
|
|
|
|
if ( !d->mCurrentItem && d->mItemList.count() )
|
|
|
|
if ( !d->mCurrentItem && d->mItemList.count() )
|
|
|
|
setCurrentItem( d->mItemList.first() );
|
|
|
|
setCurrentItem( d->mItemList.first() );
|
|
|
|
else if ( d->mCurrentItem )
|
|
|
|
else if ( d->mCurrentItem )
|
|
|
|
d->mCurrentItem->tqrepaintCard();
|
|
|
|
d->mCurrentItem->repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardView::focusOutEvent( TQFocusEvent* )
|
|
|
|
void CardView::focusOutEvent( TQFocusEvent* )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( d->mCurrentItem )
|
|
|
|
if ( d->mCurrentItem )
|
|
|
|
d->mCurrentItem->tqrepaintCard();
|
|
|
|
d->mCurrentItem->repaintCard();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CardView::keyPressEvent( TQKeyEvent *e )
|
|
|
|
void CardView::keyPressEvent( TQKeyEvent *e )
|
|
|
@ -1363,7 +1363,7 @@ void CardView::keyPressEvent( TQKeyEvent *e )
|
|
|
|
for ( ; from <= to; from++ ) {
|
|
|
|
for ( ; from <= to; from++ ) {
|
|
|
|
item = d->mItemList.at( from );
|
|
|
|
item = d->mItemList.at( from );
|
|
|
|
item->setSelected( s );
|
|
|
|
item->setSelected( s );
|
|
|
|
tqrepaintItem( item );
|
|
|
|
repaintItem( item );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
emit selectionChanged();
|
|
|
|
emit selectionChanged();
|
|
|
|