20 #include <strings.hrc>
40 #define MIN_CAPTION_HEIGHT 18
197 if ( nSizeWidth < 16 )
207 if ( rPos.Y() < nSizeWidth )
209 else if ( rPos.Y() >= pData->
mnHeight-nSizeWidth )
216 if ( rPos.Y() < nSizeWidth )
218 else if ( rPos.Y() >= pData->
mnHeight-nSizeWidth )
225 if ( rPos.X() < nSizeWidth )
227 else if ( rPos.X() >= pData->
mnWidth-nSizeWidth )
234 if ( rPos.X() < nSizeWidth )
236 else if ( rPos.X() >= pData->
mnWidth-nSizeWidth )
298 pHelpId = SV_HELPTEXT_CLOSE;
303 pHelpId = SV_HELPTEXT_MAXIMIZE;
308 pHelpId = SV_HELPTEXT_MINIMIZE;
313 pHelpId = SV_HELPTEXT_HELP;
364 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
382 : mpBorderWindow(pBorderWindow)
433 case WindowType::LISTBOX:
440 case WindowType::LISTBOXWINDOW:
445 case WindowType::COMBOBOX:
452 case WindowType::MULTILINEEDIT:
456 case WindowType::EDIT:
457 case WindowType::PATTERNFIELD:
458 case WindowType::METRICFIELD:
459 case WindowType::CURRENCYFIELD:
460 case WindowType::DATEFIELD:
461 case WindowType::TIMEFIELD:
462 case WindowType::SPINFIELD:
463 case WindowType::FORMATTEDFIELD:
484 aBounds, aContent ) )
510 if( pCompoundParent )
515 if( ! pCompoundParent )
539 else if ( nBorderStyle & WindowBorderStyle::NWF )
571 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
590 bool bNativeOK =
false;
601 case WindowType::MULTILINEEDIT:
604 case WindowType::EDIT:
605 case WindowType::PATTERNFIELD:
606 case WindowType::METRICFIELD:
607 case WindowType::CURRENCYFIELD:
608 case WindowType::DATEFIELD:
609 case WindowType::TIMEFIELD:
610 case WindowType::SPINFIELD:
611 case WindowType::FORMATTEDFIELD:
618 case WindowType::LISTBOX:
619 case WindowType::MULTILISTBOX:
620 case WindowType::TREELISTBOX:
628 case WindowType::LISTBOXWINDOW:
633 case WindowType::COMBOBOX:
634 case WindowType::PATTERNBOX:
635 case WindowType::NUMERICBOX:
636 case WindowType::METRICBOX:
637 case WindowType::CURRENCYBOX:
638 case WindowType::DATEBOX:
639 case WindowType::TIMEBOX:
640 case WindowType::LONGCURRENCYBOX:
677 bool bMouseOver =
false;
697 nState, aControlValue,
698 aBoundingRgn, aContentRgn))
700 aCtrlRegion=aContentRgn;
706 bNativeOK = rRenderContext.
DrawNativeControl(aCtrlType, aCtrlPart, aCtrlRegion, nState, aControlValue, OUString(), aBackgroundColor);
712 Edit* pEdit =
static_cast<Edit*
>(pCtrl)->GetSubEdit();
740 aDecoView.
DrawFrame(aInRect, nStyle, nFlags);
778 bool bTracking =
true;
779 bool bHitTest =
true;
1088 aPos.AdjustX(aMousePos.X() );
1089 aPos.AdjustY(aMousePos.Y() );
1125 if ( nMinWidth2 > nMinWidth )
1126 nMinWidth = nMinWidth2;
1130 if ( aNewRect.
GetWidth() < nMinWidth )
1132 else if ( aNewRect.
GetWidth() > nMaxWidth )
1138 if ( aNewRect.
GetWidth() < nMinWidth )
1140 else if ( aNewRect.
GetWidth() > nMaxWidth )
1146 if ( aNewRect.
GetHeight() < nMinHeight )
1148 else if ( aNewRect.
GetHeight() > nMaxHeight )
1154 if ( aNewRect.
GetHeight() < nMinHeight )
1156 else if ( aNewRect.
GetHeight() > nMaxHeight )
1170 if ( aSize.
Width() < nMinWidth )
1172 if ( aSize.
Height() < nMinHeight )
1174 if ( aSize.
Width() > nMaxWidth )
1176 if ( aSize.
Height() > nMaxHeight )
1191 if( aOldPos != aNewRect.
TopLeft() )
1284 auto addSquareOnRight = [&nRight, nItemTop, nItemBottom](
1287 rect.SetTop( nItemTop );
1288 rect.SetBottom( nItemBottom );
1289 rect.SetRight( nRight );
1290 rect.SetLeft( rect.Right() - rect.GetHeight() + 1 );
1291 nRight -= rect.GetWidth() + gap;
1337 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
1354 Point aTmpPoint = pOffset ? *pOffset :
Point();
1358 Color aFrameColor(aFaceColor);
1360 aFrameColor.DecreaseContrast(
sal_uInt8(0.5 * 255));
1373 if (!aItemClipRect.IsEmpty())
1376 aClipRgn.
Exclude(aItemClipRect);
1427 aTitleRect.
Move(pOffset->X(), pOffset->Y());
1428 rRenderContext.
DrawRect(aTitleRect);
1447 aInRect.
Move(pOffset->X(), pOffset->Y());
1456 rRenderContext.
DrawText(aInRect, pBorderWindow->
GetText(), nTextStyle);
1461 WindowAlign::Left,
false);
1469 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1476 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1483 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1490 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1498 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1513 nStyle &= nTestStyle;
1554 Window::ImplInit( pParent, nStyle, pSystemParentData );
1570 if ( nTypeStyle & BorderWindowStyle::Float )
1583 ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
1590 ImplInit( pParent, nStyle, nTypeStyle,
nullptr );
1648 Window::Deactivate();
1658 OUString aHelpStr(
mpBorderView->RequestHelp( aMousePosPixel, aHelpRect ) );
1661 if ( !aHelpStr.isEmpty() )
1672 Window::RequestHelp( rHEvt );
1681 sal_Int32 nLeftBorder;
1682 sal_Int32 nTopBorder;
1683 sal_Int32 nRightBorder;
1684 sal_Int32 nBottomBorder;
1685 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1702 nLeftBorder, nTopBorder,
1703 aSize.
Width()-nLeftBorder-nRightBorder,
1707 nTopBorder += nMenuHeight;
1723 Size(aSize.
Width() - nLeftBorder - nRightBorder,
1724 nNotebookBarHeight + nTopBorder)));
1729 nLeftBorder, nTopBorder,
1730 aSize.
Width() - nLeftBorder - nRightBorder,
1731 nNotebookBarHeight);
1759 Window::StateChanged( nType );
1773 Window::DataChanged( rDCEvt );
1797 sal_Int32 nLeftBorder;
1798 sal_Int32 nTopBorder;
1799 sal_Int32 nRightBorder;
1800 sal_Int32 nBottomBorder;
1802 Size aOutputSize = rNewOutSize;
1811 Size aSize = aOutputSize;
1812 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1819 if ( pClientWindow )
1824 GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1827 aOutputSize.
AdjustWidth(nLeftBorder+nRightBorder );
1842 sal_Int32 nLeftBorder;
1843 sal_Int32 nTopBorder;
1844 sal_Int32 nRightBorder;
1845 sal_Int32 nBottomBorder;
1846 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1847 if ( !(nLeftBorder || nTopBorder || nRightBorder || nBottomBorder) )
1857 if ( (aWinRect.
Right() < aWinRect.
Left()) ||
1944 const css::uno::Reference<css::frame::XFrame>& rFrame,
1950 aNotebookBarAddonsItem);
1963 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
1965 mpBorderView->GetBorder(rLeftBorder, rTopBorder, rRightBorder, rBottomBorder);
virtual Point GetPosPixel() const
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
vcl::Region GetClipRegion() const
bool IsControlBackground() const
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
WinBits const WB_NOSHADOW
ImplBorderFrameData maFrameData
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
ActivateModeFlags GetActivateMode() const
virtual tools::Long CalcTitleWidth() const override
static BorderWindowHitTest ImplHitTest(ImplBorderFrameData const *pData, const Point &rPos)
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
friend class ImplStdBorderWindowView
DrawButtonFlags mnCloseState
void setWidth(tools::Long nWidth)
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)
ImplStdBorderWindowView(ImplBorderWindow *pBorderWindow)
virtual void Deactivate() override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
static tools::Long ImplCalcTitleWidth(const ImplBorderFrameData *pData)
WinBits const WB_NODIALOGCONTROL
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
virtual void Tracking(const TrackingEvent &rTEvt) override
std::unique_ptr< sal_Int32[]> pData
BorderWindowTitleType mnTitleType
VclPtr< ImplBorderWindow > mpBorderWindow
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
void SetDisplayActive(bool bActive)
const StyleSettings & GetStyleSettings() const
const Color & GetFaceColor() const
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
BitmapEx const & GetPersonaHeader() const
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
virtual void Resize() override
virtual Size GetSizePixel() const
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
virtual void SetSizePixel(const Size &rNewSize)
virtual Size GetOptimalSize() const
DataChangedEventType GetType() const
VclPtr< OutputDevice > mpOutDev
virtual void StateChanged(StateChangedType nType) override
tools::Rectangle DrawButton(const tools::Rectangle &rRect, DrawButtonFlags nStyle)
SAL_DLLPRIVATE void ImplUpdateAll()
void ImplInit(vcl::Window *pParent, WinBits nStyle, BorderWindowStyle nTypeStyle, SystemParentData *pParentData)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
bool HasChildPathFocus(bool bSystemWindow=false) const
HelpEventMode GetMode() const
VclPtr< NotebookBar > mpNotebookBar
VclPtr< OutputDevice > mpOutDev
static void ImplDrawBrdWinSymbolButton(vcl::RenderContext *pDev, const tools::Rectangle &rRect, SymbolType eSymbol, DrawButtonFlags nState)
constexpr tools::Long Width() const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
#define MIN_CAPTION_HEIGHT
WinBits const WB_OWNERDRAWDECORATION
sal_uInt16 GetClicks() const
BorderWindowTitleType mnTitleType
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
static void ImplDrawBrdWinSymbol(vcl::RenderContext *pDev, const tools::Rectangle &rRect, SymbolType eSymbol)
AllSettingsFlags GetFlags() const
virtual tools::Long CalcTitleWidth() const override
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
tools::Rectangle maHideRect
virtual OUString GetText() const
WinBits const WB_SYSTEMFLOATWIN
SAL_DLLPRIVATE tools::Rectangle & ImplGetItemEdgeClipRect()
tools::Rectangle maCloseRect
static SAL_DLLPRIVATE void ImplCalcSymbolRect(tools::Rectangle &rRect)
std::unique_ptr< ImplBorderWindowView > mpBorderView
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
VclPtr< ImplBorderWindow > mpBorderWindow
tools::Rectangle maHelpRect
void DrawRect(const tools::Rectangle &rRect)
sal_Int32 GetFloatTitleHeight() const
OUString VclResId(TranslateId aId)
const Point & GetMousePosPixel() const
virtual bool MouseMove(const MouseEvent &rMEvt)
WinBits const WB_INTROWIN
tools::Long mnTitleHeight
WinBits const WB_DIALOGCONTROL
ImplSVData * ImplGetSVData()
void UpdateView(bool bNewView, const Size &rNewOutSize)
static OUString ImplRequestHelp(ImplBorderFrameData const *pData, const Point &rPos, tools::Rectangle &rHelpRect)
virtual OUString RequestHelp(const Point &rPos, tools::Rectangle &rHelpRect) override
bool IsLeaveWindow() const
void SetRect(const tools::Rectangle &rRect)
bool IsSystemWindow() const
void DrawSelectionBackground(const tools::Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder)
virtual void RequestHelp(const HelpEvent &rHEvt) override
WindowBorderStyle GetBorderStyle() const
virtual ~ImplBorderWindowView()
void SetMenuBarWindow(vcl::Window *pWindow)
void SetStyle(WallpaperStyle eStyle)
VclPtr< vcl::Window > mpMenuBarWindow
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
friend class ImplSmallBorderWindowView
virtual bool Tracking(const TrackingEvent &rTEvt)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
const AllSettings & GetSettings() const
virtual ~ImplStdBorderWindowView() override
WindowBorderStyle mnBorderStyle
void SetTextColor(const Color &rColor)
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)
std::unique_ptr< WindowImpl > mpWindowImpl
tools::Long CalcTitleWidth() const
WinBits const WB_TOOLTIPWIN
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
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.
WinBits const WB_DROPDOWN
const AllSettings & GetSettings() const
void SetPaintTransparent(bool bTransparent)
tools::Rectangle GetMenuRect() const
BorderWindowHitTest mnHitTest
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Point ScreenToOutputPixel(const Point &rPos) const
bool KeyboardActivated() const
void SetBorderStyle(WindowBorderStyle nStyle)
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
vcl::Window * GetParent() const
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
virtual tools::Rectangle GetMenuRect() const
virtual void Activate() override
bool IsTrackingEnded() const
void SetStyle(WinBits nStyle)
bool IsCompoundControl() const
virtual void Init(OutputDevice *pOutDev, tools::Long nWidth, tools::Long nHeight) override
WinBits const WB_NOBORDER
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
vcl::Window * GetWindow(GetWindowType nType) const
WinBits const WB_SYSTEMCHILDWINDOW
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem)
tools::Long mnTrackHeight
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
static void ImplMouseMove(ImplBorderFrameData *pData, const MouseEvent &rMEvt)
WinBits const WB_SIZEABLE
WinBits const WB_STANDALONE
virtual bool Tracking(const TrackingEvent &rTEvt) override
void SetMenuBarMode(bool bHide)
void SetPointer(PointerStyle)
void Exclude(const tools::Rectangle &rRegion)
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
static sal_Int32 GetBorderSize()
void Draw(OutputDevice *pDev, const Point &rPos)
Color GetBackgroundColor() const
Color GetFaceGradientColor() const
const vcl::Font & GetTitleFont() const
const Color & GetButtonTextColor() const
constexpr tools::Long Height() const
virtual tools::Rectangle GetMenuRect() const override
virtual Size GetOptimalSize() const override
tools::Rectangle maMenuRect
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
tools::Long mnOrgMenuHeight
virtual OUString RequestHelp(const Point &rPos, tools::Rectangle &rHelpRect)
void SetHideButton(bool bHideButton)
void SetTitleType(BorderWindowTitleType nTitleType, const Size &rSize)
void SetDockButton(bool bDockButton)
::OutputDevice const * GetOutDev() const
DrawButtonFlags mnHelpState
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
tools::Long AdjustWidth(tools::Long n)
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
sal_Int32 GetTitleHeight() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
const vcl::Font & GetFloatTitleFont() const
const Color & GetWindowColor() const
const Point & GetPosPixel() const
DrawButtonFlags mnMenuState
DrawButtonFlags mnHideState
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
tools::Long AdjustHeight(tools::Long n)
WinBits const WB_DEFAULTWIN
virtual void Init(OutputDevice *pDev, tools::Long nWidth, tools::Long nHeight) override
static void ImplInitTitle(ImplBorderFrameData *pData)
Size GetOutputSizePixel() const
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
void setHeight(tools::Long nHeight)
virtual void Init(OutputDevice *pDev, tools::Long nWidth, tools::Long nHeight) override
WindowType GetType() const
tools::Rectangle maTitleRect
ImplSmallBorderWindowView(ImplBorderWindow *pBorderWindow)
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
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.
ImplBorderWindow(const ImplBorderWindow &)=delete
virtual ~ImplBorderWindow() override
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
bool IsTrackingCanceled() const
virtual void TitleButtonClick(TitleButton nButton)
Point OutputToScreenPixel(const Point &rPos) const
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
WinBits const WB_CLOSEABLE
WinBits const WB_MOVEABLE
const MouseEvent & GetMouseEvent() const
bool IsReallyVisible() const
tools::Rectangle maDockRect
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly...
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)
The child windows are not invalidated.
virtual vcl::Window * GetOwnerWindow() const
Get the vcl::Window that this OutputDevice belongs to, if any.
void SetMenuButton(bool bMenuButton)
virtual void SetPosPixel(const Point &rNewPos)
virtual bool MouseMove(const MouseEvent &rMEvt) override
DrawButtonFlags mnDockState
SAL_DLLPRIVATE void ImplPosSizeWindow(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
virtual tools::Long CalcTitleWidth() const override
virtual void MouseMove(const MouseEvent &rMEvt) override
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
bool m_bDetectedRangeSegmentation false
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)