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 );
405 }
406
407 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 );
440 }
441
442 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 );
951}
952
954{
955 if( m_pView->GetVisibleCount() == 0 )
956 return;
957 tools::Long nLastEntryPos = m_pView->GetAbsPos( m_pView->Last() );
958
959 if( nPos < 0 )
960 nPos = 0;
961 else if( nPos > nLastEntryPos )
962 nPos = nLastEntryPos;
963
965 if( !pEntry || pEntry == m_pStartEntry )
966 return;
967
970
971 if( m_pView->IsEntryVisible(pEntry) )
972 {
973 m_pStartEntry = pEntry;
974 ShowCursor( false );
976 ShowCursor( true );
977 if (GetUpdateMode())
979 }
980}
981
983{
986 {
987 return;
988 }
989
990 // for platforms that don't have nets, DrawNativeControl does nothing and returns true
991 // so that SvImpLBox::DrawNet() doesn't draw anything either
993 {
994 ImplControlValue aControlValue;
996 tools::Rectangle(), ControlState::ENABLED, aControlValue, OUString()))
997 {
998 return;
999 }
1000 }
1001
1002 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1003 tools::Long nEntryHeightDIV2 = nEntryHeight / 2;
1004 if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
1005 nEntryHeightDIV2--;
1006
1007 SvTreeListEntry* pChild;
1009
1010 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1011 while (m_pTree->GetDepth( pEntry ) > 0)
1012 {
1013 pEntry = m_pView->GetParent(pEntry);
1014 }
1015 sal_uInt16 nOffs = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pStartEntry) - m_pView->GetVisiblePos(pEntry));
1016 tools::Long nY = 0;
1017 nY -= (nOffs * nEntryHeight);
1018
1019 DBG_ASSERT(pFirstDynamicTab,"No Tree!");
1020
1021 rRenderContext.Push(vcl::PushFlags::LINECOLOR);
1022
1023 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
1024
1025 // Set color to draw the vertical and horizontal lines
1026 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
1027
1028 Point aPos1, aPos2;
1029 sal_uInt16 nDistance;
1030 sal_uLong nMax = m_nVisibleCount + nOffs + 1;
1031
1032 const Image& rExpandedNodeBitmap = GetExpandedNodeBmp();
1033
1034 for (sal_uLong n=0; n< nMax && pEntry; n++)
1035 {
1036 if (m_pView->IsExpanded(pEntry))
1037 {
1038 // draw vertical line
1039 aPos1.setX(m_pView->GetTabPos(pEntry, pFirstDynamicTab) + m_nNodeBmpTabDistance +
1040 rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1041 aPos1.setY(nY + nEntryHeight);
1042 pChild = m_pView->FirstChild(pEntry);
1043 assert(pChild && "Child?");
1044 pChild = pChild->LastSibling();
1045 nDistance = static_cast<sal_uInt16>(m_pView->GetVisiblePos(pChild) -
1046 m_pView->GetVisiblePos(pEntry));
1047 aPos2 = aPos1;
1048 aPos2.AdjustY((nDistance * nEntryHeight) - (nEntryHeightDIV2 + 2));
1049 rRenderContext.DrawLine(aPos1, aPos2);
1050 }
1051 // visible in control?
1052 if (n >= nOffs && !m_pTree->IsAtRootDepth(pEntry))
1053 {
1054 // draw horizontal line
1055 aPos1.setX(m_pView->GetTabPos(m_pView->GetParent(pEntry), pFirstDynamicTab)
1057 + rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1058 aPos1.setY(nY + nEntryHeightDIV2);
1059 aPos2 = aPos1;
1060 aPos2.AdjustX(m_pView->GetIndent() / 2);
1061 rRenderContext.DrawLine(aPos1, aPos2);
1062 }
1063 nY += nEntryHeight;
1064 pEntry = m_pView->NextVisible(pEntry);
1065 }
1066
1067 rRenderContext.Pop();
1068}
1069
1070void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
1071{
1072 tools::Long nOverlap = 0;
1073
1074 Size aVerSize( m_nVerSBarWidth, rSize.Height() );
1075 Size aHorSize( rSize.Width(), m_nHorSBarHeight );
1076
1077 if( nMask & 0x0001 )
1078 aHorSize.AdjustWidth( -m_nVerSBarWidth );
1079 if( nMask & 0x0002 )
1080 aVerSize.AdjustHeight( -m_nHorSBarHeight );
1081
1082 aVerSize.AdjustHeight(2 * nOverlap );
1083 Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap );
1084 m_aVerSBar->SetPosSizePixel( aVerPos, aVerSize );
1085
1086 aHorSize.AdjustWidth(2 * nOverlap );
1087 Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap );
1088
1089 m_aHorSBar->SetPosSizePixel( aHorPos, aHorSize );
1090
1091 if( nMask & 0x0001 )
1092 rSize.setWidth( aVerPos.X() );
1093 if( nMask & 0x0002 )
1094 rSize.setHeight( aHorPos.Y() );
1095
1096 if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) )
1097 m_aScrBarBox->Show();
1098 else
1099 m_aScrBarBox->Hide();
1100}
1101
1103{
1104 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1105 if( !nEntryHeight )
1106 return;
1107
1108 sal_uInt16 nResult = 0;
1109
1110 Size aOSize( m_pView->Control::GetOutputSizePixel() );
1111
1112 const WinBits nWindowStyle = m_pView->GetStyle();
1113 bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
1114 bool bHorBar = false;
1115 tools::Long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
1116 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1117 aOrigin.setX( aOrigin.X() * -1 );
1118 nMaxRight += aOrigin.X() - 1;
1119 tools::Long nVis = m_nMostRight - aOrigin.X();
1120 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1121 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1122 {
1123 bHorBar = true;
1124 }
1125
1126 // number of entries that are not collapsed
1127 sal_uLong nTotalCount = m_pView->GetVisibleCount();
1128
1129 // number of entries visible within the view
1130 m_nVisibleCount = o3tl::make_unsigned(aOSize.Height() / nEntryHeight);
1131
1132 // do we need a vertical scrollbar?
1133 if( bVerSBar || nTotalCount > m_nVisibleCount )
1134 {
1135 nResult = 1;
1136 nMaxRight -= m_nVerSBarWidth;
1137 if( !bHorBar )
1138 {
1139 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1140 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1141 bHorBar = true;
1142 }
1143 }
1144
1145 // do we need a horizontal scrollbar?
1146 if( bHorBar )
1147 {
1148 nResult |= 0x0002;
1149 // the number of entries visible within the view has to be recalculated
1150 // because the horizontal scrollbar is now visible.
1151 m_nVisibleCount = o3tl::make_unsigned(std::max<tools::Long>(0, aOSize.Height() - m_nHorSBarHeight) / nEntryHeight);
1152 // we might actually need a vertical scrollbar now
1153 if( !(nResult & 0x0001) &&
1154 ((nTotalCount > m_nVisibleCount) || bVerSBar) )
1155 {
1156 nResult = 3;
1157 }
1158 }
1159
1160 PositionScrollBars( aOSize, nResult );
1161
1162 // adapt Range, VisibleRange etc.
1163
1164 // refresh output size, in case we have to scroll
1165 tools::Rectangle aRect;
1166 aRect.SetSize( aOSize );
1167 m_aSelEng.SetVisibleArea( aRect );
1168
1169 // vertical scrollbar
1170 tools::Long nTemp = static_cast<tools::Long>(m_nVisibleCount);
1171 nTemp--;
1172 if( nTemp != m_aVerSBar->GetVisibleSize() )
1173 {
1174 if( !m_bInVScrollHdl )
1175 {
1176 m_aVerSBar->SetPageSize( nTemp - 1 );
1177 m_aVerSBar->SetVisibleSize( nTemp );
1178 }
1179 else
1180 {
1182 m_nNextVerVisSize = nTemp;
1183 }
1184 }
1185
1186 // horizontal scrollbar
1187 nTemp = m_aHorSBar->GetThumbPos();
1188 m_aHorSBar->SetVisibleSize( aOSize.Width() );
1189 tools::Long nNewThumbPos = m_aHorSBar->GetThumbPos();
1190 Range aRange( m_aHorSBar->GetRange() );
1191 if( aRange.Max() < m_nMostRight+25 )
1192 {
1193 aRange.Max() = m_nMostRight+25;
1194 m_aHorSBar->SetRange( aRange );
1195 }
1196
1197 if( nTemp != nNewThumbPos )
1198 {
1199 nTemp = nNewThumbPos - nTemp;
1200 if( m_pView->IsEditingActive() )
1201 {
1202 m_pView->EndEditing( true ); // Cancel
1204 }
1205 m_pView->nFocusWidth = -1;
1206 KeyLeftRight( nTemp );
1207 }
1208
1209 if( nResult & 0x0001 )
1210 m_aVerSBar->Show();
1211 else
1212 m_aVerSBar->Hide();
1213
1214 if( nResult & 0x0002 )
1215 m_aHorSBar->Show();
1216 else
1217 {
1218 m_aHorSBar->Hide();
1219 }
1220 rSize = aOSize;
1221}
1222
1224{
1226 Size aSize( m_pView->Control::GetOutputSizePixel() );
1228}
1229
1231{
1232 m_aOutputSize = m_pView->Control::GetOutputSizePixel();
1233 if( m_aOutputSize.IsEmpty() )
1234 return;
1237
1238 if( m_pView->GetEntryHeight())
1239 {
1241 UpdateAll(false);
1242 }
1243 // HACK, as in floating and docked windows the scrollbars might not be drawn
1244 // correctly/not be drawn at all after resizing!
1245 if( m_aHorSBar->IsVisible())
1247 if( m_aVerSBar->IsVisible())
1250}
1251
1253{
1254 if( !m_pStartEntry )
1255 {
1256 sal_uLong nVisibleViewCount = m_pView->GetVisibleCount();
1257 tools::Long nTempThumb = m_aVerSBar->GetThumbPos();
1258 if( nTempThumb < 0 )
1259 nTempThumb = 0;
1260 else if( o3tl::make_unsigned(nTempThumb) >= nVisibleViewCount )
1261 nTempThumb = nVisibleViewCount == 0 ? 0 : nVisibleViewCount - 1;
1262 m_pStartEntry = m_pView->GetEntryAtVisPos(nTempThumb);
1263 }
1264 if( !m_pStartEntry )
1265 return;
1266
1267 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1268 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1269 sal_uLong nCurDispEntries = nLast-nThumb+1;
1270 if( nCurDispEntries >= m_nVisibleCount )
1271 return;
1272
1273 ShowCursor( false );
1274 // fill window by moving the thumb up incrementally
1275 bool bFound = false;
1277 while( nCurDispEntries < m_nVisibleCount && pTemp )
1278 {
1280 if( pTemp )
1281 {
1282 nThumb--;
1283 m_pStartEntry = pTemp;
1284 nCurDispEntries++;
1285 bFound = true;
1286 }
1287 }
1288 if( bFound )
1289 {
1290 m_aVerSBar->SetThumbPos( nThumb );
1291 ShowCursor( true ); // recalculate focus rectangle
1293 }
1294}
1295
1296
1298{
1299 bool bVerBar = ( m_pView->GetStyle() & WB_VSCROLL ) != 0;
1300 sal_uLong nVis = 0;
1301 if( !bVerBar )
1302 nVis = m_pView->GetVisibleCount();
1303 if( bVerBar || (m_nVisibleCount && nVis > static_cast<sal_uLong>(m_nVisibleCount-1)) )
1304 {
1305 if( !m_aVerSBar->IsVisible() )
1306 {
1307 m_pView->nFocusWidth = -1;
1309 if( GetUpdateMode() )
1311 }
1312 }
1313 else
1314 {
1315 if( m_aVerSBar->IsVisible() )
1316 {
1317 m_pView->nFocusWidth = -1;
1319 }
1320 }
1321
1322 tools::Long nMaxRight = GetOutputSize().Width();
1323 Point aPos( m_pView->GetMapMode().GetOrigin() );
1324 aPos.setX( aPos.X() * -1 ); // convert document coordinates
1325 nMaxRight = nMaxRight + aPos.X() - 1;
1326 if( nMaxRight < m_nMostRight )
1327 {
1328 if( !m_aHorSBar->IsVisible() )
1329 {
1330 m_pView->nFocusWidth = -1;
1332 if( GetUpdateMode() )
1334 }
1335 else
1336 {
1337 Range aRange( m_aHorSBar->GetRange() );
1338 if( aRange.Max() < m_nMostRight+25 )
1339 {
1340 aRange.Max() = m_nMostRight+25;
1341 m_aHorSBar->SetRange( aRange );
1342 }
1343 else
1344 {
1345 m_pView->nFocusWidth = -1;
1347 }
1348 }
1349 }
1350 else
1351 {
1352 if( m_aHorSBar->IsVisible() )
1353 {
1354 m_pView->nFocusWidth = -1;
1356 }
1357 }
1358}
1359
1360
1362{
1363 if( m_pStartEntry )
1364 {
1366 m_aVerSBar->SetThumbPos( nEntryPos );
1367 }
1368 else
1369 m_aVerSBar->SetThumbPos( 0 );
1370}
1371
1373{
1374 // parent collapsed
1375 if( !m_pView->IsEntryVisible(pEntry) )
1376 return false;
1377 tools::Long nY = GetEntryLine( pEntry );
1378 if( nY < 0 )
1379 return false;
1381 return nY < nMax;
1382}
1383
1384
1386{
1387 if(!m_pStartEntry )
1388 return -1; // invisible position
1389
1391 tools::Long nEntryVisPos = m_pView->GetVisiblePos( pEntry );
1392 nFirstVisPos = nEntryVisPos - nFirstVisPos;
1393 nFirstVisPos *= m_pView->GetEntryHeight();
1394 return nFirstVisPos;
1395}
1396
1398{
1401 if(!m_pView->HasViewData()) // are we within the Clear?
1402 {
1403 Size aSize = m_pView->Control::GetOutputSizePixel();
1404 AdjustScrollBars( aSize );
1405 }
1406 else
1407 {
1408 Resize();
1409 if( GetUpdateMode() )
1411 }
1412}
1413
1414
1415// ***********************************************************************
1416// Callback Functions
1417// ***********************************************************************
1418
1420{
1421 // SelAllDestrAnch( false, true ); //DeselectAll();
1422 if( !GetUpdateMode() )
1423 return;
1424
1425 ShowCursor( false );
1426 tools::Long nY = GetEntryLine( pEntry );
1427 if( IsLineVisible(nY) )
1428 {
1430 FindMostRight( pEntry );
1431 }
1433 // if we expanded before the thumb, the thumb's position has to be
1434 // corrected
1435 SyncVerThumb();
1436 ShowVerSBar();
1437 ShowCursor( true );
1438}
1439
1441{
1442 if( !m_pView->IsEntryVisible( pEntry ) )
1443 return;
1444
1445 ShowCursor( false );
1446
1448 {
1449 FindMostRight();
1450 }
1451
1452 if( m_pStartEntry )
1453 {
1454 tools::Long nOldThumbPos = m_aVerSBar->GetThumbPos();
1455 sal_uLong nVisList = m_pView->GetVisibleCount();
1456 m_aVerSBar->SetRange( Range(0, nVisList-1) );
1457 tools::Long nNewThumbPos = m_aVerSBar->GetThumbPos();
1458 if( nNewThumbPos != nOldThumbPos )
1459 {
1461 sal_uInt16 nDistance = static_cast<sal_uInt16>(nNewThumbPos);
1462 if( nDistance )
1464 if( GetUpdateMode() )
1466 }
1467 else
1468 SyncVerThumb();
1469 ShowVerSBar();
1470 }
1471 // has the cursor been collapsed?
1472 if( m_pTree->IsChild( pEntry, m_pCursor ) )
1473 SetCursor( pEntry );
1474 if( GetUpdateMode() )
1475 ShowVerSBar();
1476 ShowCursor( true );
1477 if( GetUpdateMode() && m_pCursor )
1479}
1480
1482{
1483 if( !m_pView->IsEntryVisible( pEntry ) || !m_pStartEntry )
1484 return;
1485
1486 SelAllDestrAnch( false ); // deselect all
1487
1488 // is the collapsed cursor visible?
1489 tools::Long nY = GetEntryLine( pEntry );
1490 if( IsLineVisible(nY) )
1491 {
1492 if( GetUpdateMode() )
1494 }
1495 else
1496 {
1497 if( m_pTree->IsChild(pEntry, m_pStartEntry) )
1498 {
1499 m_pStartEntry = pEntry;
1500 if( GetUpdateMode() )
1502 }
1503 }
1504}
1505
1506
1508{
1509 const Size aSize( rBmp.GetSizePixel() );
1510 m_nNodeBmpWidth = aSize.Width();
1511}
1512
1514{
1517 {
1518 // only if the first dynamic tab is centered (we currently assume that)
1520 m_nNodeBmpTabDistance -= aSize.Width() / 2;
1521 }
1522}
1523
1524
1525// corrects the cursor when using SingleSelection
1526
1527void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect )
1528{
1530 return;
1531
1533 if( bSelect &&
1535 pEntry != m_pCursor )
1536 {
1537 SetCursor( pEntry );
1538 DBG_ASSERT(m_pView->GetSelectionCount()==1,"selection count?");
1539 }
1540
1541 if( GetUpdateMode() && m_pView->IsEntryVisible(pEntry) )
1542 {
1543 tools::Long nY = GetEntryLine( pEntry );
1544 if( IsLineVisible( nY ) )
1545 {
1546 ShowCursor(false);
1547 InvalidateEntry(pEntry);
1548 ShowCursor(true);
1549 }
1550 }
1551}
1552
1553
1555{
1557
1558 DestroyAnchor();
1559
1560 if( !m_pView->IsEntryVisible( pEntry ) )
1561 {
1562 // if parent is collapsed => bye!
1564 return;
1565 }
1566
1567 if( pEntry == m_pMostRightEntry || (
1568 pEntry->HasChildren() && m_pView->IsExpanded(pEntry) &&
1570 {
1572 }
1573
1574 SvTreeListEntry* pOldStartEntry = m_pStartEntry;
1575
1576 SvTreeListEntry* pParent = m_pView->GetModel()->GetParent(pEntry);
1577
1578 if (pParent && m_pView->GetModel()->GetChildList(pParent).size() == 1)
1579 {
1580 DBG_ASSERT( m_pView->IsExpanded( pParent ), "Parent not expanded");
1581 pParent->SetFlags( pParent->GetFlags() | SvTLEntryFlags::NO_NODEBMP);
1582 InvalidateEntry( pParent );
1583 }
1584
1585 if( m_pCursor && m_pTree->IsChild( pEntry, m_pCursor) )
1586 m_pCursor = pEntry;
1587 if( m_pStartEntry && m_pTree->IsChild(pEntry,m_pStartEntry) )
1588 m_pStartEntry = pEntry;
1589
1590 SvTreeListEntry* pTemp;
1591 if( m_pCursor && m_pCursor == pEntry )
1592 {
1593 if( m_bSimpleTravel )
1594 m_pView->Select( m_pCursor, false );
1595 ShowCursor( false ); // focus rectangle gone
1596 // NextSibling, because we also delete the children of the cursor
1597 pTemp = m_pCursor->NextSibling();
1598 if( !pTemp )
1599 pTemp = m_pView->PrevVisible(m_pCursor);
1600
1601 SetCursor( pTemp, true );
1602 }
1603 if( m_pStartEntry && m_pStartEntry == pEntry )
1604 {
1605 pTemp = m_pStartEntry->NextSibling();
1606 if( !pTemp )
1608 m_pStartEntry = pTemp;
1609 }
1610 if( GetUpdateMode())
1611 {
1612 // if it is the last one, we have to invalidate it, so the lines are
1613 // drawn correctly (in this case they're deleted)
1614 if( m_pStartEntry && (m_pStartEntry != pOldStartEntry || pEntry == m_pView->GetModel()->Last()) )
1615 {
1618 }
1619 else
1621 }
1622}
1623
1625{
1627 {
1629 return;
1630 }
1631 if( !m_pStartEntry )
1633 if( !m_pCursor )
1634 SetCursor( m_pStartEntry, true );
1635
1638
1639 if( GetUpdateMode())
1640 {
1642 FindMostRight();
1644 FillView();
1645 if( m_pStartEntry )
1646 // if something above the thumb was deleted
1648
1649 ShowVerSBar();
1651 {
1652 if( m_pView->GetSelectionCount() )
1653 {
1654 // is a neighboring entry selected?
1655 SvTreeListEntry* pNextCursor = m_pView->PrevVisible( m_pCursor );
1656 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1657 pNextCursor = m_pView->NextVisible( m_pCursor );
1658 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1659 // no neighbor selected: use first selected
1660 pNextCursor = m_pView->FirstSelected();
1661 SetCursor( pNextCursor );
1663 }
1664 else
1666 }
1667 ShowCursor( true );
1668 }
1670}
1671
1672
1674{
1675 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1676 SelAllDestrAnch( false ); // DeselectAll();
1677 if( !bDeselAll )
1679
1680 if( pEntry == m_pCursor )
1681 ShowCursor( false );
1682 if( IsEntryInView( pEntry ) )
1684 if( pEntry != m_pStartEntry )
1685 return;
1686
1687 SvTreeListEntry* pNew = nullptr;
1688 if( !pEntry->HasChildren() )
1689 {
1691 if( !pNew )
1693 }
1694 else
1695 {
1696 pNew = pEntry->NextSibling();
1697 if( !pNew )
1698 pNew = pEntry->PrevSibling();
1699 }
1700 m_pStartEntry = pNew;
1701}
1702
1704{
1706
1707 if ( !m_pStartEntry )
1708 // this might happen if the only entry in the view is moved to its very same position
1709 // #i97346#
1711
1713 sal_uInt16 nFirstPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( m_pStartEntry ));
1714 sal_uInt16 nNewPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( pEntry ));
1715 FindMostRight();
1716 if( nNewPos < nFirstPos ) // HACK!
1717 m_pStartEntry = pEntry;
1718 SyncVerThumb();
1719 if( pEntry == m_pCursor )
1720 {
1722 ShowCursor( true );
1723 else
1724 {
1725 SvTreeListEntry* pParent = pEntry;
1726 do {
1727 pParent = m_pTree->GetParent( pParent );
1728 }
1729 while( !m_pView->IsEntryVisible( pParent ) );
1730 SetCursor( pParent );
1731 }
1732 }
1733 if( IsEntryInView( pEntry ) )
1735}
1736
1737
1739{
1740 if( !GetUpdateMode() )
1741 return;
1742
1743 SvTreeListEntry* pParent = m_pTree->GetParent(pEntry);
1744 if (pParent && m_pTree->GetChildList(pParent).size() == 1)
1745 // draw plus sign
1746 m_pTree->InvalidateEntry( pParent );
1747
1748 if( !m_pView->IsEntryVisible( pEntry ) )
1749 return;
1750 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1751 if( bDeselAll )
1752 SelAllDestrAnch( false );
1753 else
1754 DestroyAnchor();
1755 // nFlags &= (~LBoxFlags::DeselectAll);
1756// ShowCursor( false ); // if cursor is moved lower
1757 tools::Long nY = GetEntryLine( pEntry );
1758 bool bEntryVisible = IsLineVisible( nY );
1759 if( bEntryVisible )
1760 {
1761 ShowCursor( false ); // if cursor is moved lower
1762 nY -= m_pView->GetEntryHeight(); // because of lines
1764 }
1765 else if( m_pStartEntry && nY < GetEntryLine(m_pStartEntry) )
1766 {
1767 // Check if the view is filled completely. If not, then adjust
1768 // pStartEntry and the Cursor (automatic scrolling).
1769 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1770 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1771 sal_uInt16 nCurDispEntries = nLast-nThumb+1;
1772 if( nCurDispEntries < m_nVisibleCount )
1773 {
1774 // set at the next paint event
1775 m_pStartEntry = nullptr;
1776 SetCursor( nullptr );
1778 }
1779 }
1780 else if( !m_pStartEntry )
1782
1783 SetMostRight( pEntry );
1785 SyncVerThumb(); // if something was inserted before the thumb
1786 ShowVerSBar();
1787 ShowCursor( true );
1790}
1791
1792
1793// ********************************************************************
1794// Event handler
1795// ********************************************************************
1796
1797
1798// ****** Control the control animation
1799
1801{
1802 SvLBoxItem* pItem = m_pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&m_pActiveTab);
1803 if (pItem && pItem->GetType() == SvLBoxItemType::Button)
1804 {
1805 m_pActiveButton = static_cast<SvLBoxButton*>(pItem);
1806 m_pActiveEntry = pEntry;
1807 if( m_pCursor == m_pActiveEntry )
1808 m_pView->HideFocus();
1812 return true;
1813 }
1814 else
1815 m_pActiveButton = nullptr;
1816 return false;
1817}
1818
1820{
1821 if( m_pActiveButton )
1822 {
1823 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1824 if( pEntry == m_pActiveEntry &&
1826 {
1828 {
1831 }
1832 }
1833 else
1834 {
1836 {
1839 }
1840 }
1841 return true;
1842 }
1843 return false;
1844}
1845
1847{
1849 {
1851 SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
1853 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1854 if (pEntry == m_pActiveEntry && m_pView->GetItem(m_pActiveEntry, nMouseX) == m_pActiveButton)
1858 ShowCursor(true);
1859 m_pActiveButton = nullptr;
1860 m_pActiveEntry = nullptr;
1861 m_pActiveTab = nullptr;
1862 return true;
1863 }
1864 return false;
1865}
1866
1867// ******* Control plus/minus button for expanding/collapsing
1868
1869// false == no expand/collapse button hit
1870bool SvImpLBox::IsNodeButton( const Point& rPosPixel, const SvTreeListEntry* pEntry ) const
1871{
1872 if( !pEntry->HasChildren() && !pEntry->HasChildrenOnDemand() )
1873 return false;
1874
1875 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1876 if( !pFirstDynamicTab )
1877 return false;
1878
1879 tools::Long nMouseX = rPosPixel.X();
1880 // convert to document coordinates
1881 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1882 nMouseX -= aOrigin.X();
1883
1884 tools::Long nX = m_pView->GetTabPos( pEntry, pFirstDynamicTab);
1886 if( nMouseX < nX )
1887 return false;
1888 nX += m_nNodeBmpWidth;
1889 return nMouseX <= nX;
1890}
1891
1892// false == hit no node button
1894{
1895 bool bRet = false;
1896
1897 if ( m_pView->IsEditingActive() && pEntry == m_pView->pEdEntry )
1898 // inplace editing -> nothing to do
1899 bRet = true;
1900 else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
1901 {
1902 if ( m_pView->IsExpanded( pEntry ) )
1903 {
1904 m_pView->EndEditing( true );
1905 m_pView->Collapse( pEntry );
1906 }
1907 else
1908 {
1909 // you can expand an entry, which is in editing
1910 m_pView->Expand( pEntry );
1911 }
1912 bRet = true;
1913 }
1914
1915 return bRet;
1916}
1917
1919{
1920 if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
1921 return;
1922
1923 m_aEditIdle.Stop();
1924 Point aPos( rMEvt.GetPosPixel());
1925
1926 if( aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height() )
1927 return;
1928
1929 if( !m_pCursor )
1932 m_pView->GrabFocus();
1933 //fdo#82270 Grabbing focus can invalidate the entries, re-fetch
1934 SvTreeListEntry* pEntry = GetEntry(aPos);
1935 // the entry can still be invalid!
1936 if( !pEntry || !m_pView->GetViewData( pEntry ))
1937 return;
1938
1939 tools::Long nY = GetEntryLine( pEntry );
1940 // Node-Button?
1941 if( ButtonDownCheckExpand( rMEvt, pEntry ) )
1942 return;
1943
1944 if( !EntryReallyHit(pEntry,aPos,nY))
1945 return;
1946
1947 SvLBoxItem* pXItem = m_pView->GetItem( pEntry, aPos.X() );
1948 if( pXItem )
1949 {
1950 SvLBoxTab* pXTab = m_pView->GetTab( pEntry, pXItem );
1951 if ( !rMEvt.IsMod1() && !rMEvt.IsMod2() && rMEvt.IsLeft() && pXTab->IsEditable()
1952 && pEntry == m_pView->FirstSelected() && nullptr == m_pView->NextSelected( pEntry ) )
1953 // #i8234# FirstSelected() and NextSelected() ensures, that inplace editing is only triggered, when only one entry is selected
1955 if ( !m_pView->IsSelected( pEntry ) )
1957 }
1958
1959
1960 if( (rMEvt.GetClicks() % 2) == 0)
1961 {
1963 m_pView->pHdlEntry = pEntry;
1964 if( !m_pView->DoubleClickHdl() )
1965 {
1966 // Handler signals nothing to be done anymore, bail out, 'this' may
1967 // even be dead and destroyed.
1968 return;
1969 }
1970 else
1971 {
1972 // if the entry was deleted within the handler
1973 pEntry = GetClickedEntry( aPos );
1974 if( !pEntry )
1975 return;
1976 if( pEntry != m_pView->pHdlEntry )
1977 {
1978 // select anew & bye
1980 SelAllDestrAnch( false ); // DeselectAll();
1981 SetCursor( pEntry );
1982
1983 return;
1984 }
1985 if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
1986 {
1987 if( m_pView->IsExpanded(pEntry) )
1988 m_pView->Collapse( pEntry );
1989 else
1990 m_pView->Expand( pEntry );
1991 if( pEntry == m_pCursor ) // only if Entryitem was clicked
1992 // (Nodebutton is not an Entryitem!)
1994 return;
1995 }
1996 }
1997 }
1998 else
1999 {
2000 // CheckButton? (TreeListBox: Check + Info)
2001 if( ButtonDownCheckCtrl(rMEvt, pEntry) )
2002 return;
2003 // Inplace-Editing?
2004 }
2006 && !rMEvt.IsRight() ) // tdf#128824
2008}
2009
2011{
2013 m_aSelEng.SelMouseButtonUp( rMEvt );
2015 {
2017 m_aEditClickPos = rMEvt.GetPosPixel();
2019 }
2020
2022 {
2023 Point aPos(rMEvt.GetPosPixel());
2024 SvTreeListEntry* pEntry = GetEntry(aPos);
2025 // tdf#143245 ActivateOnSingleClick only
2026 // if the 'up' is at the active entry
2027 // typically selected by the 'down'
2028 if (!pEntry || pEntry != m_pCursor)
2029 return;
2031 }
2032}
2033
2035{
2036 Point aPos = rMEvt.GetPosPixel();
2037 SvTreeListEntry* pEntry = GetClickedEntry(aPos);
2038 if ( MouseMoveCheckCtrl( rMEvt, pEntry ) || ( m_aSelEng.GetSelectionMode() == SelectionMode::NONE ) )
2039 return;
2040
2041 m_aSelEng.SelMouseMove(rMEvt);
2043 {
2044 if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height())
2045 pEntry = nullptr;
2046 else
2047 pEntry = GetEntry(aPos);
2048 if (!pEntry)
2049 m_pView->SelectAll(false);
2050 else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
2051 {
2053 m_pView->Select(pEntry);
2054 m_pView->mbSelectingByHover = false;
2055 }
2056 }
2057}
2058
2060{
2061 sal_uInt16 nRefDepth = m_pTree->GetDepth(m_pCursor);
2063 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2064 {
2065 if (pCur->HasChildren() && !m_pView->IsExpanded(pCur))
2066 m_pView->Expand(pCur);
2067 pCur = m_pTree->Next(pCur);
2068 }
2069}
2070
2072{
2073 // collapse all parents until we get to the given parent to collapse
2074 if (!pParentToCollapse)
2075 return;
2076
2077 sal_uInt16 nRefDepth;
2078 // special case explorer: if the root only has a single
2079 // entry, don't collapse the root entry
2080 if (m_pTree->GetChildList(nullptr).size() < 2)
2081 {
2082 nRefDepth = 1;
2083 pParentToCollapse = m_pCursor;
2084 while (m_pTree->GetParent(pParentToCollapse)
2085 && m_pTree->GetDepth(m_pTree->GetParent(pParentToCollapse)) > 0)
2086 {
2087 pParentToCollapse = m_pTree->GetParent(pParentToCollapse);
2088 }
2089 }
2090 else
2091 nRefDepth = m_pTree->GetDepth(pParentToCollapse);
2092
2093 if (m_pView->IsExpanded(pParentToCollapse))
2094 m_pView->Collapse(pParentToCollapse);
2095 SvTreeListEntry* pCur = m_pTree->Next(pParentToCollapse);
2096 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2097 {
2098 if (pCur->HasChildren() && m_pView->IsExpanded(pCur))
2099 m_pView->Collapse(pCur);
2100 pCur = m_pTree->Next(pCur);
2101 }
2102}
2103
2105{
2106 m_aEditIdle.Stop();
2107 const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
2108
2109 if( rKeyCode.IsMod2() )
2110 return false; // don't evaluate Alt key
2111
2113
2114 if( !m_pCursor )
2116 if( !m_pCursor )
2117 return false;
2118
2119 bool bKeyUsed = true;
2120
2121 sal_uInt16 nDelta = static_cast<sal_uInt16>(m_aVerSBar->GetPageSize());
2122 sal_uInt16 aCode = rKeyCode.GetCode();
2123
2124 bool bShift = rKeyCode.IsShift();
2125 bool bMod1 = rKeyCode.IsMod1();
2126
2127 SvTreeListEntry* pNewCursor;
2128
2129 switch( aCode )
2130 {
2131 case KEY_UP:
2132 if( !IsEntryInView( m_pCursor ) )
2134
2135 pNewCursor = m_pCursor;
2136 do
2137 {
2138 pNewCursor = m_pView->PrevVisible(pNewCursor);
2139 } while( pNewCursor && !IsSelectable(pNewCursor) );
2140
2141 // if there is no next entry, take the current one
2142 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2143 // the cursor key
2144 if (!pNewCursor)
2145 pNewCursor = m_pCursor;
2146
2147 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2148 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2149 if( !IsEntryInView( pNewCursor ) )
2150 KeyUp( false );
2151 break;
2152
2153 case KEY_DOWN:
2154 if( !IsEntryInView( m_pCursor ) )
2156
2157 pNewCursor = m_pCursor;
2158 do
2159 {
2160 pNewCursor = m_pView->NextVisible(pNewCursor);
2161 } while( pNewCursor && !IsSelectable(pNewCursor) );
2162
2163 // if there is no next entry, take the current one
2164 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2165 // the cursor key
2166 // 06.09.20001 - 83416 - frank.schoenheit@sun.com
2167 if ( !pNewCursor && m_pCursor )
2168 pNewCursor = m_pCursor;
2169
2170 if( pNewCursor )
2171 {
2172 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2173 if( IsEntryInView( pNewCursor ) )
2174 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2175 else
2176 {
2177 if( m_pCursor )
2178 m_pView->Select( m_pCursor, false );
2179 KeyDown( false );
2180 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2181 }
2182 }
2183 else
2184 KeyDown( false ); // because scrollbar range might still
2185 // allow scrolling
2186 break;
2187
2188 case KEY_RIGHT:
2189 {
2190 if( m_bSubLstOpLR )
2191 {
2192 // only try to expand if sublist is expandable,
2193 // otherwise ignore the key press
2196 }
2197 else if (m_aHorSBar->IsVisible())
2198 {
2200 nThumb += m_aHorSBar->GetLineSize();
2201 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2202 m_aHorSBar->SetThumbPos( nThumb );
2203 nThumb = nOldThumb;
2204 nThumb -= m_aHorSBar->GetThumbPos();
2205 nThumb *= -1;
2206 if( nThumb )
2207 {
2208 KeyLeftRight( nThumb );
2209 }
2210 }
2211 else
2212 bKeyUsed = false;
2213 break;
2214 }
2215
2216 case KEY_LEFT:
2217 {
2218 if (m_aHorSBar->IsVisible())
2219 {
2221 nThumb -= m_aHorSBar->GetLineSize();
2222 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2223 m_aHorSBar->SetThumbPos( nThumb );
2224 nThumb = nOldThumb;
2225 nThumb -= m_aHorSBar->GetThumbPos();
2226 if( nThumb )
2227 {
2228 KeyLeftRight( -nThumb );
2229 }
2230 else if( m_bSubLstOpLR )
2231 {
2234 else
2235 {
2236 pNewCursor = m_pView->GetParent( m_pCursor );
2237 if( pNewCursor )
2238 SetCursor( pNewCursor );
2239 }
2240 }
2241 }
2242 else if( m_bSubLstOpLR )
2243 {
2246 else
2247 {
2248 pNewCursor = m_pView->GetParent( m_pCursor );
2249 if( pNewCursor )
2250 SetCursor( pNewCursor );
2251 }
2252 }
2253 else
2254 bKeyUsed = false;
2255 break;
2256 }
2257
2258 case KEY_PAGEUP:
2259 if( !bMod1 )
2260 {
2261 pNewCursor = m_pView->PrevVisible(m_pCursor, nDelta);
2262
2263 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2264 {
2265 pNewCursor = m_pView->NextVisible(pNewCursor);
2266 nDelta--;
2267 }
2268
2269 if( nDelta )
2270 {
2271 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2272 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2273 if( IsEntryInView( pNewCursor ) )
2274 SetCursor( pNewCursor );
2275 else
2276 {
2277 SetCursor( pNewCursor );
2278 KeyUp( true );
2279 }
2280 }
2281 }
2282 else
2283 bKeyUsed = false;
2284 break;
2285
2286 case KEY_PAGEDOWN:
2287 if( !bMod1 )
2288 {
2289 pNewCursor= m_pView->NextVisible(m_pCursor, nDelta);
2290
2291 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2292 {
2293 pNewCursor = m_pView->PrevVisible(pNewCursor);
2294 nDelta--;
2295 }
2296
2297 if( nDelta && pNewCursor )
2298 {
2299 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2300 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2301 if( IsEntryInView( pNewCursor ) )
2302 SetCursor( pNewCursor );
2303 else
2304 {
2305 SetCursor( pNewCursor );
2306 KeyDown( true );
2307 }
2308 }
2309 else
2310 KeyDown( false ); // see also: KEY_DOWN
2311 }
2312 else
2313 bKeyUsed = false;
2314 break;
2315
2316 case KEY_SPACE:
2318 {
2319 if ( bMod1 )
2320 {
2321 if ( m_pView->GetSelectionMode() == SelectionMode::Multiple && !bShift )
2322 // toggle selection
2324 }
2325 else if ( !bShift /*&& !bMod1*/ )
2326 {
2327 if ( m_aSelEng.IsAddMode() )
2328 {
2329 // toggle selection
2331 }
2332 else if ( !m_pView->IsSelected( m_pCursor ) )
2333 {
2334 SelAllDestrAnch( false );
2336 }
2337 else
2338 bKeyUsed = false;
2339 }
2340 else
2341 bKeyUsed = false;
2342 }
2343 else
2344 bKeyUsed = false;
2345 break;
2346
2347 case KEY_RETURN:
2348 bKeyUsed = !m_pView->DoubleClickHdl();
2349 break;
2350
2351 case KEY_F2:
2352 if( !bShift && !bMod1 )
2353 {
2354 m_aEditClickPos = Point( -1, -1 );
2355 EditTimerCall( nullptr );
2356 }
2357 else
2358 bKeyUsed = false;
2359 break;
2360
2361 case KEY_F8:
2364 {
2366 m_aSelEng.AddAlways( false );
2367 else
2368 m_aSelEng.AddAlways( true );
2369 }
2370 else
2371 bKeyUsed = false;
2372 break;
2373
2374 case KEY_ADD:
2377 if (bMod1)
2378 ExpandAll();
2379 break;
2380
2381 case KEY_A:
2382 if( bMod1 )
2383 SelAllDestrAnch( true );
2384 else
2385 bKeyUsed = false;
2386 break;
2387
2388 case KEY_SUBTRACT:
2390 {
2391 if (bMod1)
2393 else
2395 }
2396 break;
2397
2398 case KEY_MULTIPLY:
2399 if( bMod1 )
2400 {
2401 // only try to expand/collapse if sublist is expandable,
2402 // otherwise ignore the key press
2403 if( IsExpandable() )
2404 {
2406 {
2408 ExpandAll();
2409 }
2410 else
2412 }
2413 }
2414 else
2415 bKeyUsed = false;
2416 break;
2417
2418 case KEY_DIVIDE :
2419 if( bMod1 )
2420 SelAllDestrAnch( true );
2421 else
2422 bKeyUsed = false;
2423 break;
2424
2425 case KEY_COMMA :
2426 if( bMod1 )
2427 SelAllDestrAnch( false );
2428 else
2429 bKeyUsed = false;
2430 break;
2431
2432 case KEY_HOME :
2433 pNewCursor = m_pView->GetModel()->First();
2434
2435 while( pNewCursor && !IsSelectable(pNewCursor) )
2436 {
2437 pNewCursor = m_pView->NextVisible(pNewCursor);
2438 }
2439
2440 if( pNewCursor && pNewCursor != m_pCursor )
2441 {
2442// SelAllDestrAnch( false );
2443 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2444 SetCursor( pNewCursor );
2445 if( !IsEntryInView( pNewCursor ) )
2446 MakeVisible( pNewCursor );
2447 }
2448 else
2449 bKeyUsed = false;
2450 break;
2451
2452 case KEY_END :
2453 pNewCursor = m_pView->GetModel()->Last();
2454
2455 while( pNewCursor && !IsSelectable(pNewCursor) )
2456 {
2457 pNewCursor = m_pView->PrevVisible(pNewCursor);
2458 }
2459
2460 if( pNewCursor && pNewCursor != m_pCursor)
2461 {
2462// SelAllDestrAnch( false );
2463 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2464 SetCursor( pNewCursor );
2465 if( !IsEntryInView( pNewCursor ) )
2466 MakeVisible( pNewCursor );
2467 }
2468 else
2469 bKeyUsed = false;
2470 break;
2471
2472 case KEY_ESCAPE:
2473 case KEY_TAB:
2474 case KEY_DELETE:
2475 case KEY_BACKSPACE:
2476 // must not be handled because this quits dialogs and does other magic things...
2477 // if there are other single keys which should not be handled, they can be added here
2478 bKeyUsed = false;
2479 break;
2480
2481 default:
2482 // is there any reason why we should eat the events here? The only place where this is called
2483 // is from SvTreeListBox::KeyInput. If we set bKeyUsed to true here, then the key input
2484 // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
2485 // handling.
2486 // (The old code here which intentionally set bKeyUsed to sal_True said this was because of "quick search"
2487 // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
2488 // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
2489 bKeyUsed = false;
2490 break;
2491 }
2492 return bKeyUsed;
2493}
2494
2496{
2497 if( m_pCursor )
2498 {
2500 ShowCursor( true );
2501// auskommentiert wg. deselectall
2502// if( bSimpleTravel && !pView->IsSelected(pCursor) )
2503// pView->Select( pCursor, true );
2504 }
2506 {
2508 while( pEntry )
2509 {
2510 InvalidateEntry( pEntry );
2511 pEntry = m_pView->NextSelected( pEntry );
2512 }
2513 }
2514}
2515
2517{
2518 m_aEditIdle.Stop();
2519 if( m_pCursor )
2521 ShowCursor( false );
2522
2524 {
2525 SvTreeListEntry* pEntry = m_pView ? m_pView->FirstSelected() : nullptr;
2526 while( pEntry )
2527 {
2528 InvalidateEntry( pEntry );
2529 pEntry = m_pView->NextSelected( pEntry );
2530 }
2531 }
2532}
2533
2534
2535// ********************************************************************
2536// SelectionEngine
2537// ********************************************************************
2538
2539void SvImpLBox::SelectEntry( SvTreeListEntry* pEntry, bool bSelect )
2540{
2541 m_pView->Select( pEntry, bSelect );
2542}
2543
2545{
2546 pImp = pImpl;
2547 pView = pV;
2548}
2549
2551{
2552}
2553
2555{
2556 pImp->BeginDrag();
2557}
2558
2560{
2562}
2563
2565{
2566 pImp->m_pAnchor = nullptr;
2567}
2568
2569void ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, bool bDontSelectAtCursor)
2570{
2571 SvTreeListEntry* pNewCursor = pImp->MakePointVisible( rPoint );
2572 if( pNewCursor )
2573 {
2574 // at SimpleTravel, the SetCursor is selected and the select handler is
2575 // called
2576 //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
2577 // pImp->SelectEntry( pNewCursor, true );
2578 pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
2579 }
2580}
2581
2582bool ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
2583{
2584 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2585 if( pEntry )
2586 return pView->IsSelected(pEntry);
2587 return false;
2588}
2589
2590void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
2591{
2592 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2593 if( !pEntry )
2594 return;
2595 pImp->SelectEntry( pEntry, false );
2596}
2597
2599{
2600 pImp->SelAllDestrAnch( false, false ); // don't reset SelectionEngine!
2602}
2603
2604// ***********************************************************************
2605// Selection
2606// ***********************************************************************
2607
2609{
2610 SvTreeListEntry* pEntry;
2611 sal_uLong nAnchorVisPos = m_pView->GetVisiblePos( m_pAnchor );
2612 sal_uLong nOldVisPos = m_pView->GetVisiblePos( pOldCursor );
2613 sal_uLong nNewVisPos = m_pView->GetVisiblePos( pNewCursor );
2614
2615 if( nOldVisPos > nAnchorVisPos ||
2616 ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
2617 {
2618 if( nNewVisPos > nOldVisPos )
2619 {
2620 pEntry = pOldCursor;
2621 while( pEntry && pEntry != pNewCursor )
2622 {
2623 m_pView->Select( pEntry );
2624 pEntry = m_pView->NextVisible(pEntry);
2625 }
2626 if( pEntry )
2627 m_pView->Select( pEntry );
2628 return;
2629 }
2630
2631 if( nNewVisPos < nAnchorVisPos )
2632 {
2633 pEntry = m_pAnchor;
2634 while( pEntry && pEntry != pOldCursor )
2635 {
2636 m_pView->Select( pEntry, false );
2637 pEntry = m_pView->NextVisible(pEntry);
2638 }
2639 if( pEntry )
2640 m_pView->Select( pEntry, false );
2641
2642 pEntry = pNewCursor;
2643 while( pEntry && pEntry != m_pAnchor )
2644 {
2645 m_pView->Select( pEntry );
2646 pEntry = m_pView->NextVisible(pEntry);
2647 }
2648 if( pEntry )
2649 m_pView->Select( pEntry );
2650 return;
2651 }
2652
2653 if( nNewVisPos < nOldVisPos )
2654 {
2655 pEntry = m_pView->NextVisible(pNewCursor);
2656 while( pEntry && pEntry != pOldCursor )
2657 {
2658 m_pView->Select( pEntry, false );
2659 pEntry = m_pView->NextVisible(pEntry);
2660 }
2661 if( pEntry )
2662 m_pView->Select( pEntry, false );
2663 return;
2664 }
2665 }
2666 else
2667 {
2668 if( nNewVisPos < nOldVisPos ) // enlarge selection
2669 {
2670 pEntry = pNewCursor;
2671 while( pEntry && pEntry != pOldCursor )
2672 {
2673 m_pView->Select( pEntry );
2674 pEntry = m_pView->NextVisible(pEntry);
2675 }
2676 if( pEntry )
2677 m_pView->Select( pEntry );
2678 return;
2679 }
2680
2681 if( nNewVisPos > nAnchorVisPos )
2682 {
2683 pEntry = pOldCursor;
2684 while( pEntry && pEntry != m_pAnchor )
2685 {
2686 m_pView->Select( pEntry, false );
2687 pEntry = m_pView->NextVisible(pEntry);
2688 }
2689 if( pEntry )
2690 m_pView->Select( pEntry, false );
2691 pEntry = m_pAnchor;
2692 while( pEntry && pEntry != pNewCursor )
2693 {
2694 m_pView->Select( pEntry );
2695 pEntry = m_pView->NextVisible(pEntry);
2696 }
2697 if( pEntry )
2698 m_pView->Select( pEntry );
2699 return;
2700 }
2701
2702 if( nNewVisPos > nOldVisPos )
2703 {
2704 pEntry = pOldCursor;
2705 while( pEntry && pEntry != pNewCursor )
2706 {
2707 m_pView->Select( pEntry, false );
2708 pEntry = m_pView->NextVisible(pEntry);
2709 }
2710 return;
2711 }
2712 }
2713}
2714
2716 bool bSelect, bool bDestroyAnchor, bool bSingleSelToo )
2717{
2718 SvTreeListEntry* pEntry;
2720 if( bSelect && m_bSimpleTravel )
2721 {
2723 {
2725 }
2726 return;
2727 }
2728 if( !bSelect && m_pView->GetSelectionCount() == 0 )
2729 {
2730 if( m_bSimpleTravel && ( !GetUpdateMode() || !m_pCursor) )
2732 return;
2733 }
2734 if( bSelect && m_pView->GetSelectionCount() == m_pView->GetEntryCount())
2735 return;
2736 if( !bSingleSelToo && m_bSimpleTravel )
2737 return;
2738
2739 if( !bSelect && m_pView->GetSelectionCount()==1 && m_pCursor &&
2741 {
2742 m_pView->Select( m_pCursor, false );
2743 if( bDestroyAnchor )
2744 DestroyAnchor(); // delete anchor & reset SelectionEngine
2745 else
2746 m_pAnchor = nullptr; // always delete internal anchor
2747 return;
2748 }
2749
2752
2753 ShowCursor( false );
2754 bool bUpdate = GetUpdateMode();
2755
2756 m_nFlags |= LBoxFlags::IgnoreSelect; // EntryInserted should not do anything
2757 pEntry = m_pTree->First();
2758 while( pEntry )
2759 {
2760 if( m_pView->Select( pEntry, bSelect ) )
2761 {
2762 if( bUpdate && m_pView->IsEntryVisible(pEntry) )
2763 {
2764 tools::Long nY = GetEntryLine( pEntry );
2765 if( IsLineVisible( nY ) )
2766 InvalidateEntry(pEntry);
2767 }
2768 }
2769 pEntry = m_pTree->Next( pEntry );
2770 }
2772
2773 if( bDestroyAnchor )
2774 DestroyAnchor(); // delete anchor & reset SelectionEngine
2775 else
2776 m_pAnchor = nullptr; // always delete internal anchor
2777 ShowCursor( true );
2778}
2779
2781{
2782 m_aSelEng.SetSelectionMode( eSelMode);
2783 if( eSelMode == SelectionMode::Single )
2784 m_bSimpleTravel = true;
2785 else
2786 m_bSimpleTravel = false;
2787 if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == SelectionMode::Multiple) )
2788 m_aSelEng.AddAlways( true );
2789}
2790
2791// ***********************************************************************
2792// Drag & Drop
2793// ***********************************************************************
2794
2796{
2797 if( eDDMode != DragDropMode::NONE )
2798 {
2800 m_aSelEng.EnableDrag( true );
2801 }
2802 else
2803 {
2805 m_aSelEng.EnableDrag( false );
2806 }
2807}
2808
2810{
2813}
2814
2816{
2817 if (pEntry)
2818 {
2819
2820 SvViewDataEntry* pViewData = m_pView->GetViewData(pEntry);
2821 pViewData->SetDragTarget(bShow);
2822#ifdef MACOSX
2823 // in MacOS we need to draw directly (as we are synchronous) or no invalidation happens
2824 m_pView->PaintEntry1(*pEntry, GetEntryLine(pEntry), *m_pView->GetOutDev());
2825#else
2826 InvalidateEntry(pEntry);
2827#endif
2828 }
2829}
2830
2832{
2833 CommandEventId nCommand = rCEvt.GetCommand();
2834
2835 if( nCommand == CommandEventId::ContextMenu )
2836 m_aEditIdle.Stop();
2837
2838 // scroll mouse event?
2839 if (nCommand == CommandEventId::Wheel ||
2840 nCommand == CommandEventId::StartAutoScroll ||
2841 nCommand == CommandEventId::AutoScroll ||
2842 nCommand == CommandEventId::GesturePan)
2843 {
2845 return;
2846 }
2847
2848 const Point& rPos = rCEvt.GetMousePosPixel();
2849 if( rPos.X() < m_aOutputSize.Width() && rPos.Y() < m_aOutputSize.Height() )
2850 m_aSelEng.Command( rCEvt );
2851}
2852
2854{
2855 Point aPos( m_pView->GetMapMode().GetOrigin() );
2856 aPos.setX( aPos.X() * -1 );
2857 tools::Rectangle aRect( aPos, m_aOutputSize );
2858 return aRect;
2859}
2860
2862{
2864}
2865
2867{
2870 )
2871 SelAllDestrAnch( false );
2872 if ( pEntry )
2873 MakeVisible( pEntry );
2874 SetCursor( pEntry );
2875 if ( pEntry && ( m_aSelEng.GetSelectionMode() != SelectionMode::NONE ) )
2876 m_pView->Select( pEntry );
2877}
2878
2879IMPL_LINK_NOARG(SvImpLBox, EditTimerCall, Timer *, void)
2880{
2881 if( !m_pView->IsInplaceEditingEnabled() )
2882 return;
2883
2884 bool bIsMouseTriggered = m_aEditClickPos.X() >= 0;
2885 if ( bIsMouseTriggered )
2886 {
2887 Point aCurrentMousePos = m_pView->GetPointerPosPixel();
2888 if ( ( std::abs( aCurrentMousePos.X() - m_aEditClickPos.X() ) > 5 )
2889 || ( std::abs( aCurrentMousePos.Y() - m_aEditClickPos.Y() ) > 5 )
2890 )
2891 {
2892 return;
2893 }
2894 }
2895
2896 SvTreeListEntry* pEntry = GetCurEntry();
2897 if( pEntry )
2898 {
2899 ShowCursor( false );
2900 m_pView->ImplEditEntry( pEntry );
2901 ShowCursor( true );
2902 }
2903}
2904
2906{
2907 if( rHEvt.GetMode() & HelpEventMode::QUICK )
2908 {
2910 if( !GetVisibleArea().Contains( aPos ))
2911 return false;
2912
2913 SvTreeListEntry* pEntry = GetEntry( aPos );
2914 if( pEntry )
2915 {
2916 // recalculate text rectangle
2917 SvLBoxTab* pTab;
2918 SvLBoxItem* pItem = m_pView->GetItem( pEntry, aPos.X(), &pTab );
2919 if (!pItem || pItem->GetType() != SvLBoxItemType::String)
2920 return false;
2921
2922 aPos = GetEntryPosition( pEntry );
2923 aPos.setX( m_pView->GetTabPos( pEntry, pTab ) ); //pTab->GetPos();
2924 Size aSize(pItem->GetWidth(m_pView, pEntry), pItem->GetHeight(m_pView, pEntry));
2925 SvLBoxTab* pNextTab = NextTab( pTab );
2926 bool bItemClipped = false;
2927 // is the item cut off by its right neighbor?
2928 if( pNextTab && m_pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
2929 {
2930 aSize.setWidth( pNextTab->GetPos() - pTab->GetPos() );
2931 bItemClipped = true;
2932 }
2933 tools::Rectangle aItemRect( aPos, aSize );
2934
2935 tools::Rectangle aViewRect( GetVisibleArea() );
2936
2937 if( bItemClipped || !aViewRect.Contains( aItemRect ) )
2938 {
2939 // clip the right edge of the item at the edge of the view
2940 //if( aItemRect.Right() > aViewRect.Right() )
2941 // aItemRect.Right() = aViewRect.Right();
2942
2943 Point aPt = m_pView->OutputToScreenPixel( aItemRect.TopLeft() );
2944 aItemRect.SetLeft( aPt.X() );
2945 aItemRect.SetTop( aPt.Y() );
2946 aPt = m_pView->OutputToScreenPixel( aItemRect.BottomRight() );
2947 aItemRect.SetRight( aPt.X() );
2948 aItemRect.SetBottom( aPt.Y() );
2949
2950 Help::ShowQuickHelp( m_pView, aItemRect,
2951 static_cast<SvLBoxString*>(pItem)->GetText(), QuickHelpFlags::Left | QuickHelpFlags::VCenter );
2952 return true;
2953 }
2954 }
2955 }
2956 return false;
2957}
2958
2960{
2961 sal_uInt16 nTabCount = m_pView->TabCount();
2962 if( nTabCount <= 1 )
2963 return nullptr;
2964 for( int nTab=0; nTab < (nTabCount-1); nTab++)
2965 {
2966 if( m_pView->aTabs[nTab].get() == pTab )
2967 return m_pView->aTabs[nTab+1].get();
2968 }
2969 return nullptr;
2970}
2971
2973{
2974 if( m_bUpdateMode != bMode )
2975 {
2976 m_bUpdateMode = bMode;
2977 if( m_bUpdateMode )
2978 UpdateAll( false );
2979 }
2980}
2981
2983{
2985 {
2987 m_pView->SetTabs();
2989 }
2990
2991 sal_uInt16 nLastTab = m_pView->aTabs.size() - 1;
2992 sal_uInt16 nLastItem = pEntry->ItemCount() - 1;
2993 if( m_pView->aTabs.empty() || nLastItem == USHRT_MAX )
2994 return;
2995
2996 if( nLastItem < nLastTab )
2997 nLastTab = nLastItem;
2998
2999 SvLBoxTab* pTab = m_pView->aTabs[ nLastTab ].get();
3000 SvLBoxItem& rItem = pEntry->GetItem( nLastTab );
3001
3002 tools::Long nTabPos = m_pView->GetTabPos( pEntry, pTab );
3003
3004 tools::Long nMaxRight = GetOutputSize().Width();
3005 Point aPos( m_pView->GetMapMode().GetOrigin() );
3006 aPos.setX( aPos.X() * -1 ); // conversion document coordinates
3007 nMaxRight = nMaxRight + aPos.X() - 1;
3008
3009 tools::Long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50;
3010 tools::Long nTabWidth = nNextTab - nTabPos + 1;
3011 auto nItemSize = rItem.GetWidth(m_pView,pEntry);
3012 tools::Long nOffset = pTab->CalcOffset( nItemSize, nTabWidth );
3013
3014 tools::Long nRight = nTabPos + nOffset + nItemSize;
3015 if( nRight > m_nMostRight )
3016 {
3017 m_nMostRight = nRight;
3018 m_pMostRightEntry = pEntry;
3019 }
3020}
3021
3023{
3024 m_nMostRight = -1;
3025 m_pMostRightEntry = nullptr;
3026 if( !m_pView->GetModel() )
3027 return;
3028
3030 while( pEntry )
3031 {
3032 SetMostRight( pEntry );
3033 pEntry = m_pView->NextVisible( pEntry );
3034 }
3035}
3036
3038{
3039 if( !pParent )
3040 FindMostRight();
3041 else
3042 FindMostRight_Impl( pParent );
3043}
3044
3046{
3047 SvTreeListEntries& rList = m_pTree->GetChildList( pParent );
3048
3049 size_t nCount = rList.size();
3050 for( size_t nCur = 0; nCur < nCount; nCur++ )
3051 {
3052 SvTreeListEntry* pChild = rList[nCur].get();
3053 SetMostRight( pChild );
3054 if( pChild->HasChildren() && m_pView->IsExpanded( pChild ))
3055 FindMostRight_Impl( pChild );
3056 }
3057}
3058
3060{
3062 m_nCurUserEvent == nullptr )
3063 {
3065 }
3066}
3067
3069{
3071}
3072
3073IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void )
3074{
3075 m_nCurUserEvent = nullptr;
3076 if( !pArg )
3077 {
3078 m_pView->Invalidate();
3079 m_pView->PaintImmediately();
3080 }
3081 else
3082 {
3083 FindMostRight();
3084 ShowVerSBar();
3085 m_pView->Invalidate( GetVisibleArea() );
3086 }
3087}
3088
3089
3091{
3092 if( m_nCurUserEvent != nullptr )
3093 {
3095 m_nCurUserEvent = nullptr;
3096 }
3097}
3098
3100{
3101 if ( s_pDefCollapsed )
3102 // assume that all or nothing is initialized
3103 return;
3104
3105 s_pDefCollapsed = new Image(StockImage::Yes, RID_BMP_TREENODE_COLLAPSED);
3106 s_pDefExpanded = new Image(StockImage::Yes, RID_BMP_TREENODE_EXPANDED);
3107}
3108
3109
3111{
3113 return *s_pDefExpanded;
3114}
3115
3116
3118{
3120 return *s_pDefCollapsed;
3121}
3122
3123
3125{
3126 if ( m_pView )
3128}
3129
3130
3131bool SvImpLBox::IsSelectable( const SvTreeListEntry* pEntry ) const
3132{
3133 if( pEntry )
3134 {
3135 SvViewDataEntry* pViewDataNewCur = m_pView->GetViewDataEntry(pEntry);
3136 return (pViewDataNewCur == nullptr) || pViewDataNewCur->IsSelectable();
3137 }
3138 else
3139 {
3140 return false;
3141 }
3142}
3143
3144/* 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:767
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:1128
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
Definition: svapp.cxx:1152
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:2569
void DeselectAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2590
void BeginDrag() override
Definition: svimpbox.cxx:2554
VclPtr< SvTreeListBox > pView
Definition: svimpbox.hxx:44
ImpLBSelEng(SvImpLBox *pImp, SvTreeListBox *pView)
Definition: svimpbox.cxx:2544
virtual ~ImpLBSelEng() override
Definition: svimpbox.cxx:2550
void CreateAnchor() override
Definition: svimpbox.cxx:2559
void DeselectAll() override
Definition: svimpbox.cxx:2598
bool IsSelectionAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2582
void DestroyAnchor() override
Definition: svimpbox.cxx:2564
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:170
vcl::Region GetClipRegion() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:161
void SetLineColor()
Definition: line.cxx:37
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:288
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
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:1870
void PaintDDCursor(SvTreeListEntry *pEntry, bool bShow)
Definition: svimpbox.cxx:2815
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:2905
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:1102
bool ButtonDownCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1800
void EntryCollapsed(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1440
void SetNodeBmpWidth(const Image &)
Definition: svimpbox.cxx:1507
void EntrySelected(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:1527
void CollapseTo(SvTreeListEntry *pParentToCollapse)
Definition: svimpbox.cxx:2071
virtual void SyncVerThumb()
Definition: svimpbox.cxx:1361
static const Image & GetDefaultCollapsedNodeImage()
Definition: svimpbox.cxx:3117
virtual void KeyUp(bool bPageUp)
Definition: svimpbox.cxx:446
void CollapsingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1481
bool EntryReallyHit(SvTreeListEntry *pEntry, const Point &rPos, tools::Long nLine)
Definition: svimpbox.cxx:752
void Resize()
Definition: svimpbox.cxx:1230
bool IsExpandable() const
Definition: svimpbox.cxx:3068
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:2861
void SelectEntry(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:2539
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:3110
WinBits m_nStyle
Definition: svimpbox.hxx:195
SvTreeListEntry * m_pCursor
Definition: svimpbox.hxx:189
void InitScrollBarBox()
Definition: svimpbox.cxx:1223
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:1738
void NotifyTabsChanged()
Definition: svimpbox.cxx:3059
void RecalcFocusRect()
Definition: svimpbox.cxx:561
void SetDragDropMode(DragDropMode eDDMode)
Definition: svimpbox.cxx:2795
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:2780
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:2853
void ExpandAll()
Definition: svimpbox.cxx:2059
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:3099
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:2715
void PositionScrollBars(Size &rOSize, sal_uInt16 nMask)
Definition: svimpbox.cxx:1070
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:2982
const Size & GetOutputSize() const
Definition: svimpbox.hxx:291
void SetEntryHeight()
Definition: svimpbox.cxx:1397
SvLBoxTab * NextTab(SvLBoxTab const *)
Definition: svimpbox.cxx:2959
bool ButtonUpCheckCtrl(const MouseEvent &rMEvt)
Definition: svimpbox.cxx:1846
bool ButtonDownCheckExpand(const MouseEvent &, SvTreeListEntry *)
Definition: svimpbox.cxx:1893
void SetAnchorSelection(SvTreeListEntry *pOld, SvTreeListEntry *pNewCursor)
Definition: svimpbox.cxx:2608
void EntryMoved(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1703
ImplSVEvent * m_nCurUserEvent
Definition: svimpbox.hxx:192
void StopUserEvent()
Definition: svimpbox.cxx:3090
bool mbForceMakeVisible
Definition: svimpbox.hxx:126
LBoxFlags m_nFlags
Definition: svimpbox.hxx:194
void BeginDrag()
Definition: svimpbox.cxx:2809
void SetCurEntry(SvTreeListEntry *)
Definition: svimpbox.cxx:2866
VclPtr< ScrollBar > m_aVerSBar
Definition: svimpbox.hxx:188
void SetUpdateMode(bool bMode)
Definition: svimpbox.cxx:2972
void EntryExpanded(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1419
void FindMostRight_Impl(SvTreeListEntry *pParent)
Definition: svimpbox.cxx:3045
tools::Long m_nNodeBmpWidth
Definition: svimpbox.hxx:120
void MouseButtonDown(const MouseEvent &)
Definition: svimpbox.cxx:1918
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:3022
SvTreeListEntry * m_pCursorOld
Definition: svimpbox.hxx:190
void ShowVerSBar()
Definition: svimpbox.cxx:1297
void RemovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1554
bool MouseMoveCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry const *pEntry)
Definition: svimpbox.cxx:1819
void MovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1673
void LoseFocus()
Definition: svimpbox.cxx:2516
sal_uLong m_nVisibleCount
Definition: svimpbox.hxx:198
virtual bool KeyInput(const KeyEvent &)
Definition: svimpbox.cxx:2104
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:1372
void Command(const CommandEvent &rCEvt)
Definition: svimpbox.cxx:2831
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:1624
void Clear()
Definition: svimpbox.cxx:230
void GetFocus()
Definition: svimpbox.cxx:2495
void FillView()
Definition: svimpbox.cxx:1252
void MouseButtonUp(const MouseEvent &)
Definition: svimpbox.cxx:2010
void ScrollToAbsPos(tools::Long nPos)
Definition: svimpbox.cxx:953
void MakeVisible(SvTreeListEntry *pEntry, bool bMoveToTop=false)
Definition: svimpbox.cxx:912
virtual tools::Long GetEntryLine(const SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:1385
void MouseMove(const MouseEvent &)
Definition: svimpbox.cxx:2034
void DrawNet(vcl::RenderContext &rRenderContext)
Definition: svimpbox.cxx:982
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: svimpbox.cxx:3124
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:3131
void KeyLeftRight(tools::Long nDiff)
Definition: svimpbox.cxx:701
void SetNodeBmpTabDistance()
Definition: svimpbox.cxx:1513
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
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:607
void Stop()
Definition: scheduler.cxx:600
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
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:647
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:1301
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:992
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:1141
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:1296
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2816
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1307
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