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