32#include <bitmaps.hlst>
38#include <osl/diagnose.h>
57#define SMALLBUTTON_HSIZE 7
58#define SMALLBUTTON_VSIZE 7
60#define SMALLBUTTON_OFF_NORMAL_X 3
61#define SMALLBUTTON_OFF_NORMAL_Y 3
63#define TB_TEXTOFFSET 2
64#define TB_IMAGETEXTOFFSET 3
65#define TB_LINESPACING 3
66#define TB_SPIN_SIZE 14
67#define TB_SPIN_OFFSET 2
68#define TB_BORDER_OFFSET1 4
69#define TB_BORDER_OFFSET2 2
71#define TB_MAXNOSCROLL 32765
75#define TB_CALCMODE_HORZ 1
76#define TB_CALCMODE_VERT 2
77#define TB_CALCMODE_FLOAT 3
79#define TB_WBLINESIZING (WB_SIZEABLE | WB_DOCKABLE | WB_SCROLL)
81#define DOCK_LINEHSIZE (sal_uInt16(0x0001))
82#define DOCK_LINEVSIZE (sal_uInt16(0x0002))
83#define DOCK_LINERIGHT (sal_uInt16(0x1000))
84#define DOCK_LINEBOTTOM (sal_uInt16(0x2000))
85#define DOCK_LINELEFT (sal_uInt16(0x4000))
86#define DOCK_LINETOP (sal_uInt16(0x8000))
87#define DOCK_LINEOFFSET 3
166 return tmpButtonType;
192 rLeft = rTop = rRight = rBottom = 0;
206 rLeft = borderwidth+dragwidth;
208 rRight = borderwidth;
214 rTop = borderwidth+dragwidth;
216 rBottom = borderwidth;
220 rLeft = borderwidth+dragwidth;
222 rRight = borderwidth;
223 rBottom = borderwidth;
228 rTop = borderwidth+dragwidth;
229 rRight = borderwidth;
230 rBottom = borderwidth;
249 bool bNativeOk =
false;
274 int height =
static_cast<int>(0.6 * aSz.
Height() + 0.5);
275 int i = (aSz.
Height() - height) / 2;
279 int x = nDragWidth / 2;
281 i += 4 * fScaleFactor;
286 int width =
static_cast<int>(0.6 * aSz.
Width() + 0.5);
287 int i = (aSz.
Width() - width) / 2;
291 int y = nDragWidth / 2;
293 i += 4 * fScaleFactor;
314 Color startCol, endCol;
325 g.
SetStyle(css::awt::GradientStyle_LINEAR);
335 Size aLineSz(aFullSz);
360 Size aTopLineSz(aLineSz);
361 Size aBottomLineSz(aLineSz);
447 const bool bOldPaintLock =
mpData->mbIsPaintLocked;
448 mpData->mbIsPaintLocked =
true;
453 mpData->mbIsPaintLocked = bOldPaintLock;
503 bool bNativeOk =
false;
522 rRenderContext.
Pop();
530 if (!
mpData->mbNativeButtons &&
544 rRenderContext.
Pop();
629 for (
auto & item :
mpData->m_aItems)
631 if( item.IsClipped() )
647 bool bOldAssumeDocked =
mpData->mbAssumeDocked;
648 bool bOldAssumeFloating =
mpData->mbAssumeFloating;
654 mpData->mbAssumeDocked =
false;
655 mpData->mbAssumeFloating =
false;
659 mpData->mbAssumeDocked =
true;
667 mpData->mbAssumeDocked =
true;
675 mpData->mbAssumeFloating =
true;
676 nLeft = nTop = nRight = nBottom = 0;
740 mpData->mbAssumeDocked = bOldAssumeDocked;
741 mpData->mbAssumeFloating = bOldAssumeFloating;
761 for (
auto const& item :
mpData->m_aItems)
763 if ( item.mbVisible )
767 tools::Long nTempSize = item.mpWindow->GetSizePixel().Width();
768 if ( nTempSize > nCalcSize )
769 nCalcSize = nTempSize;
773 if( item.maItemSize.Width() > nCalcSize )
774 nCalcSize = item.maItemSize.Width();
782 ImplToolItems::size_type nLines;
783 ImplToolItems::size_type nCalcLines;
784 ImplToolItems::size_type nTempLines;
785 sal_Int32 nMaxLineWidth;
790 nTempLines = nLines = nCalcLines;
808 while ((nCalcSize < upperBoundWidth) && (nLines < nTempLines));
809 if ( nTempLines < nLines )
862 Size aMinSize, aMaxSize;
952 nCurSize = rPos.
X() - rRect.
Left();
957 nCurSize = rPos.
Y() - rRect.
Top();
962 nCurSize = rRect.
Right() - rPos.
X();
967 nCurSize = rRect.
Bottom() - rPos.
Y();
971 OSL_FAIL(
"ImplLineSizing: Trailing else" );
984 if ( nMaxSize < aWinSize.
Height() )
985 nMaxSize = aWinSize.
Height();
991 if ( nMaxSize < aWinSize.
Width() )
992 nMaxSize = aWinSize.
Width();
995 ImplToolItems::size_type
i = 1;
996 if ( nCurSize <= nOneLineSize )
997 nSize = nOneLineSize;
1001 while ( (nSize < nCurSize) && (
i < nMaxLines) )
1008 nSize = aSize.
Width();
1009 if ( nSize > nMaxSize )
1016 nSize = aSize.
Width();
1035 : mpDragBox(nullptr)
1046 sal_uInt16 nDragLineMode )
1097 EndDragging(
false );
1156 mpIdle.reset(
new Idle(
"vcl::ToolBox maIdle update"));
1161 mpData->maDropdownTimer.SetTimeout( 250 );
1162 mpData->maDropdownTimer.SetInvokeHandler(
LINK(
this,
ToolBox, ImplDropdownLongClickHdl ) );
1185 else if (Window::GetStyle() &
WB_3DLOOK)
1246 if (bForeground || bFont)
1265 Window::queue_resize(eReason);
1276 const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame)
1281 loadUI(pParent, rID, rUIXMLDescription, rFrame);
1330 for (
auto & item :
mpData->m_aItems)
1332 if ( item.mnId == nItemId )
1344 if( bNativeButtons )
1369 nDropDownArrowWidth *= 3;
1389 aNativeBounds, aNativeContent ) )
1391 aRect = aNativeBounds;
1396 if( nDropDownArrowWidth < nMinWidth )
1397 nDropDownArrowWidth = nMinWidth;
1398 if( nMinWidth >
mpData->mnMenuButtonWidth )
1399 mpData->mnMenuButtonWidth = nMinWidth;
1414 aNativeBounds, aNativeContent ) )
1416 aRect = aNativeBounds;
1426 aNativeBounds, aNativeContent ) )
1428 aRect = aNativeBounds;
1438 aNativeBounds, aNativeContent ) )
1440 aRect = aNativeBounds;
1446 if ( !
mpData->m_aItems.empty() )
1448 for (
auto & item :
mpData->m_aItems)
1450 item.mbVisibleText =
false;
1458 bImage = !!item.maImage;
1459 bText = !item.maText.isEmpty();
1461 if ( bImage || bText )
1464 item.mbEmptyBtn =
false;
1469 if ( bImage || !bText )
1471 item.maItemSize = item.maImage.GetSizePixel();
1477 item.mbVisibleText =
true;
1483 if ( bText || !bImage )
1487 item.mbVisibleText =
true;
1491 item.maItemSize = item.maImage.GetSizePixel();
1507 item.maItemSize.AdjustWidth(item.maImage.GetSizePixel().Width() );
1508 if ( item.maImage.GetSizePixel().Height() > item.maItemSize.Height() )
1509 item.maItemSize.setHeight( item.maImage.GetSizePixel().Height() );
1518 item.maItemSize.AdjustHeight(item.maImage.GetSizePixel().Height() );
1519 if ( item.maImage.GetSizePixel().Width() > item.maItemSize.Width() )
1520 item.maItemSize.setWidth( item.maImage.GetSizePixel().Width() );
1523 item.mbVisibleText = bText;
1528 item.maItemSize =
Size( nDefWidth, nDefHeight );
1529 item.mbEmptyBtn =
true;
1533 item.maContentSize = item.maItemSize;
1536 if ( item.mpWindow )
1538 tools::Long nHeight = item.mpWindow->GetSizePixel().Height();
1546 item.maItemSize.AdjustWidth(nDropDownArrowWidth );
1547 item.mnDropDownArrowWidth = nDropDownArrowWidth;
1552 if( item.mbVisibleText && !
mbHorz )
1555 item.maItemSize.setWidth( item.maItemSize.Height() );
1556 item.maItemSize.setHeight( tmp );
1558 tmp = item.maContentSize.Width();
1559 item.maContentSize.setWidth( item.maContentSize.Height() );
1560 item.maContentSize.setHeight( tmp );
1565 item.maItemSize =
Size( nDefWidth, nDefHeight );
1566 item.maContentSize = item.maItemSize;
1575 item.maItemSize.setWidth(
w);
1576 item.maItemSize.setHeight(
h);
1580 tools::Long nMinW = std::max(nMinWidth, item.maMinimalItemSize.Width());
1581 tools::Long nMinH = std::max(nMinHeight, item.maMinimalItemSize.Height());
1586 if( item.maItemSize.Width() < nMinW )
1588 nGrowContentWidth = nMinW - item.maItemSize.Width();
1589 item.maItemSize.setWidth( nMinW );
1591 if( item.maItemSize.Height() < nMinH )
1593 nGrowContentHeight = nMinH - item.maItemSize.Height();
1594 item.maItemSize.setHeight( nMinH );
1598 item.maContentSize.AdjustWidth(nGrowContentWidth );
1599 item.maContentSize.AdjustHeight(nGrowContentHeight );
1603 if ( item.maItemSize.Width() > nMaxWidth )
1604 nMaxWidth = item.maItemSize.Width();
1605 if ( item.maItemSize.Height() > nMaxHeight )
1606 nMaxHeight = item.maItemSize.Height();
1612 nMaxWidth = nDefWidth;
1613 nMaxHeight = nDefHeight;
1626 tools::Long nFixedWidth = nDefWidth+nDropDownArrowWidth;
1631 nMaxHeight = nFixedHeight;
1633 nMaxWidth = nFixedWidth;
1659 ImplToolItems::size_type nLines = 1;
1661 bool bBreak =
false;
1667 nMenuWidth =
mpData->maMenubuttonItem.maItemSize.Width();
1671 ImplToolItems::iterator it, lastVisible;
1672 for ( it =
mpData->m_aItems.begin(); it !=
mpData->m_aItems.end(); ++it )
1674 if ( it->mbVisible )
1678 it =
mpData->m_aItems.begin();
1679 while ( it !=
mpData->m_aItems.end() )
1681 it->mbBreak = bBreak;
1684 if ( it->mbVisible )
1693 nCurWidth = it->maItemSize.Width();
1695 nCurWidth = it->maItemSize.Height();
1697 if ( it->mpWindow && bCalcHorz )
1699 tools::Long nWinItemWidth = it->mpWindow->GetSizePixel().Width();
1700 if ( !
mbScroll || (nWinItemWidth <= nWidthTotal) )
1702 nCurWidth = nWinItemWidth;
1707 if ( it->mbEmptyBtn )
1716 if ( ( ( it == lastVisible ) && (
nLineWidth+nCurWidth > nWidthTotal) &&
mbScroll ) ||
1717 ( ( it != lastVisible ) && (
nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) &&
mbScroll ) )
1722 nCurWidth = it->mnSepSize;
1736 (nLineStart == nGroupStart) )
1742 nLineStart = it -
mpData->m_aItems.begin();
1743 nGroupStart = nLineStart;
1749 if ( nLastGroupLineWidth > nMaxLineWidth )
1750 nMaxLineWidth = nLastGroupLineWidth;
1755 nLineStart = nGroupStart;
1756 it =
mpData->m_aItems.begin() + nGroupStart;
1768 nGroupStart = it -
mpData->m_aItems.begin();
1781 if ( pMaxLineWidth )
1790 if( nMaxLineWidth < aMinWidth )
1791 nMaxLineWidth = aMinWidth;
1793 *pMaxLineWidth = nMaxLineWidth;
1805 Size aSize1( aCurrentSize );
1806 Size aSize2( aCurrentSize );
1815 if( aCurrentSize == aSize1 )
1823 Size aSz( aCurrentSize );
1827 ImplToolItems::size_type manyLines = 1000;
1830 aSz.
setHeight( nBorderY + nLineHeight * nLines );
1838 if( aSz.
Width() < aMinimalFloatSize.
Width() )
1843 if( aCurrentSize == aSize2 )
1853 if( dx1*dy1 < dx2*dy2 )
1854 aCurrentSize = aSize1;
1856 aCurrentSize = aSize2;
1858 return aCurrentSize;
1865 bool bLastSep(
true );
1866 ToolBox::ImplToolItems::iterator it;
1867 for ( it = rItems.begin(); it != rItems.end(); ++it )
1871 it->mbVisible =
false;
1875 if (std::any_of(it + 1, rItems.end(), [](
const ImplToolItem& rItem) {
1876 return (rItem.meType == ToolBoxItemType::BUTTON) && rItem.mbVisible; }))
1877 it->mbVisible =
true;
1881 else if ( it->mbVisible )
1893 mpData->ImplClearLayoutData();
1901 ImplToolItems::size_type nFormatLine;
1902 bool bMustFullPaint;
1972 if( nWinHeight > nLineSize )
1973 nLineSize = nWinHeight;
2011 if( nWinWidth > nLineSize )
2012 nLineSize = nWinWidth;
2024 for (
auto & item :
mpData->m_aItems)
2026 item.maRect = aEmptyRect;
2045 mpData->maMenubuttonItem.maRect = aEmptyRect;
2050 lcl_hideDoubleSeparators(
mpData->m_aItems );
2076 mpData->maMenubuttonItem.maRect.SetRight(
mnDX - 2 );
2077 mpData->maMenubuttonItem.maRect.SetTop( nTop );
2083 mpData->maMenubuttonItem.maRect.SetTop( nTop );
2086 mpData->maMenubuttonItem.maRect.SetLeft(
mpData->maMenubuttonItem.maRect.Right() -
mpData->mnMenuButtonWidth );
2107 mpData->maMenubuttonItem.maRect.SetBottom(
mnDY - 2 );
2108 mpData->maMenubuttonItem.maRect.SetLeft( nLeft );
2114 mpData->maMenubuttonItem.maRect.SetLeft( nLeft );
2117 mpData->maMenubuttonItem.maRect.SetTop(
mpData->maMenubuttonItem.maRect.Bottom() -
mpData->mnMenuButtonWidth );
2146 for (
auto & item :
mpData->m_aItems)
2148 item.mbShowWindow =
false;
2177 if ( !item.mbVisible || (nFormatLine <
mnCurLine) ||
2180 item.maCalcRect = aEmptyRect;
2197 nX = item.maRect.Left();
2198 item.maCalcRect.SetLeft( nX );
2205 if ( firstItemCenter > 0 )
2206 if ( firstItemCenter-aCurrentItemSize.
Height()/2 > nY )
2207 item.maCalcRect.SetTop( firstItemCenter-aCurrentItemSize.
Height()/2 );
2209 item.maCalcRect.SetTop( item.maRect.Top() );
2212 item.maCalcRect.SetTop( item.maRect.Top() );
2213 firstItemCenter = item.maRect.Top()+aCurrentItemSize.
Height()/2;
2216 item.maCalcRect.SetTop( nY+(nLineSize-aCurrentItemSize.
Height())/2 );
2217 item.maCalcRect.SetRight( nX+aCurrentItemSize.
Width()-1 );
2218 item.maCalcRect.SetBottom( item.maCalcRect.Top()+aCurrentItemSize.
Height()-1 );
2219 nX += aCurrentItemSize.
Width();
2223 item.maCalcRect.SetLeft( nX+(nLineSize-aCurrentItemSize.
Width())/2 );
2224 item.maCalcRect.SetTop( nY );
2225 item.maCalcRect.SetRight( item.maCalcRect.Left()+aCurrentItemSize.
Width()-1 );
2226 item.maCalcRect.SetBottom( nY+aCurrentItemSize.
Height()-1 );
2227 nY += aCurrentItemSize.
Height();
2232 if ( item.mpWindow )
2234 if ( item.mbShowWindow )
2236 Point aPos( item.maCalcRect.Left(), item.maCalcRect.Top() );
2238 assert( item.maCalcRect.Top() >= 0 );
2240 item.mpWindow->SetPosPixel( aPos );
2241 item.mpWindow->Show();
2244 item.mpWindow->Hide();
2279 if ( bMustFullPaint )
2296 if ( aOldMenubuttonRect !=
mpData->maMenubuttonItem.maRect )
2301 if ( pWrapper && aOldDragRect != pWrapper->
GetDragArea() )
2307 for (
auto const& item :
mpData->m_aItems)
2309 if ( item.maRect != item.maCalcRect )
2322 for (
auto & item :
mpData->m_aItems)
2323 item.maRect = item.maCalcRect;
2332 if (mnCurPos == ITEM_NOTFOUND ||
2336 mpData->mbDropDownByKeyboard =
false;
2337 mpData->maDropdownClickHdl.Call(
this );
2345 InvalidateItem(mnCurPos);
2347 mnCurPos = ITEM_NOTFOUND;
2350 mnMouseModifier = 0;
2358 if( mbFormat && mpData )
2428 if (
mpData->maMenubuttonItem.maRect.IsEmpty())
2441 ImplErase(rRenderContext,
mpData->maMenubuttonItem.maRect, bHighlight);
2450 mpData->mbMenubuttonSelected = bHighlight;
2453 rRenderContext.
Pop();
2475 false,
false, bTmpUpper, bTmpLower, !
mbHorz);
2492 bool bNativeOk =
false;
2524 bool bChecked,
bool bEnabled,
bool bIsWindow )
2529 bool bNativeOk =
false;
2542 rRect,
nState, aControlValue, OUString() );
2547 bChecked,
true, bIsWindow,
nullptr, 2);
2574 bool bHighContrastWhite =
false;
2578 bHighContrastWhite =
true;
2610 if ( nHighlight == 1 )
2615 ImplErase(rRenderContext, pItem->
maRect, nHighlight != 0, bHasOpenPopup );
2660 nImageOffY += (nBtnHeight-aImageSize.
Height())/2;
2666 nImageOffY += (nBtnHeight-aImageSize.
Height())/2;
2676 if( nHighlight != 0 )
2678 if( bHighContrastWhite )
2682 rRenderContext.
DrawImage(
Point( nImageOffX, nImageOffY ), *pImage, nImageStyle);
2686 bool bRotate =
false;
2704 nTextOffX += aTxtSize.
Height();
2705 nTextOffX += (nBtnWidth-aTxtSize.
Height())/2;
2711 rRenderContext.
SetFont(aRotateFont);
2718 nTextOffY += (nBtnHeight-aTxtSize.
Height())/2;
2729 nTextOffY += nBtnHeight - aTxtSize.
Height();
2747 0, pItem->
maText.getLength(), nTextStyle );
2756 bool bSetColor =
true;
2766 ImplErase(rRenderContext, aDropDownRect, nHighlight != 0, bHasOpenPopup);
2833 bool bWasKeyboardActivate =
mpData->mbDropDownByKeyboard;
2839 if( !bWasKeyboardActivate )
2903 if ( bNewIn !=
mbIn )
2914 if ( bNewIn !=
mbIn )
2931 if( mnCurPos < mpData->m_aItems.size() &&
2934 mpData->maDropdownTimer.Stop();
2950 if( mnCurPos < mpData->m_aItems.size() )
3040 bool bDrawHotSpot =
true;
3043 bool bFocusWindowIsAToolBoxChild =
false;
3051 bFocusWindowIsAToolBoxChild =
true;
3059 bDrawHotSpot =
false;
3099 bool bClearHigh =
true;
3102 ImplToolItems::size_type nTempPos = 0;
3103 for (
auto const& item :
mpData->m_aItems)
3105 if ( item.maRect.Contains( aMousePos ) )
3119 if (
mpData->mbMenubuttonSelected )
3138 if ( !
HasFocus() && (bClearHigh || bMenuButtonHit) )
3140 if ( !bMenuButtonHit &&
mpData->mbMenubuttonSelected )
3159 if( bMenuButtonHit )
3193 ImplToolItems::size_type
i = 0;
3197 for (
auto const& item :
mpData->m_aItems)
3200 if ( item.maRect.Contains( aMousePos ) )
3205 !item.mbShowWindow )
3217 if ( !
mpData->m_aItems[nNewPos].mbEnabled )
3251 ||
mpData->m_aItems[nNewPos].GetDropDownRect(
mbHorz ).Contains( aMousePos ))
3256 mpData->mbDropDownByKeyboard =
false;
3257 mpData->maDropdownClickHdl.Call(
this );
3276 mpData->maDropdownTimer.Start();
3398 if (
mpData && nPosition < mpData->m_aItems.size())
3407 if (!
mpData->maMenubuttonItem.maRect.IsEmpty())
3422 if(
mpData->mbIsPaintLocked )
3448 ImplToolItems::size_type nHighPos;
3454 ImplToolItems::size_type
nCount =
mpData->m_aItems.size();
3455 for( ImplToolItems::size_type
i = 0;
i <
nCount;
i++ )
3462 sal_uInt16 nHighlight = 0;
3465 else if (
i == nHighPos )
3494 std::vector<size_t> aExpandables;
3495 for (
size_t i = 0;
i <
mpData->m_aItems.size(); ++
i)
3497 if (
mpData->m_aItems[
i].mbExpand)
3500 SAL_INFO_IF(!pWindow,
"vcl.layout",
"only tabitems with window supported at the moment");
3507 aExpandables.push_back(
i);
3512 if (
mbScroll || !aExpandables.empty() )
3514 if ( !
mbFormat || !aExpandables.empty() )
3521 if (!aExpandables.empty())
3530 auto nOptimalWidth = aBounds.
GetWidth();
3531 auto nDiff = aSize.
Width() - nOptimalWidth;
3532 decltype(nDiff) nExpandablesSize = aExpandables.size();
3533 nDiff /= nExpandablesSize;
3537 for (
size_t nIndex : aExpandables)
3565 if ( nOldDX >
mnDX )
3573 if ( nOldDY >
mnDY )
3583 bool DispatchableCommand(std::u16string_view rName)
3655 const OUString& rHelpStr =
GetHelpText( nItemId );
3656 if (!rHelpStr.isEmpty())
3675 sal_uInt16 nKeyCode = aKeyCode.
GetCode();
3683 bool bOldSchoolContainer =
3707 if(
mpData->mbMenubuttonWasLastSelected )
3710 mpData->mbMenubuttonSelected =
true;
3733 for (
auto const& item :
mpData->m_aItems)
3735 if ( item.mbVisible )
3737 if ( item.mpWindow && item.mpWindow->ImplIsWindowOrChild( rNEvt.
GetWindow() ) )
3751 mpData->mbMenubuttonWasLastSelected =
false;
3914 bool bFloatMode =
false;
3926 ImplToolItems::size_type nTemp = 0;
3938 ImplToolItems::size_type nTemp = 0;
3942 rRect = aDockingRect;
3963 ImplToolItems::size_type nCalcLines;
3964 ImplToolItems::size_type nTemp;
3976 if ( nCalcLines < 1 )
3985 while ( (aTempSize.
Width() > rSize.
Width()) &&
4002 std::map<vcl::Window*, Size> aExpandables;
4008 SAL_INFO_IF(!pWindow,
"vcl.layout",
"only tabitems with window supported at the moment");
4012 aExpandables[pWindow] = aWinSize;
4021 for (
auto const& [pWindow, aWinSize] : aExpandables)
4022 pWindow->SetSizePixel(aWinSize);
4040 ImplToolItems::size_type nLines = 0;
4042 for (
auto const& item :
mpData->m_aItems)
4060 nLines =
static_cast<ImplToolItems::size_type
>(ceil( sqrt(
static_cast<double>(
GetItemCount()) ) ));
4064 mpData->mbAssumePopupMode =
true;
4081 bool bFloat =
mpData->mbAssumeFloating;
4082 bool bDocking =
mpData->mbAssumeDocked;
4085 mpData->mbAssumeFloating =
true;
4086 mpData->mbAssumeDocked =
false;
4091 mpData->mbAssumeFloating = bFloat;
4092 mpData->mbAssumeDocked = bDocking;
4107 for (
auto const& item :
mpData->m_aItems)
4109 pToolBox->CopyItem( *
this, item.mnId );
4125 Size aSize = pToolBox->CalcWindowSizePixel( 1 );
4166 if( pToolItem && !pToolItem->
mbEnabled )
4224 if( pLastLevelFloat && pLastLevelFloat != pParent )
4237 sal_uInt16 nCode = aKeyCode.
GetCode();
4245 if(
mpData->mbMenubuttonSelected )
4254 mpData->mbMenubuttonWasLastSelected =
true;
4267 mpData->mbDropDownByKeyboard =
true;
4268 mpData->maDropdownClickHdl.Call(
this );
4282 sal_uInt16 nCode = aKeyCode.
GetCode();
4288 bool bForwardKey =
false;
4289 bool bGrabFocusToDocument =
false;
4404 bGrabFocusToDocument =
true;
4407 if( !bGrabFocusToDocument )
4418 sal_uInt16 aKeyGroup = aKeyCode.
GetGroup();
4448 if (
HasFocus() &&
mpData->mbKeyInputDisabled && bParentIsContainer)
4451 if ( pFocusControl && pFocusControl !=
this )
4456 if( bGrabFocusToDocument )
4469 ImplToolItems::size_type nLine = 1;
4470 for (
auto const& item :
mpData->m_aItems)
4474 if( &item == pCurrentItem)
4488 ImplToolItems::iterator it =
mpData->m_aItems.begin();
4489 while( it !=
mpData->m_aItems.end() )
4501 if( it ==
mpData->m_aItems.end() || it->mbBreak )
4509 return (it ==
mpData->m_aItems.end()) ? nullptr : &(*it);
4516 for( ImplToolItems::size_type
nPos = 0;
nPos < rList.size(); ++
nPos )
4517 if( &rList[
nPos ] == pItem )
4554 if( !bNoGrabFocus && pItem != pOldItem && pOldItem && pOldItem->
mpWindow )
4591 if( pItem != pOldItem )
4610 if( bValid && bNotClipped && pItem->
IsClipped() )
4622 if(
mpData->mbMenubuttonSelected )
4624 mpData->mbMenubuttonSelected =
false;
4629 auto it = std::find_if(
mpData->m_aItems.rbegin(),
mpData->m_aItems.rend(),
4630 [](
const ImplToolItem& rItem) { return ImplIsValidItem( &rItem, true ); });
4631 if( it !=
mpData->m_aItems.rend() )
4640 ImplToolItems::iterator it = std::find_if(
mpData->m_aItems.begin(),
mpData->m_aItems.end(),
4641 [](
const ImplToolItem& rItem) { return ImplIsValidItem( &rItem, true ); });
4642 if( it !=
mpData->m_aItems.end() )
4654 ImplToolItems::iterator it = std::find_if(
mpData->m_aItems.begin(),
mpData->m_aItems.end(),
4655 [](
const ImplToolItem& rItem) { return ImplIsValidItem( &rItem, false ); });
4661 mpData->mbMenubuttonSelected =
true;
4676 mpData->mbMenubuttonSelected =
true;
4682 auto it = std::find_if(
mpData->m_aItems.rbegin(),
mpData->m_aItems.rend(),
4683 [](
const ImplToolItem& rItem) { return ImplIsValidItem( &rItem, false ); });
4684 if( it !=
mpData->m_aItems.rend() )
4696 ImplToolItems::size_type
nCount =
mpData->m_aItems.size();
4698 ImplToolItems::size_type
i=0;
4712 mpData->mbMenubuttonSelected =
true;
4731 mpData->mbMenubuttonSelected =
true;
4751 mpData->mbMenubuttonSelected =
true;
4780 mpData->mbMenubuttonWasLastSelected =
false;
4792 mpData->mbMenubuttonWasLastSelected =
true;
4794 mpData->mbMenubuttonSelected =
false;
void SetSelectHdl(const Link< Accelerator &, void > &rLink)
void InsertItem(sal_uInt16 nItemId, const vcl::KeyCode &rKeyCode)
const StyleSettings & GetStyleSettings() const
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
static bool InsertAccel(Accelerator *pAccel)
Insert accelerator.
static const AllSettings & GetSettings()
Gets the application's settings.
static void RemoveAccel(Accelerator const *pAccel)
Remove accelerator.
static Help * GetHelp()
Gets the application's help.
static vcl::Window * GetFocusWindow()
Get the currently focused window.
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void RemoveWindow(const vcl::Window *pWin)
void AddWindow(const vcl::Window *pWin)
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
void SetMinOutputSizePixel(const Size &rSize)
void SetOutputSizePixel(const Size &rNewSize) override
Point GetPosPixel() const override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void StateChanged(StateChangedType nType) override
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Size GetSizePixel() const override
virtual void StartDocking()
virtual bool EventNotify(NotifyEvent &rNEvt) override
Size GetOutputSizePixel() const
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
virtual bool Docking(const Point &rPos, tools::Rectangle &rRect)
void SetMaxOutputSizePixel(const Size &rSize)
void loadUI(vcl::Window *pParent, const OUString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame)
virtual void Tracking(const TrackingEvent &rTEvt) override
bool IsDockingCanceled() const
VclPtr< vcl::Window > mpDialogParent
virtual void ToggleFloatingMode()
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
SAL_DLLPRIVATE FloatingWindow * ImplFindLastLevelFloat()
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
void SetStyle(css::awt::GradientStyle eStyle)
void SetStartColor(const Color &rColor)
void SetAngle(Degree10 nAngle)
void SetEndColor(const Color &rColor)
HelpEventMode GetMode() const
bool KeyboardActivated() const
const Point & GetMousePosPixel() const
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
An idle is a timer to be scheduled immediately.
Size GetSizePixel() const
void setTristateVal(ButtonValue nTristate)
ImplDockingWindowWrapper.
void SetDragArea(const tools::Rectangle &rRect)
const tools::Rectangle & GetDragArea() const
void ShowMenuTitleButton(bool bVisible)
void SetMinOutputSizePixel(const Size &rSize)
void SetMaxOutputSizePixel(const Size &rSize)
DECL_LINK(SelectHdl, Accelerator &, void)
ImplTBDragMgr(const ImplTBDragMgr &)=delete
tools::Rectangle maStartRect
void StartDragging(ToolBox *pDragBox, const Point &rPos, const tools::Rectangle &rRect, sal_uInt16 nLineMode)
void EndDragging(bool bOK=true)
ImplTBDragMgr & operator=(const ImplTBDragMgr &)=delete
void Dragging(const Point &rPos)
VclPtr< ToolBox > mpDragBox
ToolBox::ImplToolItems::size_type mnStartLines
const vcl::KeyCode & GetKeyCode() const
static OUString EraseAllMnemonicChars(const OUString &rStr)
MouseEventModifiers GetMode() const
bool IsLeaveWindow() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
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)
const vcl::Font & GetFont() const
void SetAntialiasing(AntialiasingFlags nMode)
float GetDPIScaleFactor() const
void SetFont(const vcl::Font &rNewFont)
void DrawEllipse(const tools::Rectangle &rRect)
Size GetOutputSizePixel() const
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void DrawPolygon(const tools::Polygon &rPoly)
Render the given polygon.
void SetTextColor(const Color &rColor)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const Color & GetLineColor() const
void DrawWallpaper(const tools::Rectangle &rRect, const Wallpaper &rWallpaper)
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
AntialiasingFlags GetAntialiasing() const
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)
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.
const Color & GetFillColor() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
BitmapEx const & GetPersonaHeader() const
const Color & GetWindowColor() const
bool GetHighContrastMode() const
const Color & GetShadowColor() const
BitmapEx const & GetPersonaFooter() const
Color GetSeparatorColor() const
const Color & GetWindowTextColor() const
const Color & GetLightColor() const
const vcl::Font & GetToolFont() const
Color GetFaceGradientColor() const
sal_Int32 GetFloatTitleHeight() const
const Color & GetFaceColor() const
const Color & GetToolTextColor() const
const Color & GetButtonTextColor() const
bool IsTrackingEnded() const
bool IsTrackingRepeat() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
A construction helper for a temporary VclPtr.
reference_type * get() const
Get the body.
VclPtr< vcl::Window > mpBorderWindow
bool mbDrawSelectionBackground
void SetOrientation(Degree10 nLineOrientation)
sal_uInt16 GetGroup() const
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
void Intersect(const tools::Rectangle &rRegion)
tools::Rectangle GetBoundRect() const
Point OutputToScreenPixel(const Point &rPos) const
void SetFont(const vcl::Font &rNewFont)
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
bool IsReallyVisible() const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
virtual void RequestHelp(const HelpEvent &rHEvt)
GetFocusFlags GetGetFocusFlags() const
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
bool IsMouseCaptured() const
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
bool IsBackground() const
sal_uInt16 GetChildCount() const
bool IsPaintTransparent() const
WindowType GetType() const
virtual void SetSizePixel(const Size &rNewSize)
virtual void Command(const CommandEvent &rCEvt)
Size get_preferred_size() const
vcl::Window * GetWindow(GetWindowType nType) const
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
const Color & GetControlForeground() const
bool IsUpdateMode() const
virtual void MouseButtonDown(const MouseEvent &rMEvt)
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)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
void GrabFocusToDocument()
bool IsControlForeground() const
const AllSettings & GetSettings() const
virtual void MouseButtonUp(const MouseEvent &rMEvt)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
::OutputDevice const * GetOutDev() const
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
virtual void MouseMove(const MouseEvent &rMEvt)
virtual Size GetSizePixel() const
bool IsControlBackground() const
Point GetPointerPosPixel()
const Color & GetControlBackground() const
virtual void SetPointer(PointerStyle)
void SetPaintTransparent(bool bTransparent)
bool HasPaintEvent() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
Point ScreenToOutputPixel(const Point &rPos) const
const OUString & GetQuickHelpText() const
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
const OUString & GetHelpText() const
void EnableChildTransparentMode(bool bEnable=true)
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEYGROUP_ALPHA
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEYGROUP_MISC
constexpr sal_uInt16 KEYGROUP_FKEYS
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEYGROUP_NUM
constexpr sal_uInt16 KEY_END
bool isContainerWindow(const vcl::Window &rWindow)
#define LINK(Instance, Class, Member)
#define SAL_INFO_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
void ImplDrawUpDownButtons(vcl::RenderContext &rRenderContext, const tools::Rectangle &rUpperRect, const tools::Rectangle &rLowerRect, bool bUpperIn, bool bLowerIn, bool bUpperEnabled, bool bLowerEnabled, bool bHorz, bool bMirrorHorz)
ImplTBDragMgr * mpTBDragMgr
ImplSVCtrlData maCtrlData
ImplSVWinData * mpWinData
VclPtr< FloatingWindow > mpFirstFloat
ImplSVData * ImplGetSVData()
DockingManager * ImplGetDockingManager()
@ RESIZE
Resize runs before repaint, so we won't paint twice.
@ Update
The invalidated area is updated immediately.
@ NoClipChildren
The area is invalidated regardless of overlapping child windows.
WinBits const WB_DIALOGCONTROL
WinBits const WB_NODIALOGCONTROL
WinBits const WB_NOSHADOW