35 #include <com/sun/star/accessibility/AccessibleRole.hpp>
37 #include <rtl/instance.hxx>
40 #include <osl/diagnose.h>
46 #define MULTILINE_ENTRY_DRAW_FLAGS ( DrawTextFlags::WordBreak | DrawTextFlags::MultiLine | DrawTextFlags::VCenter )
88 std::vector<std::unique_ptr<ImplEntryType> >::iterator iter =
maEntries.begin()+nPos;
90 if ( ( (*iter)->mbIsSelected != bSelect ) &&
93 (*iter)->mbIsSelected = bSelect;
103 :
public rtl::StaticWithInit< comphelper::string::NaturalStringSorter, theSorter >
119 return rSorter.
compare(rA, rB);
131 sal_Int32 insPos = 0;
132 const sal_Int32 nEntriesSize =
static_cast<sal_Int32
>(
maEntries.size());
136 if (0 <= nPos && nPos < nEntriesSize)
139 maEntries.insert(
maEntries.begin() + nPos, std::unique_ptr<ImplEntryType>(pNewEntry) );
143 insPos = nEntriesSize;
144 maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
151 const OUString& rStr = pNewEntry->
maStr;
162 insPos = nEntriesSize;
163 maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
184 nMid =
static_cast<sal_Int32
>((nLow + nHigh) / 2);
199 while ( nLow <= nHigh );
209 catch (uno::RuntimeException& )
228 std::vector<std::unique_ptr<ImplEntryType> >::iterator iter =
maEntries.begin()+ nPos;
230 if ( !!(*iter)->maImage )
239 const sal_Int32 nEntries =
static_cast<sal_Int32
>(
maEntries.size());
240 for ( sal_Int32
n = bSearchMRUArea ? 0 :
GetMRUCount();
n < nEntries;
n++ )
243 if ( aComp == rString )
255 for ( sal_Int32
n = nStart;
n < nEntryCount; )
265 bMatch = pImplEntry->
maStr.startsWith(rStr);
282 sal_Int32 nStart = std::min(i_nEndIndex, i_nBeginIndex);
283 sal_Int32 nStop = std::max(i_nEndIndex, i_nBeginIndex);
288 if( nStop > nEntryCount-1 )
289 nStop = nEntryCount-1;
292 else if( nStart > nEntryCount-1 )
293 nStart = nEntryCount-1;
295 sal_Int32
nIndex = nStart;
299 if (nHeight > ::std::numeric_limits<tools::Long>::max() - nPosHeight)
301 SAL_WARN(
"vcl",
"ImplEntryList::GetAddedHeight: truncated");
304 nHeight += nPosHeight;
310 return i_nEndIndex > i_nBeginIndex ? nHeight : -nHeight;
324 aEntryText = pImplEntry->
maStr;
333 bImage = !!pImplEntry->
maImage;
356 return pImplEntry ? pImplEntry->
mpUserData :
nullptr;
368 sal_Int32 nSelCount = 0;
389 for ( sal_Int32
n = 0;
n < nEntryCount;
n++ )
394 if ( nSel == nIndex )
446 maQuickSelectionEngine( *this )
566 struct ImplEntryMetrics
590 std::unique_ptr<SalLayout> pLayout = pOutputDevice->
ImplLayout(
607 ImplEntryMetrics aMetrics;
608 aMetrics.bText = !rEntry.
maStr.isEmpty();
609 aMetrics.bImage = !!rEntry.
maImage;
610 aMetrics.nEntryWidth = 0;
611 aMetrics.nEntryHeight = 0;
612 aMetrics.nTextWidth = 0;
613 aMetrics.nImgWidth = 0;
614 aMetrics.nImgHeight = 0;
616 if ( aMetrics.bText )
627 aMetrics.nTextWidth = aTextRect.
GetWidth();
645 if ( aMetrics.bImage )
648 aMetrics.nImgWidth =
static_cast<sal_uInt16
>(
CalcZoom( aImgSz.
Width() ));
649 aMetrics.nImgHeight =
static_cast<sal_uInt16
>(
CalcZoom( aImgSz.
Height() ));
657 aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, aMetrics.nEntryHeight );
662 if (bIsUserDrawEnabled || aMetrics.bImage)
665 if (!bIsUserDrawEnabled && aMetrics.bText)
668 aMetrics.nEntryHeight );
671 if (!aMetrics.bText && !aMetrics.bImage && !bIsUserDrawEnabled)
683 rEntry.
mnHeight = aMetrics.nEntryHeight;
695 if ( nFirstMatchingEntryPos || !nMRUCount )
697 bool bSelectNewEntry =
false;
698 if ( nFirstMatchingEntryPos < nMRUCount )
702 if ( nFirstMatchingEntryPos == nSelected )
703 bSelectNewEntry =
true;
705 else if ( nMRUCount ==
GetEntryList()->GetMaxMRUCount() )
733 sal_Int32 nNewPos =
mpEntryList->InsertEntry( nPos, pNewEntry, bSort );
785 sal_Int32 nSelect =
mnTop;
790 if (rPoint.Y() <= nEntryHeight + nY)
795 if( pEntry ==
nullptr )
805 if( i_nEntry >=
mnTop )
829 for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff =
mpEntryList->GetAddedHeight( nPos,
mnTop ) )
832 if( nDiff > nWindowHeight && nPos >
mnTop )
895 nSelect = std::min( nSelect, static_cast<sal_Int32>(
mpEntryList->GetEntryCount() - 1 ) );
985 bool bSelectionChanged =
false;
989 bool bFocusChanged =
false;
994 sal_Int32 nDeselect =
mpEntryList->GetSelectedEntryPos( 0 );
995 if( nSelect != nDeselect )
999 bFocusChanged =
true;
1000 bSelectionChanged =
true;
1006 sal_Int32 nEntryCount =
mpEntryList->GetEntryCount();
1009 bool bSelect =
nPos == nSelect;
1013 bFocusChanged =
true;
1014 bSelectionChanged =
true;
1026 bool bSelect = !
mpEntryList->IsEntryPosSelected( nSelect );
1030 if ( !
mpEntryList->IsEntryPosSelected( nSelect ) )
1032 bFocusChanged =
true;
1033 bSelectionChanged =
true;
1039 bFocusChanged =
true;
1041 sal_Int32 nAnchor =
mpEntryList->GetSelectionAnchor();
1049 sal_Int32 nStart = std::min( nSelect, nAnchor );
1050 sal_Int32 nEnd = std::max( nSelect, nAnchor );
1051 for ( sal_Int32
n = nStart;
n <= nEnd;
n++ )
1056 bSelectionChanged =
true;
1064 if ( ( nLast > nSelect ) && ( nLast > nAnchor ) )
1066 for ( sal_Int32
n = nSelect+1;
n <= nLast;
n++ )
1071 bSelectionChanged =
true;
1075 else if ( ( nLast < nSelect ) && ( nLast < nAnchor ) )
1077 for ( sal_Int32
n = nLast;
n < nSelect;
n++ )
1082 bSelectionChanged =
true;
1094 bFocusChanged =
true;
1099 bFocusChanged =
true;
1102 if( bSelectionChanged )
1114 if (bSelectPosChange)
1121 return bSelectionChanged;
1160 bool bTrackOrQuickClick =
mbTrack;
1171 bTrackOrQuickClick =
true;
1176 if( bTrackOrQuickClick )
1180 bool bShift = aMEvt.
IsShift();
1181 bool bCtrl = aMEvt.
IsMod1();
1189 if( nSelect <
mnTop )
1197 nSelect = std::min( static_cast<sal_Int32>(
mnCurrentPos+1), static_cast<sal_Int32>(
mpEntryList->GetEntryCount()-1) );
1206 nSelect = std::min( nSelect, static_cast<sal_Int32>(
mpEntryList->GetEntryCount() - 1 ) );
1258 bool bShift = aKeyCode.
IsShift();
1260 bool bMod2 = aKeyCode.
IsMod2();
1262 bool bHandleKey =
false;
1327 (
mnTop-nCurVis) : 0 );
1329 else if ( !bCtrl && !bMod2 )
1358 else if ( !bCtrl && !bMod2 )
1368 sal_Int32 nTmp = std::min( nCurVis, nCount );
1372 tools::Long nTmp2 = std::min( static_cast<tools::Long>(nCount-nCurVis), static_cast<tools::Long>(static_cast<tools::Long>(
mnTop)+static_cast<tools::Long>(nCurVis)-1) );
1374 nTmp =
static_cast<sal_Int32
>(nTmp2+(nCurVis-1) );
1378 nSelect =
mpEntryList->FindFirstSelectable( nTmp,
false );
1410 else if ( !bCtrl && !bMod2 )
1419 nSelect =
mpEntryList->FindFirstSelectable( nCount - 1,
false );
1421 if( nCount > nCurVis )
1432 if ( !bCtrl && !bMod2 )
1443 if ( !bCtrl && !bMod2 )
1487 sal_Int32 nEntryCount =
mpEntryList->GetEntryCount();
1488 for( sal_Int32
i = 0;
i < nEntryCount;
i++ )
1516 && ( ( !
mpEntryList->IsEntryPosSelected( nSelect ) )
1523 if (nSelect >= nCount)
1527 if(
SelectEntries( nSelect, eLET, bShift, bCtrl, bCurPosChange))
1547 if ( _nPos >= nEntryCount )
1559 return static_cast< sal_Int32
>(
reinterpret_cast< sal_Int64
>( _entry ) ) - 1;
1570 sal_Int32 nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
1571 return lcl_getEntry( *
GetEntryList(), nNextPos, _out_entryText );
1576 sal_Int32 nSelect = lcl_getEntryPos( _entry );
1585 OSL_ENSURE( nSelect < mpEntryList->GetEntryCount(),
"ImplListBoxWindow::SelectEntry: how that?" );
1587 if (nSelect >= nCount)
1616 bool bSelected =
mpEntryList->IsEntryPosSelected(nPos);
1641 UserDrawEvent aUDEvt(
this, &rRenderContext, aRect, nPos, bSelected);
1647 DrawEntry(rRenderContext, nPos,
true,
true);
1676 rRenderContext.
DrawImage(aPtImg, aImage);
1682 rRenderContext.
DrawImage(aPtImg, aImgSz, aImage);
1688 if (nEdgeBlendingPercent && aImgSz.
Width() && aImgSz.
Height())
1692 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
1706 if (!
aStr.isEmpty())
1714 Size(nMaxWidth, nEntryHeight));
1736 Point aStartPos(0, nY);
1739 Point aEndPos(aStartPos);
1741 rRenderContext.
DrawLine(aStartPos, aEndPos);
1767 if (nY + nEntryHeight >= rRect.
Top() &&
1802 if( nEntries > nCount )
1803 nEntries =
static_cast<sal_uInt16
>(nCount);
1813 if ( bShowFocusRect )
1822 if ( bShowFocusRect )
1854 sal_Int32 nLastEntry =
mpEntryList->GetEntryCount()-1;
1855 if( nTop > nLastEntry )
1861 if ( nTop ==
mnTop )
1900 nDiff = - std::min(
mnLeft, nAbs );
1907 mnLeft = sal::static_int_cast<sal_uInt16>(
mnLeft + nDiff);
2032 Control( pParent, nWinStyle ),
2036 SetType( WindowType::LISTBOXWINDOW );
2144 if( nSet > mpVScrollBar->GetRangeMax() )
2145 mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
2146 mpVScrollBar->SetThumbPos( GetTopEntry() );
2148 mpHScrollBar->SetThumbPos( GetLeftIndent() );
2150 maScrollHdl.Call(
this );
2155 sal_uInt16
nPos =
static_cast<sal_uInt16
>(pSB->GetThumbPos());
2156 if( pSB == mpVScrollBar )
2157 SetTopEntry( nPos );
2158 else if( pSB == mpHScrollBar )
2159 SetLeftIndent( nPos );
2166 bool bArrange =
false;
2173 if( nEntries > nMaxVisEntries )
2202 if( nWidth < nMaxWidth )
2211 if( nEntries > nMaxVisEntries )
2226 sal_uInt16 nMaxLI =
static_cast<sal_uInt16
>(nMaxWidth - nWidth);
2276 Size aInnerSz( aOutSz );
2282 Point aWinPos( 0, 0 );
2396 return bDone || Window::EventNotify( rNEvt );
2430 sal_Int32 nMRUCount = 0;
2434 OUString aEntry = rEntries.getToken( 0, cSep, nIndex );
2443 while ( nIndex >= 0 );
2460 aEntries.append(cSep);
2462 return aEntries.makeStringAndClear();
2475 Control ( pParent, nWinStyle )
2529 bool bNativeOK =
false;
2553 sal_Int32 nLeft, nTop, nRight, nBottom;
2554 pWin->
GetBorder( nLeft, nTop, nRight, nBottom );
2555 Point aPoint( -nLeft, -nTop );
2558 bool bMouseOver =
false;
2577 nState, aControlValue, OUString() );
2581 nState, aControlValue, OUString());
2586 if (bHasFocus && !
ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea)
2660 if (bImage && !bLayout)
2672 rRenderContext.
DrawImage( aPtImg, *pImage, nStyle );
2678 rRenderContext.
DrawImage( aPtImg, aImgSz, *pImage, nStyle );
2681 const sal_uInt16 nEdgeBlendingPercent(
GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0);
2683 if(nEdgeBlendingPercent)
2685 const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor());
2686 const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor());
2687 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
2701 if ( bImage && !bLayout )
2718 OUString* pDisplayText = bLayout ? &
mpControlData->mpLayoutData->m_aDisplayText :
nullptr;
2719 rRenderContext.
DrawText( aTextRect,
maString, nTextStyle, pVector, pDisplayText );
2881 sal_Int32 nLeft, nTop, nRight, nBottom;
2882 GetBorder( nLeft, nTop, nRight, nBottom );
2901 if ( ( aFloatSz.
Height() < nMaxHeight ) || (
mnDDLineCount && ( mnDDLineCount < mpImplLB->GetEntryList()->GetEntryCount() ) ) )
2909 if (aFloatSz.
Width() > nDesktopWidth)
2911 aFloatSz.
setWidth( nDesktopWidth );
2914 if ( aFloatSz.
Height() > nMaxHeight )
2930 if ( nInnerHeight % nEntryHeight )
2932 nInnerHeight /= nEntryHeight;
2934 nInnerHeight *= nEntryHeight;
2935 aFloatSz.
setHeight( nInnerHeight + nTop + nBottom );
2970 const sal_Int32 nLeft = 4, nTop = 4, nRight = 4, nBottom = 4;
2971 aPos.AdjustX(nLeft );
2972 aPos.AdjustY(nTop );
2985 pGrandparentOutDev->
ReMirror( aRect );
2993 if( bStartTracking )
virtual Point GetPosPixel() const
tools::Rectangle maFocusRect
#define LINK(Instance, Class, Member)
void SelectEntry(sal_Int32 nPos, bool bSelect)
Size GetSizePixel() 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)
bool IsControlBackground() const
bool GetEdgeBlending() const
virtual void EnableRTL(bool bEnable=true) override
virtual void ShowFocus(const tools::Rectangle &rRect) override
bool IsInPopupMode() const
virtual const Wallpaper & GetDisplayBackground() const
WinBits const WB_NOSHADOW
virtual void LoseFocus() override
Link< sal_Int32, void > maFocusHdl
void SetMRUEntries(const OUString &rEntries, sal_Unicode cSep)
const Wallpaper & GetBackground() const
sal_Int32 NaturalSortCompare(const OUString &rA, const OUString &rB)
void StartPopupMode(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
SalLayoutGlyphs maStrGlyphs
virtual void Resize() override
virtual void LoseFocus() override
bool HandleKeyEvent(const KeyEvent &_rKEvt)
WinBits const WB_SYSTEMWINDOW
bool HasEntryImage(sal_Int32 nPos) const
virtual void StateChanged(StateChangedType nType) override
const ImplEntryList * GetEntryList() const
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...
std::vector< tools::Rectangle > MetricVector
static OUString filterFormattingChars(const OUString &)
virtual void FillLayoutData() const override
void setWidth(tools::Long nWidth)
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
sal_Int32 GetSelectedEntryPos(sal_Int32 nIndex) const
void SetUserItemSize(const Size &rSz)
const CommandEvent * GetCommandEvent() const
const Color & GetHighlightTextColor() const
BitmapEx createBlendFrame(const Size &rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight)
Create a blend frame as BitmapEx.
std::unique_ptr< ContentProperties > pData
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
virtual ~ImplListBoxWindow() override
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
void ScrollHorz(tools::Long nDiff)
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
ImplEntryList * GetEntryList() const
SAL_DLLPRIVATE void ImplClearLayoutData() const
tools::Rectangle maFocusRect
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Gets the application's settings.
constexpr sal_uInt16 KEY_A
tools::Long mnMaxImgWidth
Maximum width of an image item.
bool mbSelectionChanged
Do not call Select() too often ...
void ImplResizeControls()
virtual void StateChanged(StateChangedType nStateChange) override
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Link< ImplListBoxWindow *, void > maScrollHdl
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void EnableMouseMoveSelect(bool bMouseMoveSelect)
sal_Int32 GetTopEntry() const
virtual Size GetSizePixel() const
virtual void SetSizePixel(const Size &rNewSize)
constexpr tools::Long gnBorder
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
sal_Int32 GetEntryPosForPoint(const Point &rPoint) const
void CompatStateChanged(StateChangedType nStateChange)
bool MatchString(const OUString &rStr1, const OUString &rStr2) const
void SetMRUCount(sal_Int32 n)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
const Color & GetFieldRolloverTextColor() const
sal_uInt16 GetCode() const
void SelectEntry(sal_Int32 nPos, bool bSelect)
sal_Int32 FindEntry(std::u16string_view rStr, bool bSearchMRUArea=false) const
sal_Int32 GetSelectedEntryCount() const
DataChangedEventType GetType() const
The invalidated area is updated immediately.
tools::Rectangle GetDesktopRectPixel() const
bool mbMouseMoveSelect
Select at MouseMove.
sal_Int32 mnTop
output from line on
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
sal_uInt16 GetDisplayLineCount() const
const Color & GetControlBackground() const
const CommandWheelData * GetWheelData() const
constexpr sal_uInt16 KEY_SPACE
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator. ...
void SetType(WindowType nType)
bool mbCenter
center Text output
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
virtual void Tracking(const TrackingEvent &rTEvt) override
static Point ImplCalcPos(vcl::Window *pWindow, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags, sal_uInt16 &rArrangeIndex, Point *pLOKTwipsPos=nullptr)
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.
const vcl::Font & GetFieldFont() const
tools::Long GetLeftIndent() const
const Color & GetFieldTextColor() const
void ImplUpdateEntryMetrics(ImplEntryType &rEntry)
constexpr sal_uInt16 KEY_UP
#define LISTBOX_ENTRY_NOTFOUND
const Color & GetHighlightColor() const
VclPtr< ImplListBoxWindow > maLBWindow
ImplEntryList(vcl::Window *pWindow)
The invalidated area is painted with the background color/pattern.
void ImplInitScrollBars()
Link< void *, void > maMBDownHdl
sal_Int32 GetTopEntry() const
constexpr sal_uInt16 KEY_END
void RemoveEntry(sal_Int32 nPos)
const Fraction & GetZoom() const
void * GetEntryData(sal_Int32 nPos) const
tools::Long mnMaxWidth
Maximum width of an entry.
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
tools::Long mnTextHeight
text height
tools::Long GetMaxEntryWidth() const
sal_uInt16 GetEdgeBlending() const
sal_uInt16 GetClicks() const
VclPtr< vcl::Window > mpWindow
For getting the current locale when matching strings.
IMPL_LINK_NOARG(ImplListBox, MRUChanged, LinkParamNone *, void)
bool IsTravelSelect() const
std::set< sal_Int32 > maSeparators
Separator positions.
virtual bool PreNotify(NotifyEvent &rNEvt) override
void RemoveEntry(sal_Int32 nPos)
tools::Long mnMaxImgTxtWidth
Maximum width of a text item.
void Enable(bool bEnable=true, bool bChild=true)
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
this flags lets the item be drawn disabled (e.g.
VclPtr< ImplListBox > mpImplLB
virtual void StateChanged(StateChangedType nType) override
virtual ~ImplListBoxFloatingWindow() override
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool IsControlForeground() const
bool IsEnterWindow() const
void SetMRUChangedHdl(const Link< LinkParamNone *, void > &rLink)
AllSettingsFlags GetFlags() const
constexpr sal_uInt16 KEY_PAGEUP
virtual const Wallpaper & GetDisplayBackground() const override
bool mbIsDropdown
Listbox is actually a dropdown (either combobox, or popup window treated as dropdown) ...
tools::Long mnMaxTxtWidth
Maximum width of a text item.
tools::Long getHeightWithMargin() const
virtual void Resize() override
sal_uInt16 GetModifier() const
const void * StringEntryIdentifier
Link< LinkParamNone *, void > maListItemSelectHdl
ImplWin(vcl::Window *pParent, WinBits nWinStyle)
bool mbSimpleMode
SimpleMode for MultiListBox.
void DrawLine(const Point &rStartPt, const Point &rEndPt)
const Color & GetEdgeBlendingBottomRightColor() const
Image GetEntryImage(sal_Int32 nPos) const
ImplListBoxWindow * GetMainWindow()
void DrawRect(const tools::Rectangle &rRect)
sal_Int32 mnTrackingSaveSelection
Selection before Tracking();.
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
const Color & GetControlForeground() const
this flag disables a selection of an entry completely.
void SetTopEntry(sal_Int32 nTop)
constexpr sal_uInt16 KEY_DOWN
void RemoveEntry(sal_Int32 nPos)
void SetScrollHdl(const Link< ImplListBoxWindow *, void > &rLink)
Link< void *, void > maMBDownHdl
ImplListBoxFloatingWindow(vcl::Window *pParent)
sal_Int32 GetSeparatorPos() const
Gets the position of the separator which was added first.
sal_Int32 GetMRUCount() const
void ShowProminentEntry(sal_Int32 nPos)
ImplSVData * ImplGetSVData()
bool ProcessKeyInput(const KeyEvent &rKEvt)
this flag can be used to make an entry multiline capable A normal entry is single line and will there...
virtual void KeyInput(const KeyEvent &rKEvt) override
const Color & GetDisableColor() const
virtual bool PreNotify(NotifyEvent &rNEvt) override
std::vector< std::unique_ptr< ImplEntryType > > maEntries
sal_Int32 FindFirstSelectable(sal_Int32 nPos, bool bForward=true)
bool IsRTLEnabled() const
virtual bool PreNotify(NotifyEvent &rNEvt)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
bool IsLeaveWindow() const
virtual void Resize() override
bool IsEntryPosSelected(sal_Int32 nIndex) const
bool IsNativeWidgetEnabled() const
ImplBtn(vcl::Window *pParent, WinBits nWinStyle)
virtual void Resize() override
constexpr sal_uInt16 KEY_HOME
virtual ~ImplListBox() override
void SetControlBackground()
virtual bool PreNotify(NotifyEvent &rNEvt) override
WinBits const WB_SIMPLEMODE
IMPL_LINK(ImplListBox, ScrollBarHdl, ScrollBar *, pSB, void)
bool mbMulti
MultiListBox.
tools::Long mnLeft
output from column on
void ImplCheckScrollBars()
Link< ImplListBoxWindow *, void > maDoubleClickHdl
void SetControlForeground()
CommandWheelMode GetMode() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
void SetUpdateMode(bool bUpdate)
Size GetOutputSize() const
sal_Int32 mnSelectionAnchor
ImplListBox(vcl::Window *pParent, WinBits nWinStyle)
bool IsUpdateMode() const
tools::Long Width() const
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 Color & GetFieldColor() const
tools::Long GetEntryHeightWithMargin() const
CommandEventId GetCommand() const
const Color & GetLineColor() const
VclPtr< ScrollBarBox > mpScrollBarBox
void SetZoom(const Fraction &rZoom)
sal_uInt16 GetModifier() const
Size CalcSize(sal_Int32 nMaxLines) const
void SetTextColor(const Color &rColor)
constexpr sal_uInt16 KEY_PAGEDOWN
DrawTextFlags ImplGetTextStyle() const
void SetEdgeBlending(bool bNew)
void ImplDoPaint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
MouseNotifyEvent GetType() const
void SetLeftIndent(tools::Long n)
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.
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
WinBits const WB_DROPDOWN
const AllSettings & GetSettings() const
Size GetOutputSizePixel() const
vcl::QuickSelectionEngine maQuickSelectionEngine
bool GetEdgeBlending() const
tools::Long GetScrollBarSize() const
VclPtr< ScrollBar > mpHScrollBar
bool HandleWheelAsCursorTravel(const CommandEvent &rCEvt, Control &rControl)
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
Link< LinkParamNone *, void > maCancelHdl
std::unique_ptr< ImplEntryList > mpEntryList
EntryList.
sal_uInt16 GetModifier() const
bool mbSort
ListBox sorted.
bool GetEdgeBlending() const
void DrawEntry(vcl::RenderContext &rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText)
Link< UserDrawEvent *, void > maUserDrawHdl
virtual void ShowFocus(const tools::Rectangle &rRect)
bool mbTravelSelect
TravelSelect.
vcl::Window * GetParent() const
ListBoxEntryFlags mnFlags
sal_Int32 FindMatchingEntry(const OUString &rStr, sal_Int32 nStart, bool bLazy) const
void SetLeftIndent(sal_uInt16 n)
void ImplPaint(vcl::RenderContext &rRenderContext, sal_Int32 nPos)
bool IsTrackingEnded() const
std::unique_ptr< SalLayout > ImplLayout(const OUString &, sal_Int32 nIndex, sal_Int32 nLen, const Point &rLogicPos=Point(0, 0), tools::Long nLogicWidth=0, const tools::Long *pLogicDXArray=nullptr, SalLayoutFlags flags=SalLayoutFlags::NONE, vcl::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
Link< LinkParamNone *, void > maMRUChangedHdl
virtual void MouseMove(const MouseEvent &rMEvt) override
void DrawEntry(vcl::RenderContext &rRenderContext, bool bLayout)
Size CalcSize(sal_Int32 nMaxLines) const
constexpr sal_uInt16 KEY_RETURN
WinBits const WB_NOBORDER
const Color & GetButtonRolloverTextColor() const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
vcl::Window * GetWindow(GetWindowType nType) const
constexpr sal_uInt16 KEY_RIGHT
#define MULTILINE_ENTRY_DRAW_FLAGS
sal_Int32 mnCurrentPos
Position (Focus)
bool mbUserDrawEnabled
UserDraw possible.
Point PixelToLogic(const Point &rDevicePt) const
VclPtr< ScrollBar > mpVScrollBar
tools::Long const nBorder
bool IsMouseMoveSelect() const
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
virtual void KeyInput(const KeyEvent &rKEvt)
const LanguageTag & getLocale()
const vcl::I18nHelper & GetLocaleI18nHelper() const
tools::Long mnMaxTxtHeight
Maximum height of a text item.
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
const vcl::KeyCode & GetKeyCode() const
tools::Long GetAddedHeight(sal_Int32 nEndIndex, sal_Int32 nBeginIndex) const
helper: add up heights up to index nEndIndex.
bool IsUserDrawEnabled() const
virtual void Resize() override
ImplEntryType * GetEntry(sal_Int32 nPos) const
bool ProcessKeyInput(const KeyEvent &rKEvt)
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
const ImplEntryType * GetEntryPtr(sal_Int32 nPos) const
bool IsEntrySelectable(sal_Int32 nPos) const
An Entry is selectable if its mnFlags does not have the ListBoxEntryFlags::DisableSelection flag set...
#define LISTBOX_MAX_ENTRIES
const Color & GetButtonTextColor() const
sal_Int32 mnItemPos
because of UserDraw I have to know which item I draw
#define SAL_WARN_IF(condition, area, stream)
const MouseEvent * GetMouseEvent() const
std::unique_ptr< vcl::ImplControlData > mpControlData
virtual void GetFocus() override
tools::Long GetEntryHeightWithMargin() const
virtual vcl::StringEntryIdentifier CurrentEntry(OUString &_out_entryText) const override
returns the current entry in the list of searchable strings.
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
sal_Int32 mnPopupModeStartSaveSelection
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator. ...
bool SelectEntries(sal_Int32 nSelect, LB_EVENT_TYPE eLET, bool bShift=false, bool bCtrl=false, bool bSelectPosChange=false)
sal_uInt16 mnSelectModifier
Modifiers.
::OutputDevice const * GetOutDev() const
tools::Long AdjustWidth(tools::Long n)
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
tools::Long mnMaxImgHeight
Maximum height of an image item.
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.
tools::Long Height() const
Reference< XComponentContext > getProcessComponentContext()
tools::Long CalcZoom(tools::Long n) const
ImplListBoxWindow(vcl::Window *pParent, WinBits nWinStyle)
bool IsGrabFocusAllowed() const
const Point & GetPosPixel() const
WinBits const WB_AUTOHSCROLL
tools::Long AdjustHeight(tools::Long n)
virtual void GetFocus() override
tools::Long GetEntryHeight(sal_Int32 nPos) const
sal_Int32 InsertEntry(sal_Int32 nPos, ImplEntryType *pNewEntry)
void setHeight(tools::Long nHeight)
virtual bool EventNotify(NotifyEvent &rNEvt) override
Event to pass information for UserDraw() handling eg. in comboboxes.
tools::Long GetDelta() const
sal_Int32 InsertEntry(sal_Int32 nPos, const OUString &rStr)
bool isSeparator(const sal_Int32 &n) const
Checks if the given number n is an element of the separator positions set.
ScXMLEditAttributeMap::Entry const aEntries[]
#define SAL_WARN(area, stream)
OUString GetSelectedEntry(sal_Int32 nIndex) const
void SetTopEntry(sal_Int32 nTop)
bool IsTrackingCanceled() const
OUString GetMRUEntries(sal_Unicode cSep) const
void SelectEntry(sal_Int32 nPos, bool bSelect)
Link< sal_Int32, void > maSelectionChangedHdl
sal_Int32 mnUserDrawEntry
virtual void FillLayoutData() const override
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
OUString GetEntryText(sal_Int32 nPos) const
constexpr sal_uInt16 KEY_LEFT
Point OutputToScreenPixel(const Point &rPos) const
void StartFloat(bool bStartTracking)
sal_Int32 GetLastVisibleEntry() const
void SetEntryData(sal_Int32 nPos, void *pNewData)
void ImplInitDropDownButton(PushButton *pButton)
sal_Int32 compare(const OUString &rLHS, const OUString &rRHS) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
void SetAccessibleRole(sal_uInt16 nRole)
bool mbInUserDraw
In UserDraw.
const MouseEvent & GetMouseEvent() const
bool IsReallyVisible() const
vcl::Font GetControlFont() const
bool mbGrabFocus
Grab focus at MBDown.
virtual vcl::StringEntryIdentifier NextEntry(vcl::StringEntryIdentifier _currentEntry, OUString &_out_entryText) const override
returns the next entry in the list.
SalLayoutGlyphs * GetTextGlyphs(const OutputDevice *pOutputDevice)
Computes maStr's text layout (glyphs), cached in maStrGlyphs.
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
const Color & GetEdgeBlendingTopLeftColor() const
void SetEdgeBlending(bool bNew)
WinBits const WB_WORDBREAK
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly...
tools::Long mnMaxHeight
Maximum height of an entry.
void ShowProminentEntry(sal_Int32 nEntryPos)
ShowProminentEntry will set the entry corresponding to nEntryPos either at top or in the middle depen...
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
sal_Int32 InsertEntry(sal_Int32 nPos, ImplEntryType *pNewEntry, bool bSort)
virtual void SetPosPixel(const Point &rNewPos)
virtual void Resize() override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
virtual void GetFocus() override
bool mbCallSelectionChangedHdl
sal_Int32 GetEntryCount() const
tools::Rectangle GetBoundingRectangle(sal_Int32 nItem) const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Link< LinkParamNone *, void > maSelectHdl
void ImplDraw(vcl::RenderContext &rRenderContext, bool bLayout=false)
bool mbTrackingSelect
Selected at a MouseMove.
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
bool mbRight
right align Text output