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