37 #define HELPWINSTYLE_QUICK 0
38 #define HELPWINSTYLE_BALLOON 1
40 #define HELPTEXTMARGIN_QUICK 3
41 #define HELPTEXTMARGIN_BALLOON 6
43 #define HELPTEXTMAXLEN 150
159 const OUString& rHelpText )
162 rHelpText, rScreenPos, rRect );
182 const OUString& rHelpText,
194 bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->
IsVisible();
211 nId = pHelpWin.
get();
219 const OUString& rText)
259 maShowTimer(
"vcl::HelpTextWindow maShowTimer" ),
260 maHideTimer(
"vcl::HelpTextWindow maHideTimer" )
262 SetType( WindowType::HELPTEXTWINDOW );
274 Window::SetHelpText( rText );
342 sal_Int32 nCharsInLine = 35 + ((
maHelpText.getLength()/100)*5);
344 OUStringBuffer
aBuf(nCharsInLine);
347 Size aTmpSize( nWidth, 0x7FFFFFFF );
377 bool bNativeOK =
false;
443 if ( pTimer == &maShowTimer )
455 SAL_WARN_IF( pTimer != &maHideTimer,
"vcl",
"HelpTextWindow::TimerHdl with bad Timer" );
480 const OUString& rHelpText,
495 bool bNoDelay =
false;
498 SAL_WARN_IF( pHelpWin == pParent,
"vcl",
"HelpInHelp ?!" );
500 bool bRemoveHelp = (rHelpText.isEmpty() || (pHelpWin->
GetWinStyle() != nHelpWinStyle))
503 if (!bRemoveHelp && pHelpWin->
GetParent() == pParent)
505 bool const bUpdate = (pHelpWin->
GetHelpText() != rHelpText) ||
520 bool bWasVisible = pHelpWin->
IsVisible();
528 if (pHelpWin || rHelpText.isEmpty())
564 if( bUpdateHideTime )
586 if ( aPos.Y() > aScreenRect.
Top()+nScreenHeight-(nScreenHeight/4) )
587 aPos.AdjustY( -(aSz.
Height()+4) );
596 if ( aPos == aMousePos )
611 aPos = devHelpArea.
Center();
614 aPos.setX( devHelpArea.
Left() );
616 aPos.setX( devHelpArea.
Right() );
619 aPos.setY( devHelpArea.
Top() );
621 aPos.setY( devHelpArea.
Bottom() );
624 if ( nStyle & QuickHelpFlags::Left )
626 else if ( nStyle & QuickHelpFlags::Right )
627 aPos.AdjustX( -(aSz.
Width()) );
629 aPos.AdjustX( -(aSz.
Width()/2) );
631 if ( nStyle & QuickHelpFlags::Top )
633 else if ( nStyle & QuickHelpFlags::Bottom )
634 aPos.AdjustY( -(aSz.
Height()) );
636 aPos.AdjustY( -(aSz.
Height()/2) );
639 if ( aPos.X() < aScreenRect.
Left() )
640 aPos.setX( aScreenRect.
Left() );
641 else if ( ( aPos.X() + aSz.
Width() ) > aScreenRect.
Right() )
642 aPos.setX( aScreenRect.
Right() - aSz.
Width() );
643 if ( aPos.Y() < aScreenRect.
Top() )
644 aPos.setY( aScreenRect.
Top() );
645 else if ( ( aPos.Y() + aSz.
Height() ) > aScreenRect.
Bottom() )
658 if( aHelpRect.
Contains( aMousePos ) )
662 Point aTest( aMousePos - aSize - delta );
663 if( aTest.X() > aScreenRect.
Left() && aTest.Y() > aScreenRect.
Top() )
666 aPos = aMousePos + delta;
ImplSVHelpData & ImplGetSVHelpData()
#define LINK(Instance, Class, Member)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
#define ENSURE_OR_RETURN_VOID(c, m)
VclPtr< HelpTextWindow > mpHelpWin
Point GetPointerPosPixel()
static void EnableContextHelp()
static void DisableBalloonHelp()
sal_Int32 GetTipTimeout() const
WinBits const WB_SYSTEMWINDOW
A tooltip: adds tips to widgets in a floating / popup window.
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
tools::Rectangle maTextRect
static bool IsExtHelpEnabled()
void setWidth(tools::Long nWidth)
sal_uInt16 mnHelpWinStyle
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
sal_uInt16 GetWinStyle() const
static bool StartExtHelp()
#define HELPTEXTMARGIN_BALLOON
const StyleSettings & GetStyleSettings() const
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
virtual Size GetSizePixel() const
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
const tools::Rectangle & GetHelpArea() const
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
void SetHelpText(const OUString &rHelpText)
tools::Rectangle GetDesktopRectPixel() const
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
SAL_DLLPRIVATE void ImplUpdateAll()
void SetType(WindowType nType)
const Color & GetHelpTextColor() const
static sal_Int32 GetTipDelay()
#define HELPTEXTMARGIN_QUICK
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
virtual OUString GetText() const override
constexpr tools::Long Width() const
static void DisableContextHelp()
static void EnableBalloonHelp()
sal_uInt64 mnLastHelpHideTime
static void DisableQuickHelp()
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
virtual void SetOutputSizePixel(const Size &rNewSize)
force balloon-style in ShowPopover and ShowQuickHelp
QuickHelpFlags GetStyle() const
const HelpSettings & GetHelpSettings() const
void DrawRect(const tools::Rectangle &rRect)
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
static void DisableExtHelp()
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
ImplSVData * ImplGetSVData()
static void HidePopover(vcl::Window const *pParent, void *nId)
virtual ~HelpTextWindow() override
static bool IsQuickHelpEnabled()
VclPtr< WorkWindow > mpAppWin
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
#define HELPWINSTYLE_BALLOON
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_GRAY
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
const AllSettings & GetSettings() const
const Color & GetLineColor() const
SAL_DLLPRIVATE void ImplGenerateMouseMove()
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
void SetTextColor(const Color &rColor)
const vcl::Font & GetHelpFont() const
virtual void SearchKeyword(const OUString &rKeyWord)
WinBits const WB_TOOLTIPWIN
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 SetPaintTransparent(bool bTransparent)
void DrawCtrlText(const Point &rPos, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, DrawTextFlags nStyle=DrawTextFlags::Mnemonic, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr)
void SetTimeout(sal_uInt64 nTimeoutMs)
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
vcl::Window * GetParent() const
void ImplShowHelpWindow(vcl::Window *pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString &rHelpText, const Point &rScreenPos, const tools::Rectangle &rHelpArea)
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
static bool IsBalloonHelpEnabled()
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
IMPL_LINK(HelpTextWindow, TimerHdl, Timer *, pTimer, void)
virtual void RequestHelp(const HelpEvent &rHEvt) override
#define HELPWINSTYLE_QUICK
A construction helper for a temporary VclPtr.
static bool IsContextHelpEnabled()
SalFrame * ImplGetFrame() const
virtual bool UpdatePopover(void *, const OUString &, vcl::Window *, const tools::Rectangle &)
#define SAL_WARN_IF(condition, area, stream)
constexpr tools::Long Height() const
virtual bool HidePopover(void *)
const OUString & GetHelpText() const
void ShowHelp(bool bNoDelay)
ImplSVFrameData maFrameData
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
::OutputDevice const * GetOutDev() const
void EnableChildTransparentMode(bool bEnable=true)
tools::Long AdjustWidth(tools::Long n)
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
const Color & GetHelpColor() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
void SetInvokeHandler(const Link< Timer *, void > &rLink)
static sal_Int32 GetBalloonDelay()
tools::Long AdjustHeight(tools::Long n)
static void EnableQuickHelp()
Size GetOutputSizePixel() const
void setHeight(tools::Long nHeight)
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
reference_type * get() const
Get the body.
Point OutputToScreenPixel(const Point &rPos) const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
virtual void * ShowPopover(const OUString &, vcl::Window *, const tools::Rectangle &, QuickHelpFlags)
static void EnableExtHelp()
void SetHelpArea(const tools::Rectangle &rRect)
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
static void HideBalloonAndQuickHelp()
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
virtual void SetPosPixel(const Point &rNewPos)
void SetTextAlign(TextAlign eAlign)
void ImplDestroyHelpWindow(bool bUpdateHideTime)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')