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
671{
674 SyncVerThumb();
675 FillView();
676 ShowVerSBar();
679 ShowCursor( true );
681}
682
683IMPL_LINK( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar, void )
684{
685 tools::Long nDelta = pScrollBar->GetDelta();
686 if( nDelta )
687 {
688 if( m_pView->IsEditingActive() )
689 {
690 m_pView->EndEditing( true ); // Cancel
691 m_pView->PaintImmediately();
692 }
693 m_pView->nFocusWidth = -1;
694 KeyLeftRight( nDelta );
695 }
696}
697
699{
703 ShowCursor( false );
704
705 // calculate new origin
707 Point aOrigin( -nPos, 0 );
708
709 MapMode aMapMode( m_pView->GetMapMode() );
710 aMapMode.SetOrigin( aOrigin );
711 m_pView->SetMapMode( aMapMode );
712
714 {
716 m_pView->Scroll( -nDelta, 0, aRect, ScrollFlags::NoChildren );
717 }
718 else
721 ShowCursor( true );
723}
724
725
726// returns the last entry if position is just past the last entry
728{
729 DBG_ASSERT( m_pView->GetModel(), "SvImpLBox::GetClickedEntry: how can this ever happen? Please tell me (frank.schoenheit@sun.com) how to reproduce!" );
730 if ( !m_pView->GetModel() )
731 // this is quite impossible. Nevertheless, stack traces from the crash reporter
732 // suggest it isn't. Okay, make it safe, and wait for somebody to reproduce it
733 // reliably :-\ ...
734 // #122359# / 2005-05-23 / frank.schoenheit@sun.com
735 return nullptr;
737 return nullptr;
738
739 sal_uInt16 nClickedEntry = static_cast<sal_uInt16>(rPoint.Y() / m_pView->GetEntryHeight() );
740 sal_uInt16 nTemp = nClickedEntry;
742 return pEntry;
743}
744
745
746// checks if the entry was hit "the right way"
747// (Focusrect+ ContextBitmap at TreeListBox)
748
749bool SvImpLBox::EntryReallyHit(SvTreeListEntry* pEntry, const Point& rPosPixel, tools::Long nLine)
750{
751 bool bRet;
752 // we are not too exact when it comes to "special" entries
753 // (with CheckButtons etc.)
754 if( pEntry->ItemCount() >= 3 )
755 return true;
756
757 tools::Rectangle aRect( m_pView->GetFocusRect( pEntry, nLine ));
759
761 aRect.AdjustLeft( -pBmp->GetWidth(m_pView,pEntry) );
762 aRect.AdjustLeft( -4 ); // a little tolerance
763
764 Point aPos( rPosPixel );
765 aPos -= m_pView->GetMapMode().GetOrigin();
766 bRet = aRect.Contains( aPos );
767 return bRet;
768}
769
770
771// returns 0 if position is just past the last entry
773{
774 if( (m_pView->GetEntryCount() == 0) || !m_pStartEntry ||
775 (rPoint.Y() > m_aOutputSize.Height())
776 || !m_pView->GetEntryHeight())
777 return nullptr;
778
779 sal_uInt16 nClickedEntry = static_cast<sal_uInt16>(rPoint.Y() / m_pView->GetEntryHeight() );
780 sal_uInt16 nTemp = nClickedEntry;
782 if( nTemp != nClickedEntry )
783 pEntry = nullptr;
784 return pEntry;
785}
786
787
789{
790 if( !m_pCursor )
791 return nullptr;
792 tools::Long nY = rPoint.Y();
793 SvTreeListEntry* pEntry = nullptr;
795 if( nY < 0 || nY >= nMax ) // aOutputSize.Height() )
796 {
797 if( nY < 0 )
798 pEntry = m_pView->PrevVisible(m_pCursor);
799 else
800 pEntry = m_pView->NextVisible(m_pCursor);
801
802 if( pEntry && pEntry != m_pCursor )
804
805 if( nY < 0 )
806 KeyUp( false );
807 else
808 KeyDown( false );
809 }
810 else
811 {
812 pEntry = GetClickedEntry( rPoint );
813 if( !pEntry )
814 {
815 sal_uInt16 nSteps = 0xFFFF;
816 // TODO: LastVisible is not yet implemented!
817 pEntry = m_pView->NextVisible(m_pStartEntry, nSteps);
818 }
819 if( pEntry )
820 {
821 if( pEntry != m_pCursor &&
823 )
824 m_pView->Select( m_pCursor, false );
825 }
826 }
827 return pEntry;
828}
829
831{
832 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
833 aOrigin.setX( aOrigin.X() * -1 ); // conversion document coordinates
834 tools::Rectangle aClipRect( aOrigin, m_aOutputSize );
835 aClipRect.AdjustBottom( 1 );
836 return aClipRect;
837}
838
839
840void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
841{
842 if (!m_pView->GetVisibleCount())
843 return;
844
846
848 {
849 SvTreeListEntry* pFirst = m_pView->First();
850 if (pFirst != m_pStartEntry)
851 {
852 ShowCursor(false);
856 ShowCursor(true);
858 reinterpret_cast<void*>(1));
859 return;
860 }
861 }
862
863 if (!m_pStartEntry)
864 {
866 }
867
870
871 tools::Long nRectHeight = rRect.GetHeight();
872 tools::Long nEntryHeight = m_pView->GetEntryHeight();
873
874 // calculate area for the entries we want to draw
875 sal_uInt16 nStartLine = static_cast<sal_uInt16>(rRect.Top() / nEntryHeight);
876 sal_uInt16 nCount = static_cast<sal_uInt16>(nRectHeight / nEntryHeight);
877 nCount += 2; // don't miss a row
878
879 tools::Long nY = nStartLine * nEntryHeight;
881 while (nStartLine && pEntry)
882 {
883 pEntry = m_pView->NextVisible(pEntry);
884 nStartLine--;
885 }
886
888 {
889 // do not select if multiselection or explicit set
891 SetCursor(m_pStartEntry, bNotSelect);
892 }
893
894 for(sal_uInt16 n=0; n< nCount && pEntry; n++)
895 {
896 /*long nMaxRight=*/
897 m_pView->PaintEntry1(*pEntry, nY, rRenderContext );
898 nY += nEntryHeight;
899 pEntry = m_pView->NextVisible(pEntry);
900 }
901
903 DrawNet(rRenderContext);
904
907}
908
909void SvImpLBox::MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop )
910{
911 if( !pEntry )
912 return;
913
914 bool bInView = IsEntryInView( pEntry );
915
916 if( bInView && (!bMoveToTop || m_pStartEntry == pEntry) )
917 return; // is already visible
918
921 if( !bInView )
922 {
923 if( !m_pView->IsEntryVisible(pEntry) ) // Parent(s) collapsed?
924 {
925 SvTreeListEntry* pParent = m_pView->GetParent( pEntry );
926 while( pParent )
927 {
928 if( !m_pView->IsExpanded( pParent ) )
929 {
930 bool bRet = m_pView->Expand( pParent );
931 DBG_ASSERT(bRet,"Not expanded!");
932 }
933 pParent = m_pView->GetParent( pParent );
934 }
935 // do the parent's children fit into the view or do we have to scroll?
936 if( IsEntryInView( pEntry ) && !bMoveToTop )
937 return; // no need to scroll
938 }
939 }
940
941 m_pStartEntry = pEntry;
942 ShowCursor( false );
943 FillView();
945 ShowCursor( true );
948}
949
951{
952 if( m_pView->GetVisibleCount() == 0 )
953 return;
954 tools::Long nLastEntryPos = m_pView->GetAbsPos( m_pView->Last() );
955
956 if( nPos < 0 )
957 nPos = 0;
958 else if( nPos > nLastEntryPos )
959 nPos = nLastEntryPos;
960
962 if( !pEntry || pEntry == m_pStartEntry )
963 return;
964
967
968 if( m_pView->IsEntryVisible(pEntry) )
969 {
970 m_pStartEntry = pEntry;
971 ShowCursor( false );
973 ShowCursor( true );
974 if (GetUpdateMode())
976 }
977}
978
980{
983 {
984 return;
985 }
986
987 // for platforms that don't have nets, DrawNativeControl does nothing and returns true
988 // so that SvImpLBox::DrawNet() doesn't draw anything either
990 {
991 ImplControlValue aControlValue;
993 tools::Rectangle(), ControlState::ENABLED, aControlValue, OUString()))
994 {
995 return;
996 }
997 }
998
999 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1000 tools::Long nEntryHeightDIV2 = nEntryHeight / 2;
1001 if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
1002 nEntryHeightDIV2--;
1003
1004 SvTreeListEntry* pChild;
1006
1007 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1008 while (m_pTree->GetDepth( pEntry ) > 0)
1009 {
1010 pEntry = m_pView->GetParent(pEntry);
1011 }
1012 sal_uInt16 nOffs = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pStartEntry) - m_pView->GetVisiblePos(pEntry));
1013 tools::Long nY = 0;
1014 nY -= (nOffs * nEntryHeight);
1015
1016 DBG_ASSERT(pFirstDynamicTab,"No Tree!");
1017
1018 rRenderContext.Push(vcl::PushFlags::LINECOLOR);
1019
1020 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
1021
1022 // Set color to draw the vertical and horizontal lines
1023 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
1024
1025 Point aPos1, aPos2;
1026 sal_uInt16 nDistance;
1027 sal_uLong nMax = m_nVisibleCount + nOffs + 1;
1028
1029 const Image& rExpandedNodeBitmap = GetExpandedNodeBmp();
1030
1031 for (sal_uLong n=0; n< nMax && pEntry; n++)
1032 {
1033 if (m_pView->IsExpanded(pEntry))
1034 {
1035 // draw vertical line
1036 aPos1.setX(m_pView->GetTabPos(pEntry, pFirstDynamicTab) + m_nNodeBmpTabDistance +
1037 rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1038 aPos1.setY(nY + nEntryHeight);
1039 pChild = m_pView->FirstChild(pEntry);
1040 assert(pChild && "Child?");
1041 pChild = pChild->LastSibling();
1042 nDistance = static_cast<sal_uInt16>(m_pView->GetVisiblePos(pChild) -
1043 m_pView->GetVisiblePos(pEntry));
1044 aPos2 = aPos1;
1045 aPos2.AdjustY((nDistance * nEntryHeight) - (nEntryHeightDIV2 + 2));
1046 rRenderContext.DrawLine(aPos1, aPos2);
1047 }
1048 // visible in control?
1049 if (n >= nOffs && !m_pTree->IsAtRootDepth(pEntry))
1050 {
1051 // draw horizontal line
1052 aPos1.setX(m_pView->GetTabPos(m_pView->GetParent(pEntry), pFirstDynamicTab)
1054 + rExpandedNodeBitmap.GetSizePixel().Width() / 2);
1055 aPos1.setY(nY + nEntryHeightDIV2);
1056 aPos2 = aPos1;
1057 aPos2.AdjustX(m_pView->GetIndent() / 2);
1058 rRenderContext.DrawLine(aPos1, aPos2);
1059 }
1060 nY += nEntryHeight;
1061 pEntry = m_pView->NextVisible(pEntry);
1062 }
1063
1064 rRenderContext.Pop();
1065}
1066
1067void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
1068{
1069 tools::Long nOverlap = 0;
1070
1071 Size aVerSize( m_nVerSBarWidth, rSize.Height() );
1072 Size aHorSize( rSize.Width(), m_nHorSBarHeight );
1073
1074 if( nMask & 0x0001 )
1075 aHorSize.AdjustWidth( -m_nVerSBarWidth );
1076 if( nMask & 0x0002 )
1077 aVerSize.AdjustHeight( -m_nHorSBarHeight );
1078
1079 aVerSize.AdjustHeight(2 * nOverlap );
1080 Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap );
1081 m_aVerSBar->SetPosSizePixel( aVerPos, aVerSize );
1082
1083 aHorSize.AdjustWidth(2 * nOverlap );
1084 Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap );
1085
1086 m_aHorSBar->SetPosSizePixel( aHorPos, aHorSize );
1087
1088 if( nMask & 0x0001 )
1089 rSize.setWidth( aVerPos.X() );
1090 if( nMask & 0x0002 )
1091 rSize.setHeight( aHorPos.Y() );
1092
1093 if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) )
1094 m_aScrBarBox->Show();
1095 else
1096 m_aScrBarBox->Hide();
1097}
1098
1100{
1101 tools::Long nEntryHeight = m_pView->GetEntryHeight();
1102 if( !nEntryHeight )
1103 return;
1104
1105 sal_uInt16 nResult = 0;
1106
1107 Size aOSize( m_pView->Control::GetOutputSizePixel() );
1108
1109 const WinBits nWindowStyle = m_pView->GetStyle();
1110 bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
1111 bool bHorBar = false;
1112 tools::Long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
1113 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1114 aOrigin.setX( aOrigin.X() * -1 );
1115 nMaxRight += aOrigin.X() - 1;
1116 tools::Long nVis = m_nMostRight - aOrigin.X();
1117 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1118 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1119 {
1120 bHorBar = true;
1121 }
1122
1123 // number of entries that are not collapsed
1124 sal_uLong nTotalCount = m_pView->GetVisibleCount();
1125
1126 // number of entries visible within the view
1127 m_nVisibleCount = o3tl::make_unsigned(aOSize.Height() / nEntryHeight);
1128
1129 // do we need a vertical scrollbar?
1130 if( bVerSBar || nTotalCount > m_nVisibleCount )
1131 {
1132 nResult = 1;
1133 nMaxRight -= m_nVerSBarWidth;
1134 if( !bHorBar )
1135 {
1136 if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
1137 (nVis < m_nMostRight || nMaxRight < m_nMostRight) )
1138 bHorBar = true;
1139 }
1140 }
1141
1142 // do we need a horizontal scrollbar?
1143 if( bHorBar )
1144 {
1145 nResult |= 0x0002;
1146 // the number of entries visible within the view has to be recalculated
1147 // because the horizontal scrollbar is now visible.
1148 m_nVisibleCount = o3tl::make_unsigned(std::max<tools::Long>(0, aOSize.Height() - m_nHorSBarHeight) / nEntryHeight);
1149 // we might actually need a vertical scrollbar now
1150 if( !(nResult & 0x0001) &&
1151 ((nTotalCount > m_nVisibleCount) || bVerSBar) )
1152 {
1153 nResult = 3;
1154 }
1155 }
1156
1157 PositionScrollBars( aOSize, nResult );
1158
1159 // adapt Range, VisibleRange etc.
1160
1161 // refresh output size, in case we have to scroll
1162 tools::Rectangle aRect;
1163 aRect.SetSize( aOSize );
1164 m_aSelEng.SetVisibleArea( aRect );
1165
1166 // vertical scrollbar
1167 tools::Long nTemp = static_cast<tools::Long>(m_nVisibleCount);
1168 nTemp--;
1169 if( nTemp != m_aVerSBar->GetVisibleSize() )
1170 {
1171 if( !m_bInVScrollHdl )
1172 {
1173 m_aVerSBar->SetPageSize( nTemp - 1 );
1174 m_aVerSBar->SetVisibleSize( nTemp );
1175 }
1176 else
1177 {
1179 m_nNextVerVisSize = nTemp;
1180 }
1181 }
1182
1183 // horizontal scrollbar
1184 nTemp = m_aHorSBar->GetThumbPos();
1185 m_aHorSBar->SetVisibleSize( aOSize.Width() );
1186 tools::Long nNewThumbPos = m_aHorSBar->GetThumbPos();
1187 Range aRange( m_aHorSBar->GetRange() );
1188 if( aRange.Max() < m_nMostRight+25 )
1189 {
1190 aRange.Max() = m_nMostRight+25;
1191 m_aHorSBar->SetRange( aRange );
1192 }
1193
1194 if( nTemp != nNewThumbPos )
1195 {
1196 nTemp = nNewThumbPos - nTemp;
1197 if( m_pView->IsEditingActive() )
1198 {
1199 m_pView->EndEditing( true ); // Cancel
1201 }
1202 m_pView->nFocusWidth = -1;
1203 KeyLeftRight( nTemp );
1204 }
1205
1206 if( nResult & 0x0001 )
1207 m_aVerSBar->Show();
1208 else
1209 m_aVerSBar->Hide();
1210
1211 if( nResult & 0x0002 )
1212 m_aHorSBar->Show();
1213 else
1214 {
1215 m_aHorSBar->Hide();
1216 }
1217 rSize = aOSize;
1218}
1219
1221{
1223 Size aSize( m_pView->Control::GetOutputSizePixel() );
1225}
1226
1228{
1229 m_aOutputSize = m_pView->Control::GetOutputSizePixel();
1230 if( m_aOutputSize.IsEmpty() )
1231 return;
1234
1235 if( m_pView->GetEntryHeight())
1236 {
1238 UpdateAll();
1239 }
1240 // HACK, as in floating and docked windows the scrollbars might not be drawn
1241 // correctly/not be drawn at all after resizing!
1242 if( m_aHorSBar->IsVisible())
1244 if( m_aVerSBar->IsVisible())
1247}
1248
1250{
1251 if( !m_pStartEntry )
1252 {
1253 sal_uLong nVisibleViewCount = m_pView->GetVisibleCount();
1254 tools::Long nTempThumb = m_aVerSBar->GetThumbPos();
1255 if( nTempThumb < 0 )
1256 nTempThumb = 0;
1257 else if( o3tl::make_unsigned(nTempThumb) >= nVisibleViewCount )
1258 nTempThumb = nVisibleViewCount == 0 ? 0 : nVisibleViewCount - 1;
1259 m_pStartEntry = m_pView->GetEntryAtVisPos(nTempThumb);
1260 }
1261 if( !m_pStartEntry )
1262 return;
1263
1264 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1265 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1266 sal_uLong nCurDispEntries = nLast-nThumb+1;
1267 if( nCurDispEntries >= m_nVisibleCount )
1268 return;
1269
1270 ShowCursor( false );
1271 // fill window by moving the thumb up incrementally
1272 bool bFound = false;
1274 while( nCurDispEntries < m_nVisibleCount && pTemp )
1275 {
1277 if( pTemp )
1278 {
1279 nThumb--;
1280 m_pStartEntry = pTemp;
1281 nCurDispEntries++;
1282 bFound = true;
1283 }
1284 }
1285 if( bFound )
1286 {
1287 m_aVerSBar->SetThumbPos( nThumb );
1288 ShowCursor( true ); // recalculate focus rectangle
1290 }
1291}
1292
1293
1295{
1296 bool bVerBar = ( m_pView->GetStyle() & WB_VSCROLL ) != 0;
1297 sal_uLong nVis = 0;
1298 if( !bVerBar )
1299 nVis = m_pView->GetVisibleCount();
1300 if( bVerBar || (m_nVisibleCount && nVis > static_cast<sal_uLong>(m_nVisibleCount-1)) )
1301 {
1302 if( !m_aVerSBar->IsVisible() )
1303 {
1304 m_pView->nFocusWidth = -1;
1306 if( GetUpdateMode() )
1308 }
1309 }
1310 else
1311 {
1312 if( m_aVerSBar->IsVisible() )
1313 {
1314 m_pView->nFocusWidth = -1;
1316 }
1317 }
1318
1319 tools::Long nMaxRight = GetOutputSize().Width();
1320 Point aPos( m_pView->GetMapMode().GetOrigin() );
1321 aPos.setX( aPos.X() * -1 ); // convert document coordinates
1322 nMaxRight = nMaxRight + aPos.X() - 1;
1323 if( nMaxRight < m_nMostRight )
1324 {
1325 if( !m_aHorSBar->IsVisible() )
1326 {
1327 m_pView->nFocusWidth = -1;
1329 if( GetUpdateMode() )
1331 }
1332 else
1333 {
1334 Range aRange( m_aHorSBar->GetRange() );
1335 if( aRange.Max() < m_nMostRight+25 )
1336 {
1337 aRange.Max() = m_nMostRight+25;
1338 m_aHorSBar->SetRange( aRange );
1339 }
1340 else
1341 {
1342 m_pView->nFocusWidth = -1;
1344 }
1345 }
1346 }
1347 else
1348 {
1349 if( m_aHorSBar->IsVisible() )
1350 {
1351 m_pView->nFocusWidth = -1;
1353 }
1354 }
1355}
1356
1357
1359{
1360 if( m_pStartEntry )
1361 {
1363 m_aVerSBar->SetThumbPos( nEntryPos );
1364 }
1365 else
1366 m_aVerSBar->SetThumbPos( 0 );
1367}
1368
1370{
1371 // parent collapsed
1372 if( !m_pView->IsEntryVisible(pEntry) )
1373 return false;
1374 tools::Long nY = GetEntryLine( pEntry );
1375 if( nY < 0 )
1376 return false;
1378 return nY < nMax;
1379}
1380
1381
1383{
1384 if(!m_pStartEntry )
1385 return -1; // invisible position
1386
1388 tools::Long nEntryVisPos = m_pView->GetVisiblePos( pEntry );
1389 nFirstVisPos = nEntryVisPos - nFirstVisPos;
1390 nFirstVisPos *= m_pView->GetEntryHeight();
1391 return nFirstVisPos;
1392}
1393
1395{
1398 if(!m_pView->HasViewData()) // are we within the Clear?
1399 {
1400 Size aSize = m_pView->Control::GetOutputSizePixel();
1401 AdjustScrollBars( aSize );
1402 }
1403 else
1404 {
1405 Resize();
1406 if( GetUpdateMode() )
1408 }
1409}
1410
1411
1412// ***********************************************************************
1413// Callback Functions
1414// ***********************************************************************
1415
1417{
1418 // SelAllDestrAnch( false, true ); //DeselectAll();
1419 if( !GetUpdateMode() )
1420 return;
1421
1422 ShowCursor( false );
1423 tools::Long nY = GetEntryLine( pEntry );
1424 if( IsLineVisible(nY) )
1425 {
1427 FindMostRight( pEntry );
1428 }
1430 // if we expanded before the thumb, the thumb's position has to be
1431 // corrected
1432 SyncVerThumb();
1433 ShowVerSBar();
1434 ShowCursor( true );
1435}
1436
1438{
1439 if( !m_pView->IsEntryVisible( pEntry ) )
1440 return;
1441
1442 ShowCursor( false );
1443
1445 {
1446 FindMostRight();
1447 }
1448
1449 if( m_pStartEntry )
1450 {
1451 tools::Long nOldThumbPos = m_aVerSBar->GetThumbPos();
1452 sal_uLong nVisList = m_pView->GetVisibleCount();
1453 m_aVerSBar->SetRange( Range(0, nVisList-1) );
1454 tools::Long nNewThumbPos = m_aVerSBar->GetThumbPos();
1455 if( nNewThumbPos != nOldThumbPos )
1456 {
1458 sal_uInt16 nDistance = static_cast<sal_uInt16>(nNewThumbPos);
1459 if( nDistance )
1461 if( GetUpdateMode() )
1463 }
1464 else
1465 SyncVerThumb();
1466 ShowVerSBar();
1467 }
1468 // has the cursor been collapsed?
1469 if( m_pTree->IsChild( pEntry, m_pCursor ) )
1470 SetCursor( pEntry );
1471 if( GetUpdateMode() )
1472 ShowVerSBar();
1473 ShowCursor( true );
1474 if( GetUpdateMode() && m_pCursor )
1476}
1477
1479{
1480 if( !m_pView->IsEntryVisible( pEntry ) || !m_pStartEntry )
1481 return;
1482
1483 SelAllDestrAnch( false ); // deselect all
1484
1485 // is the collapsed cursor visible?
1486 tools::Long nY = GetEntryLine( pEntry );
1487 if( IsLineVisible(nY) )
1488 {
1489 if( GetUpdateMode() )
1491 }
1492 else
1493 {
1494 if( m_pTree->IsChild(pEntry, m_pStartEntry) )
1495 {
1496 m_pStartEntry = pEntry;
1497 if( GetUpdateMode() )
1499 }
1500 }
1501}
1502
1503
1505{
1506 const Size aSize( rBmp.GetSizePixel() );
1507 m_nNodeBmpWidth = aSize.Width();
1508}
1509
1511{
1514 {
1515 // only if the first dynamic tab is centered (we currently assume that)
1517 m_nNodeBmpTabDistance -= aSize.Width() / 2;
1518 }
1519}
1520
1521
1522// corrects the cursor when using SingleSelection
1523
1524void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect )
1525{
1527 return;
1528
1530 if( bSelect &&
1532 pEntry != m_pCursor )
1533 {
1534 SetCursor( pEntry );
1535 DBG_ASSERT(m_pView->GetSelectionCount()==1,"selection count?");
1536 }
1537
1538 if( GetUpdateMode() && m_pView->IsEntryVisible(pEntry) )
1539 {
1540 tools::Long nY = GetEntryLine( pEntry );
1541 if( IsLineVisible( nY ) )
1542 {
1543 ShowCursor(false);
1544 InvalidateEntry(pEntry);
1545 ShowCursor(true);
1546 }
1547 }
1548}
1549
1550
1552{
1554
1555 DestroyAnchor();
1556
1557 if( !m_pView->IsEntryVisible( pEntry ) )
1558 {
1559 // if parent is collapsed => bye!
1561 return;
1562 }
1563
1564 if( pEntry == m_pMostRightEntry || (
1565 pEntry->HasChildren() && m_pView->IsExpanded(pEntry) &&
1567 {
1569 }
1570
1571 SvTreeListEntry* pOldStartEntry = m_pStartEntry;
1572
1573 SvTreeListEntry* pParent = m_pView->GetModel()->GetParent(pEntry);
1574
1575 if (pParent && m_pView->GetModel()->GetChildList(pParent).size() == 1)
1576 {
1577 DBG_ASSERT( m_pView->IsExpanded( pParent ), "Parent not expanded");
1578 pParent->SetFlags( pParent->GetFlags() | SvTLEntryFlags::NO_NODEBMP);
1579 InvalidateEntry( pParent );
1580 }
1581
1582 if( m_pCursor && m_pTree->IsChild( pEntry, m_pCursor) )
1583 m_pCursor = pEntry;
1584 if( m_pStartEntry && m_pTree->IsChild(pEntry,m_pStartEntry) )
1585 m_pStartEntry = pEntry;
1586
1587 SvTreeListEntry* pTemp;
1588 if( m_pCursor && m_pCursor == pEntry )
1589 {
1590 if( m_bSimpleTravel )
1591 m_pView->Select( m_pCursor, false );
1592 ShowCursor( false ); // focus rectangle gone
1593 // NextSibling, because we also delete the children of the cursor
1594 pTemp = m_pCursor->NextSibling();
1595 if( !pTemp )
1596 pTemp = m_pView->PrevVisible(m_pCursor);
1597
1598 SetCursor( pTemp, true );
1599 }
1600 if( m_pStartEntry && m_pStartEntry == pEntry )
1601 {
1602 pTemp = m_pStartEntry->NextSibling();
1603 if( !pTemp )
1605 m_pStartEntry = pTemp;
1606 }
1607 if( GetUpdateMode())
1608 {
1609 // if it is the last one, we have to invalidate it, so the lines are
1610 // drawn correctly (in this case they're deleted)
1611 if( m_pStartEntry && (m_pStartEntry != pOldStartEntry || pEntry == m_pView->GetModel()->Last()) )
1612 {
1615 }
1616 else
1618 }
1619}
1620
1622{
1624 {
1626 return;
1627 }
1628 if( !m_pStartEntry )
1630 if( !m_pCursor )
1631 SetCursor( m_pStartEntry, true );
1632
1635
1636 if( GetUpdateMode())
1637 {
1639 FindMostRight();
1641 FillView();
1642 if( m_pStartEntry )
1643 // if something above the thumb was deleted
1645
1646 ShowVerSBar();
1648 {
1649 if( m_pView->GetSelectionCount() )
1650 {
1651 // is a neighboring entry selected?
1652 SvTreeListEntry* pNextCursor = m_pView->PrevVisible( m_pCursor );
1653 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1654 pNextCursor = m_pView->NextVisible( m_pCursor );
1655 if( !pNextCursor || !m_pView->IsSelected( pNextCursor ))
1656 // no neighbor selected: use first selected
1657 pNextCursor = m_pView->FirstSelected();
1658 SetCursor( pNextCursor );
1660 }
1661 else
1663 }
1664 ShowCursor( true );
1665 }
1667}
1668
1669
1671{
1672 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1673 SelAllDestrAnch( false ); // DeselectAll();
1674 if( !bDeselAll )
1676
1677 if( pEntry == m_pCursor )
1678 ShowCursor( false );
1679 if( IsEntryInView( pEntry ) )
1681 if( pEntry != m_pStartEntry )
1682 return;
1683
1684 SvTreeListEntry* pNew = nullptr;
1685 if( !pEntry->HasChildren() )
1686 {
1688 if( !pNew )
1690 }
1691 else
1692 {
1693 pNew = pEntry->NextSibling();
1694 if( !pNew )
1695 pNew = pEntry->PrevSibling();
1696 }
1697 m_pStartEntry = pNew;
1698}
1699
1701{
1703
1704 if ( !m_pStartEntry )
1705 // this might happen if the only entry in the view is moved to its very same position
1706 // #i97346#
1708
1710 sal_uInt16 nFirstPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( m_pStartEntry ));
1711 sal_uInt16 nNewPos = static_cast<sal_uInt16>(m_pTree->GetAbsPos( pEntry ));
1712 FindMostRight();
1713 if( nNewPos < nFirstPos ) // HACK!
1714 m_pStartEntry = pEntry;
1715 SyncVerThumb();
1716 if( pEntry == m_pCursor )
1717 {
1719 ShowCursor( true );
1720 else
1721 {
1722 SvTreeListEntry* pParent = pEntry;
1723 do {
1724 pParent = m_pTree->GetParent( pParent );
1725 }
1726 while( !m_pView->IsEntryVisible( pParent ) );
1727 SetCursor( pParent );
1728 }
1729 }
1730 if( IsEntryInView( pEntry ) )
1732}
1733
1734
1736{
1737 if( !GetUpdateMode() )
1738 return;
1739
1740 SvTreeListEntry* pParent = m_pTree->GetParent(pEntry);
1741 if (pParent && m_pTree->GetChildList(pParent).size() == 1)
1742 // draw plus sign
1743 m_pTree->InvalidateEntry( pParent );
1744
1745 if( !m_pView->IsEntryVisible( pEntry ) )
1746 return;
1747 bool bDeselAll(m_nFlags & LBoxFlags::DeselectAll);
1748 if( bDeselAll )
1749 SelAllDestrAnch( false );
1750 else
1751 DestroyAnchor();
1752 // nFlags &= (~LBoxFlags::DeselectAll);
1753// ShowCursor( false ); // if cursor is moved lower
1754 tools::Long nY = GetEntryLine( pEntry );
1755 bool bEntryVisible = IsLineVisible( nY );
1756 if( bEntryVisible )
1757 {
1758 ShowCursor( false ); // if cursor is moved lower
1759 nY -= m_pView->GetEntryHeight(); // because of lines
1761 }
1762 else if( m_pStartEntry && nY < GetEntryLine(m_pStartEntry) )
1763 {
1764 // Check if the view is filled completely. If not, then adjust
1765 // pStartEntry and the Cursor (automatic scrolling).
1766 sal_uInt16 nLast = static_cast<sal_uInt16>(m_pView->GetVisiblePos(m_pView->LastVisible()));
1767 sal_uInt16 nThumb = static_cast<sal_uInt16>(m_pView->GetVisiblePos( m_pStartEntry ));
1768 sal_uInt16 nCurDispEntries = nLast-nThumb+1;
1769 if( nCurDispEntries < m_nVisibleCount )
1770 {
1771 // set at the next paint event
1772 m_pStartEntry = nullptr;
1773 SetCursor( nullptr );
1775 }
1776 }
1777 else if( !m_pStartEntry )
1779
1780 SetMostRight( pEntry );
1782 SyncVerThumb(); // if something was inserted before the thumb
1783 ShowVerSBar();
1784 ShowCursor( true );
1787}
1788
1789
1790// ********************************************************************
1791// Event handler
1792// ********************************************************************
1793
1794
1795// ****** Control the control animation
1796
1798{
1799 SvLBoxItem* pItem = m_pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&m_pActiveTab);
1800 if (pItem && pItem->GetType() == SvLBoxItemType::Button)
1801 {
1802 m_pActiveButton = static_cast<SvLBoxButton*>(pItem);
1803 m_pActiveEntry = pEntry;
1804 if( m_pCursor == m_pActiveEntry )
1805 m_pView->HideFocus();
1809 return true;
1810 }
1811 else
1812 m_pActiveButton = nullptr;
1813 return false;
1814}
1815
1817{
1818 if( m_pActiveButton )
1819 {
1820 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1821 if( pEntry == m_pActiveEntry &&
1823 {
1825 {
1828 }
1829 }
1830 else
1831 {
1833 {
1836 }
1837 }
1838 return true;
1839 }
1840 return false;
1841}
1842
1844{
1846 {
1848 SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
1850 tools::Long nMouseX = rMEvt.GetPosPixel().X();
1851 if (pEntry == m_pActiveEntry && m_pView->GetItem(m_pActiveEntry, nMouseX) == m_pActiveButton)
1855 ShowCursor(true);
1856 m_pActiveButton = nullptr;
1857 m_pActiveEntry = nullptr;
1858 m_pActiveTab = nullptr;
1859 return true;
1860 }
1861 return false;
1862}
1863
1864// ******* Control plus/minus button for expanding/collapsing
1865
1866// false == no expand/collapse button hit
1867bool SvImpLBox::IsNodeButton( const Point& rPosPixel, const SvTreeListEntry* pEntry ) const
1868{
1869 if( !pEntry->HasChildren() && !pEntry->HasChildrenOnDemand() )
1870 return false;
1871
1872 SvLBoxTab* pFirstDynamicTab = m_pView->GetFirstDynamicTab();
1873 if( !pFirstDynamicTab )
1874 return false;
1875
1876 tools::Long nMouseX = rPosPixel.X();
1877 // convert to document coordinates
1878 Point aOrigin( m_pView->GetMapMode().GetOrigin() );
1879 nMouseX -= aOrigin.X();
1880
1881 tools::Long nX = m_pView->GetTabPos( pEntry, pFirstDynamicTab);
1883 if( nMouseX < nX )
1884 return false;
1885 nX += m_nNodeBmpWidth;
1886 return nMouseX <= nX;
1887}
1888
1889// false == hit no node button
1891{
1892 bool bRet = false;
1893
1894 if ( m_pView->IsEditingActive() && pEntry == m_pView->pEdEntry )
1895 // inplace editing -> nothing to do
1896 bRet = true;
1897 else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
1898 {
1899 if ( m_pView->IsExpanded( pEntry ) )
1900 {
1901 m_pView->EndEditing( true );
1902 m_pView->Collapse( pEntry );
1903 }
1904 else
1905 {
1906 // you can expand an entry, which is in editing
1907 m_pView->Expand( pEntry );
1908 }
1909 bRet = true;
1910 }
1911
1912 return bRet;
1913}
1914
1916{
1917 if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
1918 return;
1919
1920 m_aEditIdle.Stop();
1921 Point aPos( rMEvt.GetPosPixel());
1922
1923 if( aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height() )
1924 return;
1925
1926 if( !m_pCursor )
1929 m_pView->GrabFocus();
1930 //fdo#82270 Grabbing focus can invalidate the entries, re-fetch
1931 SvTreeListEntry* pEntry = GetEntry(aPos);
1932 // the entry can still be invalid!
1933 if( !pEntry || !m_pView->GetViewData( pEntry ))
1934 return;
1935
1936 tools::Long nY = GetEntryLine( pEntry );
1937 // Node-Button?
1938 if( ButtonDownCheckExpand( rMEvt, pEntry ) )
1939 return;
1940
1941 if( !EntryReallyHit(pEntry,aPos,nY))
1942 return;
1943
1944 SvLBoxItem* pXItem = m_pView->GetItem( pEntry, aPos.X() );
1945 if( pXItem )
1946 {
1947 SvLBoxTab* pXTab = m_pView->GetTab( pEntry, pXItem );
1948 if ( !rMEvt.IsMod1() && !rMEvt.IsMod2() && rMEvt.IsLeft() && pXTab->IsEditable()
1949 && pEntry == m_pView->FirstSelected() && nullptr == m_pView->NextSelected( pEntry ) )
1950 // #i8234# FirstSelected() and NextSelected() ensures, that inplace editing is only triggered, when only one entry is selected
1952 if ( !m_pView->IsSelected( pEntry ) )
1954 }
1955
1956
1957 if( (rMEvt.GetClicks() % 2) == 0)
1958 {
1960 m_pView->pHdlEntry = pEntry;
1961 if( !m_pView->DoubleClickHdl() )
1962 {
1963 // Handler signals nothing to be done anymore, bail out, 'this' may
1964 // even be dead and destroyed.
1965 return;
1966 }
1967 else
1968 {
1969 // if the entry was deleted within the handler
1970 pEntry = GetClickedEntry( aPos );
1971 if( !pEntry )
1972 return;
1973 if( pEntry != m_pView->pHdlEntry )
1974 {
1975 // select anew & bye
1977 SelAllDestrAnch( false ); // DeselectAll();
1978 SetCursor( pEntry );
1979
1980 return;
1981 }
1982 if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
1983 {
1984 if( m_pView->IsExpanded(pEntry) )
1985 m_pView->Collapse( pEntry );
1986 else
1987 m_pView->Expand( pEntry );
1988 if( pEntry == m_pCursor ) // only if Entryitem was clicked
1989 // (Nodebutton is not an Entryitem!)
1991 return;
1992 }
1993 }
1994 }
1995 else
1996 {
1997 // CheckButton? (TreeListBox: Check + Info)
1998 if( ButtonDownCheckCtrl(rMEvt, pEntry) )
1999 return;
2000 // Inplace-Editing?
2001 }
2003 && !rMEvt.IsRight() ) // tdf#128824
2005}
2006
2008{
2010 m_aSelEng.SelMouseButtonUp( rMEvt );
2012 {
2014 m_aEditClickPos = rMEvt.GetPosPixel();
2016 }
2017
2019 {
2020 Point aPos(rMEvt.GetPosPixel());
2021 SvTreeListEntry* pEntry = GetEntry(aPos);
2022 // tdf#143245 ActivateOnSingleClick only
2023 // if the 'up' is at the active entry
2024 // typically selected by the 'down'
2025 if (!pEntry || pEntry != m_pCursor)
2026 return;
2028 }
2029}
2030
2032{
2033 Point aPos = rMEvt.GetPosPixel();
2034 SvTreeListEntry* pEntry = GetClickedEntry(aPos);
2035 if ( MouseMoveCheckCtrl( rMEvt, pEntry ) || ( m_aSelEng.GetSelectionMode() == SelectionMode::NONE ) )
2036 return;
2037
2038 m_aSelEng.SelMouseMove(rMEvt);
2040 {
2041 if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height())
2042 pEntry = nullptr;
2043 else
2044 pEntry = GetEntry(aPos);
2045 if (!pEntry)
2046 m_pView->SelectAll(false);
2047 else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
2048 {
2050 m_pView->Select(pEntry);
2051 m_pView->mbSelectingByHover = false;
2052 }
2053 }
2054}
2055
2057{
2058 sal_uInt16 nRefDepth = m_pTree->GetDepth(m_pCursor);
2060 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2061 {
2062 if (pCur->HasChildren() && !m_pView->IsExpanded(pCur))
2063 m_pView->Expand(pCur);
2064 pCur = m_pTree->Next(pCur);
2065 }
2066}
2067
2069{
2070 // collapse all parents until we get to the given parent to collapse
2071 if (!pParentToCollapse)
2072 return;
2073
2074 sal_uInt16 nRefDepth;
2075 // special case explorer: if the root only has a single
2076 // entry, don't collapse the root entry
2077 if (m_pTree->GetChildList(nullptr).size() < 2)
2078 {
2079 nRefDepth = 1;
2080 pParentToCollapse = m_pCursor;
2081 while (m_pTree->GetParent(pParentToCollapse)
2082 && m_pTree->GetDepth(m_pTree->GetParent(pParentToCollapse)) > 0)
2083 {
2084 pParentToCollapse = m_pTree->GetParent(pParentToCollapse);
2085 }
2086 }
2087 else
2088 nRefDepth = m_pTree->GetDepth(pParentToCollapse);
2089
2090 if (m_pView->IsExpanded(pParentToCollapse))
2091 m_pView->Collapse(pParentToCollapse);
2092 SvTreeListEntry* pCur = m_pTree->Next(pParentToCollapse);
2093 while (pCur && m_pTree->GetDepth(pCur) > nRefDepth)
2094 {
2095 if (pCur->HasChildren() && m_pView->IsExpanded(pCur))
2096 m_pView->Collapse(pCur);
2097 pCur = m_pTree->Next(pCur);
2098 }
2099}
2100
2102{
2103 m_aEditIdle.Stop();
2104 const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
2105
2106 if( rKeyCode.IsMod2() )
2107 return false; // don't evaluate Alt key
2108
2110
2111 if( !m_pCursor )
2113 if( !m_pCursor )
2114 return false;
2115
2116 bool bKeyUsed = true;
2117
2118 sal_uInt16 nDelta = static_cast<sal_uInt16>(m_aVerSBar->GetPageSize());
2119 sal_uInt16 aCode = rKeyCode.GetCode();
2120
2121 bool bShift = rKeyCode.IsShift();
2122 bool bMod1 = rKeyCode.IsMod1();
2123
2124 SvTreeListEntry* pNewCursor;
2125
2126 switch( aCode )
2127 {
2128 case KEY_UP:
2129 if( !IsEntryInView( m_pCursor ) )
2131
2132 pNewCursor = m_pCursor;
2133 do
2134 {
2135 pNewCursor = m_pView->PrevVisible(pNewCursor);
2136 } while( pNewCursor && !IsSelectable(pNewCursor) );
2137
2138 // if there is no next entry, take the current one
2139 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2140 // the cursor key
2141 if (!pNewCursor)
2142 pNewCursor = m_pCursor;
2143
2144 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2145 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2146 if( !IsEntryInView( pNewCursor ) )
2147 KeyUp( false );
2148 break;
2149
2150 case KEY_DOWN:
2151 if( !IsEntryInView( m_pCursor ) )
2153
2154 pNewCursor = m_pCursor;
2155 do
2156 {
2157 pNewCursor = m_pView->NextVisible(pNewCursor);
2158 } while( pNewCursor && !IsSelectable(pNewCursor) );
2159
2160 // if there is no next entry, take the current one
2161 // this ensures that in case of _one_ entry in the list, this entry is selected when pressing
2162 // the cursor key
2163 // 06.09.20001 - 83416 - frank.schoenheit@sun.com
2164 if ( !pNewCursor && m_pCursor )
2165 pNewCursor = m_pCursor;
2166
2167 if( pNewCursor )
2168 {
2169 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2170 if( IsEntryInView( pNewCursor ) )
2171 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2172 else
2173 {
2174 if( m_pCursor )
2175 m_pView->Select( m_pCursor, false );
2176 KeyDown( false );
2177 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2178 }
2179 }
2180 else
2181 KeyDown( false ); // because scrollbar range might still
2182 // allow scrolling
2183 break;
2184
2185 case KEY_RIGHT:
2186 {
2187 if( m_bSubLstOpLR )
2188 {
2189 // only try to expand if sublist is expandable,
2190 // otherwise ignore the key press
2193 }
2194 else if (m_aHorSBar->IsVisible())
2195 {
2197 nThumb += m_aHorSBar->GetLineSize();
2198 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2199 m_aHorSBar->SetThumbPos( nThumb );
2200 nThumb = nOldThumb;
2201 nThumb -= m_aHorSBar->GetThumbPos();
2202 nThumb *= -1;
2203 if( nThumb )
2204 {
2205 KeyLeftRight( nThumb );
2206 }
2207 }
2208 else
2209 bKeyUsed = false;
2210 break;
2211 }
2212
2213 case KEY_LEFT:
2214 {
2215 if (m_aHorSBar->IsVisible())
2216 {
2218 nThumb -= m_aHorSBar->GetLineSize();
2219 tools::Long nOldThumb = m_aHorSBar->GetThumbPos();
2220 m_aHorSBar->SetThumbPos( nThumb );
2221 nThumb = nOldThumb;
2222 nThumb -= m_aHorSBar->GetThumbPos();
2223 if( nThumb )
2224 {
2225 KeyLeftRight( -nThumb );
2226 }
2227 else if( m_bSubLstOpLR )
2228 {
2231 else
2232 {
2233 pNewCursor = m_pView->GetParent( m_pCursor );
2234 if( pNewCursor )
2235 SetCursor( pNewCursor );
2236 }
2237 }
2238 }
2239 else if( m_bSubLstOpLR )
2240 {
2243 else
2244 {
2245 pNewCursor = m_pView->GetParent( m_pCursor );
2246 if( pNewCursor )
2247 SetCursor( pNewCursor );
2248 }
2249 }
2250 else
2251 bKeyUsed = false;
2252 break;
2253 }
2254
2255 case KEY_PAGEUP:
2256 if( !bMod1 )
2257 {
2258 pNewCursor = m_pView->PrevVisible(m_pCursor, nDelta);
2259
2260 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2261 {
2262 pNewCursor = m_pView->NextVisible(pNewCursor);
2263 nDelta--;
2264 }
2265
2266 if( nDelta )
2267 {
2268 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2269 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2270 if( IsEntryInView( pNewCursor ) )
2271 SetCursor( pNewCursor );
2272 else
2273 {
2274 SetCursor( pNewCursor );
2275 KeyUp( true );
2276 }
2277 }
2278 }
2279 else
2280 bKeyUsed = false;
2281 break;
2282
2283 case KEY_PAGEDOWN:
2284 if( !bMod1 )
2285 {
2286 pNewCursor= m_pView->NextVisible(m_pCursor, nDelta);
2287
2288 while( nDelta && pNewCursor && !IsSelectable(pNewCursor) )
2289 {
2290 pNewCursor = m_pView->PrevVisible(pNewCursor);
2291 nDelta--;
2292 }
2293
2294 if( nDelta && pNewCursor )
2295 {
2296 DBG_ASSERT(pNewCursor && pNewCursor!=m_pCursor, "Cursor?");
2297 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2298 if( IsEntryInView( pNewCursor ) )
2299 SetCursor( pNewCursor );
2300 else
2301 {
2302 SetCursor( pNewCursor );
2303 KeyDown( true );
2304 }
2305 }
2306 else
2307 KeyDown( false ); // see also: KEY_DOWN
2308 }
2309 else
2310 bKeyUsed = false;
2311 break;
2312
2313 case KEY_SPACE:
2315 {
2316 if ( bMod1 )
2317 {
2318 if ( m_pView->GetSelectionMode() == SelectionMode::Multiple && !bShift )
2319 // toggle selection
2321 }
2322 else if ( !bShift /*&& !bMod1*/ )
2323 {
2324 if ( m_aSelEng.IsAddMode() )
2325 {
2326 // toggle selection
2328 }
2329 else if ( !m_pView->IsSelected( m_pCursor ) )
2330 {
2331 SelAllDestrAnch( false );
2333 }
2334 else
2335 bKeyUsed = false;
2336 }
2337 else
2338 bKeyUsed = false;
2339 }
2340 else
2341 bKeyUsed = false;
2342 break;
2343
2344 case KEY_RETURN:
2345 bKeyUsed = !m_pView->DoubleClickHdl();
2346 break;
2347
2348 case KEY_F2:
2349 if( !bShift && !bMod1 )
2350 {
2351 m_aEditClickPos = Point( -1, -1 );
2352 EditTimerCall( nullptr );
2353 }
2354 else
2355 bKeyUsed = false;
2356 break;
2357
2358 case KEY_F8:
2361 {
2363 m_aSelEng.AddAlways( false );
2364 else
2365 m_aSelEng.AddAlways( true );
2366 }
2367 else
2368 bKeyUsed = false;
2369 break;
2370
2371 case KEY_ADD:
2374 if (bMod1)
2375 ExpandAll();
2376 break;
2377
2378 case KEY_A:
2379 if( bMod1 )
2380 SelAllDestrAnch( true );
2381 else
2382 bKeyUsed = false;
2383 break;
2384
2385 case KEY_SUBTRACT:
2387 {
2388 if (bMod1)
2390 else
2392 }
2393 break;
2394
2395 case KEY_MULTIPLY:
2396 if( bMod1 )
2397 {
2398 // only try to expand/collapse if sublist is expandable,
2399 // otherwise ignore the key press
2400 if( IsExpandable() )
2401 {
2403 {
2405 ExpandAll();
2406 }
2407 else
2409 }
2410 }
2411 else
2412 bKeyUsed = false;
2413 break;
2414
2415 case KEY_DIVIDE :
2416 if( bMod1 )
2417 SelAllDestrAnch( true );
2418 else
2419 bKeyUsed = false;
2420 break;
2421
2422 case KEY_COMMA :
2423 if( bMod1 )
2424 SelAllDestrAnch( false );
2425 else
2426 bKeyUsed = false;
2427 break;
2428
2429 case KEY_HOME :
2430 pNewCursor = m_pView->GetModel()->First();
2431
2432 while( pNewCursor && !IsSelectable(pNewCursor) )
2433 {
2434 pNewCursor = m_pView->NextVisible(pNewCursor);
2435 }
2436
2437 if( pNewCursor && pNewCursor != m_pCursor )
2438 {
2439// SelAllDestrAnch( false );
2440 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2441 SetCursor( pNewCursor );
2442 if( !IsEntryInView( pNewCursor ) )
2443 MakeVisible( pNewCursor );
2444 }
2445 else
2446 bKeyUsed = false;
2447 break;
2448
2449 case KEY_END :
2450 pNewCursor = m_pView->GetModel()->Last();
2451
2452 while( pNewCursor && !IsSelectable(pNewCursor) )
2453 {
2454 pNewCursor = m_pView->PrevVisible(pNewCursor);
2455 }
2456
2457 if( pNewCursor && pNewCursor != m_pCursor)
2458 {
2459// SelAllDestrAnch( false );
2460 m_aSelEng.CursorPosChanging( bShift, bMod1 );
2461 SetCursor( pNewCursor );
2462 if( !IsEntryInView( pNewCursor ) )
2463 MakeVisible( pNewCursor );
2464 }
2465 else
2466 bKeyUsed = false;
2467 break;
2468
2469 case KEY_ESCAPE:
2470 case KEY_TAB:
2471 case KEY_DELETE:
2472 case KEY_BACKSPACE:
2473 // must not be handled because this quits dialogs and does other magic things...
2474 // if there are other single keys which should not be handled, they can be added here
2475 bKeyUsed = false;
2476 break;
2477
2478 default:
2479 // is there any reason why we should eat the events here? The only place where this is called
2480 // is from SvTreeListBox::KeyInput. If we set bKeyUsed to true here, then the key input
2481 // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
2482 // handling.
2483 // (The old code here which intentionally set bKeyUsed to sal_True said this was because of "quick search"
2484 // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
2485 // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
2486 bKeyUsed = false;
2487 break;
2488 }
2489 return bKeyUsed;
2490}
2491
2493{
2494 if( m_pCursor )
2495 {
2497 ShowCursor( true );
2498// auskommentiert wg. deselectall
2499// if( bSimpleTravel && !pView->IsSelected(pCursor) )
2500// pView->Select( pCursor, true );
2501 }
2503 {
2505 while( pEntry )
2506 {
2507 InvalidateEntry( pEntry );
2508 pEntry = m_pView->NextSelected( pEntry );
2509 }
2510 }
2511}
2512
2514{
2515 m_aEditIdle.Stop();
2516 if( m_pCursor )
2518 ShowCursor( false );
2519
2521 {
2522 SvTreeListEntry* pEntry = m_pView ? m_pView->FirstSelected() : nullptr;
2523 while( pEntry )
2524 {
2525 InvalidateEntry( pEntry );
2526 pEntry = m_pView->NextSelected( pEntry );
2527 }
2528 }
2529}
2530
2531
2532// ********************************************************************
2533// SelectionEngine
2534// ********************************************************************
2535
2536void SvImpLBox::SelectEntry( SvTreeListEntry* pEntry, bool bSelect )
2537{
2538 m_pView->Select( pEntry, bSelect );
2539}
2540
2542{
2543 pImp = pImpl;
2544 pView = pV;
2545}
2546
2548{
2549}
2550
2552{
2553 pImp->BeginDrag();
2554}
2555
2557{
2559}
2560
2562{
2563 pImp->m_pAnchor = nullptr;
2564}
2565
2566void ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, bool bDontSelectAtCursor)
2567{
2568 SvTreeListEntry* pNewCursor = pImp->MakePointVisible( rPoint );
2569 if( pNewCursor )
2570 {
2571 // at SimpleTravel, the SetCursor is selected and the select handler is
2572 // called
2573 //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
2574 // pImp->SelectEntry( pNewCursor, true );
2575 pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
2576 }
2577}
2578
2580{
2581 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2582 if( pEntry )
2583 return pView->IsSelected(pEntry);
2584 return false;
2585}
2586
2588{
2589 SvTreeListEntry* pEntry = pImp->MakePointVisible( rPoint );
2590 if( !pEntry )
2591 return;
2592 pImp->SelectEntry( pEntry, false );
2593}
2594
2596{
2597 pImp->SelAllDestrAnch( false, false ); // don't reset SelectionEngine!
2599}
2600
2601// ***********************************************************************
2602// Selection
2603// ***********************************************************************
2604
2606{
2607 SvTreeListEntry* pEntry;
2608 sal_uLong nAnchorVisPos = m_pView->GetVisiblePos( m_pAnchor );
2609 sal_uLong nOldVisPos = m_pView->GetVisiblePos( pOldCursor );
2610 sal_uLong nNewVisPos = m_pView->GetVisiblePos( pNewCursor );
2611
2612 if( nOldVisPos > nAnchorVisPos ||
2613 ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
2614 {
2615 if( nNewVisPos > nOldVisPos )
2616 {
2617 pEntry = pOldCursor;
2618 while( pEntry && pEntry != pNewCursor )
2619 {
2620 m_pView->Select( pEntry );
2621 pEntry = m_pView->NextVisible(pEntry);
2622 }
2623 if( pEntry )
2624 m_pView->Select( pEntry );
2625 return;
2626 }
2627
2628 if( nNewVisPos < nAnchorVisPos )
2629 {
2630 pEntry = m_pAnchor;
2631 while( pEntry && pEntry != pOldCursor )
2632 {
2633 m_pView->Select( pEntry, false );
2634 pEntry = m_pView->NextVisible(pEntry);
2635 }
2636 if( pEntry )
2637 m_pView->Select( pEntry, false );
2638
2639 pEntry = pNewCursor;
2640 while( pEntry && pEntry != m_pAnchor )
2641 {
2642 m_pView->Select( pEntry );
2643 pEntry = m_pView->NextVisible(pEntry);
2644 }
2645 if( pEntry )
2646 m_pView->Select( pEntry );
2647 return;
2648 }
2649
2650 if( nNewVisPos < nOldVisPos )
2651 {
2652 pEntry = m_pView->NextVisible(pNewCursor);
2653 while( pEntry && pEntry != pOldCursor )
2654 {
2655 m_pView->Select( pEntry, false );
2656 pEntry = m_pView->NextVisible(pEntry);
2657 }
2658 if( pEntry )
2659 m_pView->Select( pEntry, false );
2660 return;
2661 }
2662 }
2663 else
2664 {
2665 if( nNewVisPos < nOldVisPos ) // enlarge selection
2666 {
2667 pEntry = pNewCursor;
2668 while( pEntry && pEntry != pOldCursor )
2669 {
2670 m_pView->Select( pEntry );
2671 pEntry = m_pView->NextVisible(pEntry);
2672 }
2673 if( pEntry )
2674 m_pView->Select( pEntry );
2675 return;
2676 }
2677
2678 if( nNewVisPos > nAnchorVisPos )
2679 {
2680 pEntry = pOldCursor;
2681 while( pEntry && pEntry != m_pAnchor )
2682 {
2683 m_pView->Select( pEntry, false );
2684 pEntry = m_pView->NextVisible(pEntry);
2685 }
2686 if( pEntry )
2687 m_pView->Select( pEntry, false );
2688 pEntry = m_pAnchor;
2689 while( pEntry && pEntry != pNewCursor )
2690 {
2691 m_pView->Select( pEntry );
2692 pEntry = m_pView->NextVisible(pEntry);
2693 }
2694 if( pEntry )
2695 m_pView->Select( pEntry );
2696 return;
2697 }
2698
2699 if( nNewVisPos > nOldVisPos )
2700 {
2701 pEntry = pOldCursor;
2702 while( pEntry && pEntry != pNewCursor )
2703 {
2704 m_pView->Select( pEntry, false );
2705 pEntry = m_pView->NextVisible(pEntry);
2706 }
2707 return;
2708 }
2709 }
2710}
2711
2713 bool bSelect, bool bDestroyAnchor, bool bSingleSelToo )
2714{
2715 SvTreeListEntry* pEntry;
2717 if( bSelect && m_bSimpleTravel )
2718 {
2720 {
2722 }
2723 return;
2724 }
2725 if( !bSelect && m_pView->GetSelectionCount() == 0 )
2726 {
2727 if( m_bSimpleTravel && ( !GetUpdateMode() || !m_pCursor) )
2729 return;
2730 }
2731 if( bSelect && m_pView->GetSelectionCount() == m_pView->GetEntryCount())
2732 return;
2733 if( !bSingleSelToo && m_bSimpleTravel )
2734 return;
2735
2736 if( !bSelect && m_pView->GetSelectionCount()==1 && m_pCursor &&
2738 {
2739 m_pView->Select( m_pCursor, false );
2740 if( bDestroyAnchor )
2741 DestroyAnchor(); // delete anchor & reset SelectionEngine
2742 else
2743 m_pAnchor = nullptr; // always delete internal anchor
2744 return;
2745 }
2746
2749
2750 ShowCursor( false );
2751 bool bUpdate = GetUpdateMode();
2752
2753 m_nFlags |= LBoxFlags::IgnoreSelect; // EntryInserted should not do anything
2754 pEntry = m_pTree->First();
2755 while( pEntry )
2756 {
2757 if( m_pView->Select( pEntry, bSelect ) )
2758 {
2759 if( bUpdate && m_pView->IsEntryVisible(pEntry) )
2760 {
2761 tools::Long nY = GetEntryLine( pEntry );
2762 if( IsLineVisible( nY ) )
2763 InvalidateEntry(pEntry);
2764 }
2765 }
2766 pEntry = m_pTree->Next( pEntry );
2767 }
2769
2770 if( bDestroyAnchor )
2771 DestroyAnchor(); // delete anchor & reset SelectionEngine
2772 else
2773 m_pAnchor = nullptr; // always delete internal anchor
2774 ShowCursor( true );
2775}
2776
2778{
2779 m_aSelEng.SetSelectionMode( eSelMode);
2780 if( eSelMode == SelectionMode::Single )
2781 m_bSimpleTravel = true;
2782 else
2783 m_bSimpleTravel = false;
2784 if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == SelectionMode::Multiple) )
2785 m_aSelEng.AddAlways( true );
2786}
2787
2788// ***********************************************************************
2789// Drag & Drop
2790// ***********************************************************************
2791
2793{
2794 if( eDDMode != DragDropMode::NONE )
2795 {
2797 m_aSelEng.EnableDrag( true );
2798 }
2799 else
2800 {
2802 m_aSelEng.EnableDrag( false );
2803 }
2804}
2805
2807{
2810}
2811
2813{
2814 if (pEntry)
2815 {
2816
2817 SvViewDataEntry* pViewData = m_pView->GetViewData(pEntry);
2818 pViewData->SetDragTarget(bShow);
2819#ifdef MACOSX
2820 // in MacOS we need to draw directly (as we are synchronous) or no invalidation happens
2821 m_pView->PaintEntry1(*pEntry, GetEntryLine(pEntry), *m_pView->GetOutDev());
2822#else
2823 InvalidateEntry(pEntry);
2824#endif
2825 }
2826}
2827
2829{
2830 CommandEventId nCommand = rCEvt.GetCommand();
2831
2832 if( nCommand == CommandEventId::ContextMenu )
2833 m_aEditIdle.Stop();
2834
2835 // scroll mouse event?
2836 if (nCommand == CommandEventId::Wheel ||
2837 nCommand == CommandEventId::StartAutoScroll ||
2838 nCommand == CommandEventId::AutoScroll ||
2839 nCommand == CommandEventId::GesturePan)
2840 {
2842 return;
2843 }
2844
2845 const Point& rPos = rCEvt.GetMousePosPixel();
2846 if( rPos.X() < m_aOutputSize.Width() && rPos.Y() < m_aOutputSize.Height() )
2847 m_aSelEng.Command( rCEvt );
2848}
2849
2851{
2852 Point aPos( m_pView->GetMapMode().GetOrigin() );
2853 aPos.setX( aPos.X() * -1 );
2854 tools::Rectangle aRect( aPos, m_aOutputSize );
2855 return aRect;
2856}
2857
2859{
2861}
2862
2864{
2867 )
2868 SelAllDestrAnch( false );
2869 if ( pEntry )
2870 MakeVisible( pEntry );
2871 SetCursor( pEntry );
2872 if ( pEntry && ( m_aSelEng.GetSelectionMode() != SelectionMode::NONE ) )
2873 m_pView->Select( pEntry );
2874}
2875
2876IMPL_LINK_NOARG(SvImpLBox, EditTimerCall, Timer *, void)
2877{
2878 if( !m_pView->IsInplaceEditingEnabled() )
2879 return;
2880
2881 bool bIsMouseTriggered = m_aEditClickPos.X() >= 0;
2882 if ( bIsMouseTriggered )
2883 {
2884 Point aCurrentMousePos = m_pView->GetPointerPosPixel();
2885 if ( ( std::abs( aCurrentMousePos.X() - m_aEditClickPos.X() ) > 5 )
2886 || ( std::abs( aCurrentMousePos.Y() - m_aEditClickPos.Y() ) > 5 )
2887 )
2888 {
2889 return;
2890 }
2891 }
2892
2893 SvTreeListEntry* pEntry = GetCurEntry();
2894 if( pEntry )
2895 {
2896 ShowCursor( false );
2897 m_pView->ImplEditEntry( pEntry );
2898 ShowCursor( true );
2899 }
2900}
2901
2903{
2904 if( rHEvt.GetMode() & HelpEventMode::QUICK )
2905 {
2907 if( !GetVisibleArea().Contains( aPos ))
2908 return false;
2909
2910 SvTreeListEntry* pEntry = GetEntry( aPos );
2911 if( pEntry )
2912 {
2913 // recalculate text rectangle
2914 SvLBoxTab* pTab;
2915 SvLBoxItem* pItem = m_pView->GetItem( pEntry, aPos.X(), &pTab );
2916 if (!pItem || pItem->GetType() != SvLBoxItemType::String)
2917 return false;
2918
2919 aPos = GetEntryPosition( pEntry );
2920 aPos.setX( m_pView->GetTabPos( pEntry, pTab ) ); //pTab->GetPos();
2921 Size aSize(pItem->GetWidth(m_pView, pEntry), pItem->GetHeight(m_pView, pEntry));
2922 SvLBoxTab* pNextTab = NextTab( pTab );
2923 bool bItemClipped = false;
2924 // is the item cut off by its right neighbor?
2925 if( pNextTab && m_pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
2926 {
2927 aSize.setWidth( pNextTab->GetPos() - pTab->GetPos() );
2928 bItemClipped = true;
2929 }
2930 tools::Rectangle aItemRect( aPos, aSize );
2931
2932 tools::Rectangle aViewRect( GetVisibleArea() );
2933
2934 if( bItemClipped || !aViewRect.Contains( aItemRect ) )
2935 {
2936 // clip the right edge of the item at the edge of the view
2937 //if( aItemRect.Right() > aViewRect.Right() )
2938 // aItemRect.Right() = aViewRect.Right();
2939
2940 Point aPt = m_pView->OutputToScreenPixel( aItemRect.TopLeft() );
2941 aItemRect.SetLeft( aPt.X() );
2942 aItemRect.SetTop( aPt.Y() );
2943 aPt = m_pView->OutputToScreenPixel( aItemRect.BottomRight() );
2944 aItemRect.SetRight( aPt.X() );
2945 aItemRect.SetBottom( aPt.Y() );
2946
2947 Help::ShowQuickHelp( m_pView, aItemRect,
2948 static_cast<SvLBoxString*>(pItem)->GetText(), QuickHelpFlags::Left | QuickHelpFlags::VCenter );
2949 return true;
2950 }
2951 }
2952 }
2953 return false;
2954}
2955
2957{
2958 sal_uInt16 nTabCount = m_pView->TabCount();
2959 if( nTabCount <= 1 )
2960 return nullptr;
2961 for( int nTab=0; nTab < (nTabCount-1); nTab++)
2962 {
2963 if( m_pView->aTabs[nTab].get() == pTab )
2964 return m_pView->aTabs[nTab+1].get();
2965 }
2966 return nullptr;
2967}
2968
2970{
2971 if( m_bUpdateMode != bMode )
2972 {
2973 m_bUpdateMode = bMode;
2974 if( m_bUpdateMode )
2975 UpdateAll();
2976 }
2977}
2978
2980{
2982 {
2984 m_pView->SetTabs();
2986 }
2987
2988 sal_uInt16 nLastTab = m_pView->aTabs.size() - 1;
2989 sal_uInt16 nLastItem = pEntry->ItemCount() - 1;
2990 if( m_pView->aTabs.empty() || nLastItem == USHRT_MAX )
2991 return;
2992
2993 if( nLastItem < nLastTab )
2994 nLastTab = nLastItem;
2995
2996 SvLBoxTab* pTab = m_pView->aTabs[ nLastTab ].get();
2997 SvLBoxItem& rItem = pEntry->GetItem( nLastTab );
2998
2999 tools::Long nTabPos = m_pView->GetTabPos( pEntry, pTab );
3000
3001 tools::Long nMaxRight = GetOutputSize().Width();
3002 Point aPos( m_pView->GetMapMode().GetOrigin() );
3003 aPos.setX( aPos.X() * -1 ); // conversion document coordinates
3004 nMaxRight = nMaxRight + aPos.X() - 1;
3005
3006 tools::Long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50;
3007 tools::Long nTabWidth = nNextTab - nTabPos + 1;
3008 auto nItemSize = rItem.GetWidth(m_pView,pEntry);
3009 tools::Long nOffset = pTab->CalcOffset( nItemSize, nTabWidth );
3010
3011 tools::Long nRight = nTabPos + nOffset + nItemSize;
3012 if( nRight > m_nMostRight )
3013 {
3014 m_nMostRight = nRight;
3015 m_pMostRightEntry = pEntry;
3016 }
3017}
3018
3020{
3021 m_nMostRight = -1;
3022 m_pMostRightEntry = nullptr;
3023 if( !m_pView->GetModel() )
3024 return;
3025
3027 while( pEntry )
3028 {
3029 SetMostRight( pEntry );
3030 pEntry = m_pView->NextVisible( pEntry );
3031 }
3032}
3033
3035{
3036 if( !pParent )
3037 FindMostRight();
3038 else
3039 FindMostRight_Impl( pParent );
3040}
3041
3043{
3044 SvTreeListEntries& rList = m_pTree->GetChildList( pParent );
3045
3046 size_t nCount = rList.size();
3047 for( size_t nCur = 0; nCur < nCount; nCur++ )
3048 {
3049 SvTreeListEntry* pChild = rList[nCur].get();
3050 SetMostRight( pChild );
3051 if( pChild->HasChildren() && m_pView->IsExpanded( pChild ))
3052 FindMostRight_Impl( pChild );
3053 }
3054}
3055
3057{
3059 m_nCurUserEvent == nullptr )
3060 {
3062 }
3063}
3064
3066{
3068}
3069
3070IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void )
3071{
3072 m_nCurUserEvent = nullptr;
3073 if( !pArg )
3074 {
3075 m_pView->Invalidate();
3076 m_pView->PaintImmediately();
3077 }
3078 else
3079 {
3080 FindMostRight();
3081 ShowVerSBar();
3082 m_pView->Invalidate( GetVisibleArea() );
3083 }
3084}
3085
3086
3088{
3089 if( m_nCurUserEvent != nullptr )
3090 {
3092 m_nCurUserEvent = nullptr;
3093 }
3094}
3095
3097{
3098 if ( s_pDefCollapsed )
3099 // assume that all or nothing is initialized
3100 return;
3101
3102 s_pDefCollapsed = new Image(StockImage::Yes, RID_BMP_TREENODE_COLLAPSED);
3103 s_pDefExpanded = new Image(StockImage::Yes, RID_BMP_TREENODE_EXPANDED);
3104}
3105
3106
3108{
3110 return *s_pDefExpanded;
3111}
3112
3113
3115{
3117 return *s_pDefCollapsed;
3118}
3119
3120
3122{
3123 if ( m_pView )
3125}
3126
3127
3128bool SvImpLBox::IsSelectable( const SvTreeListEntry* pEntry ) const
3129{
3130 if( pEntry )
3131 {
3132 SvViewDataEntry* pViewDataNewCur = m_pView->GetViewDataEntry(pEntry);
3133 return (pViewDataNewCur == nullptr) || pViewDataNewCur->IsSelectable();
3134 }
3135 else
3136 {
3137 return false;
3138 }
3139}
3140
3141/* 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:638
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:999
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
Definition: svapp.cxx:1023
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:2566
void DeselectAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2587
void BeginDrag() override
Definition: svimpbox.cxx:2551
VclPtr< SvTreeListBox > pView
Definition: svimpbox.hxx:44
ImpLBSelEng(SvImpLBox *pImp, SvTreeListBox *pView)
Definition: svimpbox.cxx:2541
virtual ~ImpLBSelEng() override
Definition: svimpbox.cxx:2547
void CreateAnchor() override
Definition: svimpbox.cxx:2556
void DeselectAll() override
Definition: svimpbox.cxx:2595
bool IsSelectionAtPoint(const Point &rPoint) override
Definition: svimpbox.cxx:2579
void DestroyAnchor() override
Definition: svimpbox.cxx:2561
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:138
const Point & GetOrigin() const
Definition: mapmod.cxx:183
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.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
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:368
bool SelMouseMove(const MouseEvent &rMEvt)
Definition: seleng.cxx:313
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:247
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:1867
void PaintDDCursor(SvTreeListEntry *pEntry, bool bShow)
Definition: svimpbox.cxx:2812
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:2902
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:840
bool m_bInVScrollHdl
Definition: svimpbox.hxx:199
virtual void AdjustScrollBars(Size &rSize)
Definition: svimpbox.cxx:1099
bool ButtonDownCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1797
void EntryCollapsed(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1437
void SetNodeBmpWidth(const Image &)
Definition: svimpbox.cxx:1504
void EntrySelected(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:1524
void CollapseTo(SvTreeListEntry *pParentToCollapse)
Definition: svimpbox.cxx:2068
virtual void SyncVerThumb()
Definition: svimpbox.cxx:1358
static const Image & GetDefaultCollapsedNodeImage()
Definition: svimpbox.cxx:3114
virtual void KeyUp(bool bPageUp)
Definition: svimpbox.cxx:446
void CollapsingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1478
bool EntryReallyHit(SvTreeListEntry *pEntry, const Point &rPos, tools::Long nLine)
Definition: svimpbox.cxx:749
void Resize()
Definition: svimpbox.cxx:1227
bool IsExpandable() const
Definition: svimpbox.cxx:3065
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:2858
void SelectEntry(SvTreeListEntry *pEntry, bool bSelect)
Definition: svimpbox.cxx:2536
tools::Rectangle GetClipRegionRect() const
Definition: svimpbox.cxx:830
virtual void InvalidateEntry(tools::Long nY) const
Definition: svimpbox.cxx:517
SvTreeListEntry * MakePointVisible(const Point &rPoint)
Definition: svimpbox.cxx:788
static Image * s_pDefCollapsed
Definition: svimpbox.hxx:100
static const Image & GetDefaultExpandedNodeImage()
Definition: svimpbox.cxx:3107
WinBits m_nStyle
Definition: svimpbox.hxx:195
SvTreeListEntry * m_pCursor
Definition: svimpbox.hxx:189
void InitScrollBarBox()
Definition: svimpbox.cxx:1220
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:1735
void NotifyTabsChanged()
Definition: svimpbox.cxx:3056
void RecalcFocusRect()
Definition: svimpbox.cxx:561
void SetDragDropMode(DragDropMode eDDMode)
Definition: svimpbox.cxx:2792
virtual SvTreeListEntry * GetEntry(const Point &rPos) const
Definition: svimpbox.cxx:772
const Image & GetExpandedNodeBmp()
Definition: svimpbox.hxx:339
SvLBoxTab * m_pActiveTab
Definition: svimpbox.hxx:93
void SetSelectionMode(SelectionMode eSelMode)
Definition: svimpbox.cxx:2777
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:2850
void ExpandAll()
Definition: svimpbox.cxx:2056
SvLBoxButton * m_pActiveButton
Definition: svimpbox.hxx:91
virtual void CursorDown()
Definition: svimpbox.cxx:330
Size m_aOutputSize
Definition: svimpbox.hxx:193
static void implInitDefaultNodeImages()
Definition: svimpbox.cxx:3096
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:2712
void PositionScrollBars(Size &rOSize, sal_uInt16 nMask)
Definition: svimpbox.cxx:1067
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:2979
const Size & GetOutputSize() const
Definition: svimpbox.hxx:291
void SetEntryHeight()
Definition: svimpbox.cxx:1394
SvLBoxTab * NextTab(SvLBoxTab const *)
Definition: svimpbox.cxx:2956
bool ButtonUpCheckCtrl(const MouseEvent &rMEvt)
Definition: svimpbox.cxx:1843
bool ButtonDownCheckExpand(const MouseEvent &, SvTreeListEntry *)
Definition: svimpbox.cxx:1890
void SetAnchorSelection(SvTreeListEntry *pOld, SvTreeListEntry *pNewCursor)
Definition: svimpbox.cxx:2605
void EntryMoved(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1700
ImplSVEvent * m_nCurUserEvent
Definition: svimpbox.hxx:192
void StopUserEvent()
Definition: svimpbox.cxx:3087
virtual void UpdateAll()
Definition: svimpbox.cxx:670
bool mbForceMakeVisible
Definition: svimpbox.hxx:126
LBoxFlags m_nFlags
Definition: svimpbox.hxx:194
void BeginDrag()
Definition: svimpbox.cxx:2806
void SetCurEntry(SvTreeListEntry *)
Definition: svimpbox.cxx:2863
VclPtr< ScrollBar > m_aVerSBar
Definition: svimpbox.hxx:188
void SetUpdateMode(bool bMode)
Definition: svimpbox.cxx:2969
void EntryExpanded(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1416
void FindMostRight_Impl(SvTreeListEntry *pParent)
Definition: svimpbox.cxx:3042
tools::Long m_nNodeBmpWidth
Definition: svimpbox.hxx:120
void MouseButtonDown(const MouseEvent &)
Definition: svimpbox.cxx:1915
void UpdateStringSorter()
Definition: svimpbox.cxx:131
SvTreeList * m_pTree
Definition: svimpbox.hxx:88
virtual SvTreeListEntry * GetClickedEntry(const Point &) const
Definition: svimpbox.cxx:727
VclPtr< ScrollBarBox > m_aScrBarBox
Definition: svimpbox.hxx:95
std::vector< short > m_aContextBmpWidthVector
Definition: svimpbox.hxx:133
void FindMostRight()
Definition: svimpbox.cxx:3019
SvTreeListEntry * m_pCursorOld
Definition: svimpbox.hxx:190
void ShowVerSBar()
Definition: svimpbox.cxx:1294
void RemovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1551
bool MouseMoveCheckCtrl(const MouseEvent &rMEvt, SvTreeListEntry const *pEntry)
Definition: svimpbox.cxx:1816
void MovingEntry(SvTreeListEntry *pEntry)
Definition: svimpbox.cxx:1670
void LoseFocus()
Definition: svimpbox.cxx:2513
sal_uLong m_nVisibleCount
Definition: svimpbox.hxx:198
virtual bool KeyInput(const KeyEvent &)
Definition: svimpbox.cxx:2101
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:1369
void Command(const CommandEvent &rCEvt)
Definition: svimpbox.cxx:2828
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:1621
void Clear()
Definition: svimpbox.cxx:230
void GetFocus()
Definition: svimpbox.cxx:2492
void FillView()
Definition: svimpbox.cxx:1249
void MouseButtonUp(const MouseEvent &)
Definition: svimpbox.cxx:2007
void ScrollToAbsPos(tools::Long nPos)
Definition: svimpbox.cxx:950
void MakeVisible(SvTreeListEntry *pEntry, bool bMoveToTop=false)
Definition: svimpbox.cxx:909
virtual tools::Long GetEntryLine(const SvTreeListEntry *pEntry) const
Definition: svimpbox.cxx:1382
void MouseMove(const MouseEvent &)
Definition: svimpbox.cxx:2031
void DrawNet(vcl::RenderContext &rRenderContext)
Definition: svimpbox.cxx:979
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: svimpbox.cxx:3121
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:3128
void KeyLeftRight(tools::Long nDiff)
Definition: svimpbox.cxx:698
void SetNodeBmpTabDistance()
Definition: svimpbox.cxx:1510
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:266
bool IsSelected(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1310
SvTreeListEntry * NextVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:234
SvTreeListEntry * GetEntryAtAbsPos(sal_uInt32 nAbsPos) const
Definition: treelist.hxx:257
SvTreeListEntry * FirstVisible() const
Definition: treelist.hxx:231
SvTreeListEntry * PrevVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:237
bool HasViewData() const
Definition: treelist.cxx:1032
std::unique_ptr< SvTreeList > pModel
Definition: treelist.hxx:210
sal_uInt32 GetVisibleCount() const
Definition: treelist.hxx:228
bool IsEntryVisible(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:272
sal_uInt32 GetSelectionCount() const
Definition: treelist.cxx:1029
SvTreeListEntry * NextSelected(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:254
bool IsAllExpanded(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1293
SvTreeListEntry * LastVisible() const
Definition: treelist.hxx:240
SvTreeListEntry * FirstSelected() const
Definition: treelist.hxx:251
sal_uInt32 GetAbsPos(SvTreeListEntry const *pEntry) const
Definition: treelist.hxx:263
const SvViewDataEntry * GetViewData(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1327
bool IsExpanded(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1283
SvTreeListEntry * GetEntryAtVisPos(sal_uInt32 nVisPos) const
Definition: treelist.hxx:260
void SetEntryFocus(SvTreeListEntry *pEntry, bool bFocus)
Definition: treelist.cxx:1319
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()
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:1474
const SvTreeListEntry * GetParent(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1488
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:606
void Stop()
Definition: scheduler.cxx:599
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:2806
void PaintImmediately()
Definition: paint.cxx:1268
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
Definition: window2.cxx:644
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
Definition: window.cxx:3860
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1288
void HideFocus()
Definition: window2.cxx:95
void GrabFocus()
Definition: window.cxx:2976
bool HasFocus() const
Definition: window.cxx:2981
void SetMapMode()
Definition: window3.cxx:125
WinBits GetStyle() const
Definition: window2.cxx:979
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
const MapMode & GetMapMode() const
Definition: window3.cxx:99
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void Hide()
Definition: window.hxx:879
void ReleaseMouse()
Definition: mouse.cxx:469
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
Definition: window.cxx:2944
virtual void ShowFocus(const tools::Rectangle &rRect)
Definition: window2.cxx:53
virtual Size GetSizePixel() const
Definition: window.cxx:2402
bool IsVisible() const
Definition: window2.cxx:1128
void CaptureMouse()
Definition: mouse.cxx:451
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1283
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2812
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1294
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