LibreOffice Module vcl (master) 1
menufloatingwindow.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
21#include "menuitemlist.hxx"
22#include "bufferdevice.hxx"
23
24#include <sal/log.hxx>
25#include <salframe.hxx>
26#include <svdata.hxx>
27#include <vcl/decoview.hxx>
28#include <vcl/settings.hxx>
29#include <window.h>
30
32 FloatingWindow( pParent, nStyle ),
33 pMenu(pMen),
34 aHighlightChangedTimer("vcl::MenuFloatingWindow aHighlightChangedTimer"),
35 aSubmenuCloseTimer( "vcl::MenuFloatingWindow aSubmenuCloseTimer" ),
36 aScrollTimer( "vcl::MenuFloatingWindow aScrollTimer" ),
37 nHighlightedItem(ITEMPOS_INVALID),
38 nMBDownPos(ITEMPOS_INVALID),
39 nScrollerHeight(0),
40 nFirstEntry(0),
41 nPosInParent(ITEMPOS_INVALID),
42 bInExecute(false),
43 bScrollMenu(false),
44 bScrollUp(false),
45 bScrollDown(false),
46 bIgnoreFirstMove(true),
47 bKeyInput(false)
48{
49 mpWindowImpl->mbMenuFloatingWindow= true;
50
52
53 SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
54
56 aHighlightChangedTimer.SetTimeout( GetSettings().GetMouseSettings().GetMenuDelay() );
57
58 aSubmenuCloseTimer.SetTimeout( GetSettings().GetMouseSettings().GetMenuDelay() );
60
62
63 AddEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) );
64}
65
67{
68 if( !pMenu )
69 return;
70
71 // #105373# notify toolkit that highlight was removed
72 // otherwise the entry will not be read when the menu is opened again
76 {
77 // #102461# remove highlight in parent
78 size_t i, nCount = pMenu->pStartedFrom->pItemList->size();
79 for(i = 0; i < nCount; i++)
80 {
81 MenuItemData* pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
82 if( pData && ( pData->pSubMenu == pMenu ) )
83 break;
84 }
85 if( i < nCount )
86 {
88 if (pPWin)
89 pPWin->InvalidateItem(i);
90 }
91 }
92
93 // free the reference to the accessible component
94 SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
95
97
98 // #95056# invalidate screen area covered by system window
99 // so this can be taken into account if the commandhandler performs a scroll operation
100 if( GetParent() )
101 {
103 GetParent()->Invalidate( aInvRect );
104 }
105 pMenu = nullptr;
106 RemoveEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) );
107
113
114}
115
117{
118 disposeOnce();
119}
120
122{
123 doShutdown();
124 pMenu.clear();
128}
129
131{
132 InitMenuClipRegion(*GetOutDev()); // FIXME
133}
134
136{
137 FloatingWindow::ApplySettings(rRenderContext);
138
141 {
142 AllSettings aSettings(GetSettings());
143 ImplGetFrame()->UpdateSettings(aSettings); // Update theme colors.
144 StyleSettings aStyle(aSettings.GetStyleSettings());
146 if (aHighlightTextColor != COL_TRANSPARENT)
147 {
148 aStyle.SetMenuHighlightTextColor(aHighlightTextColor);
149 }
150 aSettings.SetStyleSettings(aStyle);
151 GetOutDev()->SetSettings(aSettings);
152 }
153
154 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
155 SetPointFont(rRenderContext, rStyleSettings.GetMenuFont());
156
158 {
159 rRenderContext.SetBackground(); // background will be drawn by NWF
160 }
161 else
162 rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetMenuColor()));
163
164 rRenderContext.SetTextColor(rStyleSettings.GetMenuTextColor());
165 rRenderContext.SetTextFillColor();
166 rRenderContext.SetLineColor();
167}
168
171{
172 tools::Long nY = 0;
173 if( pMenu )
174 {
175 // avoid crash if somehow menu got disposed, and MenuItemList is empty (workaround for tdf#104686)
177 {
178 return 0;
179 }
180
181 for ( sal_uInt16 n = 0; n < nFirstEntry; n++ )
182 nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height();
183 nY -= pMenu->GetTitleHeight();
184 }
185 return -nY;
186}
187
189{
190 Size aOutSz = GetOutputSizePixel();
191 tools::Rectangle aRect( Point(), aOutSz );
194
195 vcl::Region aRegion(aRect);
196
197 return aRegion;
198}
199
201{
202 if (IsScrollMenu())
203 {
204 rRenderContext.SetClipRegion(ImplCalcClipRegion());
205 }
206 else
207 {
208 rRenderContext.SetClipRegion();
209 }
210}
211
212void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDown )
213{
214 if( ! pMenu )
215 return;
216
218 tools::Long nMouseY = rMEvt.GetPosPixel().Y();
219 Size aOutSz = GetOutputSizePixel();
220 if ( ( nMouseY >= nY ) && ( nMouseY < aOutSz.Height() ) )
221 {
222 bool bHighlighted = false;
223 size_t nCount = pMenu->pItemList->size();
224 for ( size_t n = 0; !bHighlighted && ( n < nCount ); n++ )
225 {
226 if ( pMenu->ImplIsVisible( n ) )
227 {
228 MenuItemData* pItemData = pMenu->pItemList->GetDataFromPos( n );
229 tools::Long nOldY = nY;
230 nY += pItemData->aSz.Height();
231 if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) )
232 {
233 bool bPopupArea = true;
234 if ( pItemData->nBits & MenuItemBits::POPUPSELECT )
235 {
236 // only when clicked over the arrow...
237 Size aSz = GetOutputSizePixel();
238 tools::Long nFontHeight = GetTextHeight();
239 bPopupArea = ( rMEvt.GetPosPixel().X() >= ( aSz.Width() - nFontHeight - nFontHeight/4 ) );
240 }
241
242 if ( bMBDown )
243 {
244 if ( n != nHighlightedItem )
245 {
246 ChangeHighlightItem( static_cast<sal_uInt16>(n), false );
247 }
248
249 bool bAllowNewPopup = true;
250 if ( pActivePopup )
251 {
252 MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
253 bAllowNewPopup = pData && ( pData->pSubMenu != pActivePopup );
254 if ( bAllowNewPopup )
256 }
257
258 if ( bPopupArea && bAllowNewPopup )
259 {
260 HighlightChanged( nullptr );
261 }
262 }
263 else
264 {
265 if ( n != nHighlightedItem )
266 {
267 ChangeHighlightItem( static_cast<sal_uInt16>(n), true );
268 }
269 else if ( pItemData->nBits & MenuItemBits::POPUPSELECT )
270 {
271 if ( bPopupArea && ( pActivePopup != pItemData->pSubMenu ) )
272 HighlightChanged( nullptr );
273 }
274 }
275 bHighlighted = true;
276 }
277 }
278 }
279 if ( !bHighlighted )
281 }
282 else
283 {
284 ImplScroll( rMEvt.GetPosPixel() );
286 }
287}
288
290{
291 // "this" will be deleted before the end of this method!
292 Menu* pM = pMenu;
293 if ( bInExecute )
294 {
295 End();
296 if ( pActivePopup )
297 {
298 KillActivePopup(); // should be ok to just remove it
299 //pActivePopup->bCanceled = true;
300 }
301 pMenu->bInCallback = true;
302 pMenu->Deactivate();
303 pMenu->bInCallback = false;
304 }
305 else
306 {
307 if (pMenu && pMenu->pStartedFrom)
308 pMenu->pStartedFrom->ClosePopup(pMenu);
309 }
310
311 if ( pM )
312 pM->pStartedFrom = nullptr;
313}
314
316{
317 ImplScroll( GetPointerPosPixel() );
318}
319
320IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void )
321{
322 if( ! pMenu )
323 return;
324
325 MenuItemData* pItemData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
326 if ( !pItemData )
327 return;
328
329 if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
330 {
331 FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
332 SetPopupModeFlags( GetPopupModeFlags() | FloatWinPopupFlags::NoAppFocusClose );
333 KillActivePopup();
334 SetPopupModeFlags( nOldFlags );
335 }
336 if ( !(pItemData->bEnabled && pItemData->pSubMenu && pItemData->pSubMenu->GetItemCount() && ( pItemData->pSubMenu != pActivePopup )) )
337 return;
338
339 pActivePopup = static_cast<PopupMenu*>(pItemData->pSubMenu.get());
340 tools::Long nY = nScrollerHeight+ImplGetStartY();
341 MenuItemData* pData = nullptr;
342 for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
343 {
344 pData = pMenu->pItemList->GetDataFromPos( n );
345 nY += pData->aSz.Height();
346 }
347 pData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
348 Size MySize = GetOutputSizePixel();
349 Point aItemTopLeft( 0, nY );
350 Point aItemBottomRight( aItemTopLeft );
351 aItemBottomRight.AdjustX(MySize.Width() );
352 aItemBottomRight.AdjustY(pData->aSz.Height() );
353
354 // shift the popups a little
355 aItemTopLeft.AdjustX(2 );
356 aItemBottomRight.AdjustX( -2 );
357 if ( nHighlightedItem )
358 aItemTopLeft.AdjustY( -2 );
359 else
360 {
361 sal_Int32 nL, nT, nR, nB;
362 GetBorder( nL, nT, nR, nB );
363 aItemTopLeft.AdjustY( -nT );
364 }
365
366 // pTest: crash due to Reschedule() in call of Activate()
367 // Also it is prevented that submenus are displayed which
368 // were for long in Activate Rescheduled and which should not be
369 // displayed now.
370 Menu* pTest = pActivePopup;
371 FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
372 SetPopupModeFlags( GetPopupModeFlags() | FloatWinPopupFlags::NoAppFocusClose );
373 sal_uInt16 nRet = pActivePopup->ImplExecute( this, tools::Rectangle( aItemTopLeft, aItemBottomRight ), FloatWinPopupFlags::Right, pMenu, pTimer == nullptr );
374 SetPopupModeFlags( nOldFlags );
375
376 // nRet != 0, if it was stopped during Activate()...
377 if ( !nRet && ( pActivePopup == pTest ) && pActivePopup->ImplGetWindow() )
378 pActivePopup->ImplGetFloatingWindow()->AddPopupModeWindow( this );
379}
380
382{
383 if( pMenu && pMenu->pStartedFrom )
384 {
385 MenuFloatingWindow* pWin = static_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->GetWindow());
386 if( pWin )
387 pWin->KillActivePopup();
388 }
389}
390
391IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent&, rEvent, void )
392{
393 if( ! pMenu )
394 return;
395
396 if( rEvent.GetId() == VclEventId::WindowShow )
397 pMenu->ImplCallEventListeners( VclEventId::MenuShow, ITEMPOS_INVALID );
398 else if( rEvent.GetId() == VclEventId::WindowHide )
399 pMenu->ImplCallEventListeners( VclEventId::MenuHide, ITEMPOS_INVALID );
400}
401
403{
404 bScrollMenu = b;
405 nScrollerHeight = b ? static_cast<sal_uInt16>(GetSettings().GetStyleSettings().GetScrollBarSize()) /2 : 0;
406 bScrollDown = true;
408}
409
411{
412 if (bInExecute)
413 return;
414 bInExecute = true;
415 if (GetParent())
417}
418
420{
421 if (HasChildPathFocus())
422 return true;
423 PopupMenu* pSub = GetActivePopup();
424 if (!pSub)
425 return false;
427}
428
430{
431 if (!bInExecute)
432 return;
433
434 if (GetParent() && !GetParent()->isDisposed())
436
437 // restore focus to previous window if we still have the focus
439 xSaveFocusId = nullptr;
440 if (xFocusId != nullptr && MenuInHierarchyHasFocus())
441 {
443 Window::EndSaveFocus(xFocusId);
444 }
445
446 bInExecute = false;
447}
448
450{
451 ImplSVData* pSVData = ImplGetSVData();
452
453 pSVData->maAppData.mpActivePopupMenu = static_cast<PopupMenu*>(pMenu.get());
454
455 Start();
456
457 while (bInExecute && !Application::IsQuit())
459
460 pSVData->maAppData.mpActivePopupMenu = nullptr;
461}
462
464{
465 End();
466
468
470 if (pActivePopup)
471 {
473 }
474 // notify parent, needed for accessibility
475 if( pMenu && pMenu->pStartedFrom )
477}
478
480{
481 if ( !pActivePopup || ( pThisOnly && ( pThisOnly != pActivePopup ) ) )
482 return;
483
484 if( pActivePopup->pWindow )
485 if( static_cast<FloatingWindow *>(pActivePopup->pWindow.get())->IsInCleanUp() )
486 return; // kill it later
488 pActivePopup->bCanceled = true;
489
490 // For all actions pActivePopup = 0, if e.g.
491 // PopupModeEndHdl the popups to destroy were called synchronous
492 PopupMenu* pPopup = pActivePopup;
493 pActivePopup = nullptr;
494 pPopup->bInCallback = true;
495 pPopup->Deactivate();
496 pPopup->bInCallback = false;
497 if ( pPopup->ImplGetWindow() )
498 {
501 pPopup->pWindow.disposeAndClear();
502
504 }
505}
506
508{
509 Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : nullptr;
510
511 // if started elsewhere, cleanup there as well
512 MenuFloatingWindow* pCleanUpFrom = this;
513 MenuFloatingWindow* pWin = this;
514 while (pWin && !pWin->bInExecute &&
515 pWin->pMenu->pStartedFrom && !pWin->pMenu->pStartedFrom->IsMenuBar())
516 {
517 pWin = static_cast<PopupMenu*>(pWin->pMenu->pStartedFrom.get())->ImplGetFloatingWindow();
518 }
519 if ( pWin )
520 pCleanUpFrom = pWin;
521
522 // this window will be destroyed => store date locally...
523 Menu* pM = pMenu;
524 sal_uInt16 nItem = nHighlightedItem;
525
526 pCleanUpFrom->StopExecute();
527
528 if ( !(nItem != ITEMPOS_INVALID && pM) )
529 return;
530
531 MenuItemData* pItemData = pM->GetItemList()->GetDataFromPos( nItem );
532 if ( pItemData && !pItemData->bIsTemporary )
533 {
534 pM->nSelectedId = pItemData->nId;
535 pM->sSelectedIdent = pItemData->sIdent;
536 if (pStart)
537 {
538 pStart->nSelectedId = pItemData->nId;
539 pStart->sSelectedIdent = pItemData->sIdent;
540 }
541
542 pM->ImplSelect();
543 }
544}
545
546void MenuFloatingWindow::EndExecute( sal_uInt16 nId )
547{
548 size_t nPos;
549 if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) )
551 else
553
554 EndExecute();
555}
556
558{
559 // TH creates a ToTop on this window, but the active popup
560 // should stay on top...
561 // due to focus change this would close all menus -> don't do it (#94123)
562 //if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup )
563 // pActivePopup->ImplGetFloatingWindow()->ToTop( ToTopFlags::NoGrabFocus );
564
565 ImplHighlightItem( rMEvt, true );
566
568}
569
571{
573 // nMBDownPos store in local variable and reset immediately,
574 // as it will be too late after EndExecute
575 sal_uInt16 _nMBDownPos = nMBDownPos;
577 if ( !(pData && pData->bEnabled && ( pData->eType != MenuItemType::SEPARATOR )) )
578 return;
579
580 if ( !pData->pSubMenu )
581 {
582 EndExecute();
583 }
584 else if ( ( pData->nBits & MenuItemBits::POPUPSELECT ) && ( nHighlightedItem == _nMBDownPos ) && ( rMEvt.GetClicks() == 2 ) )
585 {
586 // not when clicked over the arrow...
587 Size aSz = GetOutputSizePixel();
588 tools::Long nFontHeight = GetTextHeight();
589 if ( rMEvt.GetPosPixel().X() < ( aSz.Width() - nFontHeight - nFontHeight/4 ) )
590 EndExecute();
591 }
592
593}
594
596{
597 if ( !IsVisible() || rMEvt.IsSynthetic() || rMEvt.IsEnterWindow() )
598 return;
599
600 if ( rMEvt.IsLeaveWindow() )
601 {
602 // #102461# do not remove highlight if a popup menu is open at this position
603 MenuItemData* pData = pMenu ? pMenu->pItemList->GetDataFromPos( nHighlightedItem ) : nullptr;
604 // close popup with some delayed if we leave somewhere else
605 if( pActivePopup && pData && pData->pSubMenu != pActivePopup )
607
608 if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) )
610
611 if ( IsScrollMenu() )
612 ImplScroll( rMEvt.GetPosPixel() );
613 }
614 else
615 {
617 if( bIgnoreFirstMove )
618 bIgnoreFirstMove = false;
619 else
620 ImplHighlightItem( rMEvt, false );
621 }
622}
623
625{
628
629 if (!pMenu)
630 return;
631
632 Invalidate();
633
635
636 if ( bScrollUp && bUp )
637 {
639 SAL_WARN_IF( nFirstEntry == ITEMPOS_INVALID, "vcl", "Scroll?!" );
640
641 // avoid crash if somehow menu got disposed, and MenuItemList is empty (workaround for tdf#104686)
642 const auto pItemData = pMenu->GetItemList()->GetDataFromPos( nFirstEntry );
643 if ( pItemData )
644 {
645 tools::Long nScrollEntryHeight = pItemData->aSz.Height();
646
647 if ( !bScrollDown )
648 {
649 bScrollDown = true;
650 Invalidate();
651 }
652
654 {
655 bScrollUp = false;
656 Invalidate();
657 }
658
659 Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion().GetBoundRect(), ScrollFlags::Clip );
660 }
661 }
662 else if ( bScrollDown && !bUp )
663 {
664 // avoid crash if somehow menu got disposed, and MenuItemList is empty (workaround for tdf#104686)
665 const auto pItemData = pMenu->GetItemList()->GetDataFromPos( nFirstEntry );
666 if ( pItemData )
667 {
668 tools::Long nScrollEntryHeight = pItemData->aSz.Height();
669
671 SAL_WARN_IF( nFirstEntry == ITEMPOS_INVALID, "vcl", "Scroll?!" );
672
673 if ( !bScrollUp )
674 {
675 bScrollUp = true;
676 Invalidate();
677 }
678
680 sal_uInt16 nLastVisible;
681 static_cast<PopupMenu*>(pMenu.get())->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible );
682 if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID )
683 {
684 bScrollDown = false;
685 Invalidate();
686 }
687
688 Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion().GetBoundRect(), ScrollFlags::Clip );
689 }
690 }
691
692 Invalidate();
693}
694
695void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
696{
697 Size aOutSz = GetOutputSizePixel();
698
700 tools::Long nMouseY = rMousePos.Y();
701 tools::Long nDelta = 0;
702
703 if ( bScrollUp && ( nMouseY < nY ) )
704 {
705 ImplScroll( true );
706 nDelta = nY - nMouseY;
707 }
708 else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) )
709 {
710 ImplScroll( false );
711 nDelta = nMouseY - ( aOutSz.Height() - nY );
712 }
713
714 if ( !nDelta )
715 return;
716
717 aScrollTimer.Stop(); // if scrolled through MouseMove.
718 tools::Long nTimeout;
719 if ( nDelta < 3 )
720 nTimeout = 200;
721 else if ( nDelta < 5 )
722 nTimeout = 100;
723 else if ( nDelta < 8 )
724 nTimeout = 70;
725 else if ( nDelta < 12 )
726 nTimeout = 40;
727 else
728 nTimeout = 20;
729 aScrollTimer.SetTimeout( nTimeout );
731}
732void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTimer )
733{
734 // #57934# if necessary, immediately close the active, as TH's backgroundstorage works.
735 // #65750# we prefer to refrain from the background storage of small lines.
736 // otherwise the menus are difficult to operate.
737 // MenuItemData* pNextData = pMenu->pItemList->GetDataFromPos( n );
738 // if ( pActivePopup && pNextData && ( pActivePopup != pNextData->pSubMenu ) )
739 // KillActivePopup();
740
742 if( ! pMenu )
743 return;
744
746 {
749 }
750
752 SAL_WARN_IF( !pMenu->ImplIsVisible( nHighlightedItem ) && nHighlightedItem != ITEMPOS_INVALID, "vcl", "ChangeHighlightItem: Not visible!" );
754 {
756 {
757 // #102461# make sure parent entry is highlighted as well
758 size_t i, nCount = pMenu->pStartedFrom->pItemList->size();
759 for(i = 0; i < nCount; i++)
760 {
761 MenuItemData* pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
762 if( pData && ( pData->pSubMenu == pMenu ) )
763 break;
764 }
765 if( i < nCount )
766 {
768 if( pPWin && pPWin->nHighlightedItem != i )
769 {
770 pPWin->InvalidateItem(i);
771 pPWin->nHighlightedItem = i;
772 }
773 }
774 }
777 }
778 else
779 {
780 pMenu->nSelectedId = 0;
781 pMenu->sSelectedIdent.clear();
782 }
783
784 if ( bStartPopupTimer )
785 {
786 // #102438# Menu items are not selectable
787 // If a menu item is selected by an AT-tool via the XAccessibleAction, XAccessibleValue
788 // or XAccessibleSelection interface, and the parent popup menus are not executed yet,
789 // the parent popup menus must be executed SYNCHRONOUSLY, before the menu item is selected.
790 if ( GetSettings().GetMouseSettings().GetMenuDelay() )
792 else
793 HighlightChanged( &aHighlightChangedTimer );
794 }
795}
796
800{
801 tools::Long nStartY = ImplGetStartY();
802 if (pStartY)
803 *pStartY = nStartY;
804 return nScrollerHeight + nStartY +
806}
807
810{
811 if (!pMenu)
812 return;
813
815 size_t nCount = pMenu->pItemList->size();
816 for (size_t n = 0; n < nCount; n++)
817 {
818 MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
819 tools::Long nHeight = pData->aSz.Height();
820 if (n == nPos)
821 {
822 Size aWidth( GetSizePixel() );
823 tools::Rectangle aRect(Point(0, nY), Size(aWidth.Width(), nHeight));
824 Invalidate( aRect );
825 }
826 nY += nHeight;
827 }
828}
829
831{
832 if (!pMenu)
833 return;
834
836
837 tools::Long nX = 0;
838 tools::Long nStartY;
839 tools::Long nY = GetInitialItemY(&nStartY);
840
841 int nOuterSpaceX = ImplGetSVData()->maNWFData.mnMenuFormatBorderX;
842
843 size_t nCount = pMenu->pItemList->size();
844 for (size_t n = 0; n < nCount; n++)
845 {
846 MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
847 if (n == nPos)
848 {
849 SAL_WARN_IF(!pMenu->ImplIsVisible(n), "vcl", "Highlight: Item not visible!");
850 if (pData->eType != MenuItemType::SEPARATOR)
851 {
852 bool bRestoreLineColor = false;
853 Color oldLineColor;
854 bool bDrawItemRect = true;
855
856 tools::Rectangle aItemRect(Point(nX + nOuterSpaceX, nY), Size(aSz.Width() - 2 * nOuterSpaceX, pData->aSz.Height()));
857 if (pData->nBits & MenuItemBits::POPUPSELECT)
858 {
859 tools::Long nFontHeight = GetTextHeight();
860 aItemRect.AdjustRight( -(nFontHeight + nFontHeight / 4) );
861 }
862
864 {
865 Size aPxSize(GetOutputSizePixel());
866 rRenderContext.Push(vcl::PushFlags::CLIPREGION);
867 rRenderContext.IntersectClipRegion(tools::Rectangle(Point(nX, nY), Size(aSz.Width(), pData->aSz.Height())));
868 tools::Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width()-nX, aPxSize.Height()));
869 MenupopupValue aVal(pMenu->nTextPos-GUTTERBORDER, aItemRect);
871 aCtrlRect, ControlState::ENABLED, aVal, OUString());
873 {
874 bDrawItemRect = false;
875 if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::MenuItem, aItemRect,
876 ControlState::SELECTED | (pData->bEnabled
879 aVal, OUString()))
880 {
881 bDrawItemRect = true;
882 }
883 }
884 else
885 bDrawItemRect = true;
886 rRenderContext.Pop();
887 }
888 if (bDrawItemRect)
889 {
890 if (pData->bEnabled)
891 rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
892 else
893 {
894 rRenderContext.SetFillColor();
895 oldLineColor = rRenderContext.GetLineColor();
896 rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
897 bRestoreLineColor = true;
898 }
899
900 rRenderContext.DrawRect(aItemRect);
901 }
902 pMenu->ImplPaint(rRenderContext, GetOutputSizePixel(), nScrollerHeight, nStartY, pData, true/*bHighlight*/);
903 if (bRestoreLineColor)
904 rRenderContext.SetLineColor(oldLineColor);
905 }
906 return;
907 }
908
909 nY += pData->aSz.Height();
910 }
911}
912
914{
915 if( ! pMenu )
916 return tools::Rectangle();
917
918 tools::Rectangle aRect;
919 Size aSz = GetOutputSizePixel();
920 tools::Long nStartY = ImplGetStartY();
921 tools::Long nY = nScrollerHeight+nStartY;
922
923 size_t nCount = pMenu->pItemList->size();
924 for ( size_t n = 0; n < nCount; n++ )
925 {
926 MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
927 if ( n == nPos )
928 {
929 SAL_WARN_IF( !pMenu->ImplIsVisible( n ), "vcl", "ImplGetItemRect: Item not visible!" );
930 if ( pData->eType != MenuItemType::SEPARATOR )
931 {
932 aRect = tools::Rectangle( Point( 0, nY ), Size( aSz.Width(), pData->aSz.Height() ) );
933 if ( pData->nBits & MenuItemBits::POPUPSELECT )
934 {
935 tools::Long nFontHeight = GetTextHeight();
936 aRect.AdjustRight( -(nFontHeight + nFontHeight/4) );
937 }
938 }
939 break;
940 }
941 nY += pData->aSz.Height();
942 }
943 return aRect;
944}
945
946void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd )
947{
948 if( ! pMenu )
949 return;
950
951 const StyleSettings& rSettings = GetSettings().GetStyleSettings();
952
953 sal_uInt16 n = nHighlightedItem;
954 if ( n == ITEMPOS_INVALID )
955 {
956 if ( bUp )
957 n = 0;
958 else
959 n = pMenu->GetItemCount()-1;
960 }
961
962 sal_uInt16 nLoop = n;
963
964 if( bHomeEnd )
965 {
966 // absolute positioning
967 if( bUp )
968 {
969 n = pMenu->GetItemCount();
970 nLoop = n-1;
971 }
972 else
973 {
974 n = sal_uInt16(-1);
975 nLoop = n+1;
976 }
977 }
978
979 do
980 {
981 if ( bUp )
982 {
983 if ( n )
984 n--;
985 else
987 n = pMenu->GetItemCount()-1;
988 else
989 break;
990 }
991 else
992 {
993 n++;
994 if ( n >= pMenu->GetItemCount() )
995 {
997 n = 0;
998 else
999 break;
1000 }
1001 }
1002
1004 if ( ( pData->bEnabled || !rSettings.GetSkipDisabledInMenus() )
1005 && ( pData->eType != MenuItemType::SEPARATOR ) && pMenu->ImplIsVisible( n ) && pMenu->ImplIsSelectable( n ) )
1006 {
1007 // Is selection in visible area?
1008 if ( IsScrollMenu() )
1009 {
1011
1012 while ( n < nFirstEntry )
1013 ImplScroll( true );
1014
1015 Size aOutSz = GetOutputSizePixel();
1016 sal_uInt16 nLastVisible;
1017 static_cast<PopupMenu*>(pMenu.get())->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
1018 while ( n > nLastVisible )
1019 {
1020 ImplScroll( false );
1021 static_cast<PopupMenu*>(pMenu.get())->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
1022 }
1023 }
1024 ChangeHighlightItem( n, false );
1025 break;
1026 }
1027 } while ( n != nLoop );
1028}
1029
1031{
1032 VclPtr<vcl::Window> xWindow = this;
1033
1034 sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
1035 bKeyInput = true;
1036 switch ( nCode )
1037 {
1038 case KEY_UP:
1039 case KEY_DOWN:
1040 {
1042 }
1043 break;
1044 case KEY_END:
1045 case KEY_HOME:
1046 {
1047 ImplCursorUpDown( nCode == KEY_END, true );
1048 }
1049 break;
1050 case KEY_F6:
1051 case KEY_ESCAPE:
1052 {
1053 // Ctrl-F6 acts like ESC here, the menu bar however will then put the focus in the document
1054 if( nCode == KEY_F6 && !rKEvent.GetKeyCode().IsMod1() )
1055 break;
1056 if( pMenu )
1057 {
1058 if ( !pMenu->pStartedFrom )
1059 {
1060 StopExecute();
1062 }
1063 else if (pMenu->pStartedFrom->IsMenuBar())
1064 {
1066 }
1067 else
1068 {
1069 StopExecute();
1070 PopupMenu* pPopupMenu = static_cast<PopupMenu*>(pMenu->pStartedFrom.get());
1071 MenuFloatingWindow* pFloat = pPopupMenu->ImplGetFloatingWindow();
1072 pFloat->GrabFocus();
1073 pFloat->KillActivePopup();
1074 pPopupMenu->ImplCallHighlight(pFloat->nHighlightedItem);
1075 }
1076 }
1077 }
1078 break;
1079 case KEY_LEFT:
1080 {
1081 if ( pMenu && pMenu->pStartedFrom )
1082 {
1083 StopExecute();
1085 {
1087 }
1088 else
1089 {
1090 MenuFloatingWindow* pFloat = static_cast<PopupMenu*>(pMenu->pStartedFrom.get())->ImplGetFloatingWindow();
1091 pFloat->GrabFocus();
1092 pFloat->KillActivePopup();
1093 sal_uInt16 highlightItem = pFloat->GetHighlightedItem();
1094 pFloat->ChangeHighlightItem(highlightItem, false);
1095 }
1096 }
1097 }
1098 break;
1099 case KEY_RIGHT:
1100 {
1101 if( pMenu )
1102 {
1103 bool bDone = false;
1105 {
1107 if ( pData && pData->pSubMenu )
1108 {
1109 HighlightChanged( nullptr );
1110 bDone = true;
1111 }
1112 }
1113 if ( !bDone )
1114 {
1115 Menu* pStart = pMenu->ImplGetStartMenu();
1116 if (pStart && pStart->IsMenuBar())
1117 {
1118 // Forward...
1119 pStart->ImplGetWindow()->KeyInput( rKEvent );
1120 }
1121 }
1122 }
1123 }
1124 break;
1125 case KEY_RETURN:
1126 {
1127 if( pMenu )
1128 {
1130 if ( pData && pData->bEnabled )
1131 {
1132 if ( pData->pSubMenu )
1133 HighlightChanged( nullptr );
1134 else
1135 EndExecute();
1136 }
1137 else
1138 StopExecute();
1139 }
1140 }
1141 break;
1142 case KEY_MENU:
1143 {
1144 if( pMenu )
1145 {
1146 Menu* pStart = pMenu->ImplGetStartMenu();
1147 if (pStart && pStart->IsMenuBar())
1148 {
1149 // Forward...
1150 pStart->ImplGetWindow()->KeyInput( rKEvent );
1151 }
1152 }
1153 }
1154 break;
1155 default:
1156 {
1157 sal_Unicode nCharCode = rKEvent.GetCharCode();
1158 size_t nPos = 0;
1159 size_t nDuplicates = 0;
1160 MenuItemData* pData = (nCharCode && pMenu) ?
1161 pMenu->GetItemList()->SearchItem(nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem) : nullptr;
1162 if (pData)
1163 {
1164 if ( pData->pSubMenu || nDuplicates > 1 )
1165 {
1166 ChangeHighlightItem( nPos, false );
1167 HighlightChanged( nullptr );
1168 }
1169 else
1170 {
1172 EndExecute();
1173 }
1174 }
1175 else
1176 FloatingWindow::KeyInput( rKEvent );
1177 }
1178 }
1179
1180 // #105474# check if menu window was not destroyed
1181 if ( !xWindow->isDisposed() )
1182 {
1183 bKeyInput = false;
1184 }
1185}
1186
1187void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &rPaintRect)
1188{
1189 if (!pMenu)
1190 return;
1191
1192 // Set the clip before the buffering starts: rPaintRect may be larger than the current clip,
1193 // this way the buffer -> render context copy happens with this clip.
1194 rRenderContext.Push(vcl::PushFlags::CLIPREGION);
1195 rRenderContext.SetClipRegion(vcl::Region(rPaintRect));
1196
1197 // Make sure that all actual rendering happens in one go to avoid flicker.
1198 vcl::BufferDevice pBuffer(this, rRenderContext);
1199
1201 {
1202 pBuffer->SetClipRegion();
1203 tools::Long nX = 0;
1204 Size aPxSize(GetOutputSizePixel());
1205 aPxSize.AdjustWidth( -nX );
1209 aVal, OUString());
1210 InitMenuClipRegion(*pBuffer);
1211 }
1212 if (IsScrollMenu())
1213 {
1214 ImplDrawScroller(*pBuffer, true);
1215 ImplDrawScroller(*pBuffer, false);
1216 }
1217 pBuffer->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuColor());
1221
1222 pBuffer.Dispose();
1223 rRenderContext.Pop();
1224}
1225
1227{
1228 if (!pMenu)
1229 return;
1230
1231 rRenderContext.SetClipRegion();
1232
1233 Size aOutSz(GetOutputSizePixel());
1234 tools::Long nY = bUp ? 0 : (aOutSz.Height() - nScrollerHeight);
1235 tools::Long nX = 0;
1236 tools::Rectangle aRect(Point(nX, nY), Size(aOutSz.Width() - nX, nScrollerHeight));
1237
1238 DecorationView aDecoView(&rRenderContext);
1240
1242 if ((bUp && !bScrollUp) || (!bUp && !bScrollDown))
1243 nStyle |= DrawSymbolFlags::Disable;
1244
1245 aDecoView.DrawSymbol(aRect, eSymbol, rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor(), nStyle);
1246
1247 InitMenuClipRegion(rRenderContext);
1248}
1249
1251{
1252 sal_uInt16 nId = nHighlightedItem;
1253 Menu* pM = pMenu;
1254 vcl::Window* pW = this;
1255
1256 // #102618# Get item rect before destroying the window in EndExecute() call
1258
1259 if ( rHEvt.GetMode() & HelpEventMode::CONTEXT )
1260 {
1262 EndExecute();
1263 pW = nullptr;
1264 }
1265
1266 if( !ImplHandleHelpEvent( pW, pM, nId, rHEvt, aHighlightRect ) )
1267 Window::RequestHelp( rHEvt );
1268}
1269
1271{
1273
1275 {
1277 Invalidate();
1278 }
1279}
1280
1282{
1284
1285 if ( (rDCEvt.GetType() == DataChangedEventType::FONTS) ||
1287 ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
1288 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
1289 {
1291 Invalidate();
1292 }
1293}
1294
1296{
1297 if ( rCEvt.GetCommand() == CommandEventId::Wheel )
1298 {
1299 const CommandWheelData* pData = rCEvt.GetWheelData();
1300 if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
1301 {
1302 ImplScroll( pData->GetDelta() > 0 );
1304 }
1305 }
1306}
1307
1308css::uno::Reference<css::accessibility::XAccessible> MenuFloatingWindow::CreateAccessible()
1309{
1310 css::uno::Reference<css::accessibility::XAccessible> xAcc;
1311
1312 if (pMenu && !pMenu->pStartedFrom)
1313 xAcc = pMenu->GetAccessible();
1314
1315 return xAcc;
1316}
1317
1318/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static void Yield()
Process the next event.
Definition: svapp.cxx:551
static bool IsQuit()
Has Quit() been called?
Definition: svapp.cxx:608
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
DataChangedEventType GetType() const
Definition: event.hxx:362
AllSettingsFlags GetFlags() const
Definition: event.hxx:363
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
Definition: decoview.cxx:768
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: floatwin.cxx:204
void SetPopupModeEndHdl(const Link< FloatingWindow *, void > &rLink)
Definition: floatwin.hxx:135
virtual void StateChanged(StateChangedType nType) override
Definition: floatwin.cxx:668
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: floatwin.cxx:729
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: floatwin.cxx:185
SAL_DLLPRIVATE void ImplEndPopupMode(FloatWinPopupEndFlags nFlags, const VclPtr< vcl::Window > &xFocusId)
Definition: floatwin.cxx:867
bool IsInCleanUp() const
Definition: floatwin.hxx:131
HelpEventMode GetMode() const
Definition: event.hxx:208
sal_Unicode GetCharCode() const
Definition: event.hxx:56
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
Class that implements the actual window of the floating menu.
tools::Rectangle ImplGetItemRect(sal_uInt16 nPos) const
PopupMenu * GetActivePopup() const
VclPtr< vcl::Window > xSaveFocusId
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void ImplScroll(const Point &rMousePos)
virtual void RequestHelp(const HelpEvent &rHEvt) override
VclPtr< PopupMenu > pActivePopup
virtual void StateChanged(StateChangedType nType) override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
sal_uInt16 GetHighlightedItem() const
tools::Long GetInitialItemY(tools::Long *pOptStartY=nullptr) const
Calculate the initial vertical pixel offset of the first item.
void RenderHighlightItem(vcl::RenderContext &rRenderContext, sal_uInt16 nPos)
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
MenuFloatingWindow(Menu *pMenu, vcl::Window *pParent, WinBits nStyle)
vcl::Region ImplCalcClipRegion() const
virtual void Resize() override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
void InitMenuClipRegion(vcl::RenderContext &rRenderContext)
virtual void KeyInput(const KeyEvent &rKEvent) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual ~MenuFloatingWindow() override
void ChangeHighlightItem(sal_uInt16 n, bool bStartPopupTimer)
void InvalidateItem(sal_uInt16 nPos)
Emit an Invalidate just for this item's area.
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void Command(const CommandEvent &rCEvt) override
virtual void MouseMove(const MouseEvent &rMEvt) override
void ImplDrawScroller(vcl::RenderContext &rRenderContext, bool bUp)
void ImplCursorUpDown(bool bUp, bool bHomeEnd=false)
void KillActivePopup(PopupMenu *pThisOnly=nullptr)
tools::Long ImplGetStartY() const
Get a negative pixel offset for an offset menu.
bool MenuInHierarchyHasFocus() const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void ImplHighlightItem(const MouseEvent &rMEvt, bool bMBDown)
MenuItemData * GetData(sal_uInt16 nSVId, size_t &rPos) const
MenuItemData * GetDataFromPos(size_t nPos) const
MenuItemData * SearchItem(sal_Unicode cSelectChar, vcl::KeyCode aKeyCode, size_t &rPos, size_t &nDuplicates, size_t nCurrentPos) const
static bool ImplHandleHelpEvent(vcl::Window *pMenuWindow, Menu const *pMenu, sal_uInt16 nHighlightedItem, const HelpEvent &rHEvt, const tools::Rectangle &rHighlightRect)
Show the appropriate help tooltip.
Definition: menuwindow.cxx:40
Definition: menu.hxx:116
SAL_DLLPRIVATE void ImplCallEventListeners(VclEventId nEvent, sal_uInt16 nPos)
Definition: menu.cxx:383
virtual void MenuBarKeyInput(const KeyEvent &rEvent)
Forward the KeyInput call to the MenuBar.
Definition: menu.cxx:2183
sal_uInt16 nTextPos
Definition: menu.hxx:149
virtual bool IsMenuBar() const =0
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: menu.cxx:1279
VclPtr< Menu > pStartedFrom
Definition: menu.hxx:127
OString sSelectedIdent
Definition: menu.hxx:145
bool bCanceled
Terminated during a callback.
Definition: menu.hxx:151
SAL_DLLPRIVATE Menu * ImplGetStartMenu()
Definition: menu.cxx:2075
SAL_DLLPRIVATE void ImplKillLayoutData() const
Definition: menu.cxx:2187
SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible(sal_uInt16 nPos) const
Definition: menu.cxx:613
SAL_DLLPRIVATE void ImplPaint(vcl::RenderContext &rRenderContext, Size const &rSize, sal_uInt16 nBorder, tools::Long nOffY=0, MenuItemData const *pThisDataOnly=nullptr, bool bHighlighted=false, bool bLayout=false, bool bRollover=false) const
Definition: menu.cxx:1700
SAL_DLLPRIVATE bool ImplIsSelectable(sal_uInt16 nPos) const
Definition: menu.cxx:1267
void Deactivate()
Definition: menu.cxx:287
SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible(sal_uInt16 nPos) const
Definition: menu.cxx:603
SAL_DLLPRIVATE bool ImplIsVisible(sal_uInt16 nPos) const
Definition: menu.cxx:1183
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:128
SAL_DLLPRIVATE void ImplCallHighlight(sal_uInt16 nHighlightItem)
Definition: menu.cxx:2083
sal_uInt16 nSelectedId
Definition: menu.hxx:144
bool bInCallback
In Activate/Deactivate.
Definition: menu.hxx:152
SAL_DLLPRIVATE void ImplSelect()
Definition: menu.cxx:330
sal_uInt16 GetTitleHeight() const
Definition: menu.hxx:334
MenuItemList * GetItemList() const
Definition: menu.hxx:345
sal_uInt16 GetItemCount() const
Definition: menu.cxx:577
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:210
std::unique_ptr< MenuItemList > pItemList
Definition: menu.hxx:126
bool IsEnterWindow() const
Definition: event.hxx:138
bool IsSynthetic() const
Definition: event.hxx:142
bool IsLeaveWindow() const
Definition: event.hxx:140
sal_uInt16 GetClicks() const
Definition: event.hxx:126
const Point & GetPosPixel() const
Definition: event.hxx:123
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
virtual void SetSettings(const AllSettings &rSettings)
Definition: outdev.cxx:215
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
void SetLineColor()
Definition: line.cxx:37
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
void SetFillColor()
Definition: fill.cxx:29
const Color & GetLineColor() const
Definition: outdev.hxx:511
void SetTextFillColor()
Definition: text.cxx:734
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:32
void SetBackground()
Definition: background.cxx:27
void Pop()
Definition: stack.cxx:91
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
const AllSettings & GetSettings() const
Definition: outdev.hxx:289
void IntersectClipRegion(const tools::Rectangle &rRect)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const
Definition: menu.cxx:2658
virtual void UpdateSettings(AllSettings &rSettings)=0
constexpr tools::Long Height() const
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
sal_Int32 GetScrollBarSize() const
const Color & GetMenuColor() const
const Color & GetMenuHighlightColor() const
const vcl::Font & GetMenuFont() const
bool GetSkipDisabledInMenus() const
void SetMenuHighlightTextColor(const Color &rColor)
const Color & GetMenuTextColor() const
const Color & GetButtonTextColor() const
void Stop()
Definition: scheduler.cxx:596
Definition: timer.hxx:27
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
void disposeAndClear()
Definition: vclptr.hxx:200
void clear()
Definition: vclptr.hxx:190
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
bool isDisposed() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
Buffers drawing on a vcl::RenderContext using a VirtualDevice.
bool IsMod1() const
Definition: keycod.hxx:56
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
vcl::Window * GetParent() const
Definition: window2.cxx:1128
void PaintImmediately()
Definition: paint.cxx:1268
void DecModalCount()
Definition: window.cxx:3617
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:312
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3011
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
void GrabFocus()
Definition: window.cxx:2983
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
const AllSettings & GetSettings() const
Definition: window3.cxx:129
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1809
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
Definition: window3.cxx:74
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
Definition: window.cxx:2917
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:307
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:484
SalFrame * ImplGetFrame() const
Definition: window2.cxx:874
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
Definition: window.cxx:2951
virtual Size GetSizePixel() const
Definition: window.cxx:2406
Size GetOutputSizePixel() const
Definition: window3.cxx:89
Point GetPointerPosPixel()
Definition: mouse.cxx:564
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2177
bool IsVisible() const
Definition: window2.cxx:1133
void IncModalCount()
Definition: window.cxx:3603
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
DrawSymbolFlags
Definition: decoview.hxx:35
sal_Int64 n
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
constexpr sal_uInt16 KEY_ESCAPE
Definition: keycodes.hxx:120
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_MENU
Definition: keycodes.hxx:147
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
constexpr auto ITEMPOS_INVALID
Invalid menu item id.
Definition: menu.hxx:100
IMPL_LINK(MenuFloatingWindow, HighlightChanged, Timer *, pTimer, void)
IMPL_LINK_NOARG(MenuFloatingWindow, PopupEnd, FloatingWindow *, void)
#define GUTTERBORDER
std::unique_ptr< sal_Int32[]> pData
sal_uInt16 nCode
int i
@ eSymbol
Definition: ppdparser.hxx:44
long Long
sal_Int16 nId
QPRO_FUNC_TYPE nType
sal_uIntPtr sal_uLong
VclPtr< PopupMenu > mpActivePopupMenu
Definition: svdata.hxx:151
ImplSVNWFData maNWFData
Definition: svdata.hxx:406
ImplSVWinData * mpWinData
Definition: svdata.hxx:403
ImplSVAppData maAppData
Definition: svdata.hxx:400
int mnMenuFormatBorderY
Definition: svdata.hxx:320
int mnMenuFormatBorderX
Definition: svdata.hxx:319
::Color maMenuBarHighlightTextColor
Definition: svdata.hxx:321
bool mbNoDeactivate
Definition: svdata.hxx:270
VclPtr< Menu > pSubMenu
OString sIdent
sal_uInt16 nId
MenuItemBits nBits
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
sal_uInt16 sal_Unicode
SymbolType
Definition: vclenum.hxx:74
FloatWinPopupFlags
Definition: vclenum.hxx:330
@ MenuSubmenuDeactivate
StateChangedType
Definition: window.hxx:291
sal_Int64 WinBits
Definition: wintypes.hxx:109