LibreOffice Module vcl (master)  1
listbox.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 <vcl/commandevent.hxx>
22 #include <vcl/event.hxx>
23 #include <vcl/lstbox.hxx>
24 #include <vcl/settings.hxx>
25 #include <vcl/uitest/uiobject.hxx>
26 #include <sal/log.hxx>
27 
28 #include <svdata.hxx>
29 #include <controldata.hxx>
30 #include <listbox.hxx>
31 #include <dndeventdispatcher.hxx>
32 #include <comphelper/lok.hxx>
33 
34 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
35 #include <boost/property_tree/ptree.hpp>
36 
38  : Control(nType)
39  , mpImplLB(nullptr)
40 {
42 }
43 
45 {
47  ImplInit( pParent, nStyle );
48 }
49 
51 {
52  disposeOnce();
53 }
54 
56 {
58 
63 
65 }
66 
68 {
69  mpFloatWin = nullptr;
70  mpImplWin = nullptr;
71  mpBtn = nullptr;
72  mnDDHeight = 0;
74  mnLineCount = 0;
75  m_nMaxWidthChars = -1;
76  mbDDAutoSize = true;
77 }
78 
79 void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
80 {
81  nStyle = ImplInitStyle( nStyle );
82  if ( !(nStyle & WB_NOBORDER) && ( nStyle & WB_DROPDOWN ) )
83  nStyle |= WB_BORDER;
84 
85  Control::ImplInit( pParent, nStyle, nullptr );
86 
87  css::uno::Reference< css::datatransfer::dnd::XDropTargetListener> xDrop = new DNDEventDispatcher(this);
88 
89  if( nStyle & WB_DROPDOWN )
90  {
91  sal_Int32 nLeft, nTop, nRight, nBottom;
92  GetBorder( nLeft, nTop, nRight, nBottom );
93  mnDDHeight = static_cast<sal_uInt16>(GetTextHeight() + nTop + nBottom + 4);
94 
95  if( IsNativeWidgetEnabled() &&
97  {
98  ImplControlValue aControlValue;
99  tools::Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
100  tools::Rectangle aBoundingRgn( aCtrlRegion );
101  tools::Rectangle aContentRgn( aCtrlRegion );
103  ControlState::ENABLED, aControlValue,
104  aBoundingRgn, aContentRgn ) )
105  {
106  sal_Int32 nHeight = aBoundingRgn.GetHeight();
107  if( nHeight > mnDDHeight )
108  mnDDHeight = static_cast<sal_uInt16>(nHeight);
109  }
110  }
111 
115  mpFloatWin->SetAutoWidth( true );
116  mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
117  mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
118 
119  mpImplWin = VclPtr<ImplWin>::Create( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER );
120  mpImplWin->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
121  mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
122  mpImplWin->Show();
123  mpImplWin->GetDropTarget()->addDropTargetListener(xDrop);
124  mpImplWin->SetEdgeBlending(false);
125 
128  mpBtn->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
129  mpBtn->Show();
130  mpBtn->GetDropTarget()->addDropTargetListener(xDrop);
131  }
132 
133  vcl::Window* pLBParent = this;
134  if ( mpFloatWin )
135  pLBParent = mpFloatWin;
136  mpImplLB = VclPtr<ImplListBox>::Create( pLBParent, nStyle&(~WB_BORDER) );
137  mpImplLB->SetSelectHdl( LINK( this, ListBox, ImplSelectHdl ) );
138  mpImplLB->SetScrollHdl( LINK( this, ListBox, ImplScrollHdl ) );
139  mpImplLB->SetCancelHdl( LINK( this, ListBox, ImplCancelHdl ) );
140  mpImplLB->SetDoubleClickHdl( LINK( this, ListBox, ImplDoubleClickHdl ) );
141  mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
142  mpImplLB->SetFocusHdl( LINK( this, ListBox, ImplFocusHdl ) );
143  mpImplLB->SetListItemSelectHdl( LINK( this, ListBox, ImplListItemSelectHdl ) );
144  mpImplLB->SetPosPixel( Point() );
145  mpImplLB->SetEdgeBlending(false);
146  mpImplLB->Show();
147 
148  mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
149 
150  if ( mpFloatWin )
151  {
153  mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
154  }
155  else
157 
158  SetCompoundControl( true );
159 }
160 
162 {
163  if ( !(nStyle & WB_NOTABSTOP) )
164  nStyle |= WB_TABSTOP;
165  if ( !(nStyle & WB_NOGROUP) )
166  nStyle |= WB_GROUP;
167  return nStyle;
168 }
169 
170 IMPL_LINK_NOARG(ListBox, ImplSelectHdl, LinkParamNone*, void)
171 {
172  bool bPopup = IsInDropDown();
173  if( IsDropDownBox() )
174  {
175  if( !mpImplLB->IsTravelSelect() )
176  {
177  mpFloatWin->EndPopupMode();
178  mpImplWin->GrabFocus();
179  }
180 
181  mpImplWin->SetItemPos( GetSelectedEntryPos() );
182  mpImplWin->SetString( GetSelectedEntry() );
183  if( mpImplLB->GetEntryList()->HasImages() )
184  {
185  Image aImage = mpImplLB->GetEntryList()->GetEntryImage( GetSelectedEntryPos() );
186  mpImplWin->SetImage( aImage );
187  }
188  mpImplWin->Invalidate();
189  }
190 
191  if ( ( !IsTravelSelect() || mpImplLB->IsSelectionChanged() ) || ( bPopup && !IsMultiSelectionEnabled() ) )
192  Select();
193 }
194 
195 IMPL_LINK( ListBox, ImplFocusHdl, sal_Int32, nPos, void )
196 {
197  CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos) );
198 }
199 
200 IMPL_LINK_NOARG( ListBox, ImplListItemSelectHdl, LinkParamNone*, void )
201 {
202  CallEventListeners( VclEventId::DropdownSelect );
203 }
204 
205 IMPL_LINK_NOARG(ListBox, ImplScrollHdl, ImplListBox*, void)
206 {
207  CallEventListeners( VclEventId::ListboxScrolled );
208 }
209 
210 IMPL_LINK_NOARG(ListBox, ImplCancelHdl, LinkParamNone*, void)
211 {
212  if( IsInDropDown() )
213  mpFloatWin->EndPopupMode();
214 }
215 
216 IMPL_LINK( ListBox, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
217 {
218  if ( !mpImplLB->IsTrackingSelect() )
219  {
220  const ImplEntryList* pEntryList = mpImplLB->GetEntryList();
221  if ( pEntryList->IsEntryPosSelected( nChanged ) )
222  {
223  // FIXME? This should've been turned into an ImplPaintEntry some time ago...
224  if ( nChanged < pEntryList->GetMRUCount() )
225  nChanged = pEntryList->FindEntry( pEntryList->GetEntryText( nChanged ) );
226  mpImplWin->SetItemPos( nChanged );
227  mpImplWin->SetString( mpImplLB->GetEntryList()->GetEntryText( nChanged ) );
228  if( mpImplLB->GetEntryList()->HasImages() )
229  {
230  Image aImage = mpImplLB->GetEntryList()->GetEntryImage( nChanged );
231  mpImplWin->SetImage( aImage );
232  }
233  }
234  else
235  {
236  mpImplWin->SetItemPos( LISTBOX_ENTRY_NOTFOUND );
237  mpImplWin->SetString( OUString() );
238  Image aImage;
239  mpImplWin->SetImage( aImage );
240  }
241  mpImplWin->Invalidate();
242  }
243 }
244 
245 IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl, ImplListBoxWindow*, void)
246 {
247  DoubleClick();
248 }
249 
250 IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl, void*, void)
251 {
252  if( !mpFloatWin->IsInPopupMode() )
253  {
254  CallEventListeners( VclEventId::DropdownPreOpen );
255  mpImplWin->GrabFocus();
256  mpBtn->SetPressed( true );
257  mpFloatWin->StartFloat( true );
258  CallEventListeners( VclEventId::DropdownOpen );
259 
260  ImplClearLayoutData();
261  if( mpImplLB )
262  mpImplLB->GetMainWindow()->ImplClearLayoutData();
263  if( mpImplWin )
264  mpImplWin->ImplClearLayoutData();
265  }
266 }
267 
268 IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl, FloatingWindow*, void)
269 {
270  if( mpFloatWin->IsPopupModeCanceled() )
271  {
272  if ( ( mpFloatWin->GetPopupModeStartSaveSelection() != LISTBOX_ENTRY_NOTFOUND )
273  && !IsEntryPosSelected( mpFloatWin->GetPopupModeStartSaveSelection() ) )
274  {
275  mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), true );
276  bool bTravelSelect = mpImplLB->IsTravelSelect();
277  mpImplLB->SetTravelSelect( true );
278 
279  VclPtr<vcl::Window> xWindow = this;
280  Select();
281  if ( xWindow->IsDisposed() )
282  return;
283 
284  mpImplLB->SetTravelSelect( bTravelSelect );
285  }
286  }
287 
288  ImplClearLayoutData();
289  if( mpImplLB )
290  mpImplLB->GetMainWindow()->ImplClearLayoutData();
291  if( mpImplWin )
292  mpImplWin->ImplClearLayoutData();
293 
294  mpBtn->SetPressed( false );
295  CallEventListeners( VclEventId::DropdownClose );
296 }
297 
299 {
300  if( IsDropDownBox() )
301  {
302  if( mpFloatWin->IsInPopupMode() )
304  else
305  {
307  mpImplWin->GrabFocus();
308  mpBtn->SetPressed( true );
309  mpFloatWin->StartFloat( true );
311  }
312  }
313 }
314 
316 {
317  rRenderContext.SetBackground();
318 }
319 
320 void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )
321 {
323 
324  Point aPos = pDev->LogicToPixel( rPos );
325  Size aSize = pDev->LogicToPixel( rSize );
326  vcl::Font aFont = mpImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
327 
328  pDev->Push();
329  pDev->SetMapMode();
330  pDev->SetFont( aFont );
331  pDev->SetTextFillColor();
332 
333  // Border/Background
334  pDev->SetLineColor();
335  pDev->SetFillColor();
336  bool bBorder = (GetStyle() & WB_BORDER);
337  bool bBackground = IsControlBackground();
338  if ( bBorder || bBackground )
339  {
340  tools::Rectangle aRect( aPos, aSize );
341  if ( bBorder )
342  {
343  ImplDrawFrame( pDev, aRect );
344  }
345  if ( bBackground )
346  {
348  pDev->DrawRect( aRect );
349  }
350  }
351 
352  // Content
353  if ( nFlags & DrawFlags::Mono )
354  {
355  pDev->SetTextColor( COL_BLACK );
356  }
357  else
358  {
359  if ( !IsEnabled() )
360  {
361  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
362  pDev->SetTextColor( rStyleSettings.GetDisableColor() );
363  }
364  else
365  {
366  pDev->SetTextColor( GetTextColor() );
367  }
368  }
369 
370  const long nOnePixel = GetDrawPixel( pDev, 1 );
371  const long nOffX = 3*nOnePixel;
373  tools::Rectangle aTextRect( aPos, aSize );
374 
375  if ( GetStyle() & WB_CENTER )
376  nTextStyle |= DrawTextFlags::Center;
377  else if ( GetStyle() & WB_RIGHT )
378  nTextStyle |= DrawTextFlags::Right;
379  else
380  nTextStyle |= DrawTextFlags::Left;
381 
382  aTextRect.AdjustLeft(nOffX );
383  aTextRect.AdjustRight( -nOffX );
384 
385  if ( IsDropDownBox() )
386  {
387  OUString aText = GetSelectedEntry();
388  long nTextHeight = pDev->GetTextHeight();
389  long nTextWidth = pDev->GetTextWidth( aText );
390  long nOffY = (aSize.Height()-nTextHeight) / 2;
391 
392  // Clipping?
393  if ( (nOffY < 0) ||
394  ((nOffY+nTextHeight) > aSize.Height()) ||
395  ((nOffX+nTextWidth) > aSize.Width()) )
396  {
397  tools::Rectangle aClip( aPos, aSize );
398  if ( nTextHeight > aSize.Height() )
399  aClip.AdjustBottom(nTextHeight-aSize.Height()+1 ); // So that HP Printers don't optimize this away
400  pDev->IntersectClipRegion( aClip );
401  }
402 
403  pDev->DrawText( aTextRect, aText, nTextStyle );
404  }
405  else
406  {
407  long nTextHeight = pDev->GetTextHeight();
408  sal_uInt16 nLines = ( nTextHeight > 0 ) ? static_cast<sal_uInt16>(aSize.Height() / nTextHeight) : 1;
409  tools::Rectangle aClip( aPos, aSize );
410 
411  pDev->IntersectClipRegion( aClip );
412 
413  if ( !nLines )
414  nLines = 1;
415 
416  for ( sal_uInt16 n = 0; n < nLines; n++ )
417  {
418  sal_Int32 nEntry = n+mpImplLB->GetTopEntry();
419  bool bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
420  if ( bSelected )
421  {
422  pDev->SetFillColor( COL_BLACK );
423  pDev->DrawRect( tools::Rectangle( Point( aPos.X(), aPos.Y() + n*nTextHeight ),
424  Point( aPos.X() + aSize.Width(), aPos.Y() + (n+1)*nTextHeight + 2*nOnePixel ) ) );
425  pDev->SetFillColor();
426  pDev->SetTextColor( COL_WHITE );
427  }
428 
429  aTextRect.SetTop( aPos.Y() + n*nTextHeight );
430  aTextRect.SetBottom( aTextRect.Top() + nTextHeight );
431 
432  pDev->DrawText( aTextRect, mpImplLB->GetEntryList()->GetEntryText( nEntry ), nTextStyle );
433 
434  if ( bSelected )
435  pDev->SetTextColor( COL_BLACK );
436  }
437  }
438 
439  pDev->Pop();
440 }
441 
443 {
444  if ( mpImplLB )
445  {
446  if( IsDropDownBox() )
447  mpImplWin->GrabFocus();
448  else
449  mpImplLB->GrabFocus();
450  }
451 
453 }
454 
456 {
457  if( IsDropDownBox() )
458  {
459  if (mpImplWin)
460  mpImplWin->HideFocus();
461  }
462  else
463  {
464  if (mpImplLB)
465  mpImplLB->HideFocus();
466  }
467 
469 }
470 
472 {
473  Control::DataChanged( rDCEvt );
474 
475  if ( (rDCEvt.GetType() == DataChangedEventType::FONTS) ||
477  ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
478  (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
479  {
480  SetBackground(); // Due to a hack in Window::UpdateSettings the background must be reset
481  // otherwise it will overpaint NWF drawn listboxes
482  Resize();
483  mpImplLB->Resize(); // Is not called by ListBox::Resize() if the ImplLB does not change
484 
485  if ( mpImplWin )
486  {
487  mpImplWin->SetSettings( GetSettings() ); // If not yet set...
489 
492  }
493 
494  if ( IsDropDownBox() )
495  Invalidate();
496  }
497 }
498 
499 void ListBox::EnableAutoSize( bool bAuto )
500 {
501  mbDDAutoSize = bAuto;
502  if ( mpFloatWin )
503  {
504  if ( bAuto && !mpFloatWin->GetDropDownLineCount() )
505  {
506  // use GetListBoxMaximumLineCount here; before, was on fixed number of five
508  }
509  else if ( !bAuto )
510  {
512  }
513  }
514 }
515 
516 void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
517 {
518  mnLineCount = nLines;
519  if ( mpFloatWin )
521 }
522 
524 {
525  // Adapt to maximum allowed number.
526  // Limit for LOK as we can't render outside of the dialog canvas.
529  else
530  SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
531 }
532 
534 {
535  if ( mpFloatWin )
537  return mnLineCount;
538 }
539 
540 void ListBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags )
541 {
542  if( IsDropDownBox() && ( nFlags & PosSizeFlags::Size ) )
543  {
544  Size aPrefSz = mpFloatWin->GetPrefSize();
545  if ( ( nFlags & PosSizeFlags::Height ) && ( nHeight >= 2*mnDDHeight ) )
546  aPrefSz.setHeight( nHeight-mnDDHeight );
547  if ( nFlags & PosSizeFlags::Width )
548  aPrefSz.setWidth( nWidth );
549  mpFloatWin->SetPrefSize( aPrefSz );
550 
551  if (IsAutoSizeEnabled())
552  nHeight = mnDDHeight;
553  }
554 
555  Control::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
556 }
557 
559 {
560  Size aOutSz = GetOutputSizePixel();
561  if( IsDropDownBox() )
562  {
563  // Initialize the dropdown button size with the standard scrollbar width
564  long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
565  long nBottom = aOutSz.Height();
566 
567  // Note: in case of no border, pBorder will actually be this
569  ImplControlValue aControlValue;
570  Point aPoint;
571  tools::Rectangle aContent, aBound;
572 
573  // Use the full extent of the control
574  tools::Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
575 
577  aArea, ControlState::NONE, aControlValue, aBound, aContent) )
578  {
579  // Convert back from border space to local coordinates
580  aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) );
581  aContent.Move( -aPoint.X(), -aPoint.Y() );
582 
583  // Use the themes drop down size for the button
584  aOutSz.setWidth( aContent.Left() );
585  mpBtn->setPosSizePixel( aContent.Left(), 0, aContent.GetWidth(), nBottom );
586 
587  // Adjust the size of the edit field
589  aArea, ControlState::NONE, aControlValue, aBound, aContent) )
590  {
591  // Convert back from border space to local coordinates
592  aContent.Move( -aPoint.X(), -aPoint.Y() );
593 
594  // Use the themes drop down size
596  {
597  // No border but focus ring behavior -> we have a problem; the
598  // native rect relies on the border to draw the focus
599  // let's do the best we can and center vertically, so it doesn't look
600  // completely wrong.
601  Size aSz( GetOutputSizePixel() );
602  long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2;
603  aContent.AdjustTop( -nDiff );
604  aContent.AdjustBottom( -nDiff );
605  }
606  mpImplWin->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() );
607  }
608  else
609  mpImplWin->SetSizePixel( aOutSz );
610  }
611  else
612  {
613  nSBWidth = CalcZoom( nSBWidth );
614  mpImplWin->setPosSizePixel( 0, 0, aOutSz.Width() - nSBWidth, aOutSz.Height() );
615  mpBtn->setPosSizePixel( aOutSz.Width() - nSBWidth, 0, nSBWidth, aOutSz.Height() );
616  }
617  }
618  else
619  {
620  mpImplLB->SetSizePixel( aOutSz );
621  }
622 
623  // Retain FloatingWindow size even when it's invisible, as we still process KEY_PGUP/DOWN ...
624  if ( mpFloatWin )
626 
627  Control::Resize();
628 }
629 
631 {
632  mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
633  const ImplListBoxWindow* rMainWin = mpImplLB->GetMainWindow();
634  if( mpFloatWin )
635  {
636  // Dropdown mode
639  if( mpFloatWin->IsReallyVisible() )
640  {
641  AppendLayoutData( *rMainWin );
642  rMainWin->SetLayoutDataParent( this );
643  }
644  }
645  else
646  {
647  AppendLayoutData( *rMainWin );
648  rMainWin->SetLayoutDataParent( this );
649  }
650 }
651 
652 long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const
653 {
654  if( !HasLayoutData() )
655  FillLayoutData();
656 
657  // Check whether rPoint fits at all
658  long nIndex = Control::GetIndexForPoint( rPoint );
659  if( nIndex != -1 )
660  {
661  // Point must be either in main list window
662  // or in impl window (dropdown case)
664 
665  // Convert coordinates to ImplListBoxWindow pixel coordinate space
666  Point aConvPoint = LogicToPixel( rPoint );
667  aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
668  aConvPoint = rMain->AbsoluteScreenToOutputPixel( aConvPoint );
669  aConvPoint = rMain->PixelToLogic( aConvPoint );
670 
671  // Try to find entry
672  sal_Int32 nEntry = rMain->GetEntryPosForPoint( aConvPoint );
673  if( nEntry == LISTBOX_ENTRY_NOTFOUND )
674  {
675  // Not found, maybe dropdown case
677  {
678  // Convert to impl window pixel coordinates
679  aConvPoint = LogicToPixel( rPoint );
680  aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
681  aConvPoint = mpImplWin->AbsoluteScreenToOutputPixel( aConvPoint );
682 
683  // Check whether converted point is inside impl window
684  Size aImplWinSize = mpImplWin->GetOutputSizePixel();
685  if( aConvPoint.X() >= 0 && aConvPoint.Y() >= 0 && aConvPoint.X() < aImplWinSize.Width() && aConvPoint.Y() < aImplWinSize.Height() )
686  {
687  // Inside the impl window, the position is the current item pos
688  rPos = mpImplWin->GetItemPos();
689  }
690  else
691  nIndex = -1;
692  }
693  else
694  nIndex = -1;
695  }
696  else
697  rPos = nEntry;
698 
699  SAL_WARN_IF( nIndex == -1, "vcl", "found index for point, but relative index failed" );
700  }
701 
702  // Get line relative index
703  if( nIndex != -1 )
704  nIndex = ToRelativeLineIndex( nIndex );
705 
706  return nIndex;
707 }
708 
710 {
711  if( nType == StateChangedType::ReadOnly )
712  {
713  if( mpImplWin )
714  mpImplWin->Enable( !IsReadOnly() );
715  if( mpBtn )
716  mpBtn->Enable( !IsReadOnly() );
717  }
718  else if( nType == StateChangedType::Enable )
719  {
720  mpImplLB->Enable( IsEnabled() );
721  if( mpImplWin )
722  {
723  mpImplWin->Enable( IsEnabled() );
726  {
728  }
729  else
731  }
732  if( mpBtn )
733  mpBtn->Enable( IsEnabled() );
734  }
735  else if( nType == StateChangedType::UpdateMode )
736  {
738  }
739  else if ( nType == StateChangedType::Zoom )
740  {
741  mpImplLB->SetZoom( GetZoom() );
742  if ( mpImplWin )
743  {
744  mpImplWin->SetZoom( GetZoom() );
747  }
748  Resize();
749  }
750  else if ( nType == StateChangedType::ControlFont )
751  {
753  if ( mpImplWin )
754  {
758  }
759  Resize();
760  }
761  else if ( nType == StateChangedType::ControlForeground )
762  {
764  if ( mpImplWin )
765  {
770  }
771  }
772  else if ( nType == StateChangedType::ControlBackground )
773  {
775  if ( mpImplWin )
776  {
778  {
779  // Transparent background
782  }
783  else
784  {
787  }
790  }
791  }
792  else if ( nType == StateChangedType::Style )
793  {
795  mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) != 0 );
796  bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) != 0;
797  mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
798  }
799  else if( nType == StateChangedType::Mirroring )
800  {
801  if( mpBtn )
802  {
805  }
807  if( mpImplWin )
809  Resize();
810  }
811 
812  Control::StateChanged( nType );
813 }
814 
816 {
817  bool bDone = false;
818  if ( mpImplLB )
819  {
820  if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( rNEvt.GetWindow() == mpImplWin ) )
821  {
822  KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
823  switch( aKeyEvt.GetKeyCode().GetCode() )
824  {
825  case KEY_DOWN:
826  {
827  if( mpFloatWin && !mpFloatWin->IsInPopupMode() &&
828  aKeyEvt.GetKeyCode().IsMod2() )
829  {
831  mpBtn->SetPressed( true );
832  mpFloatWin->StartFloat( false );
834  bDone = true;
835  }
836  else
837  {
838  bDone = mpImplLB->ProcessKeyInput( aKeyEvt );
839  }
840  }
841  break;
842  case KEY_UP:
843  {
844  if( mpFloatWin && mpFloatWin->IsInPopupMode() &&
845  aKeyEvt.GetKeyCode().IsMod2() )
846  {
848  bDone = true;
849  }
850  else
851  {
852  bDone = mpImplLB->ProcessKeyInput( aKeyEvt );
853  }
854  }
855  break;
856  case KEY_RETURN:
857  {
858  if( IsInDropDown() )
859  {
860  mpImplLB->ProcessKeyInput( aKeyEvt );
861  bDone = true;
862  }
863  }
864  break;
865 
866  default:
867  {
868  bDone = mpImplLB->ProcessKeyInput( aKeyEvt );
869  }
870  }
871  }
872  else if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
873  {
874  if ( IsInDropDown() && !HasChildPathFocus( true ) )
876  }
877  else if ( (rNEvt.GetType() == MouseNotifyEvent::COMMAND) &&
879  (rNEvt.GetWindow() == mpImplWin) )
880  {
881  MouseWheelBehaviour nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
882  if ( ( nWheelBehavior == MouseWheelBehaviour::ALWAYS )
883  || ( ( nWheelBehavior == MouseWheelBehaviour::FocusOnly )
884  && HasChildPathFocus()
885  )
886  )
887  {
889  }
890  else
891  {
892  bDone = false; // Don't consume this event, let the default handling take it (i.e. scroll the context)
893  }
894  }
895  }
896 
897  return bDone || Control::PreNotify( rNEvt );
898 }
899 
901 {
903 }
904 
906 {
908 }
909 
911 {
912  if (!mpImplLB)
913  return;
914  mpImplLB->Clear();
915  if( IsDropDownBox() )
916  {
918  mpImplWin->SetString( OUString() );
919  Image aImage;
920  mpImplWin->SetImage( aImage );
922  }
923  CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(-1) );
924 }
925 
927 {
929  if( IsDropDownBox() )
930  {
932  mpImplWin->SetString( OUString() );
933  Image aImage;
934  mpImplWin->SetImage( aImage );
936  }
937 }
938 
939 sal_Int32 ListBox::InsertEntry( const OUString& rStr, sal_Int32 nPos )
940 {
941  sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
942  nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
943  CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) );
944  return nRealPos;
945 }
946 
947 sal_Int32 ListBox::InsertEntry( const OUString& rStr, const Image& rImage, sal_Int32 nPos )
948 {
949  sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
950  nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
951  CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) );
952  return nRealPos;
953 }
954 
955 void ListBox::RemoveEntry( const OUString& rStr )
956 {
957  RemoveEntry( GetEntryPos( rStr ) );
958 }
959 
960 void ListBox::RemoveEntry( sal_Int32 nPos )
961 {
963  CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(nPos) );
964 }
965 
966 Image ListBox::GetEntryImage( sal_Int32 nPos ) const
967 {
968  if ( mpImplLB && mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
969  return mpImplLB->GetEntryList()->GetEntryImage( nPos );
970  return Image();
971 }
972 
973 sal_Int32 ListBox::GetEntryPos( const OUString& rStr ) const
974 {
975  if (!mpImplLB)
976  return LISTBOX_ENTRY_NOTFOUND;
977  sal_Int32 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
978  if ( nPos != LISTBOX_ENTRY_NOTFOUND )
979  nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount();
980  return nPos;
981 }
982 
983 OUString ListBox::GetEntry( sal_Int32 nPos ) const
984 {
985  if (!mpImplLB)
986  return OUString();
988 }
989 
990 sal_Int32 ListBox::GetEntryCount() const
991 {
992  if (!mpImplLB)
993  return 0;
995 }
996 
997 OUString ListBox::GetSelectedEntry(sal_Int32 nIndex) const
998 {
999  return GetEntry( GetSelectedEntryPos( nIndex ) );
1000 }
1001 
1003 {
1004  if (!mpImplLB)
1005  return 0;
1007 }
1008 
1009 sal_Int32 ListBox::GetSelectedEntryPos( sal_Int32 nIndex ) const
1010 {
1011  if (!mpImplLB || !mpImplLB->GetEntryList())
1012  return LISTBOX_ENTRY_NOTFOUND;
1013 
1014  sal_Int32 nPos = mpImplLB->GetEntryList()->GetSelectedEntryPos( nIndex );
1015  if ( nPos != LISTBOX_ENTRY_NOTFOUND )
1016  {
1017  if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
1019  nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount();
1020  }
1021  return nPos;
1022 }
1023 
1024 bool ListBox::IsEntryPosSelected( sal_Int32 nPos ) const
1025 {
1027 }
1028 
1029 void ListBox::SelectEntry( const OUString& rStr, bool bSelect )
1030 {
1031  SelectEntryPos( GetEntryPos( rStr ), bSelect );
1032 }
1033 
1034 void ListBox::SelectEntryPos( sal_Int32 nPos, bool bSelect )
1035 {
1036  if (!mpImplLB)
1037  return;
1038 
1039  if ( 0 <= nPos && nPos < mpImplLB->GetEntryList()->GetEntryCount() )
1040  {
1041  sal_Int32 nCurrentPos = mpImplLB->GetCurrentPos();
1042  mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
1043  //Only when bSelect == true, send both Selection & Focus events
1044  if (nCurrentPos != nPos && bSelect)
1045  {
1046  CallEventListeners( VclEventId::ListboxSelect, reinterpret_cast<void*>(nPos));
1047  if (HasFocus())
1048  CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos));
1049  }
1050  }
1051 }
1052 
1053 void ListBox::SelectEntriesPos( const std::vector<sal_Int32>& rPositions, bool bSelect )
1054 {
1055  if (!mpImplLB)
1056  return;
1057 
1058  bool bCallListeners = false;
1059 
1060  const sal_Int32 nCurrentPos = mpImplLB->GetCurrentPos();
1061  const auto nEntryCount = mpImplLB->GetEntryList()->GetEntryCount();
1062  const auto nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
1063 
1064  for (auto nPos : rPositions)
1065  {
1066  if (0 <= nPos && nPos < nEntryCount)
1067  {
1068  mpImplLB->SelectEntry(nPos + nMRUCount, bSelect);
1069  if (nCurrentPos != nPos && bSelect)
1070  bCallListeners = true;
1071  }
1072  }
1073 
1074  //Only when bSelect == true, send both Selection & Focus events
1075  if (bCallListeners)
1076  {
1078  if (HasFocus())
1080  }
1081 }
1082 
1083 void ListBox::SetEntryData( sal_Int32 nPos, void* pNewData )
1084 {
1085  mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
1086 }
1087 
1088 void* ListBox::GetEntryData( sal_Int32 nPos ) const
1089 {
1091 }
1092 
1093 void ListBox::SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags )
1094 {
1095  mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags );
1096 }
1097 
1099 {
1101 }
1102 
1103 void ListBox::SetTopEntry( sal_Int32 nPos )
1104 {
1106 }
1107 
1108 sal_Int32 ListBox::GetTopEntry() const
1109 {
1111  if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
1112  nPos = 0;
1113  return nPos;
1114 }
1115 
1117 {
1118  return mpImplLB->IsTravelSelect();
1119 }
1120 
1122 {
1123  // when the dropdown is dismissed, first mbInPopupMode is set to false, and on the next event iteration then
1124  // mbPopupMode is set to false
1126 }
1127 
1129 {
1131  tools::Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ListBox *>(this)) );
1132  aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
1133  return aRect;
1134 }
1135 
1137 {
1138  EnableMultiSelection( bMulti, false );
1139 }
1140 
1141 void ListBox::EnableMultiSelection( bool bMulti, bool bStackSelection )
1142 {
1143  mpImplLB->EnableMultiSelection( bMulti, bStackSelection );
1144 
1145  // WB_SIMPLEMODE:
1146  // The MultiListBox behaves just like a normal ListBox
1147  // MultiSelection is possible via corresponding additional keys
1148  bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) != 0;
1149  mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
1150 
1151  // In a MultiSelection, we can't see us travelling without focus
1152  if ( mpFloatWin )
1153  mpImplLB->GetMainWindow()->AllowGrabFocus( bMulti );
1154 }
1155 
1157 {
1159 }
1160 
1162 {
1163  Size aSz;
1164 
1165  if (!mpImplLB)
1166  return aSz;
1167 
1168  aSz = CalcSubEditSize();
1169 
1170  bool bAddScrollWidth = false;
1171 
1172  if (IsDropDownBox())
1173  {
1174  aSz.AdjustHeight(4 ); // add a space between entry and border
1175  aSz.AdjustWidth(4 ); // add a little breathing space
1176  bAddScrollWidth = true;
1177  }
1178  else
1179  bAddScrollWidth = (GetStyle() & WB_VSCROLL) == WB_VSCROLL;
1180 
1181  if (bAddScrollWidth)
1182  {
1183  // Try native borders; scrollbar size may not be a good indicator
1184  // See how large the edit area inside is to estimate what is needed for the dropdown
1185  ImplControlValue aControlValue;
1186  tools::Rectangle aContent, aBound;
1187  Size aTestSize( 100, 20 );
1188  tools::Rectangle aArea( Point(), aTestSize );
1190  aControlValue, aBound, aContent) )
1191  {
1192  // use the themes drop down size
1193  aSz.AdjustWidth(aTestSize.Width() - aContent.GetWidth() );
1194  }
1195  else
1196  aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() );
1197  }
1198 
1199  aSz = CalcWindowSize( aSz );
1200 
1201  if (IsDropDownBox()) // Check minimum height of dropdown box
1202  {
1203  ImplControlValue aControlValue;
1204  tools::Rectangle aRect( Point( 0, 0 ), aSz );
1205  tools::Rectangle aContent, aBound;
1207  aControlValue, aBound, aContent) )
1208  {
1209  if( aBound.GetHeight() > aSz.Height() )
1210  aSz.setHeight( aBound.GetHeight() );
1211  }
1212  }
1213 
1214  return aSz;
1215 }
1216 
1218 {
1219  Size aSz;
1220 
1221  if (!mpImplLB)
1222  return aSz;
1223 
1224  if ( !IsDropDownBox() )
1226  else
1227  {
1228  aSz.setHeight( mpImplLB->GetEntryHeight() );
1229  // Size to maximum entry width
1231 
1232  if (m_nMaxWidthChars != -1)
1233  {
1234  long nMaxWidth = m_nMaxWidthChars * approximate_char_width();
1235  aSz.setWidth( std::min(aSz.Width(), nMaxWidth) );
1236  }
1237 
1238  // Do not create ultrathin ListBoxes, it doesn't look good
1240  aSz.setWidth( GetSettings().GetStyleSettings().GetScrollBarSize() );
1241  }
1242 
1243  return aSz;
1244 }
1245 
1247 {
1248  return CalcMinimumSize();
1249 }
1250 
1251 Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
1252 {
1253  Size aSz = rPrefSize;
1254  sal_Int32 nLeft, nTop, nRight, nBottom;
1255  static_cast<vcl::Window*>(const_cast<ListBox *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1256  aSz.AdjustHeight( -(nTop+nBottom) );
1257  if ( !IsDropDownBox() )
1258  {
1259  long nEntryHeight = CalcBlockSize( 1, 1 ).Height();
1260  long nLines = aSz.Height() / nEntryHeight;
1261  if ( nLines < 1 )
1262  nLines = 1;
1263  aSz.setHeight( nLines * nEntryHeight );
1264  }
1265  else
1266  {
1267  aSz.setHeight( mnDDHeight );
1268  }
1269  aSz.AdjustHeight(nTop+nBottom );
1270 
1271  aSz = CalcWindowSize( aSz );
1272  return aSz;
1273 }
1274 
1275 Size ListBox::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
1276 {
1277  // ScrollBars are shown if needed
1278  Size aMinSz = CalcMinimumSize();
1279  // aMinSz = ImplCalcOutSz( aMinSz );
1280 
1281  Size aSz;
1282 
1283  // Height
1284  if ( nLines )
1285  {
1286  if ( !IsDropDownBox() )
1287  aSz.setHeight( mpImplLB->CalcSize( nLines ).Height() );
1288  else
1289  aSz.setHeight( mnDDHeight );
1290  }
1291  else
1292  aSz.setHeight( aMinSz.Height() );
1293 
1294  // Width
1295  if ( nColumns )
1296  aSz.setWidth( nColumns * GetTextWidth( OUString('X') ) );
1297  else
1298  aSz.setWidth( aMinSz.Width() );
1299 
1300  if ( IsDropDownBox() )
1301  aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() );
1302 
1303  if ( !IsDropDownBox() )
1304  {
1305  if ( aSz.Width() < aMinSz.Width() )
1306  aSz.AdjustHeight(GetSettings().GetStyleSettings().GetScrollBarSize() );
1307  if ( aSz.Height() < aMinSz.Height() )
1308  aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() );
1309  }
1310 
1311  aSz = CalcWindowSize( aSz );
1312  return aSz;
1313 }
1314 
1315 void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
1316 {
1317  float nCharWidth = approximate_char_width();
1318  if ( !IsDropDownBox() )
1319  {
1321  rnCols = static_cast<sal_uInt16>(aOutSz.Width()/nCharWidth);
1322  rnLines = static_cast<sal_uInt16>(aOutSz.Height()/mpImplLB->GetEntryHeightWithMargin());
1323  }
1324  else
1325  {
1326  Size aOutSz = mpImplWin->GetOutputSizePixel();
1327  rnCols = static_cast<sal_uInt16>(aOutSz.Width()/nCharWidth);
1328  rnLines = 1;
1329  }
1330 }
1331 
1332 IMPL_LINK( ListBox, ImplUserDrawHdl, UserDrawEvent*, pEvent, void )
1333 {
1334  UserDraw( *pEvent );
1335 }
1336 
1338 {
1339 }
1340 
1342 {
1343  if (rEvt.GetWindow() == mpImplLB->GetMainWindow())
1344  mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), true/*bDrawImage*/, true/*bDrawText*/, false/*bDrawTextAtImagePos*/ );
1345  else if (rEvt.GetWindow() == mpImplWin)
1346  mpImplWin->DrawEntry(*rEvt.GetRenderContext(), false/*layout*/);
1347 }
1348 
1349 void ListBox::EnableUserDraw( bool bUserDraw )
1350 {
1351  mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
1352  if ( mpImplWin )
1353  mpImplWin->EnableUserDraw( bUserDraw );
1354 }
1355 
1356 void ListBox::SetReadOnly( bool bReadOnly )
1357 {
1358  if ( mpImplLB->IsReadOnly() != bReadOnly )
1359  {
1360  mpImplLB->SetReadOnly( bReadOnly );
1362  }
1363 }
1364 
1366 {
1367  return mpImplLB->IsReadOnly();
1368 }
1369 
1370 void ListBox::SetSeparatorPos( sal_Int32 n )
1371 {
1372  mpImplLB->SetSeparatorPos( n );
1373 }
1374 
1375 sal_Int32 ListBox::GetSeparatorPos() const
1376 {
1377  return mpImplLB->GetSeparatorPos();
1378 }
1379 
1380 void ListBox::AddSeparator( sal_Int32 n )
1381 {
1382  mpImplLB->AddSeparator( n );
1383 }
1384 
1386 {
1387  return mpImplLB->GetDisplayLineCount();
1388 }
1389 
1391 {
1393 }
1394 
1396 {
1397  return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast<ListBox*>(this) ) : tools::Rectangle();
1398 }
1399 
1401 {
1402  // !!! Recursion does not occur because the ImplListBox is initialized by default
1403  // to a non-transparent color in Window::ImplInitData
1404  return mpImplLB->GetDisplayBackground();
1405 }
1406 
1407 void ListBox::setMaxWidthChars(sal_Int32 nWidth)
1408 {
1409  if (nWidth != m_nMaxWidthChars)
1410  {
1411  m_nMaxWidthChars = nWidth;
1412  queue_resize();
1413  }
1414 }
1415 
1416 bool ListBox::set_property(const OString &rKey, const OUString &rValue)
1417 {
1418  if (rKey == "active")
1419  SelectEntryPos(rValue.toInt32());
1420  else if (rKey == "max-width-chars")
1421  setMaxWidthChars(rValue.toInt32());
1422  else if (rKey == "can-focus")
1423  {
1424  // as far as I can see in Gtk, setting a ComboBox as can.focus means
1425  // the focus gets stuck in it, so try here to behave like gtk does
1426  // with the settings that work, i.e. can.focus of false doesn't
1427  // set the hard WB_NOTABSTOP
1428  WinBits nBits = GetStyle();
1429  nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
1430  if (toBool(rValue))
1431  nBits |= WB_TABSTOP;
1432  SetStyle(nBits);
1433  }
1434  else
1435  return Control::set_property(rKey, rValue);
1436  return true;
1437 }
1438 
1440 {
1441  return ListBoxUIObject::create;
1442 }
1443 
1444 boost::property_tree::ptree ListBox::DumpAsPropertyTree()
1445 {
1446  boost::property_tree::ptree aTree(Control::DumpAsPropertyTree());
1447  boost::property_tree::ptree aEntries;
1448 
1449  for (int i = 0; i < GetEntryCount(); ++i)
1450  {
1451  boost::property_tree::ptree aEntry;
1452  aEntry.put("", GetEntry(i));
1453  aEntries.push_back(std::make_pair("", aEntry));
1454  }
1455 
1456  aTree.add_child("entries", aEntries);
1457 
1458  boost::property_tree::ptree aSelected;
1459 
1460  for (int i = 0; i < GetSelectedEntryCount(); ++i)
1461  {
1462  boost::property_tree::ptree aEntry;
1463  aEntry.put("", GetSelectedEntryPos(i));
1464  aSelected.push_back(std::make_pair("", aEntry));
1465  }
1466 
1467  aTree.put("selectedCount", GetSelectedEntryCount());
1468  aTree.add_child("selectedEntries", aSelected);
1469 
1470  return aTree;
1471 }
1472 
1473 MultiListBox::MultiListBox( vcl::Window* pParent, WinBits nStyle ) :
1475 {
1476  ImplInit( pParent, nStyle );
1477  EnableMultiSelection( true );
1478 }
1479 
1480 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 m_nMaxWidthChars
Definition: lstbox.hxx:88
Point TopLeft() const
long Width() const
const Color & GetTextColor() const
Definition: outdev.hxx:1117
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:781
bool IsControlBackground() const
Definition: window2.cxx:1087
virtual void EnableRTL(bool bEnable=true) override
Definition: ctrl.cxx:65
bool IsInPopupMode() const
Definition: floatwin.hxx:148
virtual Size GetOptimalSize() const override
Definition: listbox.cxx:1246
SAL_DLLPRIVATE float approximate_char_width() const
Definition: text.cxx:903
Image GetEntryImage(sal_Int32 nPos) const
Definition: listbox.cxx:966
bool IsDropDownBox() const
Definition: lstbox.hxx:114
bool ImplCallEventListenersAndHandler(VclEventId nEvent, std::function< void()> const &callHandler)
this calls both our event listeners, and a specified handler
Definition: ctrl.cxx:305
long GetWidth() const
void SetSelectHdl(const Link< LinkParamNone *, void > &rLink)
Definition: listbox.hxx:482
long GetIndexForPoint(const Point &rPoint, sal_Int32 &rPos) const
Definition: listbox.cxx:652
OUString GetSelectedEntry(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:997
void EnableMultiSelection(bool bMulti, bool bStackMode)
Definition: listbox.hxx:468
void HideFocus()
Definition: window2.cxx:91
SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const
Definition: floatwin.hxx:122
sal_Int32 nIndex
void SetPopupModeEndHdl(const Link< FloatingWindow *, void > &rLink)
Definition: floatwin.hxx:153
void SetMBDownHdl(const Link< void *, void > &rLink)
Definition: listbox.hxx:581
bool HasEntryImage(sal_Int32 nPos) const
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: listbox.cxx:315
const ImplEntryList * GetEntryList() const
Definition: listbox.hxx:417
void SetNoSelection()
long ToRelativeLineIndex(long nIndex) const
ToRelativeLineIndex changes a layout data index to a count relative to its line.
Definition: ctrl.cxx:211
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:1009
sal_Int32 GetSeparatorPos() const
Gets the position of the separator which was added first.
Definition: listbox.hxx:448
long AdjustWidth(long n)
sal_uInt16 mnDDHeight
Definition: lstbox.hxx:86
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
sal_Int32 GetSelectedEntryPos(sal_Int32 nIndex) const
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:331
void EnableUserDraw(bool bUserDraw)
Definition: listbox.hxx:584
bool IsTravelSelect() const
Definition: listbox.hxx:465
VclPtr< ImplBtn > mpBtn
Definition: lstbox.hxx:85
long Height() const
SAL_DLLPRIVATE void ImplDrawFrame(OutputDevice *pDev, tools::Rectangle &rRect)
draws a frame around the give rectangle, onto the given device
Definition: ctrl.cxx:336
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:79
IMPL_LINK_NOARG(ListBox, ImplSelectHdl, LinkParamNone *, void)
Definition: listbox.cxx:170
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: listbox.cxx:79
void AllowGrabFocus(bool b)
Definition: listbox.hxx:300
WinBits const WB_NOGROUP
long AdjustLeft(long nHorzMoveDelta)
ListBoxEntryFlags GetEntryFlags(sal_Int32 nPos) const
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2928
void disposeAndClear()
Definition: vclptr.hxx:200
const StyleSettings & GetStyleSettings() const
bool IsMultiSelectionEnabled() const
Definition: listbox.hxx:469
virtual void Select()
Definition: listbox.cxx:900
const Size & GetPrefSize() const
Definition: listbox.hxx:526
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
Definition: listbox.cxx:540
ImplSVNWFData maNWFData
Definition: svdata.hxx:399
sal_Int64 n
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
sal_Int32 GetTopEntry() const
Definition: listbox.hxx:456
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1262
WinBits const WB_RIGHT
sal_Int32 GetEntryPosForPoint(const Point &rPoint) const
void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3907
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual FactoryFunction GetUITestFactory() const override
Definition: listbox.cxx:1439
void SetTextFillColor()
Definition: text.cxx:699
sal_uInt16 GetCode() const
Definition: keycod.hxx:53
void RemoveEntry(const OUString &rStr)
Definition: listbox.cxx:955
sal_Int32 GetSelectedEntryCount() const
PosSizeFlags
Definition: window.hxx:141
DataChangedEventType GetType() const
Definition: event.hxx:361
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:315
void IntersectClipRegion(const tools::Rectangle &rRect)
long GetMaxEntryWidth() const
Definition: listbox.hxx:479
long CalcZoom(long n) const
Definition: window2.cxx:397
void AppendLayoutData(const Control &rSubControl) const
Definition: ctrl.cxx:273
WinBits const WB_VSCROLL
void SetDropDownLineCount(sal_uInt16 nLines)
Definition: listbox.cxx:516
void Clear()
Definition: listbox.cxx:910
virtual void SetSettings(const AllSettings &rSettings) override
const Color & GetControlBackground() const
Definition: window2.cxx:1082
VclPtr< ImplListBox > mpImplLB
Definition: lstbox.hxx:82
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator. ...
Definition: listbox.cxx:1370
bool IsReadOnly() const
Definition: listbox.hxx:474
virtual void DoubleClick()
Definition: listbox.cxx:905
void SetDropDownLineCount(sal_uInt16 n)
Definition: listbox.hxx:536
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
long AdjustHeight(long n)
void EnableUserDraw(bool bUserDraw)
Definition: listbox.cxx:1349
sal_Int32 FindEntry(const OUString &rStr, bool bSearchMRUArea=false) const
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3059
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
void SetMapMode()
Definition: map.cxx:655
void SetUserDrawHdl(const Link< UserDrawEvent *, void > &rLink)
Definition: listbox.hxx:485
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
#define LISTBOX_ENTRY_NOTFOUND
Definition: lstbox.hxx:34
long AdjustBottom(long nVertMoveDelta)
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool HandleWheelAsCursorTravel(const CommandEvent &rCEvt)
const Fraction & GetZoom() const
Definition: window2.cxx:1210
void SelectEntry(const OUString &rStr, bool bSelect=true)
Definition: listbox.cxx:1029
void * GetEntryData(sal_Int32 nPos) const
StateChangedType
Definition: window.hxx:311
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2732
sal_Int64 WinBits
vcl::Window * GetWindow() const
Definition: event.hxx:308
void SetBackground()
void SetControlFont()
Definition: window2.cxx:409
sal_Int32 GetCurrentPos() const
Definition: listbox.hxx:434
void SetReadOnly(bool b)
Definition: listbox.hxx:473
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2446
tools::Rectangle GetBoundingRectangle(sal_Int32 nItem) const
Definition: listbox.cxx:1128
void EnableAutoSize(bool bAuto)
Definition: listbox.cxx:499
sal_Int32 GetEntryCount() const
Definition: listbox.cxx:990
Size CalcAdjustedSize(const Size &rPrefSize) const
Definition: listbox.cxx:1251
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: listbox.cxx:471
const vcl::Font & GetFont() const
Definition: outdev.hxx:643
void SetUserDrawHdl(const Link< UserDrawEvent *, void > &rLink)
Definition: listbox.hxx:582
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
Definition: listbox.hxx:453
void EnableMirroring()
pb: #106948# explicit mirroring for calc
Definition: listbox.hxx:504
void SetEntryData(sal_Int32 nPos, void *pNewData)
Definition: listbox.hxx:426
AllSettingsFlags GetFlags() const
Definition: event.hxx:362
virtual boost::property_tree::ptree DumpAsPropertyTree() override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: listbox.cxx:1444
virtual const Wallpaper & GetDisplayBackground() const override
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1314
void * GetEntryData(sal_Int32 nPos) const
Definition: listbox.cxx:1088
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:947
long Top() const
OUString GetEntry(sal_Int32 nPos) const
Definition: listbox.cxx:983
void SetDoubleClickHdl(const Link< ImplListBoxWindow *, void > &rLink)
Definition: listbox.hxx:484
bool IsReadOnly() const
Definition: listbox.cxx:1365
bool mbDDAutoSize
Definition: lstbox.hxx:93
Image GetEntryImage(sal_Int32 nPos) const
ImplListBoxWindow * GetMainWindow()
Definition: listbox.hxx:418
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
virtual void Draw(OutputDevice *pDev, const Point &rPos, const Size &rSize, DrawFlags nFlags) override
Definition: listbox.cxx:320
const Color & GetControlForeground() const
Definition: window2.cxx:1072
long GetDrawPixel(::OutputDevice const *pDev, long nPixels) const
Definition: window2.cxx:563
void SetMultiSelectionSimpleMode(bool bSimple)
Definition: listbox.hxx:471
void SetTopEntry(sal_Int32 nTop)
Definition: listbox.hxx:455
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
void RemoveEntry(sal_Int32 nPos)
WinBits const WB_NOLIGHTBORDER
sal_Int32 GetMRUCount() const
Definition: listbox.hxx:158
sal_uInt16 GetDisplayLineCount() const
Definition: listbox.hxx:497
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
Size CalcWindowSize(const Size &rOutSz) const
Definition: window2.cxx:537
bool IsAutoSizeEnabled() const
Definition: lstbox.hxx:151
void SetScrollHdl(const Link< ImplListBox *, void > &rLink)
Definition: listbox.hxx:481
virtual boost::property_tree::ptree DumpAsPropertyTree()
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: window.cxx:3407
void SetLineColor()
const Color & GetDisableColor() const
bool IsRTLEnabled() const
Definition: outdev.hxx:1361
void SetTop(long v)
vcl::RenderContext * GetRenderContext() const
Definition: event.hxx:236
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
sal_Int32 mnSaveValue
Definition: lstbox.hxx:87
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: listbox.cxx:1416
int i
DrawFlags
Definition: window.hxx:354
virtual void Resize() override
void setMaxWidthChars(sal_Int32 nWidth)
Definition: listbox.cxx:1407
bool IsEntryPosSelected(sal_Int32 nIndex) const
Link< ListBox &, void > maDoubleClickHdl
Definition: lstbox.hxx:90
The edit field part of a control, e.g.
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3758
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
Definition: listbox.cxx:1380
void SetControlBackground()
Definition: window2.cxx:497
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: listbox.cxx:1034
WinBits const WB_SIMPLEMODE
void SetReadOnly(bool bReadOnly=true)
Definition: listbox.cxx:1356
sal_uInt16 GetDropDownLineCount() const
Definition: listbox.hxx:537
void SetImage(const Image &rImg)
Definition: listbox.hxx:579
void SelectEntriesPos(const std::vector< sal_Int32 > &rPositions, bool bSelect=true)
Definition: listbox.cxx:1053
void SetControlForeground()
Definition: window2.cxx:457
tools::Rectangle GetDropDownPosSizePixel() const
Definition: listbox.cxx:1395
bool IsTravelSelect() const
Definition: listbox.cxx:1116
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1160
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget()
Definition: mouse.cxx:659
void SetUpdateMode(bool bUpdate)
Definition: window.cxx:3022
sal_uInt16 GetDropDownLineCount() const
Definition: listbox.cxx:533
virtual ~ListBox() override
Definition: listbox.cxx:50
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: ctrl.cxx:297
bool IsUpdateMode() const
Definition: window2.cxx:1173
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
CommandEventId GetCommand() const
void SetNoSelection()
Definition: listbox.cxx:926
sal_Int32 GetSelectedEntryCount() const
Definition: listbox.cxx:1002
void SetZoom(const Fraction &rZoom)
Definition: window2.cxx:365
void SetTextColor(const Color &rColor)
Definition: text.cxx:664
void SetItemPos(sal_Int32 n)
Definition: listbox.hxx:575
WinBits const WB_RECTSTYLE
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
Definition: listbox.cxx:939
void EnableMirroring()
Definition: listbox.cxx:1390
bool bPopup
bool IsEntryPosSelected(sal_Int32 nPos) const
Definition: listbox.cxx:1024
MouseNotifyEvent GetType() const
Definition: event.hxx:307
void GetMaxVisColumnsAndLines(sal_uInt16 &rnCols, sal_uInt16 &rnLines) const
Definition: listbox.cxx:1315
sal_uInt16 GetDisplayLineCount() const
Definition: listbox.cxx:1385
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: ctrl.cxx:59
WinBits const WB_DROPDOWN
virtual void Resize() override
Definition: listbox.cxx:558
static bool toBool(const OString &rValue)
Definition: builder.cxx:76
const AllSettings & GetSettings() const
Definition: outdev.hxx:420
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
DrawTextFlags
Definition: outdev.hxx:144
void DrawEntry(const UserDrawEvent &rEvt)
Definition: listbox.cxx:1341
virtual bool set_property(const OString &rKey, const OUString &rValue)
Definition: window2.cxx:1432
WinBits const WB_SORT
void RequestDoubleBuffering(bool bRequest)
Enable/disable double-buffering of the frame window and all its children.
Definition: window.cxx:3874
virtual void LoseFocus()
Definition: window.cxx:1869
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2875
void GrabFocus()
Definition: window.cxx:3031
Size CalcSubEditSize() const
Definition: listbox.cxx:1217
void ToggleDropDown()
Definition: listbox.cxx:298
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:890
virtual const Wallpaper & GetDisplayBackground() const override
Definition: listbox.cxx:1400
SAL_DLLPRIVATE void ImplInitListBoxData()
Definition: listbox.cxx:67
WinBits const WB_LEFT
void SetStyle(WinBits nStyle)
Definition: window.cxx:1976
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2918
Size GetSize() const
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
this methods stores a combination of flags from the ListBoxEntryFlags::* defines at the given entry...
Definition: listbox.cxx:1093
void DrawEntry(vcl::RenderContext &rRenderContext, bool bLayout)
Size CalcSize(sal_Int32 nMaxLines) const
Definition: listbox.hxx:476
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
WinBits const WB_NOBORDER
void EnableSort(bool b)
Definition: listbox.hxx:359
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1268
sal_uInt16 GetItemId() const
Definition: event.hxx:238
ListBoxEntryFlags GetEntryFlags(sal_Int32 nPos) const
this methods gets the current combination of flags from the ListBoxEntryFlags::* defines from the giv...
Definition: listbox.cxx:1098
Size CalcMinimumSize() const
Definition: listbox.cxx:1161
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: listbox.cxx:815
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1046
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1179
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:934
long GetIndexForPoint(const Point &rPoint) const
Definition: ctrl.cxx:134
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:932
virtual void GetFocus() override
Definition: listbox.cxx:442
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: window.cxx:2437
sal_Int32 GetEntryPos(const OUString &rStr) const
Definition: listbox.cxx:973
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:54
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: listbox.cxx:55
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: listbox.cxx:1275
void DrawEntry(vcl::RenderContext &rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos=false)
void SetPressed(bool bPressed)
Definition: button.cxx:1536
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
Definition: listbox.cxx:161
virtual void Resize() override
Definition: ctrl.cxx:74
sal_uInt16 mnLineCount
Definition: lstbox.hxx:91
void SetPrefSize(const Size &rSz)
Definition: listbox.hxx:525
bool ProcessKeyInput(const KeyEvent &rKEvt)
Definition: listbox.hxx:436
long AdjustRight(long nHorzMoveDelta)
WindowType
VclPtr< ImplListBoxFloatingWindow > mpFloatWin
Definition: lstbox.hxx:83
Definition: ctrl.hxx:33
long GetEntryHeight() const
Definition: listbox.hxx:477
ListBoxEntryFlags
Definition: lstbox.hxx:44
virtual void GetFocus()
Definition: window.cxx:1855
bool mbNoFocusRects
Definition: svdata.hxx:321
#define SAL_WARN_IF(condition, area, stream)
WinBits const WB_BORDER
void SetFont(const vcl::Font &rNewFont)
std::unique_ptr< vcl::ImplControlData > mpControlData
Definition: ctrl.hxx:36
sal_Int32 GetTopEntry() const
Definition: listbox.cxx:1108
void SetAutoWidth(bool b)
Definition: listbox.hxx:528
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator. ...
Definition: listbox.hxx:443
virtual void FillLayoutData() const override
Definition: listbox.cxx:630
void SetEdgeBlending(bool bNew)
Definition: listbox.hxx:590
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
Definition: window2.cxx:553
Definition: image.hxx:40
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
void SetSelectionChangedHdl(const Link< sal_Int32, void > &rLnk)
Definition: listbox.hxx:488
void SetBottom(long v)
long GetEntryHeightWithMargin() const
Definition: listbox.hxx:478
void EnableMultiSelection(bool bMulti, bool bStackSelection)
Definition: listbox.cxx:1141
long AdjustTop(long nVertMoveDelta)
sal_Int32 GetSeparatorPos() const
Gets the position of the separator which was added first.
Definition: listbox.cxx:1375
void SetCancelHdl(const Link< LinkParamNone *, void > &rLink)
Definition: listbox.hxx:483
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
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:879
bool IsDisposed() const
Definition: window.cxx:136
WinBits const WB_TABSTOP
VclPtr< ImplWin > mpImplWin
Definition: lstbox.hxx:84
bool IsMultiSelectionEnabled() const
Definition: listbox.cxx:1156
Event to pass information for UserDraw() handling eg. in comboboxes.
Definition: event.hxx:218
WinBits const WB_CENTER
sal_Int32 InsertEntry(sal_Int32 nPos, const OUString &rStr)
ScXMLEditAttributeMap::Entry const aEntries[]
bool IsEnabled() const
Definition: window2.cxx:1122
MouseWheelBehaviour
Definition: settings.hxx:80
void AdaptDropDownLineCountToMaximum()
Definition: listbox.cxx:523
void SetFocusHdl(const Link< sal_Int32, void > &rLink)
Definition: listbox.hxx:486
virtual void LoseFocus() override
Definition: listbox.cxx:455
WinBits GetStyle() const
Definition: window2.cxx:953
void SelectEntry(sal_Int32 nPos, bool bSelect)
virtual void UserDraw(const UserDrawEvent &rUDEvt)
Definition: listbox.cxx:1337
OUString GetEntryText(sal_Int32 nPos) const
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2869
void StartFloat(bool bStartTracking)
WinBits const WB_GROUP
void ImplInitDropDownButton(PushButton *pButton)
Definition: imp_listbox.cxx:52
void SetTopEntry(sal_Int32 nPos)
Definition: listbox.cxx:1103
void SetString(const OUString &rStr)
Definition: listbox.hxx:577
void SetEntryData(sal_Int32 nPos, void *pNewData)
Definition: listbox.cxx:1083
long GetScrollBarSize() const
void EnableUserDraw(bool bUserDraw)
Definition: listbox.hxx:329
bool IsReallyVisible() const
Definition: window2.cxx:1107
vcl::Font GetControlFont() const
Definition: window2.cxx:438
sal_Int32 GetItemPos() const
Definition: listbox.hxx:574
void SetImplListBox(ImplListBox *pLB)
Definition: listbox.hxx:523
Link< ListBox &, void > maSelectHdl
Definition: lstbox.hxx:89
bool HasFocus() const
Definition: window.cxx:3036
bool IsInDropDown() const
Definition: listbox.cxx:1121
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: outdevstate.cxx:60
void SetEdgeBlending(bool bNew)
void setWidth(long nWidth)
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
Definition: floatwin.cxx:905
vcl::Window * GetWindow() const
Definition: event.hxx:235
WinBits const WB_NOTABSTOP
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1257
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
tools::Rectangle GetWindowExtentsRelative(vcl::Window *pRelativeWindow) const
Definition: window.cxx:2955
sal_Int32 GetEntryCount() const
Definition: listbox.hxx:127
virtual void StateChanged(StateChangedType nType) override
Definition: listbox.cxx:709
bool HasLayoutData() const
determines whether we currently have layout data
Definition: ctrl.cxx:90
void SetMBDownHdl(const Link< void *, void > &rLink)
Definition: listbox.hxx:608
sal_uInt16 nPos
tools::Rectangle GetBoundingRectangle(sal_Int32 nItem) const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:35
ListBox(WindowType nType)
Definition: listbox.cxx:37
void SetLayoutDataParent(const Control *pParent) const
Definition: ctrl.cxx:324
void SetListItemSelectHdl(const Link< LinkParamNone *, void > &rLink)
Definition: listbox.hxx:487
bool IsMod2() const
Definition: keycod.hxx:62
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2201
IMPL_LINK(ListBox, ImplFocusHdl, sal_Int32, nPos, void)
Definition: listbox.cxx:195
void setHeight(long nHeight)