LibreOffice Module vcl (master) 1
svimpbox.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <o3tl/safeint.hxx>
23#include <vcl/svapp.hxx>
25#include <vcl/help.hxx>
26#include <vcl/settings.hxx>
27#include <vcl/commandevent.hxx>
28
29#include <cstdlib>
30#include <memory>
31#include <stack>
32
35#include <vcl/wintypes.hxx>
36#include <bitmaps.hlst>
37#include <svimpbox.hxx>
39#include <comphelper/string.hxx>
41#include <tools/debug.hxx>
42
45
46// #i27063# (pl), #i32300# (pb) never access VCL after DeInitVCL - also no destructors
49oslInterlockedCount SvImpLBox::s_nImageRefCount = 0;
50
52 : m_aScrBarBox(VclPtr<ScrollBarBox>::Create(pLBView))
53 , m_aFctSet(this, pLBView)
54 , mbForceMakeVisible (false)
55 , m_aEditIdle("SvImpLBox m_aEditIdle")
56 , m_aHorSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_HSCROLL))
57 , m_aVerSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_VSCROLL))
58 , m_aOutputSize(0, 0)
59 , mbNoAutoCurEntry(false)
60 , m_aSelEng(pLBView, nullptr)
61 , m_nNextVerVisSize(0)
62{
63 osl_atomic_increment(&s_nImageRefCount);
64 m_pView = pLBView;
65 m_pTree = pLBTree;
68 SetStyle( nWinStyle );
71
72 m_aVerSBar->SetScrollHdl( LINK( this, SvImpLBox, ScrollUpDownHdl ) );
73 m_aHorSBar->SetScrollHdl( LINK( this, SvImpLBox, ScrollLeftRightHdl ) );
74 m_aHorSBar->SetEndScrollHdl( LINK( this, SvImpLBox, EndScrollHdl ) );
75 m_aVerSBar->SetEndScrollHdl( LINK( this, SvImpLBox, EndScrollHdl ) );
76 m_aVerSBar->SetRange( Range(0,0) );
78 m_aHorSBar->SetRange( Range(0,0) );
79 m_aHorSBar->SetPageSize( 24 ); // pixels
80 m_aHorSBar->SetLineSize( 8 ); // pixels
81
82 m_nHorSBarHeight = static_cast<short>(m_aHorSBar->GetSizePixel().Height());
83 m_nVerSBarWidth = static_cast<short>(m_aVerSBar->GetSizePixel().Width());
84
85 m_pStartEntry = nullptr;
86 m_pCursor = nullptr;
87 m_pCursorOld = nullptr;
88 m_pAnchor = nullptr;
89 m_nVisibleCount = 0; // number of rows of data in control
92
93 // button animation in listbox
94 m_pActiveButton = nullptr;
95 m_pActiveEntry = nullptr;
96 m_pActiveTab = nullptr;
97
99
101 m_aEditIdle.SetInvokeHandler( LINK(this,SvImpLBox,EditTimerCall) );
102
103 m_nMostRight = -1;
104 m_pMostRightEntry = nullptr;
105 m_nCurUserEvent = nullptr;
106
107 m_bUpdateMode = true;
108 m_bInVScrollHdl = false;
110
111 m_bSubLstOpLR = false;
112}
113
115{
118
119 if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
120 {
121 delete s_pDefCollapsed;
122 s_pDefCollapsed = nullptr;
123 delete s_pDefExpanded;
124 s_pDefExpanded = nullptr;
125 }
129}
130
132{
133 const css::lang::Locale& rNewLocale = Application::GetSettings().GetLanguageTag().getLocale();
134
135 if( m_pStringSorter )
136 {
137 // different Locale from the older one, drop it and force recreate
138 const css::lang::Locale &aLocale = m_pStringSorter->getLocale();
139 if( aLocale.Language != rNewLocale.Language ||
140 aLocale.Country != rNewLocale.Country ||
141 aLocale.Variant != rNewLocale.Variant )
142 m_pStringSorter.reset();
143 }
144
145 if( !m_pStringSorter )
146 {
148 ::comphelper::getProcessComponentContext(),
149 rNewLocale));
150 }
151}
152
153short SvImpLBox::UpdateContextBmpWidthVector( SvTreeListEntry const * pEntry, short nWidth )
154{
155 DBG_ASSERT( m_pView->pModel, "View and Model aren't valid!" );
156
157 sal_uInt16 nDepth = m_pView->pModel->GetDepth( pEntry );
158 // initialize vector if necessary
159 std::vector< short >::size_type nSize = m_aContextBmpWidthVector.size();
160 while ( nDepth > nSize )
161 {
162 m_aContextBmpWidthVector.resize( nSize + 1 );
163 m_aContextBmpWidthVector.at( nSize ) = nWidth;
164 ++nSize;
165 }
166 if( m_aContextBmpWidthVector.size() == nDepth )
167 {
168 m_aContextBmpWidthVector.resize( nDepth + 1 );
169 m_aContextBmpWidthVector.at( nDepth ) = 0;
170 }
171 short nContextBmpWidth = m_aContextBmpWidthVector[ nDepth ];
172 if( nContextBmpWidth < nWidth )
173 {
174 m_aContextBmpWidthVector.at( nDepth ) = nWidth;
175 return nWidth;
176 }
177 else
178 return nContextBmpWidth;
179}
180
182{
183 DBG_ASSERT( pEntry, "Moved Entry is invalid!" );
184
185 SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem(SvLBoxItemType::ContextBmp) );
186 short nExpWidth = static_cast<short>(pBmpItem->GetBitmap1().GetSizePixel().Width());
187 short nColWidth = static_cast<short>(pBmpItem->GetBitmap2().GetSizePixel().Width());
188 short nMax = std::max(nExpWidth, nColWidth);
189 UpdateContextBmpWidthVector( pEntry, nMax );
190
191 if( pEntry->HasChildren() ) // recursive call, whether expanded or not
192 {
193 SvTreeListEntry* pChild = m_pView->FirstChild( pEntry );
194 DBG_ASSERT( pChild, "The first child is invalid!" );
195 do
196 {
198 pChild = m_pView->Next( pChild );
199 } while ( pChild );
200 }
201}
202
204{
205 sal_uInt16 nDepth = m_pView->pModel->GetDepth( pEntry );
206 if( m_aContextBmpWidthVector.empty() )
207 return;
208 short nWidth = m_aContextBmpWidthVector[ nDepth ];
209 if( nWidth != m_pView->nContextBmpWidthMax ) {
212 m_pView->SetTabs();
214 }
215}
216
217void SvImpLBox::SetStyle( WinBits i_nWinStyle )
218{
219 m_nStyle = i_nWinStyle;
221 m_aSelEng.AddAlways( true );
222}
223
225{
227}
228
229// don't touch the model any more
231{
233 m_pStartEntry = nullptr;
234 m_pAnchor = nullptr;
235
236 m_pActiveButton = nullptr;
237 m_pActiveEntry = nullptr;
238 m_pActiveTab = nullptr;
239
240 m_nMostRight = -1;
241 m_pMostRightEntry = nullptr;
242
243 // don't touch the cursor any more
244 if( m_pCursor )
245 {
246 if( m_pView->HasFocus() )
248 m_pCursor = nullptr;
249 }
250 m_pCursorOld = nullptr;
251 m_aVerSBar->Hide();
253 Range aRange( 0, 0 );
254 m_aVerSBar->SetRange( aRange );
255 m_aOutputSize = m_pView->Control::GetOutputSizePixel();
256 m_aHorSBar->Hide();
258 MapMode aMapMode( m_pView->GetMapMode());
259 aMapMode.SetOrigin( Point(0,0) );
260 m_pView->Control::SetMapMode( aMapMode );
261 m_aHorSBar->SetRange( aRange );
264 if( GetUpdateMode() )
269
271
273}
274
275// *********************************************************************
276// Paint, navigate, scroll
277// *********************************************************************
278
279IMPL_LINK_NOARG(SvImpLBox, EndScrollHdl, ScrollBar*, void)
280{
282 {
283 m_aVerSBar->SetVisibleSize( m_nNextVerVisSize );
284 m_nFlags &= ~LBoxFlags::EndScrollSetVisSize;
285 }
286}
287
288// handler for vertical scrollbar
289
290IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar, void )
291{
292 DBG_ASSERT(!m_bInVScrollHdl,"Scroll handler out-paces itself!");
293 tools::Long nDelta = pScrollBar->GetDelta();
294 if( !nDelta )
295 return;
296
297 // when only one row don't skip lines
298 if (pScrollBar->GetPageSize() == 1)
299 nDelta = nDelta > 0 ? 1 : -1;
300
301 m_nFlags &= ~LBoxFlags::Filling;
302
303 m_bInVScrollHdl = true;
304
305 if( m_pView->IsEditingActive() )
306 {
307 m_pView->EndEditing( true ); // Cancel
308 m_pView->PaintImmediately();
309 }
310
311 if( nDelta > 0 )
312 {
313 if( nDelta == 1 && pScrollBar->GetPageSize() > 1)
314 CursorDown();
315 else
316 PageDown( static_cast<sal_uInt16>(nDelta) );
317 }
318 else
319 {
320 nDelta *= -1;
321 if( nDelta == 1 && pScrollBar->GetPageSize() > 1)
322 CursorUp();
323 else
324 PageUp( static_cast<sal_uInt16>(nDelta) );
325 }
326 m_bInVScrollHdl = false;
327}
328
329
331{
332 if (!m_pStartEntry)
333 return;
334
335 SvTreeListEntry* pNextFirstToDraw = m_pView->NextVisible(m_pStartEntry);
336 if( pNextFirstToDraw )
337 {
339 ShowCursor( false );
341 m_pStartEntry = pNextFirstToDraw;
345 ShowCursor( true );
347 }
348}
349
351{
352 if (!m_pStartEntry)
353 return;
354
355 SvTreeListEntry* pPrevFirstToDraw = m_pView->PrevVisible(m_pStartEntry);
356 if( !pPrevFirstToDraw )
357 return;
358
360 tools::Long nEntryHeight = m_pView->GetEntryHeight();
361 ShowCursor( false );
363 m_pStartEntry = pPrevFirstToDraw;
365 if (aArea.GetHeight() > nEntryHeight)
366 aArea.AdjustBottom(-nEntryHeight);
367 m_pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren );
369 ShowCursor( true );
371}
372
373void SvImpLBox::PageDown( sal_uInt16 nDelta )
374{
375 sal_uInt16 nRealDelta = nDelta;
376
377 if( !nDelta )
378 return;
379
380 if (!m_pStartEntry)
381 return;
382
383 SvTreeListEntry* pNext = m_pView->NextVisible(m_pStartEntry, nRealDelta);
384 if( pNext == m_pStartEntry )
385 return;
386
387 ShowCursor( false );
388
390 m_pStartEntry = pNext;
391
392 if( nRealDelta >= m_nVisibleCount )
393 {
396 }
397 else
398 {
400 tools::Long nScroll = m_pView->GetEntryHeight() * static_cast<tools::Long>(nRealDelta);
401 nScroll = -nScroll;
403 m_pView->Scroll( 0, nScroll, aArea, ScrollFlags::NoChildren );
406 }
407
408 ShowCursor( true );
409}
410
411void SvImpLBox::PageUp( sal_uInt16 nDelta )
412{
413 sal_uInt16 nRealDelta = nDelta;
414 if( !nDelta )
415 return;
416
417 if (!m_pStartEntry)
418 return;
419
420 SvTreeListEntry* pPrev = m_pView->PrevVisible(m_pStartEntry, nRealDelta);
421 if( pPrev == m_pStartEntry )
422 return;
423
425 ShowCursor( false );
426
427 m_pStartEntry = pPrev;
428 if( nRealDelta >= m_nVisibleCount )
429 {
432 }
433 else
434 {
435 tools::Long nEntryHeight = m_pView->GetEntryHeight();
438 m_pView->Scroll( 0, nEntryHeight*nRealDelta, aArea, ScrollFlags::NoChildren );
441 }
442
443 ShowCursor( true );
444}
445
446void SvImpLBox::KeyUp( bool bPageUp )
447{
448 if( !m_aVerSBar->IsVisible() )
449 return;
450
451 tools::Long nDelta;
452 if( bPageUp )
453 nDelta = m_aVerSBar->GetPageSize();
454 else
455 nDelta = 1;
456
457 tools::Long nThumbPos = m_aVerSBar->GetThumbPos();
458
459 if( nThumbPos < nDelta )
460 nDelta = nThumbPos;
461
462 if( nDelta <= 0 )
463 return;
464
466
467 m_aVerSBar->SetThumbPos( nThumbPos - nDelta );
468 if( bPageUp )
469 PageUp( static_cast<short>(nDelta) );
470 else
471 CursorUp();
472}
473
474
475void SvImpLBox::KeyDown( bool bPageDown )
476{
477 if( !m_aVerSBar->IsVisible() )
478 return;
479
480 tools::Long nDelta;
481 if( bPageDown )
482 nDelta = m_aVerSBar->GetPageSize();
483 else
484 nDelta = 1;
485
486 tools::Long nThumbPos = m_aVerSBar->GetThumbPos();
487 tools::Long nVisibleSize = m_aVerSBar->GetVisibleSize();
488 tools::Long nRange = m_aVerSBar->GetRange().Len();
489
490 tools::Long nTmp = nThumbPos+nVisibleSize;
491 while( (nDelta > 0) && (nTmp+nDelta) >= nRange )
492 nDelta--;
493
494 if( nDelta <= 0 )
495 return;
496
498
499 m_aVerSBar->SetThumbPos( nThumbPos+nDelta );
500 if( bPageDown )
501 PageDown( static_cast<short>(nDelta) );
502 else
503 CursorDown();
504}
505
506
508{
510 {
512 aRect.SetTop( nY );
513 m_pView->Invalidate( aRect );
514 }
515}
516
518{
520 return;
521
523 tools::Long nMaxBottom = aRect.Bottom();
524 aRect.SetTop( nY );
525 aRect.SetBottom( nY ); aRect.AdjustBottom(m_pView->GetEntryHeight() );
526 if( aRect.Top() > nMaxBottom )
527 return;
528 if( aRect.Bottom() > nMaxBottom )
529 aRect.SetBottom( nMaxBottom );
531 // Perform full paint when flicker is to be avoided explicitly.
533 else
534 m_pView->Invalidate(aRect);
535}
536
538{
539 if( GetUpdateMode() )
540 {
542 SetMostRight( pEntry );
543 if( nPrev < m_nMostRight )
544 ShowVerSBar();
545 }
547 {
548 bool bHasFocusRect = false;
549 if( pEntry==m_pCursor && m_pView->HasFocus() )
550 {
551 bHasFocusRect = true;
552 ShowCursor( false );
553 }
554 InvalidateEntry( GetEntryLine( pEntry ) );
555 if( bHasFocusRect )
556 ShowCursor( true );
557 }
558}
559
560
562{
563 if( m_pView->HasFocus() && m_pCursor )
564 {
569 vcl::Region aClipRegion( GetClipRegionRect() );
570 m_pView->GetOutDev()->SetClipRegion( aClipRegion );
571 m_pView->ShowFocus( aRect );
572 m_pView->GetOutDev()->SetClipRegion( aOldClip );
573 }
574}
575
576
577// Sets cursor. When using SingleSelection, the selection is adjusted.
578void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
579{
580 SvViewDataEntry* pViewDataNewCur = nullptr;
581 if( pEntry )
582 pViewDataNewCur= m_pView->GetViewDataEntry(pEntry);
583 if( pEntry &&
584 pEntry == m_pCursor &&
585 pViewDataNewCur &&
586 pViewDataNewCur->HasFocus() &&
587 pViewDataNewCur->IsSelected())
588 {
589 return;
590 }
591
592 // if this cursor is not selectable, find first visible that is and use it
593 while( pEntry && pViewDataNewCur && !pViewDataNewCur->IsSelectable() )
594 {
595 pEntry = m_pView->NextVisible(pEntry);
596 pViewDataNewCur = pEntry ? m_pView->GetViewDataEntry(pEntry) : nullptr;
597 }
598
599 SvTreeListEntry* pOldCursor = m_pCursor;
600 if( m_pCursor && pEntry != m_pCursor )
601 {
603 if( m_bSimpleTravel )
604 m_pView->Select( m_pCursor, false );
606 }
607 m_pCursor = pEntry;
608 if( m_pCursor )
609 {
610 if (pViewDataNewCur)
611 pViewDataNewCur->SetFocus( true );
612 if(!bForceNoSelect && m_bSimpleTravel && !(m_nFlags & LBoxFlags::DeselectAll) && GetUpdateMode())
613 {
616 }
617 // multiple selection: select in cursor move if we're not in
618 // Add mode (Ctrl-F8)
619 else if( GetUpdateMode() &&
622 !bForceNoSelect )
623 {
626 }
627 else
628 {
629 ShowCursor( true );
630 if (bForceNoSelect && GetUpdateMode())
631 {
633 }
634 }
635
636 if( m_pAnchor )
637 {
639 SetAnchorSelection( pOldCursor, m_pCursor );
640 }
641 }
643
645}
646
647void SvImpLBox::ShowCursor( bool bShow )
648{
649 if( !bShow || !m_pCursor || !m_pView->HasFocus() )
650 {
652 vcl::Region aClipRegion( GetClipRegionRect() );
653 m_pView->GetOutDev()->SetClipRegion( aClipRegion );
655 m_pView->GetOutDev()->SetClipRegion( aOldClip );
656 }
657 else
658 {
662 vcl::Region aClipRegion( GetClipRegionRect() );
663 m_pView->GetOutDev()->SetClipRegion( aClipRegion );
664 m_pView->ShowFocus( aRect );
665 m_pView->GetOutDev()->SetClipRegion( aOldClip );
666 }
667}
668
669
670void SvImpLBox::UpdateAll( bool bInvalidateCompleteView )
671{
674 SyncVerThumb();
675 FillView();
676 ShowVerSBar();
679 ShowCursor( true );
680 if( bInvalidateCompleteView )
682 else
684}
685
686IMPL_LINK( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar, void )
687{
688 tools::Long nDelta = pScrollBar->GetDelta();
689 if( nDelta )
690 {
691 if( m_pView->IsEditingActive() )
692 {
693 m_pView->EndEditing( true ); // Cancel
694 m_pView->PaintImmediately();
695 }
696 m_pView->nFocusWidth = -1;
697 KeyLeftRight( nDelta );
698 }
699}
700
702{
706 ShowCursor( false );
707
708 // calculate new origin
710 Point aOrigin( -nPos, 0 );
711
712 MapMode aMapMode( m_pView->GetMapMode() );
713 aMapMode.SetOrigin( aOrigin );
714 m_pView->SetMapMode( aMapMode );
715
717 {
719 m_pView->Scroll( -nDelta, 0, aRect, ScrollFlags::NoChildren );
720 }
721 else
724 ShowCursor( true );
726}
727
728
729// returns the last entry if position is just past the last entry
730SvTreeListEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
731{
732 DBG_ASSERT( m_pView->GetModel(), "SvImpLBox::GetClickedEntry: how can this ever happen? Please tell me (frank.schoenheit@sun.com) how to reproduce!" );
733 if ( !m_pView->GetModel() )
734 // this is quite impossible. Nevertheless, stack traces from the crash reporter
735 // suggest it isn't. Okay, make it safe, and wait for somebody to reproduce it
736 // reliably :-\ ...
737 // #122359# / 2005-05-23 / frank.schoenheit@sun.com
738 return nullptr;
740 return nullptr;
741
742 sal_uInt16 nClickedEntry = static_cast<sal_uInt16>(rPoint.Y() / m_pView->GetEntryHeight() );
743 sal_uInt16 nTemp = nClickedEntry;
745 return pEntry;
746}
747
748
749// checks if the entry was hit "the right way"
750// (Focusrect+ ContextBitmap at TreeListBox)
751
752bool SvImpLBox::EntryReallyHit(SvTreeListEntry* pEntry, const Point& rPosPixel, tools::Long nLine)
753{
754 bool bRet;
755 // we are not too exact when it comes to "special" entries
756 // (with CheckButtons etc.)
757 if( pEntry->ItemCount() >= 3 )
758 return true;
759
760 tools::Rectangle aRect( m_pView->GetFocusRect( pEntry, nLine ));
761 aRect.SetRight( GetOutputSize().Width() - m_pView->GetMapMode().GetOrigin().X() );
762
764 aRect.AdjustLeft( -pBmp->GetWidth(m_pView,pEntry) );
765 aRect.AdjustLeft( -4 ); // a little tolerance
766
767 Point aPos( rPosPixel );
768 aPos -= m_pView->GetMapMode().GetOrigin();
769 bRet = aRect.Contains( aPos );
770 return bRet;
771}
772
773
774// returns 0 if position is just past the last entry
775SvTreeListEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
776{
777 if( (m_pView->GetEntryCount() == 0) || !m_pStartEntry ||
778 (rPoint.Y() > m_aOutputSize.Height())
779 || !m_pView->GetEntryHeight())
780 return nullptr;
781
782 sal_uInt16 nClickedEntry = static_cast<sal_uInt16>(rPoint.Y() / m_pView->GetEntryHeight() );
783 sal_uInt16 nTemp = nClickedEntry;
785 if( nTemp != nClickedEntry )
786 pEntry = nullptr;
787 return pEntry;
788}
789
790
792{
793 if( !m_pCursor )
794 return nullptr;
795 tools::Long nY = rPoint.Y();
796 SvTreeListEntry* pEntry = nullptr;
798 if( nY < 0 || nY >= nMax ) // aOutputSize.Height() )
799 {
800 if( nY < 0 )
801 pEntry = m_pView->PrevVisible(m_pCursor);
802 else
803 pEntry = m_pView->NextVisible(m_pCursor);
804
805 if( pEntry && pEntry != m_pCursor )
807
808 if( nY < 0 )
809 KeyUp( false );
810 else
811 KeyDown( false );
812 }
813 else
814 {
815 pEntry = GetClickedEntry( rPoint );
816 if( !pEntry )
817 {
818 sal_uInt16 nSteps = 0xFFFF;
819 // TODO: LastVisible is not yet implemented!
820 pEntry = m_pView->NextVisible(m_pStartEntry, nSteps);
821 }
822 if( pEntry )
823 {
824 if( pEntry != m_pCursor &&
826 )
827 m_pView->Select( m_pCursor, false );
828 }
829 }
830 return pEntry;
831}
832
834{
835 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
836 aOrigin.setX( aOrigin.X() * -1 ); // conversion document coordinates
837 tools::Rectangle aClipRect( aOrigin, m_aOutputSize );
838 aClipRect.AdjustBottom( 1 );
839 return aClipRect;
840}
841
842
843void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
844{
845 if (!m_pView->GetVisibleCount())
846 return;
847
849
851 {
852 SvTreeListEntry* pFirst = m_pView->First();
853 if (pFirst != m_pStartEntry)
854 {
855 ShowCursor(false);
859 ShowCursor(true);
861 reinterpret_cast<void*>(1));
862 return;
863 }
864 }
865
866 if (!m_pStartEntry)
867 {
869 }
870
873
874 tools::Long nRectHeight = rRect.GetHeight();
875 tools::Long nEntryHeight = m_pView->GetEntryHeight();
876
877 // calculate area for the entries we want to draw
878 sal_uInt16 nStartLine = static_cast<sal_uInt16>(rRect.Top() / nEntryHeight);
879 sal_uInt16 nCount = static_cast<sal_uInt16>(nRectHeight / nEntryHeight);
880 nCount += 2; // don't miss a row
881
882 tools::Long nY = nStartLine * nEntryHeight;
884 while (nStartLine && pEntry)
885 {
886 pEntry = m_pView->NextVisible(pEntry);
887 nStartLine--;
888 }
889
891 {
892 // do not select if multiselection or explicit set
894 SetCursor(m_pStartEntry, bNotSelect);
895 }
896
897 for(sal_uInt16 n=0; n< nCount && pEntry; n++)
898 {
899 /*long nMaxRight=*/
900 m_pView->PaintEntry1(*pEntry, nY, rRenderContext );
901 nY += nEntryHeight;
902 pEntry = m_pView->NextVisible(pEntry);
903 }
904
906 DrawNet(rRenderContext);
907
910}
911
912void SvImpLBox::MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop )
913{
914 if( !pEntry )
915 return;
916
917 bool bInView = IsEntryInView( pEntry );
918
919 if( bInView && (!bMoveToTop || m_pStartEntry == pEntry) )
920 return; // is already visible
921
924 if( !bInView )
925 {
926 if( !m_pView->IsEntryVisible(pEntry) ) // Parent(s) collapsed?
927 {
928 SvTreeListEntry* pParent = m_pView->GetParent( pEntry );
929 while( pParent )
930 {
931 if( !m_pView->IsExpanded( pParent ) )
932 {
933 bool bRet = m_pView->Expand( pParent );
934 DBG_ASSERT(bRet,"Not expanded!");
935 }
936 pParent = m_pView->GetParent( pParent );
937 }
938 // do the parent's children fit into the view or do we have to scroll?
939 if( IsEntryInView( pEntry ) && !bMoveToTop )
940 return; // no need to scroll
941 }
942 }
943
944 m_pStartEntry = pEntry;
945 ShowCursor( false );
946 FillView();
948 ShowCursor( true );
950}
951
953{
954 if( m_pView->GetVisibleCount() == 0 )
955 return;
956 tools::Long nLastEntryPos = m_pView->GetAbsPos( m_pView->Last() );
957
958 if( nPos < 0 )
959 nPos = 0;
960 else if( nPos > nLastEntryPos )
961 nPos = nLastEntryPos;
962
964 if( !pEntry || pEntry == m_pStartEntry )
965 return;
966
969
970 if( m_pView->IsEntryVisible(pEntry) )
971 {
972 m_pStartEntry = pEntry;
973 ShowCursor( false );
975 ShowCursor( true );
976 if (GetUpdateMode())
978 }
979}
980
982{
985 {
986 return;
987 }
988
989 // for platforms that don't have nets, DrawNativeControl does nothing and returns true
990 // so that SvImpLBox::DrawNet() doesn't draw anything either
992 {
993 ImplControlValue aControlValue;
995 tools::Rectangle(), ControlState::ENABLED, aControlValue, OUString()))
996 {
997 return;
998 }
999 }
1000
1001 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1002 tools::Long nEntryHeightDIV2 = nEntryHeight / 2;
1003 if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
1004 nEntryHeightDIV2--;
1005
1006 SvTreeListEntry* pChild;
1008
1009 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1010 while (m_pTree->GetDepth( pEntry ) > 0)
1011 {
1012 pEntry = m_pView->GetParent(pEntry);
1013 }
1014 sal_uInt16 nOffs = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pStartEntry) - m_pView->GetVisiblePos(pEntry));
1015 tools::Long nY = 0;
1016 nY -= (nOffs * nEntryHeight);
1017
1018 DBG_ASSERT(pFirstDynamicTab,"No Tree!");
1019
1020 rRenderContext.Push(vcl::PushFlags::LINECOLOR);
1021
1022 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
1023
1024 // Set color to draw the vertical and horizontal lines
1025 Color aOldLineColor = rRenderContext.GetLineColor();
1026 Color aBackgroundColor = rRenderContext.GetBackground().GetColor();
1027 if (aBackgroundColor.IsDark())
1028 rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
1029 else
1030 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
1031
1032 Point aPos1, aPos2;
1033 sal_uInt16 nDistance;
1034 sal_uLong nMax = m_nVisibleCount + nOffs + 1;
1035
1036 const Image& rExpandedNodeBitmap = GetExpandedNodeBmp();
1037
1038 for (sal_uLong n=0; n< nMax && pEntry; n++)
1039 {
1040 if (m_pView->IsExpanded(pEntry))
1041 {
1042 // draw vertical line
1043 aPos1.setX(m_pView->GetTabPos(pEntry, pFirstDynamicTab) + m_nNodeBmpTabDistance +
1044 rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1045 aPos1.setY(nY + nEntryHeight);
1046 pChild = m_pView->FirstChild(pEntry);
1047 assert(pChild && "Child?");
1048 pChild = pChild->LastSibling();
1049 nDistance = static_cast<sal_uInt16>(m_pView->GetVisiblePos(pChild) -
1050 m_pView->GetVisiblePos(pEntry));
1051 aPos2 = aPos1;
1052 aPos2.AdjustY((nDistance * nEntryHeight) - (nEntryHeightDIV2 + 2));
1053 rRenderContext.DrawLine(aPos1, aPos2);
1054 }
1055 // visible in control?
1056 if (n >= nOffs && !m_pTree->IsAtRootDepth(pEntry))
1057 {
1058 // draw horizontal line
1059 aPos1.setX(m_pView->GetTabPos(m_pView->GetParent(pEntry), pFirstDynamicTab)
1061 + rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1062 aPos1.setY(nY + nEntryHeightDIV2);
1063 aPos2 = aPos1;
1064 aPos2.AdjustX(m_pView->GetIndent() / 2);
1065 rRenderContext.DrawLine(aPos1, aPos2);
1066 }
1067 nY += nEntryHeight;
1068 pEntry = m_pView->NextVisible(pEntry);
1069 }
1070
1071 rRenderContext.SetLineColor(aOldLineColor);
1072 rRenderContext.Pop();
1073}
1074
1075void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
1076{
1077 tools::Long nOverlap = 0;
1078
1079 Size aVerSize( m_nVerSBarWidth, rSize.Height() );
1080 Size aHorSize( rSize.Width(), m_nHorSBarHeight );
1081
1082 if( nMask & 0x0001 )
1083 aHorSize.AdjustWidth( -m_nVerSBarWidth );
1084 if( nMask & 0x0002 )
1085 aVerSize.AdjustHeight( -m_nHorSBarHeight );
1086
1087 aVerSize.AdjustHeight(2 * nOverlap );
1088 Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap );
1089 m_aVerSBar->SetPosSizePixel( aVerPos, aVerSize );
1090
1091 aHorSize.AdjustWidth(2 * nOverlap );
1092 Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap );
1093
1094 m_aHorSBar->SetPosSizePixel( aHorPos, aHorSize );
1095
1096 if( nMask & 0x0001 )
1097 rSize.setWidth( aVerPos.X() );
1098 if( nMask & 0x0002 )
1099 rSize.setHeight( aHorPos.Y() );
1100
1101 if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) )
1102 m_aScrBarBox->Show();
1103 else
1104 m_aScrBarBox->Hide();
1105}
1106
1108{
1109 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1110 if( !nEntryHeight )
1111 return;
1112
1113 sal_uInt16 nResult = 0;
1114
1115 Size aOSize( m_pView->Control::GetOutputSizePixel() );
1116
1117 const WinBits nWindowStyle = m_pView->GetStyle();
1118 bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
1119 bool bHorBar = false;
1120 tools::Long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
1121 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1122 aOrigin.setX( aOrigin.X() * -1 );
1123 nMaxRight += aOrigin.X() - 1;
1124 tools::Long nVis = m_nMostRight - aOrigin.X();
1125 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1126 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1127 {
1128 bHorBar = true;
1129 }
1130
1131 // number of entries that are not collapsed
1132 sal_uLong nTotalCount = m_pView->GetVisibleCount();
1133
1134 // number of entries visible within the view
1135 m_nVisibleCount = aOSize.Height() / nEntryHeight;
1136
1137 // do we need a vertical scrollbar?
1138 if( bVerSBar || nTotalCount > m_nVisibleCount )
1139 {
1140 nResult = 1;
1141 nMaxRight -= m_nVerSBarWidth;
1142 if( !bHorBar )
1143 {
1144 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1145 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1146 bHorBar = true;
1147 }
1148 }
1149
1150 // do we need a horizontal scrollbar?
1151 if( bHorBar )
1152 {
1153 nResult |= 0x0002;
1154 // the number of entries visible within the view has to be recalculated
1155 // because the horizontal scrollbar is now visible.
1156 m_nVisibleCount = (aOSize.Height() - m_nHorSBarHeight) / nEntryHeight;
1157 // we might actually need a vertical scrollbar now
1158 if( !(nResult & 0x0001) &&
1159 ((nTotalCount > m_nVisibleCount) || bVerSBar) )
1160 {
1161 nResult = 3;
1162 }
1163 }
1164
1165 PositionScrollBars( aOSize, nResult );
1166
1167 // adapt Range, VisibleRange etc.
1168
1169 // refresh output size, in case we have to scroll
1170 tools::Rectangle aRect;
1171 aRect.SetSize( aOSize );
1172 m_aSelEng.SetVisibleArea( aRect );
1173
1174 // vertical scrollbar
1175 tools::Long nTemp = static_cast<tools::Long>(m_nVisibleCount);
1176 nTemp--;
1177 if( nTemp != m_aVerSBar->GetVisibleSize() )
1178 {
1179 if( !m_bInVScrollHdl )
1180 {
1181 m_aVerSBar->SetPageSize( nTemp - 1 );
1182 m_aVerSBar->SetVisibleSize( nTemp );
1183 }
1184 else
1185 {
1187 m_nNextVerVisSize = nTemp;
1188 }
1189 }
1190
1191 // horizontal scrollbar
1192 nTemp = m_aHorSBar->GetThumbPos();
1193 m_aHorSBar->SetVisibleSize( aOSize.Width() );
1194 tools::Long nNewThumbPos = m_aHorSBar->GetThumbPos();
1195 Range aRange( m_aHorSBar->GetRange() );
1196 if( aRange.Max() < m_nMostRight+25 )
1197 {
1198 aRange.Max() = m_nMostRight+25;
1199 m_aHorSBar->SetRange( aRange );
1200 }
1201
1202 if( nTemp != nNewThumbPos )
1203 {
1204 nTemp = nNewThumbPos - nTemp;
1205 if( m_pView->IsEditingActive() )
1206 {
1207 m_pView->EndEditing( true ); // Cancel
1209 }
1210 m_pView->nFocusWidth = -1;
1211 KeyLeftRight( nTemp );
1212 }
1213
1214 if( nResult & 0x0001 )
1215 m_aVerSBar->Show();
1216 else
1217 m_aVerSBar->Hide();
1218
1219 if( nResult & 0x0002 )
1220 m_aHorSBar->Show();
1221 else
1222 {
1223 m_aHorSBar->Hide();
1224 }
1225 rSize = aOSize;
1226}
1227
1229{
1231 Size aSize( m_pView->Control::GetOutputSizePixel() );
1233}
1234
1236{
1237 m_aOutputSize = m_pView->Control::GetOutputSizePixel();
1238 if( m_aOutputSize.IsEmpty() )
1239 return;
1242
1243 if( m_pView->GetEntryHeight())
1244 {
1246 UpdateAll(false);
1247 }
1248 // HACK, as in floating and docked windows the scrollbars might not be drawn
1249 // correctly/not be drawn at all after resizing!
1250 if( m_aHorSBar->IsVisible())
1252 if( m_aVerSBar->IsVisible())
1255}
1256
1258{
1259 if( !m_pStartEntry )
1260 {
1261 sal_uLong nVisibleViewCount = m_pView->GetVisibleCount();
1262 tools::Long nTempThumb = m_aVerSBar->GetThumbPos();
1263 if( nTempThumb < 0 )
1264 nTempThumb = 0;
1265 else if( o3tl::make_unsigned(nTempThumb) >= nVisibleViewCount )
1266 nTempThumb = nVisibleViewCount == 0 ? 0 : nVisibleViewCount - 1;
1267 m_pStartEntry = m_pView->GetEntryAtVisPos(nTempThumb);
1268 }
1269 if( !m_pStartEntry )
1270 return;
1271
1272 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1273 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1274 sal_uLong nCurDispEntries = nLast-nThumb+1;
1275 if( nCurDispEntries >= m_nVisibleCount )
1276 return;
1277
1278 ShowCursor( false );
1279 // fill window by moving the thumb up incrementally
1280 bool bFound = false;
1282 while( nCurDispEntries < m_nVisibleCount && pTemp )
1283 {
1285 if( pTemp )
1286 {
1287 nThumb--;
1288 m_pStartEntry = pTemp;
1289 nCurDispEntries++;
1290 bFound = true;
1291 }
1292 }
1293 if( bFound )
1294 {
1295 m_aVerSBar->SetThumbPos( nThumb );
1296 ShowCursor( true ); // recalculate focus rectangle
1298 }
1299}
1300
1301
1303{
1304 bool bVerBar = ( m_pView->GetStyle() & WB_VSCROLL ) != 0;
1305 sal_uLong nVis = 0;
1306 if( !bVerBar )
1307 nVis = m_pView->GetVisibleCount();
1308 if( bVerBar || (m_nVisibleCount && nVis > static_cast<sal_uLong>(m_nVisibleCount-1)) )
1309 {
1310 if( !m_aVerSBar->IsVisible() )
1311 {
1312 m_pView->nFocusWidth = -1;
1314 if( GetUpdateMode() )
1316 }
1317 }
1318 else
1319 {
1320 if( m_aVerSBar->IsVisible() )
1321 {
1322 m_pView->nFocusWidth = -1;
1324 }
1325 }
1326
1327 tools::Long nMaxRight = GetOutputSize().Width();
1328 Point aPos( m_pView->GetMapMode().GetOrigin() );
1329 aPos.setX( aPos.X() * -1 ); // convert document coordinates
1330 nMaxRight = nMaxRight + aPos.X() - 1;
1331 if( nMaxRight < m_nMostRight )
1332 {
1333 if( !m_aHorSBar->IsVisible() )
1334 {
1335 m_pView->nFocusWidth = -1;
1337 if( GetUpdateMode() )
1339 }
1340 else
1341 {
1342 Range aRange( m_aHorSBar->GetRange() );
1343 if( aRange.Max() < m_nMostRight+25 )
1344 {
1345 aRange.Max() = m_nMostRight+25;
1346 m_aHorSBar->SetRange( aRange );
1347 }
1348 else
1349 {
1350 m_pView->nFocusWidth = -1;
1352 }
1353 }
1354 }
1355 else
1356 {
1357 if( m_aHorSBar->IsVisible() )
1358 {
1359 m_pView->nFocusWidth = -1;
1361 }
1362 }
1363}
1364
1365
1367{
1368 if( m_pStartEntry )
1369 {
1371 m_aVerSBar->SetThumbPos( nEntryPos );
1372 }
1373 else
1374 m_aVerSBar->SetThumbPos( 0 );
1375}
1376
1378{
1379 // parent collapsed
1380 if( !m_pView->IsEntryVisible(pEntry) )
1381 return false;
1382 tools::Long nY = GetEntryLine( pEntry );
1383 if( nY < 0 )
1384 return false;
1386 return nY < nMax;
1387}
1388
1389
1391{
1392 if(!m_pStartEntry )
1393 return -1; // invisible position
1394
1396 tools::Long nEntryVisPos = m_pView->GetVisiblePos( pEntry );
1397 nFirstVisPos = nEntryVisPos - nFirstVisPos;
1398 nFirstVisPos *= m_pView->GetEntryHeight();
1399 return nFirstVisPos;
1400}
1401
1403{
1406 if(!m_pView->HasViewData()) // are we within the Clear?
1407 {
1408 Size aSize = m_pView->Control::GetOutputSizePixel();
1409 AdjustScrollBars( aSize );
1410 }
1411 else
1412 {
1413 Resize();
1414 if( GetUpdateMode() )
1416 }
1417}
1418
1419
1420// ***********************************************************************
1421// Callback Functions
1422// ***********************************************************************
1423
1425{
1426 // SelAllDestrAnch( false, true ); //DeselectAll();
1427 if( !GetUpdateMode() )
1428 return;
1429
1430 ShowCursor( false );
1431 tools::Long nY = GetEntryLine( pEntry );
1432 if( IsLineVisible(nY) )
1433 {
1435 FindMostRight( pEntry );
1436 }
1438 // if we expanded before the thumb, the thumb's position has to be
1439 // corrected
1440 SyncVerThumb();
1441 ShowVerSBar();
1442 ShowCursor( true );
1443}
1444
1446{
1447 if( !m_pView->IsEntryVisible( pEntry ) )
1448 return;
1449
1450 ShowCursor( false );
1451
1453 {
1454 FindMostRight();
1455 }
1456
1457 if( m_pStartEntry )
1458 {
1459 tools::Long nOldThumbPos = m_aVerSBar->GetThumbPos();
1460 sal_uLong nVisList = m_pView->GetVisibleCount();
1461 m_aVerSBar->SetRange( Range(0, nVisList-1) );
1462 tools::Long nNewThumbPos = m_aVerSBar->GetThumbPos();
1463 if( nNewThumbPos != nOldThumbPos )
1464 {
1466 sal_uInt16 nDistance = static_cast<sal_uInt16>(nNewThumbPos);
1467 if( nDistance )
1469 if( GetUpdateMode() )
1471 }
1472 else
1473 SyncVerThumb();
1474 ShowVerSBar();
1475 }
1476 // has the cursor been collapsed?
1477 if( m_pTree->IsChild( pEntry, m_pCursor ) )
1478 SetCursor( pEntry );
1479 if( GetUpdateMode() )
1480 ShowVerSBar();
1481 ShowCursor( true );
1482 if( GetUpdateMode() && m_pCursor )
1484}
1485
1487{
1488 if( !m_pView->IsEntryVisible( pEntry ) || !m_pStartEntry )
1489 return;
1490
1491 SelAllDestrAnch( false ); // deselect all
1492
1493 // is the collapsed cursor visible?
1494 tools::Long nY = GetEntryLine( pEntry );
1495 if( IsLineVisible(nY) )
1496 {
1497 if( GetUpdateMode() )
1499 }
1500 else
1501 {
1502 if( m_pTree->IsChild(pEntry, m_pStartEntry) )
1503 {
1504 m_pStartEntry = pEntry;
1505 if( GetUpdateMode() )
1507 }
1508 }
1509}
1510
1511
1513{
1514 const Size aSize( rBmp.GetSizePixel() );
1515 m_nNodeBmpWidth = aSize.Width();
1516}
1517
1519{
1522 {
1523 // only if the first dynamic tab is centered (we currently assume that)
1525 m_nNodeBmpTabDistance -= aSize.Width() / 2;
1526 }
1527}
1528
1529
1530// corrects the cursor when using SingleSelection
1531
1532void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect )
1533{
1535 return;
1536
1538 if( bSelect &&
1540 pEntry != m_pCursor )
1541 {
1542 SetCursor( pEntry );
1543 DBG_ASSERT(m_pView->GetSelectionCount()==1,"selection count?");
1544 }
1545
1546 if( GetUpdateMode() && m_pView->IsEntryVisible(pEntry) )
1547 {
1548 tools::Long nY = GetEntryLine( pEntry );
1549 if( IsLineVisible( nY ) )
1550 {
1551 ShowCursor(false);
1552 InvalidateEntry(pEntry);
1553 ShowCursor(true);
1554 }
1555 }
1556}
1557
1558
1560{
1562
1563 DestroyAnchor();
1564
1565 if( !m_pView->IsEntryVisible( pEntry ) )
1566 {
1567 // if parent is collapsed => bye!
1569 return;
1570 }
1571
1572 if( pEntry == m_pMostRightEntry || (
1573 pEntry->HasChildren() && m_pView->IsExpanded(pEntry) &&
1575 {
1577 }
1578
1579 SvTreeListEntry* pOldStartEntry = m_pStartEntry;
1580
1581 SvTreeListEntry* pParent = m_pView->GetModel()->GetParent(pEntry);
1582
1583 if (pParent && m_pView->GetModel()->GetChildList(pParent).size() == 1)
1584 {
1585 DBG_ASSERT( m_pView->IsExpanded( pParent ), "Parent not expanded");
1586 pParent->SetFlags( pParent->GetFlags() | SvTLEntryFlags::NO_NODEBMP);
1587 InvalidateEntry( pParent );
1588 }
1589
1590 if( m_pCursor && m_pTree->IsChild( pEntry, m_pCursor) )
1591 m_pCursor = pEntry;
1592 if( m_pStartEntry && m_pTree->IsChild(pEntry,m_pStartEntry) )
1593 m_pStartEntry = pEntry;
1594
1595 SvTreeListEntry* pTemp;
1596 if( m_pCursor && m_pCursor == pEntry )
1597 {
1598 if( m_bSimpleTravel )
1599 m_pView->Select( m_pCursor, false );
1600 ShowCursor( false ); // focus rectangle gone
1601 // NextSibling, because we also delete the children of the cursor
1602 pTemp = m_pCursor->NextSibling();
1603 if( !pTemp )
1604 pTemp = m_pView->PrevVisible(m_pCursor);
1605
1606 SetCursor( pTemp, true );
1607 }
1608 if( m_pStartEntry && m_pStartEntry == pEntry )
1609 {
1610 pTemp = m_pStartEntry->NextSibling();
1611 if( !pTemp )
1613 m_pStartEntry = pTemp;
1614 }
1615 if( GetUpdateMode())
1616 {
1617 // if it is the last one, we have to invalidate it, so the lines are
1618 // drawn correctly (in this case they're deleted)
1619 if( m_pStartEntry && (m_pStartEntry != pOldStartEntry || pEntry == m_pView->GetModel()->Last()) )
1620 {
1623 }
1624 else
1626 }
1627}
1628
1630{
1632 {
1634 return;
1635 }
1636 if( !m_pStartEntry )
1638 if( !m_pCursor )
1639 SetCursor( m_pStartEntry, true );
1640
1643
1644 if( GetUpdateMode())
1645 {
1647 FindMostRight();
1649 FillView();
1650 if( m_pStartEntry )
1651 // if something above the thumb was deleted
1653
1654 ShowVerSBar();
1656 {
1657 if( m_pView->GetSelectionCount() )
1658 {
1659 // is a neighboring entry selected?
1660 SvTreeListEntry* pNextCursor = m_pView->PrevVisible( m_pCursor );
1661 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1662 pNextCursor = m_pView->NextVisible( m_pCursor );
1663 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1664 // no neighbor selected: use first selected
1665 pNextCursor = m_pView->FirstSelected();
1666 SetCursor( pNextCursor );
1668 }
1669 else
1671 }
1672 ShowCursor( true );
1673 }
1675}
1676
1677
1679{
1680 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1681 SelAllDestrAnch( false ); // DeselectAll();
1682 if( !bDeselAll )
1684
1685 if( pEntry == m_pCursor )
1686 ShowCursor( false );
1687 if( IsEntryInView( pEntry ) )
1689 if( pEntry != m_pStartEntry )
1690 return;
1691
1692 SvTreeListEntry* pNew = nullptr;
1693 if( !pEntry->HasChildren() )
1694 {
1696 if( !pNew )
1698 }
1699 else
1700 {
1701 pNew = pEntry->NextSibling();
1702 if( !pNew )
1703 pNew = pEntry->PrevSibling();
1704 }
1705 m_pStartEntry = pNew;
1706}
1707
1709{
1711
1712 if ( !m_pStartEntry )
1713 // this might happen if the only entry in the view is moved to its very same position
1714 // #i97346#
1716
1718 sal_uInt16 nFirstPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( m_pStartEntry ));
1719 sal_uInt16 nNewPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( pEntry ));
1720 FindMostRight();
1721 if( nNewPos < nFirstPos ) // HACK!
1722 m_pStartEntry = pEntry;
1723 SyncVerThumb();
1724 if( pEntry == m_pCursor )
1725 {
1727 ShowCursor( true );
1728 else
1729 {
1730 SvTreeListEntry* pParent = pEntry;
1731 do {
1732 pParent = m_pTree->GetParent( pParent );
1733 }
1734 while( !m_pView->IsEntryVisible( pParent ) );
1735 SetCursor( pParent );
1736 }
1737 }
1738 if( IsEntryInView( pEntry ) )
1740}
1741
1742
1744{
1745 if( !GetUpdateMode() )
1746 return;
1747
1748 SvTreeListEntry* pParent = m_pTree->GetParent(pEntry);
1749 if (pParent && m_pTree->GetChildList(pParent).size() == 1)
1750 // draw plus sign
1751 m_pTree->InvalidateEntry( pParent );
1752
1753 if( !m_pView->IsEntryVisible( pEntry ) )
1754 return;
1755 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1756 if( bDeselAll )
1757 SelAllDestrAnch( false );
1758 else
1759 DestroyAnchor();
1760 // nFlags &= (~LBoxFlags::DeselectAll);
1761// ShowCursor( false ); // if cursor is moved lower
1762 tools::Long nY = GetEntryLine( pEntry );
1763 bool bEntryVisible = IsLineVisible( nY );
1764 if( bEntryVisible )
1765 {
1766 ShowCursor( false ); // if cursor is moved lower
1767 nY -= m_pView->GetEntryHeight(); // because of lines
1769 }
1770 else if( m_pStartEntry && nY < GetEntryLine(m_pStartEntry) )
1771 {
1772 // Check if the view is filled completely. If not, then adjust
1773 // pStartEntry and the Cursor (automatic scrolling).
1774 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1775 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1776 sal_uInt16 nCurDispEntries = nLast-nThumb+1;
1777 if( nCurDispEntries < m_nVisibleCount )
1778 {
1779 // set at the next paint event
1780 m_pStartEntry = nullptr;
1781 SetCursor( nullptr );
1783 }
1784 }
1785 else if( !m_pStartEntry )
1787
1788 SetMostRight( pEntry );
1790 SyncVerThumb(); // if something was inserted before the thumb
1791 ShowVerSBar();
1792 ShowCursor( true );
1795}
1796
1797
1798// ********************************************************************
1799// Event handler
1800// ********************************************************************
1801
1802
1803// ****** Control the control animation
1804
1806{
1807 SvLBoxItem* pItem = m_pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&m_pActiveTab);
1808 if (pItem && pItem->GetType() == SvLBoxItemType::Button)
1809 {
1810 m_pActiveButton = static_cast<SvLBoxButton*>(pItem);
1811 m_pActiveEntry = pEntry;
1812 if( m_pCursor == m_pActiveEntry )
1813 m_pView->HideFocus();
1817 return true;
1818 }
1819 else
1820 m_pActiveButton = nullptr;
1821 return false;
1822}
1823
1825{
1826 if( m_pActiveButton )
1827 {
1828 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1829 if( pEntry == m_pActiveEntry &&
1831 {
1833 {
1836 }
1837 }
1838 else
1839 {
1841 {
1844 }
1845 }
1846 return true;
1847 }
1848 return false;
1849}
1850
1852{
1854 {
1856 SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
1858 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1859 if (pEntry == m_pActiveEntry && m_pView->GetItem(m_pActiveEntry, nMouseX) == m_pActiveButton)
1863 ShowCursor(true);
1864 m_pActiveButton = nullptr;
1865 m_pActiveEntry = nullptr;
1866 m_pActiveTab = nullptr;
1867 return true;
1868 }
1869 return false;
1870}
1871
1872// ******* Control plus/minus button for expanding/collapsing
1873
1874// false == no expand/collapse button hit
1875bool SvImpLBox::IsNodeButton( const Point& rPosPixel, const SvTreeListEntry* pEntry ) const
1876{
1877 if( !pEntry->HasChildren() && !pEntry->HasChildrenOnDemand() )
1878 return false;
1879
1880 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1881 if( !pFirstDynamicTab )
1882 return false;
1883
1884 tools::Long nMouseX = rPosPixel.X();
1885 // convert to document coordinates
1886 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1887 nMouseX -= aOrigin.X();
1888
1889 tools::Long nX = m_pView->GetTabPos( pEntry, pFirstDynamicTab);
1891 if( nMouseX < nX )
1892 return false;
1893 nX += m_nNodeBmpWidth;
1894 return nMouseX <= nX;
1895}
1896
1897// false == hit no node button
1899{
1900 bool bRet = false;
1901
1902 if ( m_pView->IsEditingActive() && pEntry == m_pView->pEdEntry )
1903 // inplace editing -> nothing to do
1904 bRet = true;
1905 else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
1906 {
1907 if ( m_pView->IsExpanded( pEntry ) )
1908 {
1909 m_pView->EndEditing( true );
1910 m_pView->Collapse( pEntry );
1911 }
1912 else
1913 {
1914 // you can expand an entry, which is in editing
1915 m_pView->Expand( pEntry );
1916 }
1917 bRet = true;
1918 }
1919
1920 return bRet;
1921}
1922
1924{
1925 if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
1926 return;
1927
1928 m_aEditIdle.Stop();
1929 Point aPos( rMEvt.GetPosPixel());
1930
1931 if( aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height() )
1932 return;
1933
1934 if( !m_pCursor )
1937 m_pView->GrabFocus();
1938 //fdo#82270 Grabbing focus can invalidate the entries, re-fetch
1939 SvTreeListEntry* pEntry = GetEntry(aPos);
1940 // the entry can still be invalid!
1941 if( !pEntry || !m_pView->GetViewData( pEntry ))
1942 return;
1943
1944 tools::Long nY = GetEntryLine( pEntry );
1945 // Node-Button?
1946 if( ButtonDownCheckExpand( rMEvt, pEntry ) )
1947 return;
1948
1949 if( !EntryReallyHit(pEntry,aPos,nY))
1950 return;
1951
1952 SvLBoxItem* pXItem = m_pView->GetItem( pEntry, aPos.X() );
1953 if( pXItem )
1954 {
1955 SvLBoxTab* pXTab = m_pView->GetTab( pEntry, pXItem );
1956 if ( !rMEvt.IsMod1() && !rMEvt.IsMod2() && rMEvt.IsLeft() && pXTab->IsEditable()
1957 && pEntry == m_pView->FirstSelected() && nullptr == m_pView->NextSelected( pEntry ) )
1958 // #i8234# FirstSelected() and NextSelected() ensures, that inplace editing is only triggered, when only one entry is selected
1960 if ( !m_pView->IsSelected( pEntry ) )
1962 }
1963
1964
1965 if( (rMEvt.GetClicks() % 2) == 0)
1966 {
1968 m_pView->pHdlEntry = pEntry;
1969 if( !m_pView->DoubleClickHdl() )
1970 {
1971 // Handler signals nothing to be done anymore, bail out, 'this' may
1972 // even be dead and destroyed.
1973 return;
1974 }
1975 else
1976 {
1977 // if the entry was deleted within the handler
1978 pEntry = GetClickedEntry( aPos );
1979 if( !pEntry )
1980 return;
1981 if( pEntry != m_pView->pHdlEntry )
1982 {
1983 // select anew & bye
1985 SelAllDestrAnch( false ); // DeselectAll();
1986 SetCursor( pEntry );
1987
1988 return;
1989 }
1990 if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
1991 {
1992 if( m_pView->IsExpanded(pEntry) )
1993 m_pView->Collapse( pEntry );
1994 else
1995 m_pView->Expand( pEntry );
1996 if( pEntry == m_pCursor ) // only if Entryitem was clicked
1997 // (Nodebutton is not an Entryitem!)
1999 return;
2000 }
2001 }
2002 }
2003 else
2004 {
2005 // CheckButton? (TreeListBox: Check + Info)
2006 if( ButtonDownCheckCtrl(rMEvt, pEntry) )
2007 return;
2008 // Inplace-Editing?
2009 }
2011 && !rMEvt.IsRight() ) // tdf#128824
2013}
2014
2016{
2018 m_aSelEng.SelMouseButtonUp( rMEvt );
2020 {
2022 m_aEditClickPos = rMEvt.GetPosPixel();
2024 }
2025
2027 {
2028 Point aPos(rMEvt.GetPosPixel());
2029 SvTreeListEntry* pEntry = GetEntry(aPos);
2030 // tdf#143245 ActivateOnSingleClick only
2031 // if the 'up' is at the active entry
2032 // typically selected by the 'down'
2033 if (!pEntry || pEntry != m_pCursor)
2034 return;
2036 }
2037}
2038
2040{
2041 Point aPos = rMEvt.GetPosPixel();
2042 SvTreeListEntry* pEntry = GetClickedEntry(aPos);
2043 if ( MouseMoveCheckCtrl( rMEvt, pEntry ) || ( m_aSelEng.GetSelectionMode() == SelectionMode::NONE ) )
2044 return;
2045
2046 m_aSelEng.SelMouseMove(rMEvt);
2048 {
2049 if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height())
2050 pEntry = nullptr;
2051 else
2052 pEntry = GetEntry(aPos);
2053 if (!pEntry)
2054 m_pView->SelectAll(false);
2055 else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
2056 {
2058 m_pView->Select(pEntry);
2059 m_pView->mbSelectingByHover = false;
2060 }
2061 }
2062}
2063
2065{
2066 sal_uInt16 nRefDepth = m_pTree->GetDepth(m_pCursor);
2068 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2069 {
2070 if (pCur->HasChildren() && !m_pView->IsExpanded(pCur))
2071 m_pView->Expand(pCur);
2072 pCur = m_pTree->Next(pCur);
2073 }
2074}
2075
2077{
2078 // collapse all parents until we get to the given parent to collapse
2079 if (!pParentToCollapse)
2080 return;
2081
2082 sal_uInt16 nRefDepth;
2083 // special case explorer: if the root only has a single
2084 // entry, don't collapse the root entry
2085 if (m_pTree->GetChildList(nullptr).size() < 2)
2086 {
2087 nRefDepth = 1;
2088 pParentToCollapse = m_pCursor;
2089 while (m_pTree->GetParent(pParentToCollapse)
2090 && m_pTree->GetDepth(m_pTree->GetParent(pParentToCollapse)) > 0)
2091 {
2092 pParentToCollapse = m_pTree->GetParent(pParentToCollapse);
2093 }
2094 }
2095 else
2096 nRefDepth = m_pTree->GetDepth(pParentToCollapse);
2097
2098 if (m_pView->IsExpanded(pParentToCollapse))
2099 m_pView->Collapse(pParentToCollapse);
2100 SvTreeListEntry* pCur = m_pTree->Next(pParentToCollapse);
2101 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2102 {
2103 if (pCur->HasChildren() && m_pView->IsExpanded(pCur))
2104 m_pView->Collapse(pCur);
2105 pCur = m_pTree->Next(pCur);
2106 }
2107}
2108
2110{
2111 m_aEditIdle.Stop();
2112 const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
2113
2114 if( rKeyCode.IsMod2() )
2115 return false; // don't evaluate Alt key
2116
2118
2119 if( !m_pCursor )
2121 if( !m_pCursor )
2122 return false;
2123
2124 bool bKeyUsed = true;
2125
2126 sal_uInt16 nDelta = static_cast<sal_uInt16>(m_aVerSBar->GetPageSize());
2127 sal_uInt16 aCode = rKeyCode.GetCode();
2128
2129 bool bShift = rKeyCode.IsShift();
2130 bool bMod1 = rKeyCode.IsMod1();
2131
2132 SvTreeListEntry* pNewCursor;
2133
2134 switch( aCode )
2135 {
2136 case KEY_UP:
2137 if( !IsEntryInView( m_pCursor ) )
2139
2140 pNewCursor = m_pCursor;
2141 do
2142 {
2143 pNewCursor = m_pView->PrevVisible(pNewCursor);
2144 } while( pNewCursor && !IsSelectable(pNewCursor) );
2145
2146 // if there is no next entry, take the current one
2147 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2148 // the cursor key
2149 if (!pNewCursor)
2150 pNewCursor = m_pCursor;
2151
2152 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2153 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2154 if( !IsEntryInView( pNewCursor ) )
2155 KeyUp( false );
2156 break;
2157
2158 case KEY_DOWN:
2159 if( !IsEntryInView( m_pCursor ) )
2161
2162 pNewCursor = m_pCursor;
2163 do
2164 {
2165 pNewCursor = m_pView->NextVisible(pNewCursor);
2166 } while( pNewCursor && !IsSelectable(pNewCursor) );
2167
2168 // if there is no next entry, take the current one
2169 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2170 // the cursor key
2171 // 06.09.20001 - 83416 - frank.schoenheit@sun.com
2172 if ( !pNewCursor && m_pCursor )
2173 pNewCursor = m_pCursor;
2174
2175 if( pNewCursor )
2176 {
2177 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2178 if( IsEntryInView( pNewCursor ) )
2179 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2180 else
2181 {
2182 if( m_pCursor )
2183 m_pView->Select( m_pCursor, false );
2184 KeyDown( false );
2185 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2186 }
2187 }
2188 else
2189 KeyDown( false ); // because scrollbar range might still
2190 // allow scrolling
2191 break;
2192
2193 case KEY_RIGHT:
2194 {
2195 if( m_bSubLstOpLR )
2196 {
2197 // only try to expand if sublist is expandable,
2198 // otherwise ignore the key press
2201 }
2202 else if (m_aHorSBar->IsVisible())
2203 {
2205 nThumb += m_aHorSBar->GetLineSize();
2206 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2207 m_aHorSBar->SetThumbPos( nThumb );
2208 nThumb = nOldThumb;
2209 nThumb -= m_aHorSBar->GetThumbPos();
2210 nThumb *= -1;
2211 if( nThumb )
2212 {
2213 KeyLeftRight( nThumb );
2214 }
2215 }
2216 else
2217 bKeyUsed = false;
2218 break;
2219 }
2220
2221 case KEY_LEFT:
2222 {
2223 if (m_aHorSBar->IsVisible())
2224 {
2226 nThumb -= m_aHorSBar->GetLineSize();
2227 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2228 m_aHorSBar->SetThumbPos( nThumb );
2229 nThumb = nOldThumb;
2230 nThumb -= m_aHorSBar->GetThumbPos();
2231 if( nThumb )
2232 {
2233 KeyLeftRight( -nThumb );
2234 }
2235 else if( m_bSubLstOpLR )
2236 {
2239 else
2240 {
2241 pNewCursor = m_pView->GetParent( m_pCursor );
2242 if( pNewCursor )
2243 SetCursor( pNewCursor );
2244 }
2245 }
2246 }
2247 else if( m_bSubLstOpLR )
2248 {
2251 else
2252 {
2253 pNewCursor = m_pView->GetParent( m_pCursor );
2254 if( pNewCursor )
2255 SetCursor( pNewCursor );
2256 }
2257 }
2258 else
2259 bKeyUsed = false;
2260 break;
2261 }
2262
2263 case KEY_PAGEUP:
2264 if( !bMod1 )
2265 {
2266 pNewCursor = m_pView->PrevVisible(m_pCursor, nDelta);
2267
2268 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2269 {
2270 pNewCursor = m_pView->NextVisible(pNewCursor);
2271 nDelta--;
2272 }
2273
2274 if( nDelta )
2275 {
2276 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2277 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2278 if( IsEntryInView( pNewCursor ) )
2279 SetCursor( pNewCursor );
2280 else
2281 {
2282 SetCursor( pNewCursor );
2283 KeyUp( true );
2284 }
2285 }
2286 }
2287 else
2288 bKeyUsed = false;
2289 break;
2290
2291 case KEY_PAGEDOWN:
2292 if( !bMod1 )
2293 {
2294 pNewCursor= m_pView->NextVisible(m_pCursor, nDelta);
2295
2296 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2297 {
2298 pNewCursor = m_pView->PrevVisible(pNewCursor);
2299 nDelta--;
2300 }
2301
2302 if( nDelta && pNewCursor )
2303 {
2304 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2305 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2306 if( IsEntryInView( pNewCursor ) )
2307 SetCursor( pNewCursor );
2308 else
2309 {
2310 SetCursor( pNewCursor );
2311 KeyDown( true );
2312 }
2313 }
2314 else
2315 KeyDown( false ); // see also: KEY_DOWN
2316 }
2317 else
2318 bKeyUsed = false;
2319 break;
2320
2321 case KEY_SPACE:
2323 {
2324 if ( bMod1 )
2325 {
2326 if ( m_pView->GetSelectionMode() == SelectionMode::Multiple && !bShift )
2327 // toggle selection
2329 }
2330 else if ( !bShift /*&& !bMod1*/ )
2331 {
2332 if ( m_aSelEng.IsAddMode() )
2333 {
2334 // toggle selection
2336 }
2337 else if ( !m_pView->IsSelected( m_pCursor ) )
2338 {
2339 SelAllDestrAnch( false );
2341 }
2342 else
2343 bKeyUsed = false;
2344 }
2345 else
2346 bKeyUsed = false;
2347 }
2348 else
2349 bKeyUsed = false;
2350 break;
2351
2352 case KEY_RETURN:
2353 bKeyUsed = !m_pView->DoubleClickHdl();
2354 break;
2355
2356 case KEY_F2:
2357 if( !bShift && !bMod1 )
2358 {
2359 m_aEditClickPos = Point( -1, -1 );
2360 EditTimerCall( nullptr );
2361 }
2362 else
2363 bKeyUsed = false;
2364 break;
2365
2366 case KEY_F8:
2369 {
2371 m_aSelEng.AddAlways( false );
2372 else
2373 m_aSelEng.AddAlways( true );
2374 }
2375 else
2376 bKeyUsed = false;
2377 break;
2378
2379 case KEY_ADD:
2382 if (bMod1)
2383 ExpandAll();
2384 break;
2385
2386 case KEY_A:
2387 if( bMod1 )
2388 SelAllDestrAnch( true );
2389 else
2390 bKeyUsed = false;
2391 break;
2392
2393 case KEY_SUBTRACT:
2396 if (bMod1)
2398 break;
2399
2400 case KEY_MULTIPLY:
2401 if( bMod1 )
2402 {
2403 // only try to expand/collapse if sublist is expandable,
2404 // otherwise ignore the key press
2405 if( IsExpandable() )
2406 {
2408 {
2410 ExpandAll();
2411 }
2412 else
2414 }
2415 }
2416 else
2417 bKeyUsed = false;
2418 break;
2419
2420 case KEY_DIVIDE :
2421 if( bMod1 )
2422 SelAllDestrAnch( true );
2423 else
2424 bKeyUsed = false;
2425 break;
2426
2427 case KEY_COMMA :
2428 if( bMod1 )
2429 SelAllDestrAnch( false );
2430 else
2431 bKeyUsed = false;
2432 break;
2433
2434 case KEY_HOME :
2435 pNewCursor = m_pView->GetModel()->First();
2436
2437 while( pNewCursor && !IsSelectable(pNewCursor) )
2438 {
2439 pNewCursor = m_pView->NextVisible(pNewCursor);
2440 }
2441
2442 if( pNewCursor && pNewCursor != m_pCursor )
2443 {
2444// SelAllDestrAnch( false );
2445 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2446 SetCursor( pNewCursor );
2447 if( !IsEntryInView( pNewCursor ) )
2448 MakeVisible( pNewCursor );
2449 }
2450 else
2451 bKeyUsed = false;
2452 break;
2453
2454 case KEY_END :
2455 pNewCursor = m_pView->GetModel()->Last();
2456
2457 while( pNewCursor && !IsSelectable(pNewCursor) )
2458 {
2459 pNewCursor = m_pView->PrevVisible(pNewCursor);
2460 }
2461
2462 if( pNewCursor && pNewCursor != m_pCursor)
2463 {
2464// SelAllDestrAnch( false );
2465 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2466 SetCursor( pNewCursor );
2467 if( !IsEntryInView( pNewCursor ) )
2468 MakeVisible( pNewCursor );
2469 }
2470 else
2471 bKeyUsed = false;
2472 break;
2473
2474 case KEY_ESCAPE:
2475 case KEY_TAB:
2476 case KEY_DELETE:
2477 case KEY_BACKSPACE:
2478 // must not be handled because this quits dialogs and does other magic things...
2479 // if there are other single keys which should not be handled, they can be added here
2480 bKeyUsed = false;
2481 break;
2482
2483 default:
2484 // is there any reason why we should eat the events here? The only place where this is called
2485 // is from SvTreeListBox::KeyInput. If we set bKeyUsed to true here, then the key input
2486 // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
2487 // handling.
2488 // (The old code here which intentionally set bKeyUsed to sal_True said this was because of "quick search"
2489 // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
2490 // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
2491 bKeyUsed = false;
2492 break;
2493 }
2494 return bKeyUsed;
2495}
2496
2498{
2499 if( m_pCursor )
2500 {
2502 ShowCursor( true );
2503// auskommentiert wg. deselectall
2504// if( bSimpleTravel && !pView->IsSelected(pCursor) )
2505// pView->Select( pCursor, true );
2506 }
2508 {
2510 while( pEntry )
2511 {
2512 InvalidateEntry( pEntry );
2513 pEntry = m_pView->NextSelected( pEntry );
2514 }
2515 }
2516}
2517
2519{
2520 m_aEditIdle.Stop();
2521 if( m_pCursor )
2523 ShowCursor( false );
2524
2526 {
2527 SvTreeListEntry* pEntry = m_pView ? m_pView->FirstSelected() : nullptr;
2528 while( pEntry )
2529 {
2530 InvalidateEntry( pEntry );
2531 pEntry = m_pView->NextSelected( pEntry );
2532 }
2533 }
2534}
2535
2536
2537// ********************************************************************
2538// SelectionEngine
2539// ********************************************************************
2540
2541void SvImpLBox::SelectEntry( SvTreeListEntry* pEntry, bool bSelect )
2542{
2543 m_pView->Select( pEntry, bSelect );
2544}
2545
2547{
2548 pImp = pImpl;
2549 pView = pV;
2550}
2551
2553{
2554}
2555
2557{
2558 pImp->BeginDrag();
2559}
2560
2562{
2564}
2565
2567{
2568 pImp->m_pAnchor = nullptr;
2569}
2570
2571void ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, bool bDontSelectAtCursor)
2572{
2573 SvTreeListEntry* pNewCursor = pImp->MakePointVisible( rPoint );
2574 if( pNewCursor )
2575 {
2576 // at SimpleTravel, the SetCursor is selected and the select handler is
2577 // called
2578 //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
2579 // pImp->SelectEntry( pNewCursor, true );
2580 pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
2581 }
2582}
2583
2584bool ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
2585{
2586 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2587 if( pEntry )
2588 return pView->IsSelected(pEntry);
2589 return false;
2590}
2591
2592void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
2593{
2594 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2595 if( !pEntry )
2596 return;
2597 pImp->SelectEntry( pEntry, false );
2598}
2599
2601{
2602 pImp->SelAllDestrAnch( false, false ); // don't reset SelectionEngine!
2604}
2605
2606// ***********************************************************************
2607// Selection
2608// ***********************************************************************
2609
2611{
2612 SvTreeListEntry* pEntry;
2613 sal_uLong nAnchorVisPos = m_pView->GetVisiblePos( m_pAnchor );
2614 sal_uLong nOldVisPos = m_pView->GetVisiblePos( pOldCursor );
2615 sal_uLong nNewVisPos = m_pView->GetVisiblePos( pNewCursor );
2616
2617 if( nOldVisPos > nAnchorVisPos ||
2618 ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
2619 {
2620 if( nNewVisPos > nOldVisPos )
2621 {
2622 pEntry = pOldCursor;
2623 while( pEntry && pEntry != pNewCursor )
2624 {
2625 m_pView->Select( pEntry );
2626 pEntry = m_pView->NextVisible(pEntry);
2627 }
2628 if( pEntry )
2629 m_pView->Select( pEntry );
2630 return;
2631 }
2632
2633 if( nNewVisPos < nAnchorVisPos )
2634 {
2635 pEntry = m_pAnchor;
2636 while( pEntry && pEntry != pOldCursor )
2637 {
2638 m_pView->Select( pEntry, false );
2639 pEntry = m_pView->NextVisible(pEntry);
2640 }
2641 if( pEntry )
2642 m_pView->Select( pEntry, false );
2643
2644 pEntry = pNewCursor;
2645 while( pEntry && pEntry != m_pAnchor )
2646 {
2647 m_pView->Select( pEntry );
2648 pEntry = m_pView->NextVisible(pEntry);
2649 }
2650 if( pEntry )
2651 m_pView->Select( pEntry );
2652 return;
2653 }
2654
2655 if( nNewVisPos < nOldVisPos )
2656 {
2657 pEntry = m_pView->NextVisible(pNewCursor);
2658 while( pEntry && pEntry != pOldCursor )
2659 {
2660 m_pView->Select( pEntry, false );
2661 pEntry = m_pView->NextVisible(pEntry);
2662 }
2663 if( pEntry )
2664 m_pView->Select( pEntry, false );
2665 return;
2666 }
2667 }
2668 else
2669 {
2670 if( nNewVisPos < nOldVisPos ) // enlarge selection
2671 {
2672 pEntry = pNewCursor;
2673 while( pEntry && pEntry != pOldCursor )
2674 {
2675 m_pView->Select( pEntry );
2676 pEntry = m_pView->NextVisible(pEntry);
2677 }
2678 if( pEntry )
2679 m_pView->Select( pEntry );
2680 return;
2681 }
2682
2683 if( nNewVisPos > nAnchorVisPos )
2684 {
2685 pEntry = pOldCursor;
2686 while( pEntry && pEntry != m_pAnchor )
2687 {
2688 m_pView->Select( pEntry, false );
2689 pEntry = m_pView->NextVisible(pEntry);
2690 }
2691 if( pEntry )
2692 m_pView->Select( pEntry, false );
2693 pEntry = m_pAnchor;
2694 while( pEntry && pEntry != pNewCursor )
2695 {
2696 m_pView->Select( pEntry );
2697 pEntry = m_pView->NextVisible(pEntry);
2698 }
2699 if( pEntry )
2700 m_pView->Select( pEntry );
2701 return;
2702 }
2703
2704 if( nNewVisPos > nOldVisPos )
2705 {
2706 pEntry = pOldCursor;
2707 while( pEntry && pEntry != pNewCursor )
2708 {
2709 m_pView->Select( pEntry, false );
2710 pEntry = m_pView->NextVisible(pEntry);
2711 }
2712 return;
2713 }
2714 }
2715}
2716
2718 bool bSelect, bool bDestroyAnchor, bool bSingleSelToo )
2719{
2720 SvTreeListEntry* pEntry;
2722 if( bSelect && m_bSimpleTravel )
2723 {
2725 {
2727 }
2728 return;
2729 }
2730 if( !bSelect && m_pView->GetSelectionCount() == 0 )
2731 {
2732 if( m_bSimpleTravel && ( !GetUpdateMode() || !m_pCursor) )
2734 return;
2735 }
2736 if( bSelect && m_pView->GetSelectionCount() == m_pView->GetEntryCount())
2737 return;
2738 if( !bSingleSelToo && m_bSimpleTravel )
2739 return;
2740
2741 if( !bSelect && m_pView->GetSelectionCount()==1 && m_pCursor &&
2743 {
2744 m_pView->Select( m_pCursor, false );
2745 if( bDestroyAnchor )
2746 DestroyAnchor(); // delete anchor & reset SelectionEngine
2747 else
2748 m_pAnchor = nullptr; // always delete internal anchor
2749 return;
2750 }
2751
2754
2755 ShowCursor( false );
2756 bool bUpdate = GetUpdateMode();
2757
2758 m_nFlags |= LBoxFlags::IgnoreSelect; // EntryInserted should not do anything
2759 pEntry = m_pTree->First();
2760 while( pEntry )
2761 {
2762 if( m_pView->Select( pEntry, bSelect ) )
2763 {
2764 if( bUpdate && m_pView->IsEntryVisible(pEntry) )
2765 {
2766 tools::Long nY = GetEntryLine( pEntry );
2767 if( IsLineVisible( nY ) )
2768 InvalidateEntry(pEntry);
2769 }
2770 }
2771 pEntry = m_pTree->Next( pEntry );
2772 }
2774
2775 if( bDestroyAnchor )
2776 DestroyAnchor(); // delete anchor & reset SelectionEngine
2777 else
2778 m_pAnchor = nullptr; // always delete internal anchor
2779 ShowCursor( true );
2780}
2781
2783{
2784 m_aSelEng.SetSelectionMode( eSelMode);
2785 if( eSelMode == SelectionMode::Single )
2786 m_bSimpleTravel = true;
2787 else
2788 m_bSimpleTravel = false;
2789 if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == SelectionMode::Multiple) )
2790 m_aSelEng.AddAlways( true );
2791}
2792
2793// ***********************************************************************
2794// Drag & Drop
2795// ***********************************************************************
2796
2798{
2799 if( eDDMode != DragDropMode::NONE )
2800 {
2802 m_aSelEng.EnableDrag( true );
2803 }
2804 else
2805 {
2807 m_aSelEng.EnableDrag( false );
2808 }
2809}
2810
2812{
2815}
2816
2818{
2819 if (pEntry)
2820 {
2821
2822 SvViewDataEntry* pViewData = m_pView->GetViewData(pEntry);
2823 pViewData->SetDragTarget(bShow);
2824#ifdef MACOSX
2825 // in MacOS we need to draw directly (as we are synchronous) or no invalidation happens
2826 m_pView->PaintEntry1(*pEntry, GetEntryLine(pEntry), *m_pView->GetOutDev());
2827#else
2828 InvalidateEntry(pEntry);
2829#endif
2830 }
2831}
2832
2834{
2835 CommandEventId nCommand = rCEvt.GetCommand();
2836
2837 if( nCommand == CommandEventId::ContextMenu )
2838 m_aEditIdle.Stop();
2839
2840 // scroll mouse event?
2841 if (nCommand == CommandEventId::Wheel ||
2842 nCommand == CommandEventId::StartAutoScroll ||
2843 nCommand == CommandEventId::AutoScroll ||
2844 nCommand == CommandEventId::GesturePan)
2845 {
2847 return;
2848 }
2849
2850 const Point& rPos = rCEvt.GetMousePosPixel();
2851 if( rPos.X() < m_aOutputSize.Width() && rPos.Y() < m_aOutputSize.Height() )
2852 m_aSelEng.Command( rCEvt );
2853}
2854
2856{
2857 Point aPos( m_pView->GetMapMode().GetOrigin() );
2858 aPos.setX( aPos.X() * -1 );
2859 tools::Rectangle aRect( aPos, m_aOutputSize );
2860 return aRect;
2861}
2862
2864{
2866}
2867
2869{
2872 )
2873 SelAllDestrAnch( false );
2874 if ( pEntry )
2875 MakeVisible( pEntry );
2876 SetCursor( pEntry );
2877 if ( pEntry && ( m_aSelEng.GetSelectionMode() != SelectionMode::NONE ) )
2878 m_pView->Select( pEntry );
2879}
2880
2881IMPL_LINK_NOARG(SvImpLBox, EditTimerCall, Timer *, void)
2882{
2883 if( !m_pView->IsInplaceEditingEnabled() )
2884 return;
2885
2886 bool bIsMouseTriggered = m_aEditClickPos.X() >= 0;
2887 if ( bIsMouseTriggered )
2888 {
2889 Point aCurrentMousePos = m_pView->GetPointerPosPixel();
2890 if ( ( std::abs( aCurrentMousePos.X() - m_aEditClickPos.X() ) > 5 )
2891 || ( std::abs( aCurrentMousePos.Y() - m_aEditClickPos.Y() ) > 5 )
2892 )
2893 {
2894 return;
2895 }
2896 }
2897
2898 SvTreeListEntry* pEntry = GetCurEntry();
2899 if( pEntry )
2900 {
2901 ShowCursor( false );
2902 m_pView->ImplEditEntry( pEntry );
2903 ShowCursor( true );
2904 }
2905}
2906
2908{
2909 if( rHEvt.GetMode() & HelpEventMode::QUICK )
2910 {
2912 if( !GetVisibleArea().Contains( aPos ))
2913 return false;
2914
2915 SvTreeListEntry* pEntry = GetEntry( aPos );
2916 if( pEntry )
2917 {
2918 // recalculate text rectangle
2919 SvLBoxTab* pTab;
2920 SvLBoxItem* pItem = m_pView->GetItem( pEntry, aPos.X(), &pTab );
2921 if (!pItem || pItem->GetType() != SvLBoxItemType::String)
2922 return false;
2923
2924 aPos = GetEntryPosition( pEntry );
2925 aPos.setX( m_pView->GetTabPos( pEntry, pTab ) ); //pTab->GetPos();
2926 Size aSize(pItem->GetWidth(m_pView, pEntry), pItem->GetHeight(m_pView, pEntry));
2927 SvLBoxTab* pNextTab = NextTab( pTab );
2928 bool bItemClipped = false;
2929 // is the item cut off by its right neighbor?
2930 if( pNextTab && m_pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
2931 {
2932 aSize.setWidth( pNextTab->GetPos() - pTab->GetPos() );
2933 bItemClipped = true;
2934 }
2935 tools::Rectangle aItemRect( aPos, aSize );
2936
2937 tools::Rectangle aViewRect( GetVisibleArea() );
2938
2939 if( bItemClipped || !aViewRect.Contains( aItemRect ) )
2940 {
2941 // clip the right edge of the item at the edge of the view
2942 //if( aItemRect.Right() > aViewRect.Right() )
2943 // aItemRect.Right() = aViewRect.Right();
2944
2945 Point aPt = m_pView->OutputToScreenPixel( aItemRect.TopLeft() );
2946 aItemRect.SetLeft( aPt.X() );
2947 aItemRect.SetTop( aPt.Y() );
2948 aPt = m_pView->OutputToScreenPixel( aItemRect.BottomRight() );
2949 aItemRect.SetRight( aPt.X() );
2950 aItemRect.SetBottom( aPt.Y() );
2951
2952 Help::ShowQuickHelp( m_pView, aItemRect,
2953 static_cast<SvLBoxString*>(pItem)->GetText(), QuickHelpFlags::Left | QuickHelpFlags::VCenter );
2954 return true;
2955 }
2956 }
2957 }
2958 return false;
2959}
2960
2962{
2963 sal_uInt16 nTabCount = m_pView->TabCount();
2964 if( nTabCount <= 1 )
2965 return nullptr;
2966 for( int nTab=0; nTab < (nTabCount-1); nTab++)
2967 {
2968 if( m_pView->aTabs[nTab].get() == pTab )
2969 return m_pView->aTabs[nTab+1].get();
2970 }
2971 return nullptr;
2972}
2973
2975{
2976 if( m_bUpdateMode != bMode )
2977 {
2978 m_bUpdateMode = bMode;
2979 if( m_bUpdateMode )
2980 UpdateAll( false );
2981 }
2982}
2983
2985{
2987 {
2989 m_pView->SetTabs();
2991 }
2992
2993 sal_uInt16 nLastTab = m_pView->aTabs.size() - 1;
2994 sal_uInt16 nLastItem = pEntry->ItemCount() - 1;
2995 if( m_pView->aTabs.empty() || nLastItem == USHRT_MAX )
2996 return;
2997
2998 if( nLastItem < nLastTab )
2999 nLastTab = nLastItem;
3000
3001 SvLBoxTab* pTab = m_pView->aTabs[ nLastTab ].get();
3002 SvLBoxItem& rItem = pEntry->GetItem( nLastTab );
3003
3004 tools::Long nTabPos = m_pView->GetTabPos( pEntry, pTab );
3005
3006 tools::Long nMaxRight = GetOutputSize().Width();
3007 Point aPos( m_pView->GetMapMode().GetOrigin() );
3008 aPos.setX( aPos.X() * -1 ); // conversion document coordinates
3009 nMaxRight = nMaxRight + aPos.X() - 1;
3010
3011 tools::Long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50;
3012 tools::Long nTabWidth = nNextTab - nTabPos + 1;
3013 auto nItemSize = rItem.GetWidth(m_pView,pEntry);
3014 tools::Long nOffset = pTab->CalcOffset( nItemSize, nTabWidth );
3015
3016 tools::Long nRight = nTabPos + nOffset + nItemSize;
3017 if( nRight > m_nMostRight )
3018 {
3019 m_nMostRight = nRight;
3020 m_pMostRightEntry = pEntry;
3021 }
3022}
3023
3025{
3026 m_nMostRight = -1;
3027 m_pMostRightEntry = nullptr;
3028 if( !m_pView->GetModel() )
3029 return;
3030
3032 while( pEntry )
3033 {
3034 SetMostRight( pEntry );
3035 pEntry = m_pView->NextVisible( pEntry );
3036 }
3037}
3038
3040{
3041 if( !pParent )
3042 FindMostRight();
3043 else
3044 FindMostRight_Impl( pParent );
3045}
3046
3048{
3049 SvTreeListEntries& rList = m_pTree->GetChildList( pParent );
3050
3051 size_t nCount = rList.size();
3052 for( size_t nCur = 0; nCur < nCount; nCur++ )
3053 {
3054 SvTreeListEntry* pChild = rList[nCur].get();
3055 SetMostRight( pChild );
3056 if( pChild->HasChildren() && m_pView->IsExpanded( pChild ))
3057 FindMostRight_Impl( pChild );
3058 }
3059}
3060
3062{
3064 m_nCurUserEvent == nullptr )
3065 {
3067 }
3068}
3069
3071{
3073}
3074
3075IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void )
3076{
3077 m_nCurUserEvent = nullptr;
3078 if( !pArg )
3079 {
3080 m_pView->Invalidate();
3081 m_pView->PaintImmediately();
3082 }
3083 else
3084 {
3085 FindMostRight();
3086 ShowVerSBar();
3087 m_pView->Invalidate( GetVisibleArea() );
3088 }
3089}
3090
3091
3093{
3094 if( m_nCurUserEvent != nullptr )
3095 {
3097 m_nCurUserEvent = nullptr;
3098 }
3099}
3100
3102{
3103 if ( s_pDefCollapsed )
3104 // assume that all or nothing is initialized
3105 return;
3106
3107 s_pDefCollapsed = new Image(StockImage::Yes, RID_BMP_TREENODE_COLLAPSED);
3108 s_pDefExpanded = new Image(StockImage::Yes, RID_BMP_TREENODE_EXPANDED);
3109}
3110
3111
3113{
3115 return *s_pDefExpanded;
3116}
3117
3118
3120{
3122 return *s_pDefCollapsed;
3123}
3124
3125
3127{
3128 if ( m_pView )
3130}
3131
3132
3133bool SvImpLBox::IsSelectable( const SvTreeListEntry* pEntry ) const
3134{
3135 if( pEntry )
3136 {
3137 SvViewDataEntry* pViewDataNewCur = m_pView->GetViewDataEntry(pEntry);
3138 return (pViewDataNewCur == nullptr) || pViewDataNewCur->IsSelectable();
3139 }
3140 else
3141 {
3142 return false;
3143 }
3144}
3145
3146/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const LanguageTag & GetLanguageTag() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:761
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
Definition: svapp.cxx:1122
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
Definition: svapp.cxx:1146
bool IsDark() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
HelpEventMode GetMode() const
Definition: event.hxx:208
const Point & GetMousePosPixel() const
Definition: event.hxx:207
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:180
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
Definition: image.hxx:40
Size GetSizePixel() const
Definition: Image.cxx:88
SvImpLBox * pImp
Definition: svimpbox.hxx:43
void SetCursorAtPoint(const Point &rPoint, bool bDontSelectAtCursor=false) override
Definition: svimpbox.cxx:2571
void DeselectAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2592
void BeginDrag() override
Definition: svimpbox.cxx:2556
VclPtr< SvTreeListBox > pView
Definition: svimpbox.hxx:44
ImpLBSelEng(SvImpLBox *pImp, SvTreeListBox *pView)
Definition: svimpbox.cxx:2546
virtual ~ImpLBSelEng() override
Definition: svimpbox.cxx:2552
void CreateAnchor() override
Definition: svimpbox.cxx:2561
void DeselectAll() override
Definition: svimpbox.cxx:2600
bool IsSelectionAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2584
void DestroyAnchor() override
Definition: svimpbox.cxx:2566
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
void SetOrigin(const Point &rOrigin)
Definition: mapmod.cxx:103
const Point & GetOrigin() const
Definition: mapmod.cxx:148
bool IsMod1() const
Definition: event.hxx:160
bool IsMod2() const
Definition: event.hxx:162
sal_uInt16 GetClicks() const
Definition: event.hxx:126
bool IsRight() const
Definition: event.hxx:153
const Point & GetPosPixel() const
Definition: event.hxx:123
bool IsLeft() const
Definition: event.hxx:149
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
vcl::Region GetClipRegion() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:161
const Wallpaper & GetBackground() const
Definition: outdev.hxx:524
void SetLineColor()
Definition: line.cxx:37
const Color & GetLineColor() const
Definition: outdev.hxx:511
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:32
void Pop()
Definition: stack.cxx:91
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
const AllSettings & GetSettings() const
Definition: outdev.hxx:289
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
tools::Long Max() const
tools::Long Len() const
void SetThumbPos(tools::Long nThumbPos) override
Definition: scrbar.cxx:1362
void SetRange(const Range &rRange) override
Definition: scrbar.cxx:1338
Range GetRange() const override
Definition: scrbar.hxx:115
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:130
void SetEndScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:132
void SetVisibleSize(tools::Long nNewSize) override
Definition: scrbar.cxx:1376
tools::Long GetLineSize() const override
Definition: scrbar.hxx:119
void SetLineSize(tools::Long nNewSize) override
Definition: scrbar.hxx:118
void SetPageSize(tools::Long nNewSize) override
Definition: scrbar.hxx:120
tools::Long GetPageSize() const override
Definition: scrbar.hxx:121
tools::Long GetVisibleSize() const override
Definition: scrbar.hxx:123
tools::Long GetThumbPos() const override
Definition: scrbar.hxx:117
bool Command(const CommandEvent &rCEvt)
Definition: seleng.cxx:367
bool SelMouseMove(const MouseEvent &rMEvt)
Definition: seleng.cxx:312
SelectionMode GetSelectionMode() const
Definition: seleng.hxx:137
bool IsAddMode() const
Definition: seleng.hxx:174
const Point & GetMousePosPixel() const
Definition: seleng.hxx:143
void AddAlways(bool bOn)
Definition: seleng.hxx:198
bool SelMouseButtonDown(const MouseEvent &rMEvt)
Definition: seleng.cxx:115
bool IsAlwaysAdding() const
Definition: seleng.hxx:206
void EnableDrag(bool bOn)
Definition: seleng.hxx:190
void SetSelectionMode(SelectionMode eMode)
Definition: seleng.cxx:62
void CursorPosChanging(bool bShift, bool bMod1)
Definition: seleng.cxx:67
void SetFunctionSet(FunctionSet *pFuncs)
Definition: seleng.hxx:139
void SetVisibleArea(const tools::Rectangle &rNewArea)
Definition: seleng.hxx:125
void ExpandSelectionOnMouseMove(bool bExpand=true)
Definition: seleng.hxx:165
bool SelMouseButtonUp(const MouseEvent &rMEvt)
Definition: seleng.cxx:246
bool IsEmpty() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetShadowColor() const
const Color & GetLightColor() const
SvTreeListEntry * m_pStartEntry
Definition: svimpbox.hxx:191
tools::Long m_nNextVerVisSize
Definition: svimpbox.hxx:201
Idle m_aEditIdle
Definition: svimpbox.hxx:129
bool IsNodeButton(const Point &rPosPixel, const SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:1875
void PaintDDCursor(SvTreeListEntry *pEntry, bool bShow)
Definition: svimpbox.cxx:2817
void SetStyle(WinBits i_nWinStyle)
Definition: svimpbox.cxx:217
static oslInterlockedCount s_nImageRefCount
Definition: svimpbox.hxx:102
virtual void CursorUp()
Definition: svimpbox.cxx:350
ImpLBSelEng m_aFctSet
Definition: svimpbox.hxx:118
bool RequestHelp(const HelpEvent &rHEvt)
Definition: svimpbox.cxx:2907
short m_nHorSBarHeight
Definition: svimpbox.hxx:122
SvTreeListEntry * m_pActiveEntry
Definition: svimpbox.hxx:92
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: svimpbox.cxx:843
bool m_bInVScrollHdl
Definition: svimpbox.hxx:199
virtual void AdjustScrollBars(Size &rSize)
Definition: svimpbox.cxx:1107
bool ButtonDownCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1805
void EntryCollapsed(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1445
void SetNodeBmpWidth(const Image &)
Definition: svimpbox.cxx:1512
void EntrySelected(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:1532
void CollapseTo(SvTreeListEntry *pParentToCollapse)
Definition: svimpbox.cxx:2076
virtual void SyncVerThumb()
Definition: svimpbox.cxx:1366
static const Image & GetDefaultCollapsedNodeImage()
Definition: svimpbox.cxx:3119
virtual void KeyUp(bool bPageUp)
Definition: svimpbox.cxx:446
void CollapsingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1486
bool EntryReallyHit(SvTreeListEntry *pEntry, const Point &rPos, tools::Long nLine)
Definition: svimpbox.cxx:752
void Resize()
Definition: svimpbox.cxx:1235
bool IsExpandable() const
Definition: svimpbox.cxx:3070
std::unique_ptr< comphelper::string::NaturalStringSorter > m_pStringSorter
Definition: svimpbox.hxx:131
void InvalidateEntriesFrom(tools::Long nY) const
Definition: svimpbox.cxx:507
bool m_bSimpleTravel
Definition: svimpbox.hxx:200
bool GetUpdateMode() const
Definition: svimpbox.hxx:304
void Invalidate()
Definition: svimpbox.cxx:2863
void SelectEntry(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:2541
tools::Rectangle GetClipRegionRect() const
Definition: svimpbox.cxx:833
virtual void InvalidateEntry(tools::Long nY) const
Definition: svimpbox.cxx:517
SvTreeListEntry * MakePointVisible(const Point &rPoint)
Definition: svimpbox.cxx:791
static Image * s_pDefCollapsed
Definition: svimpbox.hxx:100
static const Image & GetDefaultExpandedNodeImage()
Definition: svimpbox.cxx:3112
WinBits m_nStyle
Definition: svimpbox.hxx:195
SvTreeListEntry * m_pCursor
Definition: svimpbox.hxx:189
void InitScrollBarBox()
Definition: svimpbox.cxx:1228
VclPtr< ScrollBar > m_aHorSBar
Definition: svimpbox.hxx:187
void UpdateContextBmpWidthVectorFromMovedEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:181
bool IsLineVisible(tools::Long nY) const
Definition: svimpbox.hxx:374
virtual ~SvImpLBox()
Definition: svimpbox.cxx:114
void EntryInserted(SvTreeListEntry *)
Definition: svimpbox.cxx:1743
void NotifyTabsChanged()
Definition: svimpbox.cxx:3061
void RecalcFocusRect()
Definition: svimpbox.cxx:561
void SetDragDropMode(DragDropMode eDDMode)
Definition: svimpbox.cxx:2797
virtual SvTreeListEntry * GetEntry(const Point &rPos) const
Definition: svimpbox.cxx:775
const Image & GetExpandedNodeBmp()
Definition: svimpbox.hxx:339
SvLBoxTab * m_pActiveTab
Definition: svimpbox.hxx:93
void SetSelectionMode(SelectionMode eSelMode)
Definition: svimpbox.cxx:2782
void SetNoAutoCurEntry(bool b)
Definition: svimpbox.cxx:224
bool mbNoAutoCurEntry
Definition: svimpbox.hxx:196
SelectionEngine m_aSelEng
Definition: svimpbox.hxx:197
tools::Rectangle GetVisibleArea() const
Definition: svimpbox.cxx:2855
void ExpandAll()
Definition: svimpbox.cxx:2064
SvLBoxButton * m_pActiveButton
Definition: svimpbox.hxx:91
virtual void CursorDown()
Definition: svimpbox.cxx:330
Size m_aOutputSize
Definition: svimpbox.hxx:193
virtual void UpdateAll(bool bInvalidateCompleteView)
Definition: svimpbox.cxx:670
static void implInitDefaultNodeImages()
Definition: svimpbox.cxx:3101
tools::Long m_nNodeBmpTabDistance
Definition: svimpbox.hxx:202
void UpdateContextBmpWidthMax(SvTreeListEntry const *pEntry)
Definition: svimpbox.cxx:203
bool m_bUpdateMode
Definition: svimpbox.hxx:124
const Image & GetCollapsedNodeBmp()
Definition: svimpbox.hxx:344
Point m_aEditClickPos
Definition: svimpbox.hxx:128
tools::Long m_nMostRight
Definition: svimpbox.hxx:121
void SelAllDestrAnch(bool bSelect, bool bDestroyAnchor=true, bool bSingleSelToo=false)
Definition: svimpbox.cxx:2717
void PositionScrollBars(Size &rOSize, sal_uInt16 nMask)
Definition: svimpbox.cxx:1075
short UpdateContextBmpWidthVector(SvTreeListEntry const *pEntry, short nWidth)
Definition: svimpbox.cxx:153
SvTreeListEntry * m_pMostRightEntry
Definition: svimpbox.hxx:90
SvImpLBox(SvTreeListBox *pView, SvTreeList *, WinBits nWinStyle)
Definition: svimpbox.cxx:51
void SetMostRight(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:2984
const Size & GetOutputSize() const
Definition: svimpbox.hxx:291
void SetEntryHeight()
Definition: svimpbox.cxx:1402
SvLBoxTab * NextTab(SvLBoxTab const *)
Definition: svimpbox.cxx:2961
bool ButtonUpCheckCtrl(const MouseEvent &rMEvt)
Definition: svimpbox.cxx:1851
bool ButtonDownCheckExpand(const MouseEvent &, SvTreeListEntry *)
Definition: svimpbox.cxx:1898
void SetAnchorSelection(SvTreeListEntry *pOld, SvTreeListEntry *pNewCursor)
Definition: svimpbox.cxx:2610
void EntryMoved(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1708
ImplSVEvent * m_nCurUserEvent
Definition: svimpbox.hxx:192
void StopUserEvent()
Definition: svimpbox.cxx:3092
bool mbForceMakeVisible
Definition: svimpbox.hxx:126
LBoxFlags m_nFlags
Definition: svimpbox.hxx:194
void BeginDrag()
Definition: svimpbox.cxx:2811
void SetCurEntry(SvTreeListEntry *)
Definition: svimpbox.cxx:2868
VclPtr< ScrollBar > m_aVerSBar
Definition: svimpbox.hxx:188
void SetUpdateMode(bool bMode)
Definition: svimpbox.cxx:2974
void EntryExpanded(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1424
void FindMostRight_Impl(SvTreeListEntry *pParent)
Definition: svimpbox.cxx:3047
tools::Long m_nNodeBmpWidth
Definition: svimpbox.hxx:120
void MouseButtonDown(const MouseEvent &)
Definition: svimpbox.cxx:1923
void UpdateStringSorter()
Definition: svimpbox.cxx:131
SvTreeList * m_pTree
Definition: svimpbox.hxx:88
virtual SvTreeListEntry * GetClickedEntry(const Point &) const
Definition: svimpbox.cxx:730
VclPtr< ScrollBarBox > m_aScrBarBox
Definition: svimpbox.hxx:95
std::vector< short > m_aContextBmpWidthVector
Definition: svimpbox.hxx:133
void FindMostRight()
Definition: svimpbox.cxx:3024
SvTreeListEntry * m_pCursorOld
Definition: svimpbox.hxx:190
void ShowVerSBar()
Definition: svimpbox.cxx:1302
void RemovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1559
bool MouseMoveCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry const *pEntry)
Definition: svimpbox.cxx:1824
void MovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1678
void LoseFocus()
Definition: svimpbox.cxx:2518
sal_uLong m_nVisibleCount
Definition: svimpbox.hxx:198
virtual bool KeyInput(const KeyEvent &)
Definition: svimpbox.cxx:2109
virtual Point GetEntryPosition(const SvTreeListEntry *) const
Definition: svimpbox.hxx:369
SvTreeListEntry * m_pAnchor
Definition: svimpbox.hxx:89
virtual bool IsEntryInView(SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:1377
void Command(const CommandEvent &rCEvt)
Definition: svimpbox.cxx:2833
virtual void KeyDown(bool bPageDown)
Definition: svimpbox.cxx:475
void DestroyAnchor()
Definition: svimpbox.hxx:297
bool m_bSubLstOpLR
Definition: svimpbox.hxx:125
VclPtr< SvTreeListBox > m_pView
Definition: svimpbox.hxx:186
static Image * s_pDefExpanded
Definition: svimpbox.hxx:101
void EntryRemoved()
Definition: svimpbox.cxx:1629
void Clear()
Definition: svimpbox.cxx:230
void GetFocus()
Definition: svimpbox.cxx:2497
void FillView()
Definition: svimpbox.cxx:1257
void MouseButtonUp(const MouseEvent &)
Definition: svimpbox.cxx:2015
void ScrollToAbsPos(tools::Long nPos)
Definition: svimpbox.cxx:952
void MakeVisible(SvTreeListEntry *pEntry, bool bMoveToTop=false)
Definition: svimpbox.cxx:912
virtual tools::Long GetEntryLine(const SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:1390
void MouseMove(const MouseEvent &)
Definition: svimpbox.cxx:2039
void DrawNet(vcl::RenderContext &rRenderContext)
Definition: svimpbox.cxx:981
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: svimpbox.cxx:3126
virtual void PageDown(sal_uInt16 nDelta)
Definition: svimpbox.cxx:373
void SetCursor(SvTreeListEntry *pEntry, bool bForceNoSelect=false)
Definition: svimpbox.cxx:578
void ShowCursor(bool bShow)
Definition: svimpbox.cxx:647
bool IsSelectable(const SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:3133
void KeyLeftRight(tools::Long nDiff)
Definition: svimpbox.cxx:701
void SetNodeBmpTabDistance()
Definition: svimpbox.cxx:1518
virtual void PageUp(sal_uInt16 nDelta)
Definition: svimpbox.cxx:411
short m_nVerSBarWidth
Definition: svimpbox.hxx:122
void ClickHdl(SvTreeListEntry *)
Definition: svlbitm.cxx:353
void SetStateHilighted(bool bHilight)
Definition: svlbitm.hxx:222
bool IsStateHilighted() const
Definition: svlbitm.hxx:196
const Image & GetBitmap2() const
Definition: svlbitm.hxx:281
const Image & GetBitmap1() const
Definition: svlbitm.hxx:275
int GetHeight(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
bool isEnable() const
virtual SvLBoxItemType GetType() const =0
int GetWidth(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
bool IsEditable() const
tools::Long GetPos() const
tools::Long CalcOffset(tools::Long nItemLength, tools::Long nTabWidth)
sal_uInt32 GetVisiblePos(SvTreeListEntry const *pEntry) const
Definition: treelist.hxx:267
bool IsSelected(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1325
SvTreeListEntry * NextVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:235
SvTreeListEntry * GetEntryAtAbsPos(sal_uInt32 nAbsPos) const
Definition: treelist.hxx:258
SvTreeListEntry * FirstVisible() const
Definition: treelist.hxx:232
SvTreeListEntry * PrevVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:238
bool HasViewData() const
Definition: treelist.cxx:1047
std::unique_ptr< SvTreeList > pModel
Definition: treelist.hxx:211
sal_uInt32 GetVisibleCount() const
Definition: treelist.hxx:229
bool IsEntryVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:273
sal_uInt32 GetSelectionCount() const
Definition: treelist.cxx:1044
SvTreeListEntry * NextSelected(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:255
bool IsAllExpanded(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1308
SvTreeListEntry * LastVisible() const
Definition: treelist.hxx:241
SvTreeListEntry * FirstSelected() const
Definition: treelist.hxx:252
sal_uInt32 GetAbsPos(SvTreeListEntry const *pEntry) const
Definition: treelist.hxx:264
const SvViewDataEntry * GetViewData(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1342
bool IsExpanded(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1298
SvTreeListEntry * GetEntryAtVisPos(sal_uInt32 nVisPos) const
Definition: treelist.hxx:261
void SetEntryFocus(SvTreeListEntry *pEntry, bool bFocus)
Definition: treelist.cxx:1334
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
bool mbSelectingByHover
void NotifyScrolled()
SvLBoxItem * GetItem(SvTreeListEntry *, tools::Long nX, SvLBoxTab **ppTab)
SvTreeListEntry * FirstChild(SvTreeListEntry *pParent) const
sal_uInt32 GetEntryCount() const
SvTreeListEntry * Next(SvTreeListEntry *pEntry) const
SvTreeListEntry * pHdlEntry
bool Collapse(SvTreeListEntry *pParent)
SvTreeListEntry * pEdEntry
bool Select(SvTreeListEntry *pEntry, bool bSelect=true)
SvTreeListEntry * Last() const
bool mbActivateOnSingleClick
void OnCurrentEntryChanged()
void CallImplEventListeners(VclEventId nEvent, void *pData)
sal_uInt16 TabCount() const
bool IsEditingActive() const
short GetEntryHeight() const
virtual void SetTabs()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
std::vector< std::unique_ptr< SvLBoxTab > > aTabs
short nContextBmpWidthMax
SvViewDataEntry * GetViewDataEntry(SvTreeListEntry const *pEntry) const
SvLBoxTab * GetFirstDynamicTab() const
void EndEditing(bool bCancel=false)
SvTreeListEntry * First() const
SvTreeFlags nTreeFlags
SelectionMode GetSelectionMode() const
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry *, tools::Long nLine)
VCL_DLLPRIVATE void PaintEntry1(SvTreeListEntry &, tools::Long nLine, vcl::RenderContext &rRenderContext)
void SelectAll(bool bSelect)
SvTreeListEntry * GetParent(SvTreeListEntry *pEntry) const
SvTreeList * GetModel() const
bool Expand(SvTreeListEntry *pParent)
SvLBoxTab * GetTab(SvTreeListEntry const *, SvLBoxItem const *) const
short GetIndent() const
bool DoubleClickHdl()
sal_IntPtr GetTabPos(const SvTreeListEntry *, const SvLBoxTab *) const
SvTreeListEntry * PrevSibling() const
SvTreeListEntry * NextSibling() const
const SvLBoxItem * GetFirstItem(SvLBoxItemType eType) const
bool HasChildren() const
size_t ItemCount() const
SvTLEntryFlags GetFlags() const
bool HasChildrenOnDemand() const
const SvLBoxItem & GetItem(size_t nPos) const
void SetFlags(SvTLEntryFlags nFlags)
SvTreeListEntry * LastSibling() const
SvTreeListEntry * Last() const
Definition: treelist.cxx:555
sal_uInt32 GetAbsPos(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:821
SvTreeListEntry * Next(SvTreeListEntry *pEntry, sal_uInt16 *pDepth=nullptr) const
Definition: treelist.cxx:468
bool IsChild(const SvTreeListEntry *pParent, const SvTreeListEntry *pChild) const
Definition: treelist.cxx:128
SvTreeListEntry * First() const
Definition: treelist.cxx:460
bool IsAtRootDepth(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:115
const SvTreeListEntries & GetChildList(SvTreeListEntry *pParent) const
Definition: treelist.cxx:1489
const SvTreeListEntry * GetParent(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1503
sal_uInt16 GetDepth(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:103
SvTreeListEntry * GetRootLevelParent(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1012
void InvalidateEntry(SvTreeListEntry *)
Definition: treelist.cxx:1004
View-dependent data for a tree list entry created in the virtual function SvTreeListBox::CreateViewDa...
bool HasFocus() const
bool IsSelectable() const
void SetDragTarget(bool bDragTarget)
void SetFocus(bool bFocus)
bool IsSelected() const
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:603
void Stop()
Definition: scheduler.cxx:596
Definition: timer.hxx:27
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
Definition: vclptr.hxx:58
void disposeAndClear()
Definition: vclptr.hxx:200
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
const Color & GetColor() const
Definition: wall.hxx:71
bool Contains(const Point &rPOINT) const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
void SetSize(const Size &)
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Bottom() const
bool IsMod1() const
Definition: keycod.hxx:56
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
bool IsShift() const
Definition: keycod.hxx:54
bool IsMod2() const
Definition: keycod.hxx:58
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2810
void PaintImmediately()
Definition: paint.cxx:1268
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
Definition: window2.cxx:639
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
Definition: window.cxx:3861
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1293
void HideFocus()
Definition: window2.cxx:95
void GrabFocus()
Definition: window.cxx:2983
bool HasFocus() const
Definition: window.cxx:2988
void SetMapMode()
Definition: window3.cxx:125
WinBits GetStyle() const
Definition: window2.cxx:984
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2191
const MapMode & GetMapMode() const
Definition: window3.cxx:99
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void Hide()
Definition: window.hxx:885
void ReleaseMouse()
Definition: mouse.cxx:469
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
Definition: window.cxx:2951
virtual void ShowFocus(const tools::Rectangle &rRect)
Definition: window2.cxx:53
virtual Size GetSizePixel() const
Definition: window.cxx:2406
bool IsVisible() const
Definition: window2.cxx:1133
void CaptureMouse()
Definition: mouse.cxx:451
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1288
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2816
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1299
CommandEventId
int nCount
#define DBG_ASSERT(sCon, aError)
sal_Int32 m_nFlags
sal_Int64 n
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
constexpr sal_uInt16 KEY_F2
Definition: keycodes.hxx:84
constexpr sal_uInt16 KEY_ESCAPE
Definition: keycodes.hxx:120
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
constexpr sal_uInt16 KEY_ADD
Definition: keycodes.hxx:127
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
constexpr sal_uInt16 KEY_TAB
Definition: keycodes.hxx:121
constexpr sal_uInt16 KEY_COMMA
Definition: keycodes.hxx:132
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
constexpr sal_uInt16 KEY_DELETE
Definition: keycodes.hxx:125
constexpr sal_uInt16 KEY_F8
Definition: keycodes.hxx:90
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
constexpr sal_uInt16 KEY_SPACE
Definition: keycodes.hxx:123
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
constexpr sal_uInt16 KEY_SUBTRACT
Definition: keycodes.hxx:128
constexpr sal_uInt16 KEY_DIVIDE
Definition: keycodes.hxx:130
constexpr sal_uInt16 KEY_BACKSPACE
Definition: keycodes.hxx:122
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
constexpr sal_uInt16 KEY_MULTIPLY
Definition: keycodes.hxx:129
sal_uInt16 nPos
std::unique_ptr< sal_Int32[]> pData
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
sal_uIntPtr sal_uLong
IMPL_LINK(SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar, void)
Definition: svimpbox.cxx:290
IMPL_LINK_NOARG(SvImpLBox, EndScrollHdl, ScrollBar *, void)
Definition: svimpbox.cxx:279
LBoxFlags
Definition: svimpbox.hxx:60
@ RemovedRecalcMostRight
@ IgnoreChangedTabs
@ EndScrollSetVisSize
@ RemovedEntryInvisible
#define NODE_BMP_TABDIST_NOTVALID
Definition: svimpbox.hxx:78
@ LOWEST
Low, very idle cleanup tasks.
DragDropMode
std::vector< std::unique_ptr< SvTreeListEntry > > SvTreeListEntries
SelectionMode
Definition: vclenum.hxx:26
VclEventId
Definition: vclevent.hxx:38
@ ListboxItemRemoved
WinBits const WB_NOINITIALSELECTION
Definition: wintypes.hxx:227
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_HIDESELECTION
Definition: wintypes.hxx:228
WinBits const WB_DRAG
Definition: wintypes.hxx:152
WinBits const WB_SIMPLEMODE
Definition: wintypes.hxx:201
WinBits const WB_AUTOHSCROLL
Definition: wintypes.hxx:161
WinBits const WB_HASLINESATROOT
Definition: wintypes.hxx:225
WinBits const WB_HASLINES
Definition: wintypes.hxx:224
WinBits const WB_VSCROLL
Definition: wintypes.hxx:178
WinBits const WB_HSCROLL
Definition: wintypes.hxx:177