diff options
-rw-r--r-- | include/sfx2/templateabstractview.hxx | 2 | ||||
-rw-r--r-- | include/vcl/help.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 14 | ||||
-rw-r--r-- | vcl/source/app/help.cxx | 3 |
4 files changed, 19 insertions, 2 deletions
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx index 791394791f85..404b9823d81e 100644 --- a/include/sfx2/templateabstractview.hxx +++ b/include/sfx2/templateabstractview.hxx @@ -85,6 +85,8 @@ public: virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void RequestHelp( const HelpEvent& rHEvt ) override; + virtual void Command( const CommandEvent& rCEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override; diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx index 2070caa67269..e76bd91f4c73 100644 --- a/include/vcl/help.hxx +++ b/include/vcl/help.hxx @@ -43,7 +43,7 @@ enum class QuickHelpFlags CtrlText = 0x0040, /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp NoDelay = 0x0080, -/// force balloon-style in ShowPopover +/// force balloon-style in ShowPopover and ShowQuickHelp TipStyleBalloon = 0x0100, NoEvadePointer = 0x0200, BiDiRtl = 0x0400, diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 45f644ded8fe..539a207f6370 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -16,6 +16,7 @@ #include <sfx2/docfac.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbstreamhelper.hxx> +#include <vcl/help.hxx> #include <vcl/pngread.hxx> #include <vcl/layout.hxx> #include <unotools/moduleoptions.hxx> @@ -190,6 +191,19 @@ void TemplateAbstractView::MouseButtonDown( const MouseEvent& rMEvt ) ThumbnailView::MouseButtonDown(rMEvt); } +void TemplateAbstractView::RequestHelp( const HelpEvent& rHEvt ) +{ + if ( rHEvt.GetMode() & HelpEventMode::QUICK ) + { + Rectangle aRect( OutputToScreenPixel( GetPosPixel() ), GetSizePixel() ); + Help::ShowQuickHelp( this, aRect, GetQuickHelpText(), + QuickHelpFlags::CtrlText | QuickHelpFlags::TipStyleBalloon ); + return; + } + + ThumbnailView::RequestHelp( rHEvt ); +} + void TemplateAbstractView::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 0ebf1415a0fb..d29806a988f9 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -178,7 +178,8 @@ bool Help::ShowQuickHelp( vcl::Window* pParent, const OUString& rLongHelpText, QuickHelpFlags nStyle ) { - ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle, + sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK; + ImplShowHelpWindow( pParent, nHelpWinStyle, nStyle, rHelpText, rLongHelpText, pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect ); return true; |