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 )
291 const char* pHelpId =
nullptr;
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 switch( pCtrl->GetType() )
435 case WindowType::LISTBOX:
442 case WindowType::LISTBOXWINDOW:
447 case WindowType::COMBOBOX:
454 case WindowType::MULTILINEEDIT:
458 case WindowType::EDIT:
459 case WindowType::PATTERNFIELD:
460 case WindowType::METRICFIELD:
461 case WindowType::CURRENCYFIELD:
462 case WindowType::DATEFIELD:
463 case WindowType::TIMEFIELD:
464 case WindowType::SPINFIELD:
465 case WindowType::FORMATTEDFIELD:
467 if (pCtrl->GetStyle() &
WB_SPIN)
486 aBounds, aContent ) )
497 if (!pCtrl->IsControlBackground())
498 pCtrl->SetPaintTransparent(
true);
504 if( pCompoundParent )
509 if( ! pCompoundParent )
533 else if ( nBorderStyle & WindowBorderStyle::NWF )
559 pCtrl->queue_resize();
565 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
584 bool bNativeOK =
false;
595 case WindowType::MULTILINEEDIT:
598 case WindowType::EDIT:
599 case WindowType::PATTERNFIELD:
600 case WindowType::METRICFIELD:
601 case WindowType::CURRENCYFIELD:
602 case WindowType::DATEFIELD:
603 case WindowType::TIMEFIELD:
604 case WindowType::SPINFIELD:
605 case WindowType::FORMATTEDFIELD:
612 case WindowType::LISTBOX:
613 case WindowType::MULTILISTBOX:
614 case WindowType::TREELISTBOX:
622 case WindowType::LISTBOXWINDOW:
627 case WindowType::COMBOBOX:
628 case WindowType::PATTERNBOX:
629 case WindowType::NUMERICBOX:
630 case WindowType::METRICBOX:
631 case WindowType::CURRENCYBOX:
632 case WindowType::DATEBOX:
633 case WindowType::TIMEBOX:
634 case WindowType::LONGCURRENCYBOX:
671 bool bMouseOver =
false;
691 nState, aControlValue,
692 aBoundingRgn, aContentRgn))
694 aCtrlRegion=aContentRgn;
700 bNativeOK = rRenderContext.
DrawNativeControl(aCtrlType, aCtrlPart, aCtrlRegion, nState, aControlValue, OUString(), aBackgroundColor);
706 Edit* pEdit =
static_cast<Edit*
>(pCtrl)->GetSubEdit();
734 aDecoView.
DrawFrame(aInRect, nStyle, nFlags);
772 bool bTracking =
true;
773 bool bHitTest =
true;
1082 aPos.AdjustX(aMousePos.X() );
1083 aPos.AdjustY(aMousePos.Y() );
1119 if ( nMinWidth2 > nMinWidth )
1120 nMinWidth = nMinWidth2;
1124 if ( aNewRect.
GetWidth() < nMinWidth )
1126 else if ( aNewRect.
GetWidth() > nMaxWidth )
1132 if ( aNewRect.
GetWidth() < nMinWidth )
1134 else if ( aNewRect.
GetWidth() > nMaxWidth )
1140 if ( aNewRect.
GetHeight() < nMinHeight )
1142 else if ( aNewRect.
GetHeight() > nMaxHeight )
1148 if ( aNewRect.
GetHeight() < nMinHeight )
1150 else if ( aNewRect.
GetHeight() > nMaxHeight )
1164 if ( aSize.
Width() < nMinWidth )
1166 if ( aSize.
Height() < nMinHeight )
1168 if ( aSize.
Width() > nMaxWidth )
1170 if ( aSize.
Height() > nMaxHeight )
1185 if( aOldPos != aNewRect.
TopLeft() )
1278 auto addSquareOnRight = [&nRight, nItemTop, nItemBottom](
1281 rect.SetTop( nItemTop );
1282 rect.SetBottom( nItemBottom );
1283 rect.SetRight( nRight );
1284 rect.SetLeft( rect.Right() - rect.GetHeight() + 1 );
1285 nRight -= rect.GetWidth() + gap;
1331 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
1348 Point aTmpPoint = pOffset ? *pOffset :
Point();
1352 Color aFrameColor(aFaceColor);
1354 aFrameColor.DecreaseContrast(
sal_uInt8(0.5 * 255));
1367 if (!aItemClipRect.IsEmpty())
1370 aClipRgn.
Exclude(aItemClipRect);
1421 aTitleRect.
Move(pOffset->X(), pOffset->Y());
1422 rRenderContext.
DrawRect(aTitleRect);
1441 aInRect.
Move(pOffset->X(), pOffset->Y());
1450 rRenderContext.
DrawText(aInRect, pBorderWindow->
GetText(), nTextStyle);
1455 WindowAlign::Left,
false);
1463 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1470 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1477 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1484 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1492 aSymbolRect.
Move(pOffset->X(), pOffset->Y());
1507 nStyle &= nTestStyle;
1548 Window::ImplInit( pParent, nStyle, pSystemParentData );
1564 if ( nTypeStyle & BorderWindowStyle::Float )
1577 ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
1584 ImplInit( pParent, nStyle, nTypeStyle,
nullptr );
1642 Window::Deactivate();
1652 OUString aHelpStr(
mpBorderView->RequestHelp( aMousePosPixel, aHelpRect ) );
1655 if ( !aHelpStr.isEmpty() )
1666 Window::RequestHelp( rHEvt );
1675 sal_Int32 nLeftBorder;
1676 sal_Int32 nTopBorder;
1677 sal_Int32 nRightBorder;
1678 sal_Int32 nBottomBorder;
1679 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1696 nLeftBorder, nTopBorder,
1697 aSize.
Width()-nLeftBorder-nRightBorder,
1701 nTopBorder += nMenuHeight;
1717 Size(aSize.
Width() - nLeftBorder - nRightBorder,
1718 nNotebookBarHeight + nTopBorder)));
1723 nLeftBorder, nTopBorder,
1724 aSize.
Width() - nLeftBorder - nRightBorder,
1725 nNotebookBarHeight);
1753 Window::StateChanged( nType );
1767 Window::DataChanged( rDCEvt );
1791 sal_Int32 nLeftBorder;
1792 sal_Int32 nTopBorder;
1793 sal_Int32 nRightBorder;
1794 sal_Int32 nBottomBorder;
1796 Size aOutputSize = rNewOutSize;
1805 Size aSize = aOutputSize;
1806 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1813 if ( pClientWindow )
1818 GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1821 aOutputSize.
AdjustWidth(nLeftBorder+nRightBorder );
1836 sal_Int32 nLeftBorder;
1837 sal_Int32 nTopBorder;
1838 sal_Int32 nRightBorder;
1839 sal_Int32 nBottomBorder;
1840 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1841 if ( !(nLeftBorder || nTopBorder || nRightBorder || nBottomBorder) )
1851 if ( (aWinRect.
Right() < aWinRect.
Left()) ||
1938 const css::uno::Reference<css::frame::XFrame>& rFrame,
1944 aNotebookBarAddonsItem);
1957 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
1959 mpBorderView->GetBorder(rLeftBorder, rTopBorder, rRightBorder, rBottomBorder);
virtual Point GetPosPixel() const
vcl::Region GetClipRegion() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
OutDevType GetOutDevType() 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)
std::unique_ptr< ContentProperties > pData
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
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
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
HelpEventMode GetMode() const
VclPtr< NotebookBar > mpNotebookBar
Color GetBackgroundColor() const override
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)
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...
virtual ~ImplStdBorderWindowView() override
WindowBorderStyle mnBorderStyle
void SetTextColor(const Color &rColor)
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)
Size GetOutputSizePixel() const
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
void Draw(OutputDevice *pDev, const Point &rPos)
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)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
void SetDockButton(bool bDockButton)
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.
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
tools::Long GetFloatTitleHeight() const
const vcl::Font & GetFloatTitleFont() const
const Color & GetWindowColor() const
const Point & GetPosPixel() const
tools::Long GetTitleHeight() 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)
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
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
OUString VclResId(const char *pId)
virtual void TitleButtonClick(TitleButton nButton)
Point OutputToScreenPixel(const Point &rPos) const
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...
static tools::Long GetBorderSize()
The child windows are not invalidated.
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)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)