34 aHighlightChangedTimer(
"vcl::MenuFloatingWindow aHighlightChangedTimer"),
35 aSubmenuCloseTimer(
"vcl::MenuFloatingWindow aSubmenuCloseTimer" ),
36 aScrollTimer(
"vcl::MenuFloatingWindow aScrollTimer" ),
46 bIgnoreFirstMove(true),
94 SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
220 if ( ( nMouseY >= nY ) && ( nMouseY < aOutSz.
Height() ) )
222 bool bHighlighted =
false;
224 for (
size_t n = 0; !bHighlighted && (
n <
nCount );
n++ )
233 bool bPopupArea =
true;
239 bPopupArea = ( rMEvt.
GetPosPixel().
X() >= ( aSz.
Width() - nFontHeight - nFontHeight/4 ) );
249 bool bAllowNewPopup =
true;
254 if ( bAllowNewPopup )
258 if ( bPopupArea && bAllowNewPopup )
260 HighlightChanged(
nullptr );
272 HighlightChanged(
nullptr );
301 pMenu->bInCallback =
true;
303 pMenu->bInCallback =
false;
307 if (pMenu && pMenu->pStartedFrom)
308 pMenu->pStartedFrom->ClosePopup(pMenu);
317 ImplScroll( GetPointerPosPixel() );
325 MenuItemData* pItemData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
329 if ( pActivePopup && ( pActivePopup != pItemData->
pSubMenu ) )
334 SetPopupModeFlags( nOldFlags );
344 pData = pMenu->pItemList->GetDataFromPos(
n );
345 nY +=
pData->aSz.Height();
347 pData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
348 Size MySize = GetOutputSizePixel();
349 Point aItemTopLeft( 0, nY );
350 Point aItemBottomRight( aItemTopLeft );
356 aItemBottomRight.
AdjustX( -2 );
357 if ( nHighlightedItem )
361 sal_Int32 nL, nT, nR, nB;
362 GetBorder( nL, nT, nR, nB );
370 Menu* pTest = pActivePopup;
374 SetPopupModeFlags( nOldFlags );
377 if ( !nRet && ( pActivePopup == pTest ) && pActivePopup->ImplGetWindow() )
378 pActivePopup->ImplGetFloatingWindow()->AddPopupModeWindow(
this );
383 if( pMenu && pMenu->pStartedFrom )
443 Window::EndSaveFocus(xFocusId);
580 if ( !
pData->pSubMenu )
680 sal_uInt16 nLastVisible;
706 nDelta = nY - nMouseY;
711 nDelta = nMouseY - ( aOutSz.
Height() - nY );
721 else if ( nDelta < 5 )
723 else if ( nDelta < 8 )
725 else if ( nDelta < 12 )
784 if ( bStartPopupTimer )
790 if (
GetSettings().GetMouseSettings().GetMenuDelay() )
852 bool bRestoreLineColor =
false;
854 bool bDrawItemRect =
true;
860 aItemRect.
AdjustRight( -(nFontHeight + nFontHeight / 4) );
874 bDrawItemRect =
false;
881 bDrawItemRect =
true;
885 bDrawItemRect =
true;
886 rRenderContext.
Pop();
897 bRestoreLineColor =
true;
903 if (bRestoreLineColor)
909 nY +=
pData->aSz.Height();
936 aRect.
AdjustRight( -(nFontHeight + nFontHeight/4) );
941 nY +=
pData->aSz.Height();
962 sal_uInt16 nLoop =
n;
1016 sal_uInt16 nLastVisible;
1018 while (
n > nLastVisible )
1027 }
while (
n != nLoop );
1109 HighlightChanged(
nullptr );
1132 if (
pData->pSubMenu )
1133 HighlightChanged(
nullptr );
1159 size_t nDuplicates = 0;
1164 if (
pData->pSubMenu || nDuplicates > 1 )
1167 HighlightChanged(
nullptr );
1223 rRenderContext.
Pop();
1267 Window::RequestHelp( rHEvt );
1310 css::uno::Reference<css::accessibility::XAccessible> xAcc;
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static void Yield()
Process the next event.
static bool IsQuit()
Has Quit() been called?
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
void SetPopupModeEndHdl(const Link< FloatingWindow *, void > &rLink)
virtual void StateChanged(StateChangedType nType) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
SAL_DLLPRIVATE void ImplEndPopupMode(FloatWinPopupEndFlags nFlags, const VclPtr< vcl::Window > &xFocusId)
HelpEventMode GetMode() const
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
bool IsEnterWindow() const
bool IsLeaveWindow() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
virtual void SetSettings(const AllSettings &rSettings)
void DrawRect(const tools::Rectangle &rRect)
void SetTextColor(const Color &rColor)
const Color & GetLineColor() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
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
void IntersectClipRegion(const tools::Rectangle &rRect)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
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 SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
reference_type * get() const
Get the body.
Buffers drawing on a vcl::RenderContext using a VirtualDevice.
sal_uInt16 GetCode() const
vcl::Window * GetParent() const
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
bool HasChildPathFocus(bool bSystemWindow=false) const
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
const AllSettings & GetSettings() const
virtual void KeyInput(const KeyEvent &rKEvt)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
::OutputDevice const * GetOutDev() const
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
std::unique_ptr< WindowImpl > mpWindowImpl
SalFrame * ImplGetFrame() const
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
Point GetPointerPosPixel()
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_F6
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_MENU
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_END
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
VclPtr< PopupMenu > mpActivePopupMenu
ImplSVWinData * mpWinData
::Color maMenuBarHighlightTextColor
ImplSVData * ImplGetSVData()