Update ooo320-m1
[ooovba.git] / svtools / source / contnr / svicnvw.cxx
blob30e5412025e434db359000c7fa2c1ad1edd76cc7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svicnvw.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svtools.hxx"
34 #include <svtools/svlbox.hxx>
35 #include <svtools/svicnvw.hxx>
36 #include <svimpicn.hxx>
37 #include <svtools/svlbitm.hxx>
39 #ifndef GCC
40 #endif
42 #define ICNVW_BLOCK_ENTRYINS 0x0001
44 SvIcnVwDataEntry::SvIcnVwDataEntry()
45 : nIcnVwFlags(0),eTextMode(ShowTextDontKnow)
49 SvIcnVwDataEntry::~SvIcnVwDataEntry()
53 SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
54 SvLBox( pParent, nWinStyle | WB_BORDER )
56 nWinBits = nWinStyle;
57 nIcnVwFlags = 0;
58 pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
59 pImp->mpViewData = 0;
60 SetSelectionMode( SINGLE_SELECTION );
61 SetLineColor();
62 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
63 SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
64 SetDefaultFont();
67 SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
68 SvLBox( pParent, rResId )
70 pImp = new SvImpIconView( this, GetModel(), WB_BORDER | WB_ICON );
71 nIcnVwFlags = 0;
72 pImp->mpViewData = 0;
73 SetLineColor();
74 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
75 SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
76 SetDefaultFont();
77 pImp->SetSelectionMode( GetSelectionMode() );
78 pImp->SetWindowBits( nWindowStyle );
79 nWinBits = nWindowStyle;
82 SvIconView::~SvIconView()
84 delete pImp;
87 void SvIconView::SetDefaultFont()
89 SetFont( GetFont() );
92 SvLBoxEntry* SvIconView::CreateEntry( const XubString& rStr,
93 const Image& rCollEntryBmp, const Image& rExpEntryBmp )
95 SvLBoxEntry* pEntry = new SvLBoxEntry;
97 SvLBoxContextBmp* pContextBmp =
98 new SvLBoxContextBmp( pEntry,0, rCollEntryBmp,rExpEntryBmp, 0xffff );
99 pEntry->AddItem( pContextBmp );
101 SvLBoxString* pString = new SvLBoxString( pEntry, 0, rStr );
102 pEntry->AddItem( pString );
104 return pEntry;
107 void SvIconView::DisconnectFromModel()
109 SvLBox::DisconnectFromModel();
110 pImp->SetModel( GetModel(), 0 );
114 SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
115 SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos )
117 SvLBoxEntry* pEntry = CreateEntry(
118 rText, aCollapsedEntryBmp, aExpandedEntryBmp );
119 pEntry->EnableChildsOnDemand( bChildsOnDemand );
121 if ( !pParent )
122 SvLBox::Insert( pEntry, nPos );
123 else
124 SvLBox::Insert( pEntry, pParent, nPos );
125 return pEntry;
128 SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
129 const Image& rExpEntryBmp,
130 const Image& rCollEntryBmp,
131 SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos)
133 SvLBoxEntry* pEntry = CreateEntry(
134 rText, rCollEntryBmp, rExpEntryBmp );
136 pEntry->EnableChildsOnDemand( bChildsOnDemand );
137 if ( !pParent )
138 SvLBox::Insert( pEntry, nPos );
139 else
140 SvLBox::Insert( pEntry, pParent, nPos );
141 return pEntry;
145 void SvIconView::SetEntryText(SvLBoxEntry* pEntry, const XubString& rStr)
147 SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
148 if ( pItem )
150 pItem->SetText( pEntry, rStr );
151 GetModel()->InvalidateEntry( pEntry );
155 void SvIconView::SetExpandedEntryBmp(SvLBoxEntry* pEntry, const Image& rBmp)
157 SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
158 if ( pItem )
160 pItem->SetBitmap2( rBmp );
161 GetModel()->InvalidateEntry( pEntry );
165 void SvIconView::SetCollapsedEntryBmp(SvLBoxEntry* pEntry,
166 const Image& rBmp )
168 SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
169 if ( pItem )
171 pItem->SetBitmap1( rBmp );
172 GetModel()->InvalidateEntry( pEntry );
176 XubString SvIconView::GetEntryText(SvLBoxEntry* pEntry ) const
178 XubString aStr;
179 SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
180 if ( pItem )
181 aStr = pItem->GetText();
182 return aStr;
185 Image SvIconView::GetExpandedEntryBmp(SvLBoxEntry* pEntry) const
187 Image aBmp;
188 SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
189 if ( pItem )
190 aBmp = pItem->GetBitmap2();
191 return aBmp;
194 Image SvIconView::GetCollapsedEntryBmp(SvLBoxEntry* pEntry) const
196 Image aBmp;
197 SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
198 if ( pItem )
199 aBmp = pItem->GetBitmap1();
200 return aBmp;
204 SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource )
206 XubString aStr;
207 Image aCollEntryBmp;
208 Image aExpEntryBmp;
210 SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
211 if ( pStringItem )
212 aStr = pStringItem->GetText();
213 SvLBoxContextBmp* pBmpItem =(SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
214 if ( pBmpItem )
216 aCollEntryBmp = pBmpItem->GetBitmap1();
217 aExpEntryBmp = pBmpItem->GetBitmap2();
219 SvLBoxEntry* pEntry = CreateEntry( aStr, aCollEntryBmp, aExpEntryBmp );
220 pEntry->SvListEntry::Clone( pSource );
221 pEntry->EnableChildsOnDemand( pSource->HasChildsOnDemand() );
222 pEntry->SetUserData( pSource->GetUserData() );
223 return pEntry;
227 USHORT SvIconView::IsA()
229 return SV_LISTBOX_ID_ICONVIEW;
232 void SvIconView::RequestingChilds( SvLBoxEntry* pParent )
234 if ( !pParent->HasChilds() )
235 InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
238 void __EXPORT SvIconView::Paint( const Rectangle& rRect )
240 pImp->Paint( rRect );
243 void __EXPORT SvIconView::MouseButtonDown( const MouseEvent& rMEvt )
245 pImp->MouseButtonDown( rMEvt );
248 void __EXPORT SvIconView::MouseButtonUp( const MouseEvent& rMEvt )
250 pImp->MouseButtonUp( rMEvt );
253 void __EXPORT SvIconView::MouseMove( const MouseEvent& rMEvt )
255 pImp->MouseMove( rMEvt );
258 void __EXPORT SvIconView::KeyInput( const KeyEvent& rKEvt )
260 // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
261 if( IsEditingActive() )
262 return;
264 nImpFlags |= SVLBOX_IS_TRAVELSELECT;
265 BOOL bKeyUsed = pImp->KeyInput( rKEvt );
266 if ( !bKeyUsed )
267 SvLBox::KeyInput( rKEvt );
268 nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
271 void __EXPORT SvIconView::Resize()
273 pImp->Resize();
274 SvLBox::Resize();
277 void __EXPORT SvIconView::GetFocus()
279 pImp->GetFocus();
280 SvLBox::GetFocus();
283 void __EXPORT SvIconView::LoseFocus()
285 pImp->LoseFocus();
286 SvLBox::LoseFocus();
289 void SvIconView::SetUpdateMode( BOOL bUpdate )
291 Control::SetUpdateMode( bUpdate );
292 if ( bUpdate )
293 pImp->UpdateAll();
296 void SvIconView::SetModel( SvLBoxTreeList* )
300 void SvIconView::SetModel( SvLBoxTreeList* pNewModel, SvLBoxEntry* pParent )
302 nIcnVwFlags |= ICNVW_BLOCK_ENTRYINS;
303 SvLBox::SetModel( pNewModel );
304 nIcnVwFlags &= (~ICNVW_BLOCK_ENTRYINS);
305 if ( pParent && pParent->HasChildsOnDemand() )
306 RequestingChilds( pParent );
307 pImp->SetModel( pNewModel, pParent );
310 void __EXPORT SvIconView::ModelHasCleared()
312 SvLBox::ModelHasCleared();
313 pImp->Clear();
316 void __EXPORT SvIconView::ModelHasInserted( SvListEntry* pEntry )
318 if( !(nIcnVwFlags & ICNVW_BLOCK_ENTRYINS ) )
319 pImp->EntryInserted( (SvLBoxEntry*)pEntry );
322 void __EXPORT SvIconView::ModelHasInsertedTree( SvListEntry* pEntry )
324 pImp->TreeInserted( (SvLBoxEntry*)pEntry );
327 void __EXPORT SvIconView::ModelIsMoving(SvListEntry* pSource,
328 SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ )
330 pImp->MovingEntry( (SvLBoxEntry*)pSource );
333 void __EXPORT SvIconView::ModelHasMoved(SvListEntry* pSource )
335 pImp->EntryMoved( (SvLBoxEntry*)pSource );
338 void __EXPORT SvIconView::ModelIsRemoving( SvListEntry* pEntry )
340 pImp->RemovingEntry( (SvLBoxEntry*)pEntry );
341 NotifyRemoving( (SvLBoxEntry*)pEntry );
344 void __EXPORT SvIconView::ModelHasRemoved( SvListEntry* /* pEntry */ )
346 pImp->EntryRemoved();
349 void __EXPORT SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
351 // die einzelnen Items des Entries reinitialisieren
352 SvLBox::ModelHasEntryInvalidated( pEntry );
353 // painten
354 pImp->ModelHasEntryInvalidated( pEntry );
357 void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow )
359 pImp->ShowTargetEmphasis( pEntry, bShow );
362 Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const
364 return ((SvIconView*)this)->pImp->GetEntryPosition( pEntry );
367 void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos)
369 pImp->SetEntryPosition( pEntry, rPos, FALSE, TRUE );
372 void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid )
374 pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid );
377 void SvIconView::SetFont( const Font& rFont )
379 Font aTempFont( rFont );
380 aTempFont.SetTransparent( TRUE );
381 SvLBox::SetFont( aTempFont );
382 RecalcViewData();
383 pImp->ChangedFont();
386 void SvIconView::ViewDataInitialized( SvLBoxEntry* pEntry )
388 pImp->ViewDataInitialized( pEntry );
391 SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos )
393 return pImp->GetDropTarget( rPos );
396 SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const
398 Point aPos( rPixPos );
399 aPos -= GetMapMode().GetOrigin();
400 return ((SvIconView*)this)->pImp->GetEntry( aPos );
403 SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
405 return ((SvIconView*)this)->pImp->GetEntry( rDocPos );
409 void SvIconView::SetWindowBits( WinBits nWinStyle )
411 nWinBits = nWinStyle;
412 pImp->SetWindowBits( nWinStyle );
415 void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
417 pImp->PaintEntry( pEntry );
421 void SvIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos )
423 pImp->PaintEntry( pEntry, rPos );
426 Rectangle SvIconView::GetFocusRect( SvLBoxEntry* pEntry )
428 return pImp->CalcFocusRect( pEntry );
431 void SvIconView::InvalidateEntry( SvLBoxEntry* pEntry )
433 pImp->InvalidateEntry( pEntry );
436 void SvIconView::SetDragDropMode( DragDropMode nDDMode )
438 SvLBox::SetDragDropMode( nDDMode );
439 pImp->SetDragDropMode( nDDMode );
442 void SvIconView::SetSelectionMode( SelectionMode eSelectMode )
444 SvLBox::SetSelectionMode( eSelectMode );
445 pImp->SetSelectionMode( eSelectMode );
448 BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
450 EndEditing();
451 BOOL bRetVal = SvListView::Select( pEntry, bSelect );
452 if( bRetVal )
454 pImp->EntrySelected( pEntry, bSelect );
455 pHdlEntry = pEntry;
456 SelectHdl();
458 return bRetVal;
461 void SvIconView::SelectAll( BOOL bSelect, BOOL )
463 SvLBoxEntry* pEntry = pImp->GetCurParent();
464 pEntry = FirstChild( pEntry );
465 while( pEntry )
467 Select( pEntry, bSelect );
468 pEntry = NextSibling( pEntry );
472 void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
474 pImp->SetCursor( _pEntry );
477 SvLBoxEntry* SvIconView::GetCurEntry() const
479 return pImp->GetCurEntry();
482 void SvIconView::Arrange()
484 #ifdef DBG_UTIL
485 USHORT n=1;
486 if( n == 1 && n-1 == 0 )
488 pImp->Arrange();
490 else
492 pImp->AdjustAtGrid();
494 #else
495 pImp->Arrange();
496 #endif
500 void SvIconView::SetSpaceBetweenEntries( long nX, long nY )
502 pImp->SetSpaceBetweenEntries( nX, nY );
505 BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
506 SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
508 return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
511 BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
512 SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
514 return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
518 void SvIconView::EnableInplaceEditing( BOOL bEnable )
520 SvLBox::EnableInplaceEditing( bEnable );
523 void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
524 const Point& )
526 if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
528 Selection aSel( SELECTION_MIN, SELECTION_MAX );
529 if ( EditingEntry( pEntry, aSel ) )
531 SelectAll( FALSE );
532 EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
538 void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
539 const Selection& rSel )
541 DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?");
542 pCurEdEntry = pEntry;
543 pCurEdItem = pItem;
544 Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE ));
546 aRect.Bottom() += 4;
547 pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen!
548 aRect.Bottom() -= 4;
550 Point aPos( aRect.TopLeft() );
551 aPos += GetMapMode().GetOrigin(); // Dok-Koord. -> Window-Koord.
552 aRect.SetPos( aPos );
554 aRect.Bottom() += 2; // sieht huebscher aus
556 #ifdef WIN
557 aRect.Bottom() += 4;
558 #endif
559 #ifdef OS2
561 #if OS2_SINGLE_LINE_EDIT
562 aRect.Left() -= 3;
563 aRect.Right() += 3;
564 aRect.Top() -= 3;
565 aRect.Bottom() += 3;
566 #else
567 aRect.Left() -= 10;
568 aRect.Right() += 10;
569 aRect.Top() -= 5;
570 aRect.Bottom() += 5;
571 #endif
573 #endif // OS2
574 EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE );
577 void SvIconView::EditEntry( SvLBoxEntry* pEntry )
579 if( !pEntry )
580 pEntry = pImp->GetCurEntry();
581 if( pEntry )
583 SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
584 if( pItem )
586 Selection aSel( SELECTION_MIN, SELECTION_MAX );
587 if( EditingEntry( pEntry, aSel ) )
589 SelectAll( FALSE );
590 EditItemText( pEntry, pItem, aSel );
596 void SvIconView::EditedText( const XubString& rStr )
598 XubString aRefStr( ((SvLBoxString*)pCurEdItem)->GetText() );
599 if ( EditedEntry( pCurEdEntry, rStr ) )
601 ((SvLBoxString*)pCurEdItem)->SetText( pCurEdEntry, rStr );
602 pModel->InvalidateEntry( pCurEdEntry );
604 if( GetSelectionMode()==SINGLE_SELECTION && !GetSelectionCount())
605 Select( pCurEdEntry );
609 BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
611 return TRUE;
614 BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
616 return TRUE;
620 void SvIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo)
622 pImp->WriteDragServerInfo( rPos, pInfo );
625 void SvIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo )
627 pImp->ReadDragServerInfo( rPos, pInfo );
630 void SvIconView::Command( const CommandEvent& rCEvt )
632 pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() );
635 void SvIconView::SetCurParent( SvLBoxEntry* pNewParent )
637 if ( pNewParent && pNewParent->HasChildsOnDemand() )
638 RequestingChilds( pNewParent );
639 pImp->SetCurParent( pNewParent );
642 SvLBoxEntry* SvIconView::GetCurParent() const
644 return pImp->GetCurParent();
647 SvViewData* SvIconView::CreateViewData( SvListEntry* )
649 SvIcnVwDataEntry* pEntryData = new SvIcnVwDataEntry;
650 return (SvViewData*)pEntryData;
653 void SvIconView::InitViewData( SvViewData* pData, SvListEntry* pEntry )
655 SvLBox::InitViewData( pData, pEntry );
656 pImp->InvalidateBoundingRect( ((SvIcnVwDataEntry*)pData)->aRect );
659 Region SvIconView::GetDragRegion() const
661 Rectangle aRect;
662 SvLBoxEntry* pEntry = GetCurEntry();
663 if( pEntry )
664 aRect = pImp->GetBoundingRect( pEntry );
665 Region aRegion( aRect );
666 return aRegion;
669 ULONG SvIconView::GetSelectionCount() const
671 return (ULONG)(pImp->GetSelectionCount());
674 void SvIconView::SetGrid( long nDX, long nDY )
676 pImp->SetGrid( nDX, nDY );
679 void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
680 SvListEntry* pEntry2, ULONG nPos )
682 SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
683 switch( nActionId )
685 case LISTACTION_RESORTING:
686 SetUpdateMode( FALSE );
687 break;
689 case LISTACTION_RESORTED:
690 SetUpdateMode( TRUE );
691 Arrange();
692 break;
694 case LISTACTION_CLEARED:
695 if( IsUpdateMode() )
696 Update();
697 break;
702 void SvIconView::Scroll( long nDeltaX, long nDeltaY, USHORT )
704 pImp->Scroll( nDeltaX, nDeltaY, FALSE );
707 void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
709 pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() );
712 void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos )
714 pImp->SttDrag( rPos );
715 SvLBoxEntry* pEntry = GetEntry( rPos, TRUE );
716 pImp->mpViewData = pEntry;
717 SvLBox::StartDrag( nAction, rPos );
720 void SvIconView::DragFinished( sal_Int8 )
722 pImp->EndDrag();
725 sal_Int8 SvIconView::AcceptDrop( const AcceptDropEvent& rEvt )
727 if( pImp->mpViewData )
728 pImp->HideDDIcon();
729 sal_Int8 nRet = SvLBox::AcceptDrop( rEvt );
730 if( DND_ACTION_NONE != nRet )
731 pImp->ShowDDIcon( pImp->mpViewData, rEvt.maPosPixel );
733 return nRet;
736 sal_Int8 SvIconView::ExecuteDrop( const ExecuteDropEvent& rEvt )
738 if( pImp->mpViewData )
740 pImp->HideDDIcon();
741 pImp->mpViewData = 0;
743 return SvLBox::ExecuteDrop( rEvt );
746 void SvIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
748 pImp->ShowDDIcon( pRefEntry, rPos );
751 void SvIconView::HideDDIcon()
753 pImp->HideDDIcon();
756 void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
758 pImp->HideShowDDIcon( pRefEntry, rPos );
761 void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
762 SvPtrarr* pRects, short nOffs )
764 pImp->SelectRect( rRect, bAdd, pRects, nOffs );
767 void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY,
768 BOOL b, USHORT nBorderWidth )
770 pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth );
773 void SvIconView::EndTracking()
775 pImp->EndTracking();
778 void SvIconView::MakeVisible( SvLBoxEntry* pEntry )
780 pImp->MakeVisible( pEntry );
783 void SvIconView::PreparePaint( SvLBoxEntry* )
787 void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry )
789 pImp->AdjustAtGrid( pEntry );
792 void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
794 SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry );
795 if( bLock )
796 pViewData->SetVwFlags( ICNVW_FLAG_POS_LOCKED );
797 else
798 pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED );
801 BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
803 const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry );
804 return pViewData->IsEntryPosLocked();
807 void SvIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry )
809 pImp->SetTextMode( eMode, pEntry );
812 SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const
814 return pImp->GetTextMode( pEntry );
817 SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
819 Point aPos( rPixPos );
820 aPos -= GetMapMode().GetOrigin();
821 return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry );
824 SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
826 Point aPos( rPixPos );
827 aPos -= GetMapMode().GetOrigin();
828 return ((SvIconView*)this)->pImp->GetPrevEntry( aPos, pCurEntry );
831 void SvIconView::ShowFocusRect( const SvLBoxEntry* pEntry )
833 pImp->ShowFocusRect( pEntry );