LibreOffice Module vcl (master) 1
imivctl1.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
21#include <limits.h>
22#include <osl/diagnose.h>
23#include <tools/debug.hxx>
24#include <vcl/wall.hxx>
25#include <vcl/help.hxx>
26#include <vcl/decoview.hxx>
27#include <vcl/event.hxx>
28#include <vcl/svapp.hxx>
29#include <tools/poly.hxx>
30#include <vcl/lineinfo.hxx>
31#include <vcl/i18nhelp.hxx>
32#include <vcl/mnemonic.hxx>
33#include <vcl/settings.hxx>
34#include <vcl/commandevent.hxx>
35
37#include "imivctl.hxx"
38
39#include <algorithm>
40#include <memory>
41#include <vcl/idle.hxx>
42
43constexpr auto DRAWTEXT_FLAGS_ICON =
46
47#define DRAWTEXT_FLAGS_SMALLICON (DrawTextFlags::Left|DrawTextFlags::EndEllipsis|DrawTextFlags::Clip)
48
49#define EVENTID_SHOW_CURSOR (reinterpret_cast<void*>(1))
50#define EVENTID_ADJUST_SCROLLBARS (reinterpret_cast<void*>(2))
51
53 SvtIconChoiceCtrl* pCurView,
54 WinBits nWinStyle
55) :
56 aVerSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_VSCROLL) ),
57 aHorSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_HSCROLL) ),
58 aScrBarBox( VclPtr<ScrollBarBox>::Create(pCurView) ),
59 aAutoArrangeIdle( "svtools::SvxIconChoiceCtrl_Impl aAutoArrangeIdle" ),
60 aDocRectChangedIdle( "svtools::SvxIconChoiceCtrl_Impl aDocRectChangedIdle" ),
61 aVisRectChangedIdle( "svtools::SvxIconChoiceCtrl_Impl aVisRectChangedIdle" ),
62 aCallSelectHdlIdle( "svtools::SvxIconChoiceCtrl_Impl aCallSelectHdlIdle" ),
63 aImageSize( 32 * pCurView->GetDPIScaleFactor(), 32 * pCurView->GetDPIScaleFactor()),
64 pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT),
65 nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr),
66 pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr),
67 pHdlEntry(nullptr),
68 pAnchor(nullptr), eTextMode(SvxIconChoiceCtrlTextMode::Short),
69 eSelectionMode(SelectionMode::Multiple), ePositionMode(SvxIconChoiceCtrlPositionMode::Free),
70 bUpdateMode(true)
71{
72 SetStyle( nWinStyle );
73 pImpCursor.reset( new IcnCursor_Impl( this ) );
74 pGridMap.reset( new IcnGridMap_Impl( this ) );
75
76 aVerSBar->SetScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, ScrollUpDownHdl ) );
77 aHorSBar->SetScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl ) );
78
81
84
87
90
93
94 Clear( true );
95 Size gridSize(100,70);
96 if(pView->GetDPIScaleFactor() > 1)
97 {
98 gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) );
99 }
100 SetGrid(gridSize);
101}
102
104{
105 Clear(false);
107 pImpCursor.reset();
108 pGridMap.reset();
110 m_pColumns.reset();
114}
115
117{
118 nSelectionCount = 0;
119 pCurHighlightFrame = nullptr;
121 ShowCursor( false );
122 bBoundRectsDirty = false;
123 nMaxBoundHeight = 0;
124
125 pCursor = nullptr;
126 if( !bInCtor )
127 {
128 pImpCursor->Clear();
129 pGridMap->Clear();
132 Size aSize( pView->GetOutputSizePixel() );
134 if( nMaxVirtWidth <= 0 )
137 if( nMaxVirtHeight <= 0 )
139 maZOrderList.clear();
140 SetOrigin( Point() );
141 if( bUpdateMode )
143 }
145 maEntries.clear();
148}
149
151{
152 nWinBits = nWinStyle;
158 if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT)))
160 if( nWinStyle & WB_DETAILS )
161 {
162 if (!m_pColumns)
164 }
165}
166
167IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar, void )
168{
169 // arrow up: delta=-1; arrow down: delta=+1
170 Scroll( 0, pScrollBar->GetDelta() );
171}
172
173IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar, void )
174{
175 // arrow left: delta=-1; arrow right: delta=+1
176 Scroll( pScrollBar->GetDelta(), 0 );
177}
178
180{
182 ShowCursor( false );
183 ShowCursor( true );
184}
185
186void SvxIconChoiceCtrl_Impl::InsertEntry( std::unique_ptr<SvxIconChoiceCtrlEntry> pEntry1, size_t nPos)
187{
188 auto pEntry = pEntry1.get();
189
190 if ( nPos < maEntries.size() ) {
191 maEntries.insert( maEntries.begin() + nPos, std::move(pEntry1) );
192 } else {
193 maEntries.push_back( std::move(pEntry1) );
194 }
195
196 if( pHead )
197 pEntry->SetBacklink( pHead->pblink );
198
200 pEntry->nPos = maEntries.size() - 1;
201 else
203
204 maZOrderList.push_back( pEntry );
205 pImpCursor->Clear();
206
207 // If the UpdateMode is true, don't set all bounding rectangles to
208 // 'to be checked', but only the bounding rectangle of the new entry.
209 // Thus, don't call InvalidateBoundingRect!
210 pEntry->aRect.SetRight( LONG_MAX );
211 if( bUpdateMode )
212 {
213 FindBoundingRect( pEntry );
214 tools::Rectangle aOutputArea( GetOutputRect() );
215 pGridMap->OccupyGrids( pEntry );
216 if( !aOutputArea.Overlaps( pEntry->aRect ) )
217 return; // is invisible
218 pView->Invalidate( pEntry->aRect );
219 }
220 else
221 InvalidateBoundingRect( pEntry->aRect );
222}
223
225{
226 pImpCursor->Clear();
227 maEntries.erase(maEntries.begin() + nPos);
229}
230
232{
233 Point aOrigin( pView->GetMapMode().GetOrigin() );
234 aOrigin *= -1;
235 return tools::Rectangle( aOrigin, aOutputSize );
236}
237
239{
241 return;
242
243 size_t nCount = maEntries.size();
244 for( size_t nCur = 0; nCur < nCount; nCur++ )
245 {
246 maEntries[ nCur ]->nPos = nCur;
247 }
249}
250
252 bool bAdd )
253{
255 return;
256
257 if( !bAdd )
258 {
260 {
262 DeselectAllBut( pEntry );
264 }
265 }
266 if( pEntry->IsSelected() == bSelect )
267 return;
268
269 pHdlEntry = pEntry;
270 SvxIconViewFlags nEntryFlags = pEntry->GetFlags();
271 if( bSelect )
272 {
273 nEntryFlags |= SvxIconViewFlags::SELECTED;
274 pEntry->AssignFlags( nEntryFlags );
277 }
278 else
279 {
280 nEntryFlags &= ~SvxIconViewFlags::SELECTED;
281 pEntry->AssignFlags( nEntryFlags );
284 }
285 EntrySelected( pEntry, bSelect );
286}
287
289{
290 // When using SingleSelection, make sure that the cursor is always placed
291 // over the (only) selected entry. (But only if a cursor exists.)
292 if (bSelect && pCursor &&
294 pEntry != pCursor)
295 {
296 SetCursor(pEntry);
297 }
298
299 // Not when dragging though, else the loop in SelectRect doesn't work
300 // correctly!
302 ToTop(pEntry);
303 if (bUpdateMode)
304 {
305 if (pEntry == pCursor)
306 ShowCursor(false);
308 if (pEntry == pCursor)
309 ShowCursor(true);
310 }
311
312 // #i101012# emit vcl event LISTBOX_SELECT only in case that the given entry is selected.
313 if (bSelect)
314 {
316 }
317}
318
320{
323 const size_t nCount = maEntries.size();
324 for( size_t nCur = 0; nCur < nCount; nCur++ )
325 {
326 SvxIconChoiceCtrlEntry* pCur = maEntries[ nCur ].get();
328 if( pCur->IsPosLocked() )
329 {
330 // adapt (among others) VirtSize
331 if( !IsBoundingRectValid( pCur->aRect ) )
332 FindBoundingRect( pCur );
333 else
334 AdjustVirtSize( pCur->aRect );
335 }
336 else
338 }
339
340 if( !(nWinBits & (WB_NOVSCROLL | WB_NOHSCROLL)) )
341 {
342 Size aRealOutputSize( pView->GetOutputSizePixel() );
343 if( aVirtOutputSize.Width() < aRealOutputSize.Width() ||
344 aVirtOutputSize.Height() < aRealOutputSize.Height() )
345 {
347 aRealOutputSize, static_cast<sal_uInt16>(nGridDX), static_cast<sal_uInt16>(nGridDY) );
348 if( nGridCount < nCount )
349 {
350 if( nWinBits & WB_ALIGN_TOP )
351 nMaxVirtWidth = aRealOutputSize.Width() - nVerSBarWidth;
352 else // WB_ALIGN_LEFT
353 nMaxVirtHeight = aRealOutputSize.Height() - nHorSBarHeight;
354 }
355 }
356 }
357
358 pImpCursor->Clear();
359 pGridMap->Clear();
361}
362
364{
365 tools::Long nHeightOffs = 0;
366 tools::Long nWidthOffs = 0;
367
368 if( aVirtOutputSize.Width() < (rRect.Right()+LROFFS_WINBORDER) )
369 nWidthOffs = (rRect.Right()+LROFFS_WINBORDER) - aVirtOutputSize.Width();
370
372 nHeightOffs = (rRect.Bottom()+TBOFFS_WINBORDER) - aVirtOutputSize.Height();
373
374 if( !(nWidthOffs || nHeightOffs) )
375 return;
376
377 Range aRange;
378 aVirtOutputSize.AdjustWidth(nWidthOffs );
379 aRange.Max() = aVirtOutputSize.Width();
380 aHorSBar->SetRange( aRange );
381
382 aVirtOutputSize.AdjustHeight(nHeightOffs );
383 aRange.Max() = aVirtOutputSize.Height();
384 aVerSBar->SetRange( aRange );
385
386 pImpCursor->Clear();
387 pGridMap->OutputSizeChanged();
390}
391
393{
394 DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized");
395 size_t nCount = maEntries.size();
396 if( nCount )
397 {
398 SvxIconChoiceCtrlEntry* pPrev = maEntries[ 0 ].get();
399 for( size_t nCur = 1; nCur <= nCount; nCur++ )
400 {
402
404 if( nCur == nCount )
405 pNext = maEntries[ 0 ].get();
406 else
407 pNext = maEntries[ nCur ].get();
408 pPrev->pflink = pNext;
409 pNext->pblink = pPrev;
410 pPrev = pNext;
411 }
412 pHead = maEntries[ 0 ].get();
413 }
414 else
415 pHead = nullptr;
416}
417
419{
420 if( pHead )
421 {
422 size_t nCount = maEntries.size();
423 for( size_t nCur = 0; nCur < nCount; nCur++ )
424 {
425 SvxIconChoiceCtrlEntry* pCur = maEntries[ nCur ].get();
426 pCur->pflink = nullptr;
427 pCur->pblink = nullptr;
428 }
429 pHead = nullptr;
430 }
431}
432
433void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight )
434{
435 if ( nSetMaxVirtWidth != 0 )
436 nMaxVirtWidth = nSetMaxVirtWidth;
437 else
439
440 if ( nSetMaxVirtHeight != 0 )
441 nMaxVirtHeight = nSetMaxVirtHeight;
442 else
444
445 ImpArrange( bKeepPredecessors );
446}
447
448void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors )
449{
450 static const Point aEmptyPoint;
451
452 bool bOldUpdate = bUpdateMode;
453 tools::Rectangle aCurOutputArea( GetOutputRect() );
454 if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
455 bUpdateMode = false;
458 ShowCursor( false );
460 if( !bKeepPredecessors )
462 bBoundRectsDirty = false;
463 SetOrigin( Point() );
466 // TODO: the invalidation in the detail view should be more intelligent
467 //if( !(nWinBits & WB_DETAILS ))
470 if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
471 {
472 MakeVisible( aCurOutputArea );
473 SetUpdateMode( bOldUpdate );
474 }
475 ShowCursor( true );
476}
477
479{
480#if defined(OV_DRAWGRID)
481 Color aOldColor (rRenderContext.GetLineColor());
482 Color aCOL_BLACK);
483 rRenderContext.SetLineColor( aColor );
484 Point aOffs(rRenderContext.GetMapMode().GetOrigin());
485 Size aXSize(GetOutputSizePixel());
486 {
487 Point aStart(LROFFS_WINBORDER, 0);
488 Point aEnd(LROFFS_WINBORDER, aXSize.Height());
489 aStart -= aOffs;
490 aEnd -= aOffs;
491 rRenderContext.DrawLine(aStart, aEnd);
492 }
493 {
494 Point aStart(0, TBOFFS_WINBORDER);
495 Point aEnd(aXSize.Width(), TBOFFS_WINBORDER);
496 aStart -= aOffs;
497 aEnd -= aOffs;
498 rRenderContext.DrawLine(aStart, aEnd);
499 }
500
501 for (tools::Long nDX = nGridDX; nDX <= aXSize.Width(); nDX += nGridDX)
502 {
503 Point aStart( nDX+LROFFS_WINBORDER, 0 );
504 Point aEnd( nDX+LROFFS_WINBORDER, aXSize.Height());
505 aStart -= aOffs;
506 aEnd -= aOffs;
507 rRenderContext.DrawLine(aStart, aEnd);
508 }
509 for (tools::Long nDY = nGridDY; nDY <= aXSize.Height(); nDY += nGridDY)
510 {
511 Point aStart(0, nDY + TBOFFS_WINBORDER);
512 Point aEnd(aXSize.Width(), nDY + TBOFFS_WINBORDER);
513 aStart -= aOffs;
514 aEnd -= aOffs;
515 rRenderContext.DrawLine(aStart, aEnd);
516 }
517 rRenderContext.SetLineColor(aOldColor);
518#endif
519
520 if (!maEntries.size())
521 return;
522 if (!pCursor)
523 {
524 // set cursor to item with focus-flag
525 bool bfound = false;
526 for (sal_Int32 i = 0; i < pView->GetEntryCount() && !bfound; i++)
527 {
529 if (pEntry->IsFocused())
530 {
531 pCursor = pEntry;
532 bfound = true;
533 }
534 }
535
536 if (!bfound)
537 pCursor = maEntries[ 0 ].get();
538 }
539
540 size_t nCount = maZOrderList.size();
541 if (!nCount)
542 return;
543
544 rRenderContext.Push(vcl::PushFlags::CLIPREGION);
545 rRenderContext.SetClipRegion(vcl::Region(rRect));
546
547 std::vector< SvxIconChoiceCtrlEntry* > aNewZOrderList;
548 std::vector< SvxIconChoiceCtrlEntry* > aPaintedEntries;
549
550 size_t nPos = 0;
551 while(nCount)
552 {
554 const tools::Rectangle& rBoundRect = GetEntryBoundRect(pEntry);
555 if (rRect.Overlaps(rBoundRect))
556 {
557 PaintEntry(pEntry, rBoundRect.TopLeft(), rRenderContext);
558 // set entries to Top if they are being repainted
559 aPaintedEntries.push_back(pEntry);
560 }
561 else
562 aNewZOrderList.push_back(pEntry);
563
564 nCount--;
565 nPos++;
566 }
567 maZOrderList = std::move( aNewZOrderList );
568 maZOrderList.insert(maZOrderList.end(), aPaintedEntries.begin(), aPaintedEntries.end());
569
570 rRenderContext.Pop();
571}
572
574{
575 const size_t nCount = maZOrderList.size();
576 if (!nCount)
577 return;
578
580 for (size_t nCur = 0; nCur < nCount; nCur++)
581 {
582 SvxIconChoiceCtrlEntry* pEntry = maZOrderList[nCur];
583 if (pEntry->GetFlags() & SvxIconViewFlags::SELECTED)
584 {
585 const tools::Rectangle& rBoundRect = GetEntryBoundRect(pEntry);
586 if (aOutRect.Overlaps(rBoundRect))
587 pView->Invalidate(rBoundRect);
588 }
589 }
590}
591
593{
595 Size aSize( pView->GetOutputSizePixel() );
597}
598
600{
601 bool bHandled = true;
603 bool bGotFocus = (!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS));
604 if( !(nWinBits & WB_NOPOINTERFOCUS) )
605 pView->GrabFocus();
606
607 Point aDocPos( rMEvt.GetPosPixel() );
608 if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height())
609 return false;
610 ToDocPos( aDocPos );
611 SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, true );
612 if( pEntry )
613 MakeEntryVisible( pEntry, false );
614
616 {
617 if( pEntry )
618 SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift() );
619 return true;
620 }
621
622 if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // keyboard selection?
623 {
624 DBG_ASSERT(eSelectionMode != SelectionMode::Single,"Invalid selection mode");
625 if( rMEvt.IsMod1() )
627
628 if( rMEvt.IsShift() )
629 {
631 if( pEntry )
632 aRect.Union( GetEntryBoundRect( pEntry ) );
633 else
634 {
635 tools::Rectangle aTempRect( aDocPos, Size(1,1));
636 aRect.Union( aTempRect );
637 }
638 aCurSelectionRect = aRect;
640 }
641 else if( rMEvt.IsMod1() )
642 {
644 pAnchor = nullptr;
645 aCurSelectionRect.SetPos( aDocPos );
646 }
647
648 if( !pEntry && !(nWinBits & WB_NODRAGSELECTION))
650 return true;
651 }
652 else
653 {
654 if( !pEntry )
655 {
657 {
658 if( !rMEvt.IsMod1() ) // Ctrl
659 {
660 if( !bGotFocus )
661 {
664 }
665 }
666 else
668 aCurSelectionRect.SetPos( aDocPos );
670 }
671 else
672 bHandled = false;
673 return bHandled;
674 }
675 }
676 bool bSelected = pEntry->IsSelected();
677
678 if( rMEvt.GetClicks() == 2 )
679 {
680 DeselectAllBut( pEntry );
681 SelectEntry( pEntry, true, false );
682 pHdlEntry = pEntry;
683 pView->ClickIcon();
684 }
685 else
686 {
687 // Inplace-Editing ?
688 if( rMEvt.IsMod2() ) // Alt?
689 {
690 }
692 {
693 DeselectAllBut( pEntry );
694 SetCursor( pEntry );
695 }
697 {
698 if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) )
699 {
700 pCurHighlightFrame = nullptr; // force repaint of frame
702 SetEntryHighlightFrame( pEntry, true );
703 }
704 }
705 else
706 {
707 if( !rMEvt.GetModifier() && rMEvt.IsLeft() )
708 {
709 if( !bSelected )
710 {
711 DeselectAllBut( pEntry );
712 SetCursor( pEntry );
713 SelectEntry( pEntry, true, false );
714 }
715 else
716 {
717 // deselect only in the Up, if the Move happened via D&D!
719 }
720 }
721 else if( rMEvt.IsMod1() )
723 }
724 }
725 return bHandled;
726}
727
729{
730 bool bHandled = false;
732 {
734 bHandled = true;
735 }
736
737 Point aDocPos( rMEvt.GetPosPixel() );
738 ToDocPos( aDocPos );
739 SvxIconChoiceCtrlEntry* pDocEntry = GetEntry( aDocPos );
740 if( pDocEntry )
741 {
743 {
744 // Ctrl & MultiSelection
745 ToggleSelection( pDocEntry );
746 SetCursor( pDocEntry );
747 bHandled = true;
748 }
750 {
751 DeselectAllBut( pDocEntry );
752 SetCursor( pDocEntry );
753 SelectEntry( pDocEntry, true, false );
754 bHandled = true;
755 }
756 }
757
759
761 {
762 bHandled = true;
764 pCurHighlightFrame = nullptr; // force repaint of frame
766 SetEntryHighlightFrame( pEntry, true );
767
769 pView->ClickIcon();
770
771 // set focus on Icon
772 SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
773 SetCursor_Impl( pOldCursor, pHdlEntry, false, false );
774
775 pHdlEntry = nullptr;
776 }
777 return bHandled;
778}
779
781{
782 const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) );
783
784 if( pView->IsTracking() )
785 return false;
786 else if( nWinBits & WB_HIGHLIGHTFRAME )
787 {
788 SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, true );
789 SetEntryHighlightFrame( pEntry, false );
790 }
791 else
792 return false;
793 return true;
794}
795
797 SvxIconChoiceCtrlEntry* pNewCursor, bool bMod1, bool bShift )
798{
799 if( !pNewCursor )
800 return;
801
802 SvxIconChoiceCtrlEntry* pFilterEntry = nullptr;
803 bool bDeselectAll = false;
805 {
806 if( !bMod1 && !bShift )
807 bDeselectAll = true;
808 else if( bShift && !bMod1 && !pAnchor )
809 {
810 bDeselectAll = true;
811 pFilterEntry = pOldCursor;
812 }
813 }
814 if( bDeselectAll )
815 DeselectAllBut( pFilterEntry );
816 ShowCursor( false );
817 MakeEntryVisible( pNewCursor );
818 SetCursor( pNewCursor );
819 if( bMod1 && !bShift )
820 {
821 if( pAnchor )
822 {
823 AddSelectedRect( pAnchor, pOldCursor );
824 pAnchor = nullptr;
825 }
826 }
827 else if( bShift )
828 {
829 if( !pAnchor )
830 pAnchor = pOldCursor;
831 if ( nWinBits & WB_ALIGN_LEFT )
832 SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) );
833 else
835 }
836 else
837 {
838 SelectEntry( pCursor, true, false );
841 }
842}
843
845{
846 bool bMod2 = rKEvt.GetKeyCode().IsMod2();
847 sal_Unicode cChar = rKEvt.GetCharCode();
849 if ( bMod2 && cChar && IsMnemonicChar( cChar, nPos ) )
850 {
851 // shortcut is clicked
852 SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos );
853 SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
854 if ( pNewCursor != pOldCursor )
855 SetCursor_Impl( pOldCursor, pNewCursor, false, false );
856 return true;
857 }
858
859 if ( bMod2 )
860 // no actions with <ALT>
861 return false;
862
863 bool bKeyUsed = true;
864 bool bMod1 = rKEvt.GetKeyCode().IsMod1();
865 bool bShift = rKEvt.GetKeyCode().IsShift();
866
868 {
869 bShift = false;
870 bMod1 = false;
871 }
872
873 if( bMod1 )
875
876 SvxIconChoiceCtrlEntry* pNewCursor;
877 SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
878
879 sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
880 switch( nCode )
881 {
882 case KEY_UP:
883 case KEY_PAGEUP:
884 if( pCursor )
885 {
887 if( nCode == KEY_UP )
888 pNewCursor = pImpCursor->GoUpDown(pCursor,false);
889 else
890 pNewCursor = pImpCursor->GoPageUpDown(pCursor,false);
891 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
892 if( !pNewCursor )
893 {
895 if( aRect.Top())
896 {
897 aRect.AdjustBottom( -(aRect.Top()) );
898 aRect.SetTop( 0 );
899 MakeVisible( aRect );
900 }
901 }
902 }
903 break;
904
905 case KEY_DOWN:
906 case KEY_PAGEDOWN:
907 if( pCursor )
908 {
909 if( nCode == KEY_DOWN )
910 pNewCursor=pImpCursor->GoUpDown( pCursor,true );
911 else
912 pNewCursor=pImpCursor->GoPageUpDown( pCursor,true );
913 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
914 }
915 break;
916
917 case KEY_RIGHT:
918 if( pCursor )
919 {
920 pNewCursor=pImpCursor->GoLeftRight(pCursor,true );
921 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
922 }
923 break;
924
925 case KEY_LEFT:
926 if( pCursor )
927 {
929 pNewCursor = pImpCursor->GoLeftRight(pCursor,false );
930 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
931 if( !pNewCursor )
932 {
934 if( aRect.Left() )
935 {
936 aRect.AdjustRight( -(aRect.Left()) );
937 aRect.SetLeft( 0 );
938 MakeVisible( aRect );
939 }
940 }
941 }
942 break;
943
944 case KEY_F2:
945 if( bMod1 || bShift )
946 bKeyUsed = false;
947 break;
948
949 case KEY_F8:
950 if( rKEvt.GetKeyCode().IsShift() )
951 {
954 else
956 }
957 else
958 bKeyUsed = false;
959 break;
960
961 case KEY_SPACE:
963 {
964 if( !bMod1 )
965 {
966 //SelectAll( false );
969
970 // click Icon with spacebar
972 pView->ClickIcon();
974 pCurHighlightFrame=nullptr;
975 }
976 else
978 }
979 break;
980
981#ifdef DBG_UTIL
982 case KEY_F10:
983 if( rKEvt.GetKeyCode().IsShift() )
984 {
985 if( pCursor )
987 }
988 if( rKEvt.GetKeyCode().IsMod1() )
989 {
990 if( pCursor )
992 }
993 break;
994#endif
995
996 case KEY_ADD:
997 case KEY_DIVIDE :
998 case KEY_A:
999 if( bMod1 && (eSelectionMode != SelectionMode::Single))
1000 SelectAll();
1001 else
1002 bKeyUsed = false;
1003 break;
1004
1005 case KEY_SUBTRACT:
1006 case KEY_COMMA :
1007 if( bMod1 )
1009 else
1010 bKeyUsed = false;
1011 break;
1012
1013 case KEY_RETURN:
1014 if( !bMod1 )
1015 bKeyUsed = false;
1016 break;
1017
1018 case KEY_END:
1019 if( pCursor )
1020 {
1021 pNewCursor = maEntries.back().get();
1022 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
1023 }
1024 break;
1025
1026 case KEY_HOME:
1027 if( pCursor )
1028 {
1029 pNewCursor = maEntries[ 0 ].get();
1030 SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift );
1031 }
1032 break;
1033
1034 default:
1035 bKeyUsed = false;
1036
1037 }
1038 return bKeyUsed;
1039}
1040
1041// recalculate TopLeft of scrollbars (but not their sizes!)
1043{
1044 // horizontal scrollbar
1045 Point aPos( 0, nRealHeight );
1046 aPos.AdjustY( -nHorSBarHeight );
1047
1048 if( aHorSBar->GetPosPixel() != aPos )
1049 aHorSBar->SetPosPixel( aPos );
1050
1051 // vertical scrollbar
1052 aPos.setX( nRealWidth ); aPos.setY( 0 );
1053 aPos.AdjustX( -nVerSBarWidth );
1054 aPos.AdjustX( 1 );
1055 aPos.AdjustY( -1 );
1056
1057 if( aVerSBar->GetPosPixel() != aPos )
1058 aVerSBar->SetPosPixel( aPos );
1059}
1060
1062{
1063 tools::Long nVirtHeight = aVirtOutputSize.Height();
1064 tools::Long nVirtWidth = aVirtOutputSize.Width();
1065
1066 Size aOSize( pView->Control::GetOutputSizePixel() );
1067 tools::Long nRealHeight = aOSize.Height();
1068 tools::Long nRealWidth = aOSize.Width();
1069
1070 PositionScrollBars( nRealWidth, nRealHeight );
1071
1072 const MapMode& rMapMode = pView->GetMapMode();
1073 Point aOrigin( rMapMode.GetOrigin() );
1074
1075 tools::Long nVisibleWidth;
1076 if( nRealWidth > nVirtWidth )
1077 nVisibleWidth = nVirtWidth + aOrigin.X();
1078 else
1079 nVisibleWidth = nRealWidth;
1080
1081 tools::Long nVisibleHeight;
1082 if( nRealHeight > nVirtHeight )
1083 nVisibleHeight = nVirtHeight + aOrigin.Y();
1084 else
1085 nVisibleHeight = nRealHeight;
1086
1087 bool bVerSBar = ( nWinBits & WB_VSCROLL ) != 0;
1088 bool bHorSBar = ( nWinBits & WB_HSCROLL ) != 0;
1089 bool bNoVerSBar = ( nWinBits & WB_NOVSCROLL ) != 0;
1090 bool bNoHorSBar = ( nWinBits & WB_NOHSCROLL ) != 0;
1091
1092 sal_uInt16 nResult = 0;
1093 if( nVirtHeight )
1094 {
1095 // activate vertical scrollbar?
1096 if( !bNoVerSBar && (bVerSBar || ( nVirtHeight > nVisibleHeight)) )
1097 {
1098 nResult = 0x0001;
1099 nRealWidth -= nVerSBarWidth;
1100
1101 if( nRealWidth > nVirtWidth )
1102 nVisibleWidth = nVirtWidth + aOrigin.X();
1103 else
1104 nVisibleWidth = nRealWidth;
1105 }
1106 // activate horizontal scrollbar?
1107 if( !bNoHorSBar && (bHorSBar || (nVirtWidth > nVisibleWidth)) )
1108 {
1109 nResult |= 0x0002;
1110 nRealHeight -= nHorSBarHeight;
1111
1112 if( nRealHeight > nVirtHeight )
1113 nVisibleHeight = nVirtHeight + aOrigin.Y();
1114 else
1115 nVisibleHeight = nRealHeight;
1116
1117 // do we need a vertical scrollbar after all?
1118 if( !(nResult & 0x0001) && // only if not already there
1119 ( !bNoVerSBar && ((nVirtHeight > nVisibleHeight) || bVerSBar)) )
1120 {
1121 nResult = 3; // both turned on
1122 nRealWidth -= nVerSBarWidth;
1123
1124 if( nRealWidth > nVirtWidth )
1125 nVisibleWidth = nVirtWidth + aOrigin.X();
1126 else
1127 nVisibleWidth = nRealWidth;
1128 }
1129 }
1130 }
1131
1132 // size vertical scrollbar
1133 tools::Long nThumb = aVerSBar->GetThumbPos();
1134 Size aSize( nVerSBarWidth, nRealHeight );
1135 aSize.AdjustHeight(2 );
1136 if( aSize != aVerSBar->GetSizePixel() )
1137 aVerSBar->SetSizePixel( aSize );
1138 aVerSBar->SetVisibleSize( nVisibleHeight );
1139 aVerSBar->SetPageSize( GetScrollBarPageSize( nVisibleHeight ));
1140
1141 if( nResult & 0x0001 )
1142 {
1143 aVerSBar->SetThumbPos( nThumb );
1144 aVerSBar->Show();
1145 }
1146 else
1147 {
1148 aVerSBar->SetThumbPos( 0 );
1149 aVerSBar->Hide();
1150 }
1151
1152 // size horizontal scrollbar
1153 nThumb = aHorSBar->GetThumbPos();
1154 aSize.setWidth( nRealWidth );
1155 aSize.setHeight( nHorSBarHeight );
1156 aSize.AdjustWidth( 1 );
1157 if( nResult & 0x0001 ) // vertical scrollbar?
1158 {
1159 aSize.AdjustWidth( 1 );
1160 nRealWidth++;
1161 }
1162 if( aSize != aHorSBar->GetSizePixel() )
1163 aHorSBar->SetSizePixel( aSize );
1164 aHorSBar->SetVisibleSize( nVisibleWidth );
1165 aHorSBar->SetPageSize( GetScrollBarPageSize(nVisibleWidth ));
1166 if( nResult & 0x0002 )
1167 {
1168 aHorSBar->SetThumbPos( nThumb );
1169 aHorSBar->Show();
1170 }
1171 else
1172 {
1173 aHorSBar->SetThumbPos( 0 );
1174 aHorSBar->Hide();
1175 }
1176
1177 aOutputSize.setWidth( nRealWidth );
1178 if( nResult & 0x0002 ) // horizontal scrollbar ?
1179 nRealHeight++; // because lower border is clipped
1180 aOutputSize.setHeight( nRealHeight );
1181
1182 if( (nResult & (0x0001|0x0002)) == (0x0001|0x0002) )
1183 aScrBarBox->Show();
1184 else
1185 aScrBarBox->Hide();
1186}
1187
1189{
1192 pImpCursor->Clear();
1193 pGridMap->OutputSizeChanged();
1194
1195 const Size& rSize = pView->Control::GetOutputSizePixel();
1196 PositionScrollBars( rSize.Width(), rSize.Height() );
1197 // The scrollbars are shown/hidden asynchronously, so derived classes can
1198 // do an Arrange during Resize, without the scrollbars suddenly turning
1199 // on and off again.
1200 // If an event is already underway, we don't need to send a new one, at least
1201 // as long as there is only one event type.
1206
1208}
1209
1211{
1212 if( maZOrderList.empty() || !aHorSBar->IsVisible() )
1213 return false;
1214 const MapMode& rMapMode = pView->GetMapMode();
1215 Point aOrigin( rMapMode.GetOrigin() );
1216 if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() )
1217 {
1218 tools::Long nWidth = aOutputSize.Width();
1219 const size_t nCount = maZOrderList.size();
1220 tools::Long nMostRight = 0;
1221 for( size_t nCur = 0; nCur < nCount; nCur++ )
1222 {
1223 SvxIconChoiceCtrlEntry* pEntry = maZOrderList[ nCur ];
1224 tools::Long nRight = GetEntryBoundRect(pEntry).Right();
1225 if( nRight > nWidth )
1226 return false;
1227 if( nRight > nMostRight )
1228 nMostRight = nRight;
1229 }
1230 aHorSBar->Hide();
1232 aVirtOutputSize.setWidth( nMostRight );
1233 aHorSBar->SetThumbPos( 0 );
1234 Range aRange;
1235 aRange.Max() = nMostRight - 1;
1236 aHorSBar->SetRange( aRange );
1237 if( aVerSBar->IsVisible() )
1238 {
1239 Size aSize( aVerSBar->GetSizePixel());
1241 aVerSBar->SetSizePixel( aSize );
1242 }
1243 return true;
1244 }
1245 return false;
1246}
1247
1249{
1250 if( maZOrderList.empty() || !aVerSBar->IsVisible() )
1251 return false;
1252 const MapMode& rMapMode = pView->GetMapMode();
1253 Point aOrigin( rMapMode.GetOrigin() );
1254 if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() )
1255 {
1256 tools::Long nDeepest = 0;
1257 tools::Long nHeight = aOutputSize.Height();
1258 const size_t nCount = maZOrderList.size();
1259 for( size_t nCur = 0; nCur < nCount; nCur++ )
1260 {
1261 SvxIconChoiceCtrlEntry* pEntry = maZOrderList[ nCur ];
1262 tools::Long nBottom = GetEntryBoundRect(pEntry).Bottom();
1263 if( nBottom > nHeight )
1264 return false;
1265 if( nBottom > nDeepest )
1266 nDeepest = nBottom;
1267 }
1268 aVerSBar->Hide();
1270 aVirtOutputSize.setHeight( nDeepest );
1271 aVerSBar->SetThumbPos( 0 );
1272 Range aRange;
1273 aRange.Max() = nDeepest - 1;
1274 aVerSBar->SetRange( aRange );
1275 if( aHorSBar->IsVisible() )
1276 {
1277 Size aSize( aHorSBar->GetSizePixel());
1278 aSize.AdjustWidth(nVerSBarWidth );
1279 aHorSBar->SetSizePixel( aSize );
1280 }
1281 return true;
1282 }
1283 return false;
1284}
1285
1286
1287// hides scrollbars if they're unnecessary
1289{
1291 if( CheckHorScrollBar() )
1293 if( aVerSBar->IsVisible() && aHorSBar->IsVisible() )
1294 aScrBarBox->Show();
1295 else
1296 aScrBarBox->Hide();
1297}
1298
1299
1301{
1303 if( pCursor )
1304 {
1306 ShowCursor( true );
1307 }
1308}
1309
1311{
1312 if( pCursor )
1314 ShowCursor( false );
1315
1316// HideFocus ();
1317// pView->Invalidate ( aFocus.aRect );
1318
1320}
1321
1323{
1324 if( bUpdate != bUpdateMode )
1325 {
1326 bUpdateMode = bUpdate;
1327 if( bUpdate )
1328 {
1330 pImpCursor->Clear();
1331 pGridMap->Clear();
1333 }
1334 }
1335}
1336
1337// priorities of the emphasis: bSelected
1338void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bool bSelected,
1339 vcl::RenderContext& rRenderContext)
1340{
1341 Color aOldFillColor(rRenderContext.GetFillColor());
1342
1343 bool bSolidTextRect = false;
1344
1345 if (!bSelected)
1346 {
1347 const Color& rFillColor = rRenderContext.GetFont().GetFillColor();
1348 rRenderContext.SetFillColor(rFillColor);
1349 if (rFillColor != COL_TRANSPARENT)
1350 bSolidTextRect = true;
1351 }
1352
1353 // draw text rectangle
1354 if (bSolidTextRect)
1355 {
1356 rRenderContext.DrawRect(rTextRect);
1357 }
1358
1359 rRenderContext.SetFillColor(aOldFillColor);
1360}
1361
1362
1364 IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags,
1365 vcl::RenderContext& rRenderContext )
1366{
1367 if (eItem == IcnViewFieldType::Text)
1368 {
1369 OUString aText = SvtIconChoiceCtrl::GetEntryText(pEntry);
1370
1371 rRenderContext.DrawText(rRect, aText, nCurTextDrawFlags);
1372
1373 if (pEntry->IsFocused())
1374 {
1375 tools::Rectangle aRect (CalcFocusRect(pEntry));
1376 ShowFocus(aRect);
1377 DrawFocusRect(rRenderContext);
1378 }
1379 }
1380 else
1381 {
1382 Point aPos(rRect.TopLeft());
1383 if (nPaintFlags & PAINTFLAG_HOR_CENTERED)
1384 aPos.AdjustX((rRect.GetWidth() - aImageSize.Width()) / 2 );
1385 if (nPaintFlags & PAINTFLAG_VER_CENTERED)
1386 aPos.AdjustY((rRect.GetHeight() - aImageSize.Height()) / 2 );
1387 SvtIconChoiceCtrl::DrawEntryImage(pEntry, aPos, rRenderContext);
1388 }
1389}
1390
1392{
1393 bool bSelected = false;
1394
1396 bSelected = pEntry->IsSelected();
1397
1399
1400 OUString aEntryText(SvtIconChoiceCtrl::GetEntryText(pEntry));
1401 tools::Rectangle aTextRect(CalcTextRect(pEntry, &rPos, &aEntryText));
1402 tools::Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos));
1403
1404 bool bShowSelection = (bSelected && (eSelectionMode != SelectionMode::NONE));
1405
1406 bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus();
1407
1408 if (bShowSelection)
1409 {
1410 const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
1411 vcl::Font aNewFont(rRenderContext.GetFont());
1412
1413 // font fill colors that are attributed "hard" need corresponding "hard"
1414 // attributed highlight colors
1416 aNewFont.SetFillColor(rSettings.GetHighlightColor());
1417 else
1418 aNewFont.SetFillColor(rSettings.GetDeactiveColor());
1419
1420 Color aWinCol = rSettings.GetWindowTextColor();
1421 if (!bActiveSelection && rSettings.GetFaceColor().IsBright() == aWinCol.IsBright())
1422 aNewFont.SetColor(rSettings.GetWindowTextColor());
1423 else
1424 aNewFont.SetColor(rSettings.GetHighlightTextColor());
1425
1426 rRenderContext.SetFont(aNewFont);
1427
1428 rRenderContext.SetFillColor(rRenderContext.GetBackground().GetColor());
1429 rRenderContext.DrawRect(CalcFocusRect(pEntry));
1430 rRenderContext.SetFillColor();
1431 }
1432
1433 bool bResetClipRegion = false;
1434 if (!rRenderContext.IsClipRegion() && (aVerSBar->IsVisible() || aHorSBar->IsVisible()))
1435 {
1436 tools::Rectangle aOutputArea(GetOutputRect());
1437 if (aOutputArea.Overlaps(aTextRect) || aOutputArea.Overlaps(aBmpRect))
1438 {
1439 rRenderContext.SetClipRegion(vcl::Region(aOutputArea));
1440 bResetClipRegion = true;
1441 }
1442 }
1443
1444 bool bLargeIconMode = WB_ICON == ( nWinBits & VIEWMODE_MASK );
1445 sal_uInt16 nBmpPaintFlags = PAINTFLAG_VER_CENTERED;
1446 if (bLargeIconMode)
1447 nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED;
1448 sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
1449
1450 PaintEmphasis(aTextRect, bSelected, rRenderContext);
1451
1452 if ( bShowSelection )
1454 bActiveSelection ? 1 : 2, false, true, false);
1455
1456
1457 PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, rRenderContext);
1458
1459 PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, rRenderContext);
1460
1461 // draw highlight frame
1462 if (pEntry == pCurHighlightFrame)
1463 DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry));
1464
1465 rRenderContext.Pop();
1466 if (bResetClipRegion)
1467 rRenderContext.SetClipRegion();
1468}
1469
1471{
1472 ShowCursor( false );
1473 tools::Rectangle aBoundRect( GetEntryBoundRect( pEntry ));
1474 pView->Invalidate( aBoundRect );
1475 ToTop( pEntry );
1476 if( !IsAutoArrange() )
1477 {
1478 bool bAdjustVirtSize = false;
1479 if( rPos != aBoundRect.TopLeft() )
1480 {
1481 Point aGridOffs(
1482 pEntry->aGridRect.TopLeft() - pEntry->aRect.TopLeft() );
1483 pImpCursor->Clear();
1484 pGridMap->Clear();
1485 aBoundRect.SetPos( rPos );
1486 pEntry->aRect = aBoundRect;
1487 pEntry->aGridRect.SetPos( rPos + aGridOffs );
1488 bAdjustVirtSize = true;
1489 }
1490 if( bAdjustVirtSize )
1491 AdjustVirtSize( pEntry->aRect );
1492
1493 pView->Invalidate( pEntry->aRect );
1494 pGridMap->OccupyGrids( pEntry );
1495 }
1496 else
1497 {
1498 SvxIconChoiceCtrlEntry* pPrev = FindEntryPredecessor( pEntry, rPos );
1499 SetEntryPredecessor( pEntry, pPrev );
1501 }
1502 ShowCursor( true );
1503}
1504
1506{
1507 // block recursive calls via SelectEntry
1509 {
1511 DeselectAllBut( nullptr );
1513 }
1514}
1515
1517{
1519 // search through z-order list from the end
1520 size_t nCount = maZOrderList.size();
1521 while( nCount )
1522 {
1523 nCount--;
1525 if( pEntry->aRect.Contains( rDocPos ) )
1526 {
1527 if( bHit )
1528 {
1529 tools::Rectangle aRect = CalcBmpRect( pEntry );
1530 aRect.AdjustTop( -3 );
1531 aRect.AdjustBottom(3 );
1532 aRect.AdjustLeft( -3 );
1533 aRect.AdjustRight(3 );
1534 if( aRect.Contains( rDocPos ) )
1535 return pEntry;
1536 aRect = CalcTextRect( pEntry );
1537 if( aRect.Contains( rDocPos ) )
1538 return pEntry;
1539 }
1540 else
1541 return pEntry;
1542 }
1543 }
1544 return nullptr;
1545}
1546
1548{
1549 if ( bBound )
1550 {
1551 const tools::Rectangle& rRect = GetEntryBoundRect( pEntry );
1552 MakeVisible( rRect );
1553 }
1554 else
1555 {
1556 tools::Rectangle aRect = CalcBmpRect( pEntry );
1557 aRect.Union( CalcTextRect( pEntry ) );
1558 aRect.AdjustTop(TBOFFS_BOUND );
1559 aRect.AdjustBottom(TBOFFS_BOUND );
1560 aRect.AdjustLeft(LROFFS_BOUND );
1561 aRect.AdjustRight(LROFFS_BOUND );
1562 MakeVisible( aRect );
1563 }
1564}
1565
1567{
1568 if( !IsBoundingRectValid( pEntry->aRect ))
1569 FindBoundingRect( pEntry );
1570 return pEntry->aRect;
1571}
1572
1574{
1575 tools::Rectangle aBound = GetEntryBoundRect( pEntry );
1576 if( pPos )
1577 aBound.SetPos( *pPos );
1578 Point aPos( aBound.TopLeft() );
1579
1580 switch( nWinBits & VIEWMODE_MASK )
1581 {
1582 case WB_ICON:
1583 {
1584 aPos.AdjustX(( aBound.GetWidth() - aImageSize.Width() ) / 2 );
1585 return tools::Rectangle( aPos, aImageSize );
1586 }
1587
1588 case WB_SMALLICON:
1589 case WB_DETAILS:
1590 aPos.AdjustY(( aBound.GetHeight() - aImageSize.Height() ) / 2 );
1591 //TODO: determine horizontal distance to bounding rectangle
1592 return tools::Rectangle( aPos, aImageSize );
1593
1594 default:
1595 OSL_FAIL("IconView: Viewmode not set");
1596 return aBound;
1597 }
1598}
1599
1601 const Point* pEntryPos, const OUString* pStr )
1602{
1603 OUString aEntryText;
1604 if( !pStr )
1605 aEntryText = SvtIconChoiceCtrl::GetEntryText( pEntry );
1606 else
1607 aEntryText = *pStr;
1608
1609 const tools::Rectangle aMaxTextRect( CalcMaxTextRect( pEntry ) );
1610 tools::Rectangle aBound( GetEntryBoundRect( pEntry ) );
1611 if( pEntryPos )
1612 aBound.SetPos( *pEntryPos );
1613
1614 tools::Rectangle aTextRect = pView->GetTextRect( aMaxTextRect, aEntryText, nCurTextDrawFlags );
1615
1616 Size aTextSize( aTextRect.GetSize() );
1617
1618 Point aPos( aBound.TopLeft() );
1619 tools::Long nBoundWidth = aBound.GetWidth();
1620 tools::Long nBoundHeight = aBound.GetHeight();
1621
1622 switch( nWinBits & VIEWMODE_MASK )
1623 {
1624 case WB_ICON:
1625 aPos.AdjustY(aImageSize.Height() );
1627 aPos.AdjustX((nBoundWidth - aTextSize.Width()) / 2 );
1628 break;
1629
1630 case WB_SMALLICON:
1631 case WB_DETAILS:
1632 aPos.AdjustX(aImageSize.Width() );
1634 aPos.AdjustY((nBoundHeight - aTextSize.Height()) / 2 );
1635 break;
1636 }
1637 return tools::Rectangle( aPos, aTextSize );
1638}
1639
1640
1642{
1644 tools::Long nWidth = 0;
1645
1646 switch( nWinBits & VIEWMODE_MASK )
1647 {
1648 case WB_ICON:
1649 nWidth = std::max( nStringWidth, aImageSize.Width() );
1650 break;
1651
1652 case WB_SMALLICON:
1653 case WB_DETAILS:
1654 nWidth = aImageSize.Width();
1655 nWidth += HOR_DIST_BMP_STRING;
1656 nWidth += nStringWidth;
1657 break;
1658 }
1659 return nWidth;
1660}
1661
1663{
1665 tools::Long nHeight = 0;
1666
1667 switch( nWinBits & VIEWMODE_MASK )
1668 {
1669 case WB_ICON:
1670 nHeight = aImageSize.Height();
1671 nHeight += VER_DIST_BMP_STRING;
1672 nHeight += nStringHeight;
1673 break;
1674
1675 case WB_SMALLICON:
1676 case WB_DETAILS:
1677 nHeight = std::max( aImageSize.Height(), nStringHeight );
1678 break;
1679 }
1680 if( nHeight > nMaxBoundHeight )
1681 {
1682 const_cast<SvxIconChoiceCtrl_Impl*>(this)->nMaxBoundHeight = nHeight;
1685 }
1686 return nHeight;
1687}
1688
1690{
1692}
1693
1695{
1696 nMaxBoundHeight = 0;
1697 maZOrderList.clear();
1698 size_t nCur;
1699 SvxIconChoiceCtrlEntry* pEntry;
1700 const size_t nCount = maEntries.size();
1701
1702 if( !IsAutoArrange() || !pHead )
1703 {
1704 for( nCur = 0; nCur < nCount; nCur++ )
1705 {
1706 pEntry = maEntries[ nCur ].get();
1707 if( IsBoundingRectValid( pEntry->aRect ))
1708 {
1709 Size aBoundSize( pEntry->aRect.GetSize() );
1710 if( aBoundSize.Height() > nMaxBoundHeight )
1711 nMaxBoundHeight = aBoundSize.Height();
1712 }
1713 else
1714 FindBoundingRect( pEntry );
1715 maZOrderList.push_back( pEntry );
1716 }
1717 }
1718 else
1719 {
1720 nCur = 0;
1721 pEntry = pHead;
1722 while( nCur != nCount )
1723 {
1724 DBG_ASSERT(pEntry->pflink&&pEntry->pblink,"SvxIconChoiceCtrl_Impl::RecalcAllBoundingRect > Bad link(s)");
1725 if( IsBoundingRectValid( pEntry->aRect ))
1726 {
1727 Size aBoundSize( pEntry->aRect.GetSize() );
1728 if( aBoundSize.Height() > nMaxBoundHeight )
1729 nMaxBoundHeight = aBoundSize.Height();
1730 }
1731 else
1732 FindBoundingRect( pEntry );
1733 maZOrderList.push_back( pEntry );
1734 pEntry = pEntry->pflink;
1735 nCur++;
1736 }
1737 }
1739}
1740
1742{
1743 DBG_ASSERT(!pEntry->IsPosLocked(),"Locked entry pos in FindBoundingRect");
1744 if( pEntry->IsPosLocked() && IsBoundingRectValid( pEntry->aRect) )
1745 {
1746 AdjustVirtSize( pEntry->aRect );
1747 return;
1748 }
1749 Size aSize( CalcBoundingSize() );
1750 Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid()).TopLeft());
1751 SetBoundingRect_Impl( pEntry, aPos, aSize );
1752}
1753
1755 const Size& /*rBoundingSize*/ )
1756{
1757 tools::Rectangle aGridRect( rPos, Size(nGridDX, nGridDY) );
1758 pEntry->aGridRect = aGridRect;
1759 Center( pEntry );
1760 AdjustVirtSize( pEntry->aRect );
1761 pGridMap->OccupyGrids( pEntry );
1762}
1763
1764
1766{
1767 if( pEntry == pCursor )
1768 {
1770 !pCursor->IsSelected() )
1771 SelectEntry( pCursor, true );
1772 return;
1773 }
1774 ShowCursor( false );
1775 SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
1776 pCursor = pEntry;
1777 if( pOldCursor )
1778 {
1781 SelectEntry( pOldCursor, false ); // deselect old cursor
1782 }
1783 if( pCursor )
1784 {
1785 ToTop( pCursor );
1788 SelectEntry( pCursor, true );
1789 ShowCursor( true );
1790 }
1791}
1792
1793
1795{
1796 if( !pCursor || !bShow || !pView->HasFocus() )
1797 {
1798 pView->HideFocus();
1799 return;
1800 }
1802 /*pView->*/ShowFocus( aRect );
1803}
1804
1805
1807{
1809}
1810
1812{
1813 tools::Rectangle aDocRect( Point(), aVirtOutputSize );
1814 tools::Rectangle aVisRect( GetOutputRect() );
1815 if( aVisRect.Contains( aDocRect ))
1816 return false;
1817 Size aDocSize( aDocRect.GetSize() );
1818 Size aVisSize( aVisRect.GetSize() );
1819 bool bHor = aDocSize.Width() > aVisSize.Width();
1820 bool bVer = aDocSize.Height() > aVisSize.Height();
1821
1822 tools::Long nScrollDX = 0, nScrollDY = 0;
1823
1824 switch( rCmd.GetCommand() )
1825 {
1827 {
1828 pView->EndTracking();
1830 if( bHor )
1831 nScrollFlags |= StartAutoScrollFlags::Horz;
1832 if( bVer )
1833 nScrollFlags |= StartAutoScrollFlags::Vert;
1834 if( nScrollFlags != StartAutoScrollFlags::NONE )
1835 {
1836 pView->StartAutoScroll( nScrollFlags );
1837 return true;
1838 }
1839 }
1840 break;
1841
1843 {
1844 const CommandWheelData* pData = rCmd.GetWheelData();
1845 if( pData && (CommandWheelMode::SCROLL == pData->GetMode()) && !pData->IsHorz() )
1846 {
1847 sal_uLong nScrollLines = pData->GetScrollLines();
1848 if( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
1849 {
1850 nScrollDY = GetScrollBarPageSize( aVisSize.Width() );
1851 if( pData->GetDelta() < 0 )
1852 nScrollDY *= -1;
1853 }
1854 else
1855 {
1856 nScrollDY = pData->GetNotchDelta() * static_cast<tools::Long>(nScrollLines);
1857 nScrollDY *= GetScrollBarLineSize();
1858 }
1859 }
1860 }
1861 break;
1862
1864 {
1866 if( pData )
1867 {
1868 nScrollDX = pData->GetDeltaX() * GetScrollBarLineSize();
1869 nScrollDY = pData->GetDeltaY() * GetScrollBarLineSize();
1870 }
1871 }
1872 break;
1873
1874 default: break;
1875 }
1876
1877 if( nScrollDX || nScrollDY )
1878 {
1879 aVisRect.AdjustTop( -nScrollDY );
1880 aVisRect.AdjustBottom( -nScrollDY );
1881 aVisRect.AdjustLeft( -nScrollDX );
1882 aVisRect.AdjustRight( -nScrollDX );
1883 MakeVisible( aVisRect );
1884 return true;
1885 }
1886 return false;
1887}
1888
1889
1891{
1892 // scroll mouse event?
1893 if( (rCEvt.GetCommand() == CommandEventId::Wheel) ||
1896 {
1897 if( HandleScrollCommand( rCEvt ) )
1898 return;
1899 }
1900}
1901
1903{
1904 if( maZOrderList.empty() || pEntry == maZOrderList.back())
1905 return;
1906
1907 auto it = std::find(maZOrderList.begin(), maZOrderList.end(), pEntry);
1908 if (it != maZOrderList.end())
1909 {
1910 maZOrderList.erase( it );
1911 maZOrderList.push_back( pEntry );
1912 }
1913}
1914
1916{
1917 if( rRect.Bottom() >= aVirtOutputSize.Height() )
1918 rRect.SetBottom( aVirtOutputSize.Height() - 1 );
1919 if( rRect.Right() >= aVirtOutputSize.Width() )
1920 rRect.SetRight( aVirtOutputSize.Width() - 1 );
1921 if( rRect.Top() < 0 )
1922 rRect.SetTop( 0 );
1923 if( rRect.Left() < 0 )
1924 rRect.SetLeft( 0 );
1925}
1926
1927// rRect: area of the document (in document coordinates) that we want to make
1928// visible
1929// bScrBar == true: rectangle was calculated because of a scrollbar event
1930
1932{
1933 tools::Rectangle aVirtRect( rRect );
1934 ClipAtVirtOutRect( aVirtRect );
1935 Point aOrigin( pView->GetMapMode().GetOrigin() );
1936 // convert to document coordinate
1937 aOrigin *= -1;
1938 tools::Rectangle aOutputArea( GetOutputRect() );
1939 if( aOutputArea.Contains( aVirtRect ) )
1940 return; // is already visible
1941
1942 tools::Long nDy;
1943 if( aVirtRect.Top() < aOutputArea.Top() )
1944 {
1945 // scroll up (nDy < 0)
1946 nDy = aVirtRect.Top() - aOutputArea.Top();
1947 }
1948 else if( aVirtRect.Bottom() > aOutputArea.Bottom() )
1949 {
1950 // scroll down (nDy > 0)
1951 nDy = aVirtRect.Bottom() - aOutputArea.Bottom();
1952 }
1953 else
1954 nDy = 0;
1955
1956 tools::Long nDx;
1957 if( aVirtRect.Left() < aOutputArea.Left() )
1958 {
1959 // scroll to the left (nDx < 0)
1960 nDx = aVirtRect.Left() - aOutputArea.Left();
1961 }
1962 else if( aVirtRect.Right() > aOutputArea.Right() )
1963 {
1964 // scroll to the right (nDx > 0)
1965 nDx = aVirtRect.Right() - aOutputArea.Right();
1966 }
1967 else
1968 nDx = 0;
1969
1970 aOrigin.AdjustX(nDx );
1971 aOrigin.AdjustY(nDy );
1972 aOutputArea.SetPos( aOrigin );
1973 if( GetUpdateMode() )
1974 {
1975 HideDDIcon();
1977 ShowCursor( false );
1978 }
1979
1980 // invert origin for SV (so we can scroll/paint using document coordinates)
1981 aOrigin *= -1;
1982 SetOrigin( aOrigin );
1983
1984 bool bScrollable = pView->GetBackground().IsScrollable();
1985
1986 if( bScrollable && GetUpdateMode() )
1987 {
1988 // scroll in reverse direction!
1989 pView->Control::Scroll( -nDx, -nDy, aOutputArea,
1991 }
1992 else
1994
1995 if( aHorSBar->IsVisible() || aVerSBar->IsVisible() )
1996 {
1997 if( !bScrBar )
1998 {
1999 aOrigin *= -1;
2000 // correct thumbs
2001 if(aHorSBar->IsVisible() && aHorSBar->GetThumbPos() != aOrigin.X())
2002 aHorSBar->SetThumbPos( aOrigin.X() );
2003 if(aVerSBar->IsVisible() && aVerSBar->GetThumbPos() != aOrigin.Y())
2004 aVerSBar->SetThumbPos( aOrigin.Y() );
2005 }
2006 }
2007
2008 if( GetUpdateMode() )
2009 ShowCursor( true );
2010
2011 // check if we still need scrollbars
2013 if( bScrollable && GetUpdateMode() )
2015
2016 // If the requested area can not be made completely visible, the
2017 // Vis-Rect-Changed handler is called in any case. This case may occur e.g.
2018 // if only few pixels of the lower border are invisible, but a scrollbar has
2019 // a larger line size.
2021}
2022
2024{
2026 return 1;
2027 return nSelectionCount;
2028}
2029
2031{
2032 bool bSel;
2033 bSel = !pEntry->IsSelected();
2034 SelectEntry( pEntry, bSel, true );
2035}
2036
2038{
2040
2041 // TODO: work through z-order list, if necessary!
2042
2043 size_t nCount = maEntries.size();
2044 for( size_t nCur = 0; nCur < nCount; nCur++ )
2045 {
2046 SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get();
2047 if( pEntry != pThisEntryNot && pEntry->IsSelected() )
2048 SelectEntry( pEntry, false, true );
2049 }
2050 pAnchor = nullptr;
2052}
2053
2055{
2056 Size aMinSize( aImageSize );
2057 aMinSize.AdjustWidth(2 * LROFFS_BOUND );
2058 aMinSize.AdjustHeight(TBOFFS_BOUND ); // single offset is enough (FileDlg)
2059 Size aTextSize( pView->GetTextWidth( "XXX" ), pView->GetTextHeight() );
2060 if( nWinBits & WB_ICON )
2061 {
2063 aMinSize.AdjustHeight(aTextSize.Height() );
2064 }
2065 else
2066 {
2068 aMinSize.AdjustWidth(aTextSize.Width() );
2069 }
2070 return aMinSize;
2071}
2072
2074{
2075 Size aSize( rSize );
2076 Size aMinSize( GetMinGrid() );
2077 if( aSize.Width() < aMinSize.Width() )
2078 aSize.setWidth( aMinSize.Width() );
2079 if( aSize.Height() < aMinSize.Height() )
2080 aSize.setHeight( aMinSize.Height() );
2081
2082 nGridDX = aSize.Width();
2083 // HACK: Detail mode is not yet fully implemented, this workaround makes it
2084 // fly with a single column
2085 if( nWinBits & WB_DETAILS )
2086 {
2087 const SvxIconChoiceCtrlColumnInfo* pCol = GetColumn( 0 );
2088 if( pCol )
2089 const_cast<SvxIconChoiceCtrlColumnInfo*>(pCol)->SetWidth( nGridDX );
2090 }
2091 nGridDY = aSize.Height();
2093}
2094
2095// Calculates the maximum size that the text rectangle may use within its
2096// bounding rectangle. In WB_ICON mode with SvxIconChoiceCtrlTextMode::Full, Bottom is set to
2097// LONG_MAX.
2098
2100{
2101 tools::Rectangle aBoundRect;
2102 // avoid infinite recursion: don't calculate the bounding rectangle here
2103 if( IsBoundingRectValid( pEntry->aRect ) )
2104 aBoundRect = pEntry->aRect;
2105 else
2106 aBoundRect = pEntry->aGridRect;
2107
2108 tools::Rectangle aBmpRect( const_cast<SvxIconChoiceCtrl_Impl*>(this)->CalcBmpRect(
2109 const_cast<SvxIconChoiceCtrlEntry*>(pEntry) ) );
2110 if( nWinBits & WB_ICON )
2111 {
2112 aBoundRect.SetTop( aBmpRect.Bottom() );
2113 aBoundRect.AdjustTop(VER_DIST_BMP_STRING );
2114 if( aBoundRect.Top() > aBoundRect.Bottom())
2115 aBoundRect.SetTop( aBoundRect.Bottom() );
2116 aBoundRect.AdjustLeft(LROFFS_BOUND );
2117 aBoundRect.AdjustLeft( 1 );
2118 aBoundRect.AdjustRight( -(LROFFS_BOUND) );
2119 aBoundRect.AdjustRight( -1 );
2120 if( aBoundRect.Left() > aBoundRect.Right())
2121 aBoundRect.SetLeft( aBoundRect.Right() );
2123 aBoundRect.SetBottom( LONG_MAX );
2124 }
2125 else
2126 {
2127 aBoundRect.SetLeft( aBmpRect.Right() );
2128 aBoundRect.AdjustLeft(HOR_DIST_BMP_STRING );
2129 aBoundRect.AdjustRight( -(LROFFS_BOUND) );
2130 if( aBoundRect.Left() > aBoundRect.Right() )
2131 aBoundRect.SetLeft( aBoundRect.Right() );
2132 tools::Long nHeight = aBoundRect.GetSize().Height();
2133 nHeight = nHeight - aDefaultTextSize.Height();
2134 nHeight /= 2;
2135 aBoundRect.AdjustTop(nHeight );
2136 aBoundRect.AdjustBottom( -nHeight );
2137 }
2138 return aBoundRect;
2139}
2140
2142{
2143 tools::Long nDY = nGridDY;
2144 nDY -= aImageSize.Height();
2145 nDY -= VER_DIST_BMP_STRING;
2146 nDY -= 2 * TBOFFS_BOUND;
2147 if (nDY <= 0)
2148 nDY = 2;
2149
2150 tools::Long nDX = nGridDX;
2151 nDX -= 2 * LROFFS_BOUND;
2152 nDX -= 2;
2153 if (nDX <= 0)
2154 nDX = 2;
2155
2156 tools::Long nHeight = pView->GetTextHeight();
2157 if (nDY < nHeight)
2158 nDY = nHeight;
2159 if(pView->GetDPIScaleFactor() > 1)
2160 {
2161 nDY*=2;
2162 }
2163 aDefaultTextSize = Size(nDX, nDY);
2164}
2165
2166
2168{
2169 pEntry->aRect = pEntry->aGridRect;
2170 Size aSize( CalcBoundingSize() );
2171 if( nWinBits & WB_ICON )
2172 {
2173 // center horizontally
2174 tools::Long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width();
2175 pEntry->aRect.AdjustLeft(nBorder / 2 );
2176 pEntry->aRect.AdjustRight( -(nBorder / 2) );
2177 }
2178 // center vertically
2179 pEntry->aRect.SetBottom( pEntry->aRect.Top() + aSize.Height() );
2180}
2181
2182
2183// The deltas are the offsets by which the view is moved on the document.
2184// left, up: offsets < 0
2185// right, down: offsets > 0
2187{
2188 const MapMode& rMapMode = pView->GetMapMode();
2189 Point aOrigin( rMapMode.GetOrigin() );
2190 // convert to document coordinate
2191 aOrigin *= -1;
2192 aOrigin.AdjustY(nDeltaY );
2193 aOrigin.AdjustX(nDeltaX );
2194 tools::Rectangle aRect( aOrigin, aOutputSize );
2195 MakeVisible( aRect, true/*bScrollBar*/ );
2196}
2197
2198
2200{
2201 if (eItem == IcnViewFieldType::Text)
2202 return aDefaultTextSize;
2203 return aImageSize; // IcnViewFieldType::Image
2204}
2205
2207{
2208 tools::Rectangle aTextRect( CalcTextRect( pEntry ) );
2209 tools::Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
2210 return tools::Rectangle(
2211 aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
2212 aTextRect.Bottom() + 1);
2213}
2214
2215// the hot spot is the inner 50% of the rectangle
2217{
2218 tools::Rectangle aResult( rRect );
2219 aResult.Normalize();
2220 Size aSize( rRect.GetSize() );
2221 tools::Long nDelta = aSize.Width() / 4;
2222 aResult.AdjustLeft(nDelta );
2223 aResult.AdjustRight( -nDelta );
2224 nDelta = aSize.Height() / 4;
2225 aResult.AdjustTop(nDelta );
2226 aResult.AdjustBottom( -nDelta );
2227 return aResult;
2228}
2229
2231 bool bAdd, std::vector<tools::Rectangle>* pOtherRects )
2232{
2233 DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
2234 tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
2235 aRect.Union( GetEntryBoundRect( pEntry2 ) );
2236 SelectRect( aRect, bAdd, pOtherRects );
2237}
2238
2240 std::vector<tools::Rectangle>* pOtherRects )
2241{
2242 aCurSelectionRect = rRect;
2243 if( maZOrderList.empty() )
2244 return;
2245
2246 // set flag, so ToTop won't be called in Select
2247 bool bAlreadySelectingRect(nFlags & IconChoiceFlags::SelectingRect);
2249
2252 const size_t nCount = maZOrderList.size();
2253
2254 tools::Rectangle aRect( rRect );
2255 aRect.Normalize();
2256 bool bCalcOverlap = (bAdd && pOtherRects && !pOtherRects->empty());
2257
2258 bool bResetClipRegion = false;
2259 if( !pView->GetOutDev()->IsClipRegion() )
2260 {
2261 bResetClipRegion = true;
2263 }
2264
2265 for( size_t nPos = 0; nPos < nCount; nPos++ )
2266 {
2268
2269 if( !IsBoundingRectValid( pEntry->aRect ))
2270 FindBoundingRect( pEntry );
2271 tools::Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) );
2272 bool bSelected = pEntry->IsSelected();
2273
2274 bool bOverlaps;
2275 if( bCalcOverlap )
2276 bOverlaps = IsOver( pOtherRects, aBoundRect );
2277 else
2278 bOverlaps = false;
2279 bool bOver = aRect.Overlaps( aBoundRect );
2280
2281 if( bOver && !bOverlaps )
2282 {
2283 // is inside the new selection rectangle and outside of any old one
2284 // => select
2285 if( !bSelected )
2286 SelectEntry( pEntry, true, true );
2287 }
2288 else if( !bAdd )
2289 {
2290 // is outside of the selection rectangle
2291 // => deselect
2292 if( bSelected )
2293 SelectEntry( pEntry, false, true );
2294 }
2295 else if (bOverlaps)
2296 {
2297 // The entry is inside an old (=>span multiple rectangles with Ctrl)
2298 // selection rectangle.
2299
2300 // There is still a bug here! The selection status of an entry in a
2301 // previous rectangle has to be restored, if it was touched by the
2302 // current selection rectangle but is not inside it any more.
2303 // For simplicity's sake, let's assume that all entries in the old
2304 // rectangles were correctly selected. It is wrong to just deselect
2305 // the intersection.
2306 // Possible solution: remember a snapshot of the selection before
2307 // spanning the rectangle.
2308 if( aBoundRect.Overlaps( rRect))
2309 {
2310 // deselect intersection between old rectangles and current rectangle
2311 if( bSelected )
2312 SelectEntry( pEntry, false, true );
2313 }
2314 else
2315 {
2316 // select entry of an old rectangle
2317 if( !bSelected )
2318 SelectEntry( pEntry, true, true );
2319 }
2320 }
2321 else if( !bOver && bSelected )
2322 {
2323 // this entry is completely outside the rectangle => deselect it
2324 SelectEntry( pEntry, false, true );
2325 }
2326 }
2327
2328 if( !bAlreadySelectingRect )
2330
2332 if( bResetClipRegion )
2334}
2335
2337 SvxIconChoiceCtrlEntry const * pStart,
2338 SvxIconChoiceCtrlEntry const * pEnd,
2339 bool bAdd )
2340{
2341 sal_uLong nFront = GetEntryListPos( pStart );
2342 sal_uLong nBack = GetEntryListPos( pEnd );
2343 sal_uLong nFirst = std::min( nFront, nBack );
2344 sal_uLong nLast = std::max( nFront, nBack );
2345 sal_uLong i;
2346 SvxIconChoiceCtrlEntry* pEntry;
2347
2348 if ( ! bAdd )
2349 {
2350 // deselect everything before the first entry if not in
2351 // adding mode
2352 for ( i=0; i<nFirst; i++ )
2353 {
2354 pEntry = GetEntry( i );
2355 if( pEntry->IsSelected() )
2356 SelectEntry( pEntry, false, true );
2357 }
2358 }
2359
2360 // select everything between nFirst and nLast
2361 for ( i=nFirst; i<=nLast; i++ )
2362 {
2363 pEntry = GetEntry( i );
2364 if( ! pEntry->IsSelected() )
2365 SelectEntry( pEntry, true, true );
2366 }
2367
2368 if ( ! bAdd )
2369 {
2370 // deselect everything behind the last entry if not in
2371 // adding mode
2372 sal_uLong nEnd = GetEntryCount();
2373 for ( ; i<nEnd; i++ )
2374 {
2375 pEntry = GetEntry( i );
2376 if( pEntry->IsSelected() )
2377 SelectEntry( pEntry, false, true );
2378 }
2379 }
2380}
2381
2382bool SvxIconChoiceCtrl_Impl::IsOver( std::vector<tools::Rectangle>* pRectList, const tools::Rectangle& rBoundRect )
2383{
2384 const sal_uInt16 nCount = pRectList->size();
2385 for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
2386 {
2387 tools::Rectangle& rRect = (*pRectList)[ nCur ];
2388 if( rBoundRect.Overlaps( rRect ))
2389 return true;
2390 }
2391 return false;
2392}
2393
2395 SvxIconChoiceCtrlEntry* pEntry2 )
2396{
2397 DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
2398 tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
2399 aRect.Union( GetEntryBoundRect( pEntry2 ) );
2400 AddSelectedRect( aRect );
2401}
2402
2404{
2405 tools::Rectangle newRect = rRect;
2406 newRect.Normalize();
2407 aSelectedRectList.push_back( newRect );
2408}
2409
2411{
2412 aSelectedRectList.clear();
2413}
2414
2416{
2417 aAutoArrangeIdle.Stop();
2418 Arrange( IsAutoArrange(), 0, 0 );
2419}
2420
2422{
2423 aVisRectChangedIdle.Stop();
2424}
2425
2427{
2428 aDocRectChangedIdle.Stop();
2429}
2430
2431#ifdef DBG_UTIL
2433{
2434 if( !pEntry )
2435 {
2436 if( eTextMode != eMode )
2437 {
2438 eTextMode = eMode;
2439 Arrange( true, 0, 0 );
2440 }
2441 }
2442 else
2443 {
2444 if( pEntry->eTextMode != eMode )
2445 {
2446 pEntry->eTextMode = eMode;
2447 InvalidateEntry( pEntry );
2448 pView->Invalidate( GetEntryBoundRect( pEntry ) );
2449 AdjustVirtSize( pEntry->aRect );
2450 }
2451 }
2452}
2453#endif
2454
2455// Draw my own focusrect, because the focusrect of the outputdevice has got the inverted color
2456// of the background. But what will we see, if the backgroundcolor is gray ? - We will see
2457// a gray focusrect on a gray background !!!
2458
2460{
2461 Color aBkgColor(pView->GetBackground().GetColor());
2462 Color aPenColor;
2463 sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
2464 if (nColor > 128)
2465 aPenColor = COL_BLACK;
2466 else
2467 aPenColor = COL_WHITE;
2468
2469 aFocus.aPenColor = aPenColor;
2470 aFocus.aRect = rRect;
2471}
2472
2474{
2475 rRenderContext.SetLineColor(aFocus.aPenColor);
2476 rRenderContext.SetFillColor();
2477 tools::Polygon aPolygon (aFocus.aRect);
2478
2479 LineInfo aLineInfo(LineStyle::Dash);
2480
2481 aLineInfo.SetDashLen(1);
2482 aLineInfo.SetDotLen(1);
2483 aLineInfo.SetDistance(1);
2484 aLineInfo.SetDotCount(1);
2485
2486 rRenderContext.DrawPolyLine(aPolygon, aLineInfo);
2487}
2488
2490{
2491 bool bRet = false;
2493 size_t nEntryCount = GetEntryCount();
2494 for ( size_t i = 0; i < nEntryCount; ++i )
2495 {
2496 if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) )
2497 {
2498 bRet = true;
2499 rPos = i;
2500 break;
2501 }
2502 }
2503
2504 return bRet;
2505}
2506
2507
2508IMPL_LINK(SvxIconChoiceCtrl_Impl, UserEventHdl, void*, nId, void )
2509{
2511 {
2512 nUserEventAdjustScrBars = nullptr;
2513 AdjustScrollBars();
2514 }
2515 else if( nId == EVENTID_SHOW_CURSOR )
2516 {
2517 ShowCursor( true );
2518 }
2519}
2520
2522{
2524 {
2526 nUserEventAdjustScrBars = nullptr;
2527 }
2528}
2529
2531{
2532 if( pEntry == pCursor )
2533 ShowCursor( false );
2534 pView->Invalidate( pEntry->aRect );
2535 Center( pEntry );
2536 pView->Invalidate( pEntry->aRect );
2537 if( pEntry == pCursor )
2538 ShowCursor( true );
2539}
2540
2542{
2543 if( !GetSelectionCount() )
2544 return nullptr;
2545
2547 {
2548 return pCurHighlightFrame;
2549 }
2550
2551 size_t nCount = maEntries.size();
2552 if( !pHead )
2553 {
2554 for( size_t nCur = 0; nCur < nCount; nCur++ )
2555 {
2556 SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get();
2557 if( pEntry->IsSelected() )
2558 {
2559 return pEntry;
2560 }
2561 }
2562 }
2563 else
2564 {
2565 SvxIconChoiceCtrlEntry* pEntry = pHead;
2566 while( nCount-- )
2567 {
2568 if( pEntry->IsSelected() )
2569 {
2570 return pEntry;
2571 }
2572 pEntry = pEntry->pflink;
2573 if( nCount && pEntry == pHead )
2574 {
2575 OSL_FAIL("SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry > infinite loop!");
2576 return nullptr;
2577 }
2578 }
2579 }
2580 return nullptr;
2581}
2582
2584{
2585 size_t nCount = maEntries.size();
2586 for( size_t nCur = 0; nCur < nCount; nCur++ )
2587 {
2588 SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get();
2589 SelectEntry( pEntry, true/*bSelect*/, true );
2590 }
2592 pAnchor = nullptr;
2593}
2594
2595
2596
2597
2599{
2601 const_cast<SvxIconChoiceCtrl_Impl*>(this)->SetListPositions();
2602 return pEntry->nPos;
2603}
2604
2606{
2607 const StyleSettings& rStyleSettings = pView->GetSettings().GetStyleSettings();
2608
2609 // unit (from settings) is Point
2610 vcl::Font aFont( rStyleSettings.GetFieldFont() );
2611 aFont.SetColor( rStyleSettings.GetWindowTextColor() );
2612 pView->SetPointFont( aFont );
2614
2615 pView->SetTextColor( rStyleSettings.GetFieldTextColor() );
2617
2618 pView->SetBackground( rStyleSettings.GetFieldColor());
2619
2620 tools::Long nScrBarSize = rStyleSettings.GetScrollBarSize();
2621 if( nScrBarSize == nHorSBarHeight && nScrBarSize == nVerSBarWidth )
2622 return;
2623
2624 nHorSBarHeight = nScrBarSize;
2625 Size aSize( aHorSBar->GetSizePixel() );
2626 aSize.setHeight( nScrBarSize );
2627 aHorSBar->Hide();
2628 aHorSBar->SetSizePixel( aSize );
2629
2630 nVerSBarWidth = nScrBarSize;
2631 aSize = aVerSBar->GetSizePixel();
2632 aSize.setWidth( nScrBarSize );
2633 aVerSBar->Hide();
2634 aVerSBar->SetSizePixel( aSize );
2635
2636 Size aOSize( pView->Control::GetOutputSizePixel() );
2637 PositionScrollBars( aOSize.Width(), aOSize.Height() );
2639}
2640
2642{
2643 if( eMode == ePositionMode )
2644 return;
2645
2648 size_t nCount = maEntries.size();
2649
2651 {
2652 // when positioning moved entries "hard", there are problems with
2653 // unwanted overlaps, as these entries aren't taken into account in
2654 // Arrange.
2655 if( maEntries.size() )
2657 return;
2658 }
2659
2661 {
2662 for( size_t nCur = 0; nCur < nCount; nCur++ )
2663 {
2664 SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get();
2666 SetEntryPos(pEntry, GetEntryBoundRect( pEntry ).TopLeft());
2667 }
2668
2669 if( maEntries.size() )
2671 }
2672}
2673
2675 SvxIconChoiceCtrlEntry* pPredecessor )
2676{
2677 if( !IsAutoArrange() )
2678 return;
2679
2680 if( pEntry == pPredecessor )
2681 return;
2682
2683 sal_uLong nPos1 = GetEntryListPos( pEntry );
2684 if( !pHead )
2685 {
2686 if( pPredecessor )
2687 {
2688 sal_uLong nPos2 = GetEntryListPos( pPredecessor );
2689 if( nPos1 == (nPos2 + 1) )
2690 return; // is already the predecessor
2691 }
2692 else if( !nPos1 )
2693 return;
2694
2696 }
2697
2698 if( !pPredecessor && pHead == pEntry )
2699 return; // is already the first one
2700
2701 bool bSetHead = false;
2702 if( !pPredecessor )
2703 {
2704 bSetHead = true;
2705 pPredecessor = pHead->pblink;
2706 }
2707 if( pEntry == pHead )
2708 {
2709 pHead = pHead->pflink;
2710 bSetHead = false;
2711 }
2712 if( pEntry != pPredecessor )
2713 {
2714 pEntry->Unlink();
2715 pEntry->SetBacklink( pPredecessor );
2716 }
2717 if( bSetHead )
2718 pHead = pEntry;
2720}
2721
2723 const Point& rPosTopLeft )
2724{
2725 Point aPos( rPosTopLeft ); //TopLeft
2726 tools::Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos ));
2727 Point aNewPos( aCenterRect.Center() );
2728 GridId nGrid = GetPredecessorGrid( aNewPos );
2729 size_t nCount = maEntries.size();
2730 if( nGrid == GRID_NOT_FOUND )
2731 return nullptr;
2732 if( nGrid >= nCount )
2733 nGrid = nCount - 1;
2734 if( !pHead )
2735 return maEntries[ nGrid ].get();
2736
2737 SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0
2738 // TODO: go through list from the end if nGrid > nCount/2
2739 for( GridId nCur = 0; nCur < nGrid; nCur++ )
2740 pCur = pCur->pflink;
2741
2742 return pCur;
2743}
2744
2746{
2747 Point aPos( rPos );
2748 aPos.AdjustX( -(LROFFS_WINBORDER) );
2749 aPos.AdjustY( -(TBOFFS_WINBORDER) );
2751 if( nMaxCol )
2752 nMaxCol--;
2753 tools::Long nGridX = aPos.X() / nGridDX;
2754 if( nGridX > nMaxCol )
2755 nGridX = nMaxCol;
2756 tools::Long nGridY = aPos.Y() / nGridDY;
2757 tools::Long nGridsX = aOutputSize.Width() / nGridDX;
2758 GridId nGrid = (nGridY * nGridsX) + nGridX;
2759 tools::Long nMiddle = (nGridX * nGridDX) + (nGridDX / 2);
2760 if( rPos.X() < nMiddle )
2761 {
2762 if( !nGrid )
2763 nGrid = GRID_NOT_FOUND;
2764 else
2765 nGrid--;
2766 }
2767 return nGrid;
2768}
2769
2771{
2772 if ( !(rHEvt.GetMode() & HelpEventMode::QUICK ) )
2773 return false;
2774
2776 aPos -= pView->GetMapMode().GetOrigin();
2777 SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, true );
2778
2779 if ( !pEntry )
2780 return false;
2781
2782 OUString sQuickHelpText = pEntry->GetQuickHelpText();
2783 OUString aEntryText( SvtIconChoiceCtrl::GetEntryText( pEntry ) );
2784 tools::Rectangle aTextRect( CalcTextRect( pEntry, nullptr, &aEntryText ) );
2785 if ( ( !aTextRect.Contains( aPos ) || aEntryText.isEmpty() ) && sQuickHelpText.isEmpty() )
2786 return false;
2787
2788 tools::Rectangle aOptTextRect( aTextRect );
2789 aOptTextRect.SetBottom( LONG_MAX );
2790 DrawTextFlags nNewFlags = nCurTextDrawFlags;
2792 aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
2793 if ( aOptTextRect != aTextRect || !sQuickHelpText.isEmpty() )
2794 {
2795 //aTextRect.Right() = aTextRect.Left() + aRealSize.Width() + 4;
2796 Point aPt( aOptTextRect.TopLeft() );
2797 aPt += pView->GetMapMode().GetOrigin();
2798 aPt = pView->OutputToScreenPixel( aPt );
2799 // subtract border of tooltip help
2800 aPt.AdjustY( -1 );
2801 aPt.AdjustX( -3 );
2802 aOptTextRect.SetPos( aPt );
2803 OUString sHelpText;
2804 if ( !sQuickHelpText.isEmpty() )
2805 sHelpText = sQuickHelpText;
2806 else
2807 sHelpText = aEntryText;
2808 Help::ShowQuickHelp( static_cast<vcl::Window*>(pView), aOptTextRect, sHelpText, QuickHelpFlags::Left | QuickHelpFlags::VCenter );
2809 }
2810
2811 return true;
2812}
2813
2815{
2816 if (!m_pColumns)
2818
2820 m_pColumns->insert(std::make_pair(nIndex, std::unique_ptr<SvxIconChoiceCtrlColumnInfo>(pInfo)));
2821
2822 // HACK: Detail mode is not yet fully implemented, this workaround makes it
2823 // fly with a single column
2824 if( !nIndex && (nWinBits & WB_DETAILS) )
2825 nGridDX = pInfo->GetWidth();
2826
2827 if( GetUpdateMode() )
2828 Arrange( IsAutoArrange(), 0, 0 );
2829}
2830
2832{
2833 if (!m_pColumns)
2834 return nullptr;
2835 auto const it = m_pColumns->find( nIndex );
2836 if (it == m_pColumns->end())
2837 return nullptr;
2838 return it->second.get();
2839}
2840
2842{
2843 tools::Rectangle aBmpRect(rBmpRect);
2844 tools::Long nBorder = 2;
2845 if (aImageSize.Width() < 32)
2846 nBorder = 1;
2847 aBmpRect.AdjustRight(nBorder );
2848 aBmpRect.AdjustLeft( -nBorder );
2849 aBmpRect.AdjustBottom(nBorder );
2850 aBmpRect.AdjustTop( -nBorder );
2851
2852 DecorationView aDecoView(&rRenderContext);
2853 DrawHighlightFrameStyle nDecoFlags;
2855 nDecoFlags = DrawHighlightFrameStyle::In;
2856 else
2857 nDecoFlags = DrawHighlightFrameStyle::Out;
2858 aDecoView.DrawHighlightFrame(aBmpRect, nDecoFlags);
2859}
2860
2862 bool bKeepHighlightFlags )
2863{
2864 if( pEntry == pCurHighlightFrame )
2865 return;
2866
2867 if( !bKeepHighlightFlags )
2868 bHighlightFramePressed = false;
2869
2871 {
2873 aInvalidationRect.expand(5);
2874 pCurHighlightFrame = nullptr;
2875 pView->Invalidate(aInvalidationRect);
2876 }
2877
2878 pCurHighlightFrame = pEntry;
2879 if (pEntry)
2880 {
2881 tools::Rectangle aInvalidationRect(GetEntryBoundRect(pEntry));
2882 aInvalidationRect.expand(5);
2883 pView->Invalidate(aInvalidationRect);
2884 }
2885}
2886
2888{
2889 // When single-click mode is active, the selection handler should be called
2890 // synchronously, as the selection is automatically taken away once the
2891 // mouse cursor doesn't touch the object any more. Else, we might run into
2892 // missing calls to Select if the object is selected from a mouse movement,
2893 // because when starting the timer, the mouse cursor might have already left
2894 // the object.
2895 // In special cases (=>SfxFileDialog!), synchronous calls can be forced via
2896 // WB_NOASYNCSELECTHDL.
2898 {
2899 pHdlEntry = nullptr;
2900 pView->ClickIcon();
2901 //pView->Select();
2902 }
2903 else
2905}
2906
2908{
2909 pHdlEntry = nullptr;
2910 pView->ClickIcon();
2911 //pView->Select();
2912}
2913
2915{
2916 MapMode aMapMode( pView->GetMapMode() );
2917 aMapMode.SetOrigin( rPos );
2918 pView->SetMapMode( aMapMode );
2919}
2920
2922{
2924}
2925
2926
2927/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawTextFlags
const vcl::I18nHelper & GetUILocaleI18nHelper() 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
sal_uInt8 GetBlue() const
bool IsBright() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const CommandScrollData * GetAutoScrollData() const
void DrawHighlightFrame(const tools::Rectangle &rRect, DrawHighlightFrameStyle nStyle)
Definition: decoview.cxx:824
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
static sal_uLong GetGridCount(const Size &rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight)
Definition: imivctl2.cxx:664
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
sal_Unicode GetCharCode() const
Definition: event.hxx:56
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
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 GetModifier() const
Definition: event.hxx:156
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
bool IsShift() const
Definition: event.hxx:158
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
const vcl::Font & GetFont() const
Definition: outdev.hxx:529
void DrawPolyLine(const tools::Polygon &rPoly)
Render the given polygon as a line stroke.
Definition: polyline.cxx:31
void SetFont(const vcl::Font &rNewFont)
Definition: outdev/font.cxx:56
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:161
const Wallpaper & GetBackground() const
Definition: outdev.hxx:523
bool IsClipRegion() const
Definition: outdev.hxx:555
void SetLineColor()
Definition: line.cxx:37
void SetFillColor()
Definition: fill.cxx:29
const Color & GetLineColor() const
Definition: outdev.hxx:510
const MapMode & GetMapMode() const
Definition: outdev.hxx:1557
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:32
void Pop()
Definition: stack.cxx:91
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:797
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
const Color & GetFillColor() const
Definition: outdev.hxx:515
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
void SetThumbPos(tools::Long nThumbPos) override
Definition: scrbar.cxx:1362
void SetRange(const Range &rRange) override
Definition: scrbar.cxx:1338
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:130
void SetVisibleSize(tools::Long nNewSize) override
Definition: scrbar.cxx:1376
void SetLineSize(tools::Long nNewSize) override
Definition: scrbar.hxx:118
void SetPageSize(tools::Long nNewSize) override
Definition: scrbar.hxx:120
tools::Long GetThumbPos() const override
Definition: scrbar.hxx:117
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
sal_Int32 GetScrollBarSize() const
const Color & GetFieldTextColor() const
const Color & GetFieldColor() const
const Color & GetDeactiveColor() const
const vcl::Font & GetFieldFont() const
const Color & GetWindowTextColor() const
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
const Color & GetHighlightTextColor() const
void SetPointFont(const vcl::Font &rFont)
Definition: ivctrl.cxx:235
void SetBackground(const Wallpaper &rWallpaper)
Definition: ivctrl.cxx:324
void SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry *pEntry)
Definition: ivctrl.cxx:258
void ClickIcon()
Definition: ivctrl.cxx:279
sal_Int32 GetEntryCount() const
Definition: ivctrl.cxx:264
SvxIconChoiceCtrlEntry * GetEntry(sal_Int32 nPos) const
Definition: ivctrl.cxx:269
static OUString GetEntryText(SvxIconChoiceCtrlEntry const *pEntry)
Definition: ivctrl.cxx:139
void CallImplEventListeners(VclEventId nEvent, void *pData)
Definition: ivctrl.cxx:409
static void DrawEntryImage(SvxIconChoiceCtrlEntry const *pEntry, const Point &rPos, OutputDevice &rDev)
Definition: ivctrl.cxx:134
tools::Long GetWidth() const
Definition: ivctrl.hxx:137
void ClearFlags(SvxIconViewFlags nMask)
Definition: ivctrl.hxx:89
void SetBacklink(SvxIconChoiceCtrlEntry *pA)
Definition: ivctrl.hxx:94
bool IsSelected() const
Definition: ivctrl.hxx:122
SvxIconViewFlags GetFlags() const
Definition: ivctrl.hxx:121
SvxIconChoiceCtrlEntry * pblink
Definition: ivctrl.hxx:82
SvxIconChoiceCtrlTextMode eTextMode
Definition: ivctrl.hxx:85
bool IsFocused() const
Definition: ivctrl.hxx:123
const OUString & GetQuickHelpText() const
Definition: ivctrl.hxx:118
SvxIconChoiceCtrlTextMode GetTextMode() const
Definition: ivctrl.hxx:120
void AssignFlags(SvxIconViewFlags _nFlags)
Definition: ivctrl.hxx:91
bool IsPosLocked() const
Definition: ivctrl.hxx:124
tools::Rectangle aRect
Definition: ivctrl.hxx:73
SvxIconChoiceCtrlEntry * pflink
Definition: ivctrl.hxx:83
void SetFlags(SvxIconViewFlags nMask)
Definition: ivctrl.hxx:90
tools::Rectangle aGridRect
Definition: ivctrl.hxx:74
void SetUpdateMode(bool bUpdate)
Definition: imivctl1.cxx:1322
std::unique_ptr< SvxIconChoiceCtrlColumnInfoMap > m_pColumns
Definition: imivctl.hxx:136
void Scroll(tools::Long nDeltaX, tools::Long nDeltaY)
Definition: imivctl1.cxx:2186
VclPtr< ScrollBarBox > aScrBarBox
Definition: imivctl.hxx:119
VclPtr< SvtIconChoiceCtrl > pView
Definition: imivctl.hxx:130
void SetStyle(WinBits nWinStyle)
Definition: imivctl1.cxx:150
void PaintEntry(SvxIconChoiceCtrlEntry *, const Point &, vcl::RenderContext &rRenderContext)
Definition: imivctl1.cxx:1391
void SelectRange(SvxIconChoiceCtrlEntry const *pStart, SvxIconChoiceCtrlEntry const *pEnd, bool bAdd)
Definition: imivctl1.cxx:2336
void DeselectAllBut(SvxIconChoiceCtrlEntry const *)
Definition: imivctl1.cxx:2037
SvxIconChoiceCtrlEntry * GetCurEntry() const
Definition: imivctl.hxx:303
void ShowFocus(tools::Rectangle const &rRect)
Definition: imivctl1.cxx:2459
SelectionMode eSelectionMode
Definition: imivctl.hxx:152
ImplSVEvent * nUserEventAdjustScrBars
Definition: imivctl.hxx:141
std::unique_ptr< IcnCursor_Impl > pImpCursor
Definition: imivctl.hxx:131
tools::Long nMaxVirtHeight
Definition: imivctl.hxx:134
bool MouseMove(const MouseEvent &)
Definition: imivctl1.cxx:780
tools::Long nMaxBoundHeight
Definition: imivctl.hxx:138
const tools::Rectangle & GetEntryBoundRect(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:1566
VclPtr< ScrollBar > aHorSBar
Definition: imivctl.hxx:118
bool IsMnemonicChar(sal_Unicode cChar, sal_uLong &rPos) const
Definition: imivctl1.cxx:2489
bool IsAutoArrange() const
Definition: imivctl.hxx:231
tools::Rectangle CalcFocusRect(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:2206
tools::Rectangle CalcTextRect(SvxIconChoiceCtrlEntry *, const Point *pPos=nullptr, const OUString *pStr=nullptr)
Definition: imivctl1.cxx:1600
SvxIconChoiceCtrlEntry * pCurHighlightFrame
Definition: imivctl.hxx:142
void ImpArrange(bool bKeepPredecessors)
Definition: imivctl1.cxx:448
void SelectRect(SvxIconChoiceCtrlEntry *pEntry1, SvxIconChoiceCtrlEntry *pEntry2, bool bAdd, std::vector< tools::Rectangle > *pOtherRects)
Definition: imivctl1.cxx:2230
bool KeyInput(const KeyEvent &)
Definition: imivctl1.cxx:844
void SetPositionMode(SvxIconChoiceCtrlPositionMode)
Definition: imivctl1.cxx:2641
GridId GetPredecessorGrid(const Point &rDocPos) const
Definition: imivctl1.cxx:2745
static void PaintEmphasis(const tools::Rectangle &rRect1, bool bSelected, vcl::RenderContext &rRenderContext)
Definition: imivctl1.cxx:1338
tools::Long nVerSBarWidth
Definition: imivctl.hxx:253
tools::Rectangle GetOutputRect() const
Definition: imivctl1.cxx:231
void MakeVisible(const tools::Rectangle &rDocPos, bool bInScrollBarEvent=false)
Definition: imivctl1.cxx:1931
void SetGrid(const Size &)
Definition: imivctl1.cxx:2073
Size GetMinGrid() const
Definition: imivctl1.cxx:2054
void DrawHighlightFrame(vcl::RenderContext &rRenderContext, const tools::Rectangle &rBmpRect)
Definition: imivctl1.cxx:2841
void SetColumn(sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo &)
Definition: imivctl1.cxx:2814
void SetEntryPos(SvxIconChoiceCtrlEntry *pEntry, const Point &rPos)
Definition: imivctl1.cxx:1470
SvxIconChoiceCtrlEntry * pAnchor
Definition: imivctl.hxx:147
void SetBoundingRect_Impl(SvxIconChoiceCtrlEntry *pEntry, const Point &rPos, const Size &rBoundingSize)
Definition: imivctl1.cxx:1754
tools::Long CalcBoundingWidth() const
Definition: imivctl1.cxx:1641
Size CalcBoundingSize() const
Definition: imivctl1.cxx:1689
tools::Rectangle CalcBmpRect(SvxIconChoiceCtrlEntry *, const Point *pPos=nullptr)
Definition: imivctl1.cxx:1573
void SetEntryTextMode(SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry *pEntry)
Definition: imivctl1.cxx:2432
void RemoveEntry(size_t nPos)
Definition: imivctl1.cxx:224
SvxIconChoiceCtrl_Impl(const SvxIconChoiceCtrl_Impl &)=delete
const Size & GetItemSize(IcnViewFieldType) const
Definition: imivctl1.cxx:2199
size_t GetEntryCount() const
Definition: imivctl.hxx:384
void InsertEntry(std::unique_ptr< SvxIconChoiceCtrlEntry >, size_t nPos)
Definition: imivctl1.cxx:186
bool RequestHelp(const HelpEvent &rHEvt)
Definition: imivctl1.cxx:2770
SvxIconChoiceCtrlEntry * GetEntry(const Point &rDocPos, bool bHit=false)
Definition: imivctl1.cxx:1516
void ToggleSelection(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:2030
void ToTop(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:1902
std::vector< std::unique_ptr< SvxIconChoiceCtrlEntry > > maEntries
Definition: imivctl.hxx:116
tools::Rectangle CalcMaxTextRect(const SvxIconChoiceCtrlEntry *pEntry) const
Definition: imivctl1.cxx:2099
SvxIconChoiceCtrlPositionMode ePositionMode
Definition: imivctl.hxx:154
tools::Rectangle aCurSelectionRect
Definition: imivctl.hxx:120
void PaintItem(const tools::Rectangle &rRect, IcnViewFieldType eItem, SvxIconChoiceCtrlEntry *pEntry, sal_uInt16 nPaintFlags, vcl::RenderContext &rRenderContext)
Definition: imivctl1.cxx:1363
void FindBoundingRect(SvxIconChoiceCtrlEntry *pEntry)
Definition: imivctl1.cxx:1741
void SetEntryPredecessor(SvxIconChoiceCtrlEntry *pEntry, SvxIconChoiceCtrlEntry *pPredecessor)
Definition: imivctl1.cxx:2674
void SetCursor_Impl(SvxIconChoiceCtrlEntry *pOldCursor, SvxIconChoiceCtrlEntry *pNewCursor, bool bMod1, bool bShift)
Definition: imivctl1.cxx:796
VclPtr< ScrollBar > aVerSBar
Definition: imivctl.hxx:117
void Command(const CommandEvent &rCEvt)
Definition: imivctl1.cxx:1890
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: imivctl1.cxx:478
void Arrange(bool bKeepPredecessors, tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight)
Definition: imivctl1.cxx:433
friend class IcnCursor_Impl
Definition: imivctl.hxx:113
void SelectEntry(SvxIconChoiceCtrlEntry *, bool bSelect, bool bAddToSelection=false)
Definition: imivctl1.cxx:251
tools::Long nHorSBarHeight
Definition: imivctl.hxx:252
tools::Long nMaxVirtWidth
Definition: imivctl.hxx:133
void DrawFocusRect(vcl::RenderContext &rRenderContext)
Definition: imivctl1.cxx:2473
void AdjustVirtSize(const tools::Rectangle &)
Definition: imivctl1.cxx:363
sal_Int32 GetSelectionCount() const
Definition: imivctl1.cxx:2023
void EntrySelected(SvxIconChoiceCtrlEntry *pEntry, bool bSelect)
Definition: imivctl1.cxx:288
SvxIconChoiceCtrlTextMode eTextMode
Definition: imivctl.hxx:151
tools::Long nGridDX
Definition: imivctl.hxx:250
std::unique_ptr< IcnGridMap_Impl > pGridMap
Definition: imivctl.hxx:132
void SetEntryHighlightFrame(SvxIconChoiceCtrlEntry *pEntry, bool bKeepHighlightFlags)
Definition: imivctl1.cxx:2861
SvxIconChoiceCtrlEntry * pHead
Definition: imivctl.hxx:144
void ClipAtVirtOutRect(tools::Rectangle &rRect) const
Definition: imivctl1.cxx:1915
void SetCursor(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:1765
static tools::Long GetScrollBarPageSize(tools::Long nVisibleRange)
Definition: imivctl.hxx:175
void RecalcAllBoundingRectsSmart()
Definition: imivctl1.cxx:1694
bool MouseButtonDown(const MouseEvent &)
Definition: imivctl1.cxx:599
void Clear(bool bInCtor)
Definition: imivctl1.cxx:116
static bool IsBoundingRectValid(const tools::Rectangle &rRect)
Definition: imivctl.hxx:341
void ToDocPos(Point &rPosPixel)
Definition: imivctl.hxx:184
void CallEventListeners(VclEventId nEvent, void *pData)
Definition: imivctl1.cxx:2921
sal_Int32 nSelectionCount
Definition: imivctl.hxx:153
void ShowCursor(bool bShow)
Definition: imivctl1.cxx:1794
void MakeEntryVisible(SvxIconChoiceCtrlEntry *pEntry, bool bBound=true)
Definition: imivctl1.cxx:1547
SvxIconChoiceCtrlEntry * pCursor
Definition: imivctl.hxx:145
DrawTextFlags nCurTextDrawFlags
Definition: imivctl.hxx:140
tools::Long CalcBoundingHeight() const
Definition: imivctl1.cxx:1662
tools::Long GetScrollBarLineSize() const
Definition: imivctl.hxx:179
static bool IsOver(std::vector< tools::Rectangle > *pSelectedRectList, const tools::Rectangle &rEntryBoundRect)
Definition: imivctl1.cxx:2382
SvxIconChoiceCtrlEntry * pHdlEntry
Definition: imivctl.hxx:146
void AddSelectedRect(const tools::Rectangle &)
Definition: imivctl1.cxx:2403
void SetOrigin(const Point &)
Definition: imivctl1.cxx:2914
bool HandleScrollCommand(const CommandEvent &rCmd)
Definition: imivctl1.cxx:1811
SvxIconChoiceCtrlEntry * FindEntryPredecessor(SvxIconChoiceCtrlEntry *pEntry, const Point &)
Definition: imivctl1.cxx:2722
friend class IcnGridMap_Impl
Definition: imivctl.hxx:114
bool MouseButtonUp(const MouseEvent &)
Definition: imivctl1.cxx:728
void PositionScrollBars(tools::Long nRealWidth, tools::Long nRealHeight)
Definition: imivctl1.cxx:1042
tools::Long nGridDY
Definition: imivctl.hxx:251
sal_Int32 GetEntryListPos(SvxIconChoiceCtrlEntry const *) const
Definition: imivctl1.cxx:2598
void Center(SvxIconChoiceCtrlEntry *pEntry) const
Definition: imivctl1.cxx:2167
std::vector< SvxIconChoiceCtrlEntry * > maZOrderList
Definition: imivctl.hxx:135
IconChoiceFlags nFlags
Definition: imivctl.hxx:139
void InvalidateEntry(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:2530
bool GetUpdateMode() const
Definition: imivctl.hxx:291
SvxIconChoiceCtrlEntry * GetFirstSelectedEntry() const
Definition: imivctl1.cxx:2541
const SvxIconChoiceCtrlColumnInfo * GetColumn(sal_uInt16 nIndex) const
Definition: imivctl1.cxx:2831
std::vector< tools::Rectangle > aSelectedRectList
Definition: imivctl.hxx:121
void InvalidateBoundingRect(tools::Rectangle &rRect)
Definition: imivctl.hxx:336
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
const Color & GetColor() const
Definition: wall.hxx:71
bool IsScrollable() const
Definition: wall.cxx:245
constexpr Point Center() const
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
constexpr void SetLeft(tools::Long v)
bool Overlaps(const tools::Rectangle &rRect) const
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
void SetPos(const Point &rPoint)
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
tools::Rectangle & Union(const tools::Rectangle &rRect)
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
void expand(tools::Long nExpandBy)
void SetFillColor(const Color &)
Definition: font/font.cxx:115
void SetColor(const Color &)
Definition: font/font.cxx:107
const Color & GetFillColor() const
Definition: font/font.cxx:899
bool MatchMnemonic(std::u16string_view rString, sal_Unicode cMnemonicChar) const
Definition: i18nhelp.cxx:142
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
static void DrawSelectionBackground(vcl::RenderContext &rRenderContext, vcl::Window const &rWindow, const tools::Rectangle &rRect, sal_uInt16 nHighlight, bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly, Color *pSelectionTextColor=nullptr, tools::Long nCornerRadius=0, Color const *pPaintColor=nullptr)
Definition: paint.cxx:324
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2806
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: window3.cxx:201
const Wallpaper & GetBackground() const
Definition: window3.cxx:63
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
float GetDPIScaleFactor() const
Definition: window3.cxx:122
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
void PaintImmediately()
Definition: paint.cxx:1268
bool IsTracking() const
Definition: window2.cxx:337
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
Definition: window2.cxx:293
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
virtual Point GetPosPixel() const
Definition: window.cxx:2794
void SetMapMode()
Definition: window3.cxx:125
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
const AllSettings & GetSettings() const
Definition: window3.cxx:129
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
const MapMode & GetMapMode() const
Definition: window3.cxx:99
void SetTextFillColor()
Definition: window3.cxx:97
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void Hide()
Definition: window.hxx:879
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
virtual Size GetSizePixel() const
Definition: window.cxx:2402
Size GetOutputSizePixel() const
Definition: window3.cxx:89
void StartAutoScroll(StartAutoScrollFlags nFlags)
Definition: window2.cxx:352
bool IsVisible() const
Definition: window2.cxx:1128
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
void SetTextColor(const Color &rColor)
Definition: window3.cxx:108
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define COMMAND_WHEEL_PAGESCROLL
int nCount
#define DBG_ASSERT(sCon, aError)
DrawHighlightFrameStyle
Definition: decoview.hxx:47
IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, AutoArrangeHdl, Timer *, void)
Definition: imivctl1.cxx:2415
static tools::Rectangle GetHotSpot(const tools::Rectangle &rRect)
Definition: imivctl1.cxx:2216
IMPL_LINK(SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar *, pScrollBar, void)
Definition: imivctl1.cxx:167
constexpr auto DRAWTEXT_FLAGS_ICON
Definition: imivctl1.cxx:43
#define DRAWTEXT_FLAGS_SMALLICON
Definition: imivctl1.cxx:47
#define EVENTID_SHOW_CURSOR
Definition: imivctl1.cxx:49
#define EVENTID_ADJUST_SCROLLBARS
Definition: imivctl1.cxx:50
#define VIEWMODE_MASK
Definition: imivctl.hxx:82
#define LROFFS_BOUND
Definition: imivctl.hxx:71
#define HOR_DIST_BMP_STRING
Definition: imivctl.hxx:74
sal_uLong GridId
Definition: imivctl.hxx:101
#define GRID_NOT_FOUND
Definition: imivctl.hxx:103
IcnViewFieldType
Definition: imivctl.hxx:86
#define VER_DIST_BMP_STRING
Definition: imivctl.hxx:75
#define DEFAULT_MAX_VIRT_WIDTH
Definition: imivctl.hxx:79
std::map< sal_uInt16, std::unique_ptr< SvxIconChoiceCtrlColumnInfo > > SvxIconChoiceCtrlColumnInfoMap
Definition: imivctl.hxx:108
IconChoiceFlags
Definition: imivctl.hxx:52
#define DEFAULT_MAX_VIRT_HEIGHT
Definition: imivctl.hxx:80
#define TBOFFS_WINBORDER
Definition: imivctl.hxx:69
#define TBOFFS_BOUND
Definition: imivctl.hxx:72
#define PAINTFLAG_HOR_CENTERED
Definition: imivctl.hxx:49
#define PAINTFLAG_VER_CENTERED
Definition: imivctl.hxx:50
#define LROFFS_WINBORDER
Definition: imivctl.hxx:68
sal_Int32 nIndex
Mode eMode
#define WB_NOASYNCSELECTHDL
Definition: ivctrl.hxx:173
SvxIconChoiceCtrlPositionMode
Definition: ivctrl.hxx:56
#define WB_DETAILS
Definition: ivctrl.hxx:163
#define WB_NODRAGSELECTION
Definition: ivctrl.hxx:167
SvxIconViewFlags
Definition: ivctrl.hxx:37
#define WB_NOSELECTION
Definition: ivctrl.hxx:166
#define WB_ALIGN_LEFT
Definition: ivctrl.hxx:170
#define WB_NOHSCROLL
Definition: ivctrl.hxx:164
#define WB_SMALLICON
Definition: ivctrl.hxx:162
#define WB_SMART_ARRANGE
Definition: ivctrl.hxx:168
#define WB_NOVSCROLL
Definition: ivctrl.hxx:165
#define WB_ICON
Definition: ivctrl.hxx:161
#define WB_HIGHLIGHTFRAME
Definition: ivctrl.hxx:172
#define WB_ALIGN_TOP
Definition: ivctrl.hxx:169
SvxIconChoiceCtrlTextMode
Definition: ivctrl.hxx:50
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
constexpr sal_uInt16 KEY_F2
Definition: keycodes.hxx:84
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_COMMA
Definition: keycodes.hxx:132
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
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_END
Definition: keycodes.hxx:115
sal_uInt16 nPos
const long LONG_MAX
std::unique_ptr< sal_Int32[]> pData
NONE
tools::Long const nBorder
int i
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
long Long
sal_Int16 nId
sal_uIntPtr sal_uLong
Color aPenColor
Definition: imivctl.hxx:97
tools::Rectangle aRect
Definition: imivctl.hxx:96
@ LOWEST
Low, very idle cleanup tasks.
@ HIGH_IDLE
Important idle events to be run before processing drawing events.
sal_uInt16 sal_Unicode
SelectionMode
Definition: vclenum.hxx:26
VclEventId
Definition: vclevent.hxx:38
StartAutoScrollFlags
Definition: window.hxx:279
@ NoChildren
The child windows are not invalidated.
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_DRAG
Definition: wintypes.hxx:152
WinBits const WB_NOPOINTERFOCUS
Definition: wintypes.hxx:155
WinBits const WB_VSCROLL
Definition: wintypes.hxx:178
WinBits const WB_NOHIDESELECTION
Definition: wintypes.hxx:195
WinBits const WB_HSCROLL
Definition: wintypes.hxx:177