37#include <com/sun/star/i18n/XCharacterClassification.hpp>
47 return ( pNonLayoutParent
64 pResult = pNonLayoutParent;
87 return const_cast<TabPage*
>(pTempTabPage);
100 pParent != pNewParent; pParent = pNewParent);
130 pFoundWindow = pWindow;
138 pNextWindow = pWindow;
142 assert(!pFoundWindow || (pFoundWindow == pFoundWindow->
ImplGetWindow()));
206 sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
210 "Window::ImplGetDlgWindow() - nIndex not in Form" );
215 sal_uInt16 nStartIndex;
222 if (
i > nFormStart )
255 if ( (
i > nFormEnd) || (
i < nFormStart) )
262 if (
i <= nFormEnd && pWindow)
265 sal_uInt16 nStartIndex2 =
i;
266 sal_uInt16 nOldIndex =
i+1;
286 if ( (
i > nFormEnd) || (
i < nFormStart) )
291 while (
i != nStartIndex &&
i != nStartIndex2 && pWindow);
293 if ( (
i == nStartIndex2) && pWindow &&
308 if ( pWindow->
IsChild( pNextWindow ) )
309 pWindow = pNextWindow;
328 sal_uInt16& rFormStart, sal_uInt16& rFormEnd )
334 sal_uInt16 nSecond_i = 0;
335 sal_uInt16 nFormStart = 0;
336 sal_uInt16 nSecondFormStart = 0;
342 if( pWindow ==
nullptr )
355 pSecondWindow = pSWindow;
357 nSecondFormStart = nFormStart;
358 if ( pSWindow == pWindow )
370 if ( !pSecondWindow )
374 pSWindow = pSecondWindow;
376 nFormStart = nSecondFormStart;
382 rFormStart = nFormStart;
385 sal_Int32 nIteration = 0;
397 if ( pTempWindow && pTempWindow == pFirstChildWindow )
404 if ( nIteration >= 2 )
407 SAL_WARN(
"vcl",
"It seems to be an endless loop!" );
413 while ( pTempWindow );
420 sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
bool bCheckEnable )
422 SAL_WARN_IF( (rIndex < nFormStart) || (rIndex > nFormEnd),
"vcl",
423 "Window::ImplFindAccelWindow() - rIndex not in Form" );
426 sal_uInt16 nStart = rIndex;
427 sal_uInt16
i = rIndex;
430 uno::Reference<i18n::XCharacterClassification>
const& xCharClass(
ImplGetCharClass());
433 cCharCode = xCharClass->toUpper( OUString(cCharCode), 0, 1, rLocale )[0];
442 sal_Int32
nPos =
aStr.indexOf(
'~' );
446 cCompareChar = xCharClass->toUpper( OUString(cCompareChar), 0, 1, rLocale )[0];
447 if ( cCompareChar == cCharCode )
454 "vcl.a11y",
"label missing mnemonic_widget?");
456 return pMnemonicWidget;
476 sal_uInt16 nChildIndex;
477 sal_uInt16 nChildFormStart;
478 sal_uInt16 nChildFormEnd;
482 nChildIndex, nChildFormStart, nChildFormEnd );
484 nChildFormStart, nChildFormEnd,
527 if (bUniqueMnemonic && !
static_cast<RadioButton*
>(
this)->IsChecked())
528 static_cast<RadioButton*
>(
this)->ImplCallClick(
true, nFlags );
538 static_cast<CheckBox*
>(
this)->ImplCheck();
541 static_cast<PushButton*
>(
this)->SetPressed(
true );
542 static_cast<PushButton*
>(
this)->SetPressed(
false );
566 bool isSuitableDestination(
vcl::Window const *pWindow)
579 std::vector<VclPtr<RadioButton> >::iterator aI(aStart);
581 if (aStart != rGroup.end())
584 aI = std::find_if(aI, rGroup.end(), isSuitableDestination);
585 if (aI != rGroup.end())
591 aI = std::find_if(rGroup.begin(), aStart, isSuitableDestination);
601 bool nextInGroup(
RadioButton *pSourceWindow,
bool bBackward)
605 if (aGroup.size() < 2)
609 std::reverse(aGroup.begin(), aGroup.end());
613 assert(aStart != aGroup.end());
615 return focusNextInGroup(aStart, aGroup);
624 sal_uInt16 nKeyCode = aKeyCode.
GetCode();
630 sal_uInt16 iButtonStart;
633 sal_uInt16 nFormStart;
644 nIndex, nFormStart, nFormEnd );
650 pTempWindow = pSWindow;
654 if ( pTempWindow ==
this )
658 while ( pTempWindow );
660 pButtonWindow =
nullptr;
666 iButtonStart = iButton;
667 while ( pButtonWindow )
674 if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
675 pButtonWindow =
nullptr;
682 sal_uInt16 nNewIndex;
696 while ( pTempWindow && (pTempWindow != pSWindow) )
703 if ( nNewIndex > iStart )
708 if ( nNewIndex < iStart )
719 if ( (
i <= iStart) || (
i > nFormEnd) )
720 pTempWindow =
nullptr;
724 if ( pTempWindow && (pTempWindow == pSWindow) )
742 iButtonStart = iButton;
743 while ( pButtonWindow )
749 if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
750 pButtonWindow =
nullptr;
755 if (
mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow )
763 else if ( bKeyInput )
770 sal_uInt16 nNewIndex;
782 while ( pTempWindow )
791 pFormFirstWindow = pPrevFirstFormFirstWindow;
792 pPrevFirstFormFirstWindow = pTempWindow;
796 if ( (iTemp >
nIndex) && !pFormFirstWindow )
797 pFormFirstWindow = pTempWindow;
799 pLastFormFirstWindow = pTempWindow;
804 pTempWindow =
nullptr;
809 if ( !pFormFirstWindow )
812 pFormFirstWindow = pLastFormFirstWindow;
814 pFormFirstWindow = pFirstFormFirstWindow;
817 sal_uInt16 nFoundFormStart = 0;
818 sal_uInt16 nFoundFormEnd = 0;
819 sal_uInt16 nTempIndex = 0;
821 nFoundFormStart, nFoundFormEnd ) )
823 nTempIndex = nFoundFormStart;
825 if ( pFormFirstWindow )
855 if ( pWindow == pSWindow )
890 return nextInGroup(
static_cast<RadioButton*
>(pSWindow),
true);
903 if (isSuitableDestination(pWindow))
905 if ( pWindow != pSWindow )
921 return nextInGroup(
static_cast<RadioButton*
>(pSWindow),
false);
934 if (isSuitableDestination(pWindow))
944 else if (aKeyCode.
IsMod2())
962 if (isSuitableDestination(pButtonWindow))
972 static_cast<PushButton*
>(pButtonWindow)->SetPressed(
true );
975 else if (
mpWindowImpl->mpDlgCtrlDownWindow.get() == pButtonWindow )
978 static_cast<PushButton*
>(pButtonWindow)->SetPressed(
false );
979 static_cast<PushButton*
>(pButtonWindow)->Click();
995 while ( pDlgCtrlParent &&
1009 sal_uInt16 nFormStart;
1010 sal_uInt16 nFormEnd;
1015 while ( pDlgCtrlParent &&
1025 nIndex, nFormStart, nFormEnd );
1030 if ( pWindow && (pWindow != pSWindow) )
1041 sal_uInt16 nFormStart;
1042 sal_uInt16 nFormEnd;
1059 pOldDefButton = pPushButton;
1061 pNewDefButton = pPushButton;
1063 pNewDefButton = pPushButton;
1067 if ( !
i || (
i > nFormEnd) )
1076 pNewDefButton =
nullptr;
1078 (
i < nFormStart) || (
i > nFormEnd) )
1079 pNewDefButton =
nullptr;
1082 if ( pOldDefButton != pNewDefButton )
1084 if ( pOldDefButton )
1086 if ( pNewDefButton )
1105 sal_uInt16 nFormStart;
1106 sal_uInt16 nFormEnd;
1125 sal_uInt16 nCode = 0;
1126 if( nAccel >=
'a' && nAccel <=
'z' )
1127 nCode =
KEY_A + (nAccel-
'a');
1128 else if( nAccel >=
'A' && nAccel <=
'Z' )
1129 nCode =
KEY_A + (nAccel-
'A');
1130 else if( nAccel >=
'0' && nAccel <=
'9' )
1131 nCode =
KEY_0 + (nAccel-
'0');
1132 else if( nAccel ==
'.' )
1134 else if( nAccel ==
'-' )
1136 vcl::KeyCode aKeyCode( nCode,
false,
false,
true,
false );
1137 aKeyEvent =
KeyEvent( nAccel, aKeyCode );
1151 if(
nPos != std::u16string_view::npos &&
nPos < rStr.size() )
1152 nChar = rStr[ ++
nPos ];
1155 }
while( nChar ==
'~' );
const LanguageTag & GetUILanguageTag() const
static const AllSettings & GetSettings()
Gets the application's settings.
static vcl::Window * GetFocusWindow()
Get the currently focused window.
vcl::Window * get_mnemonic_widget() const
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
TabPage * GetTabPage(sal_uInt16 nPageId) const
sal_uInt16 GetCurPageId() const
sal_uInt16 GetCode() const
SAL_DLLPRIVATE vcl::Window * ImplFindDlgCtrlWindow(vcl::Window *pWindow)
SAL_DLLPRIVATE bool ImplIsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
vcl::Window * GetParent() const
void SetMnemonicActivateHdl(const Link< vcl::Window &, bool > &rLink)
SAL_DLLPRIVATE bool ImplIsPushButton() const
bool IsInputEnabled() const
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
bool HasChildPathFocus(bool bSystemWindow=false) const
bool IsChild(const vcl::Window *pWindow) const
WindowType GetType() const
SAL_DLLPRIVATE bool ImplDlgCtrl(const KeyEvent &rKEvt, bool bKeyInput)
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
vcl::Window * GetWindow(GetWindowType nType) const
bool IsDialogControlStart() const
vcl::Window * GetAccessibleRelationLabeledBy() const
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged(vcl::Window *pWindow, bool bGetFocus)
SAL_DLLPRIVATE void CompatLoseFocus()
std::unique_ptr< WindowImpl > mpWindowImpl
SAL_DLLPRIVATE bool ImplHasDlgCtrl() const
SAL_DLLPRIVATE void ImplDlgCtrlNextWindow()
DialogControlFlags GetDialogControlFlags() const
KeyEvent GetActivationKey() const
virtual OUString GetText() const
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
SAL_DLLPRIVATE void CompatGetFocus()
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
vcl::Window * lastLogicalChildOfParent(const vcl::Window *pTopLevel)
vcl::Window * prevLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
static vcl::Window * ImplGetNextWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex, bool bTestEnable)
static bool ImplHasIndirectTabParent(vcl::Window *pWindow)
static vcl::Window * ImplGetCurTabWindow(const vcl::Window *pWindow)
vcl::Window * ImplFindAccelWindow(vcl::Window *pParent, sal_uInt16 &rIndex, sal_Unicode cCharCode, sal_uInt16 nFormStart, sal_uInt16 nFormEnd, bool bCheckEnable)
sal_Unicode getAccel(std::u16string_view rStr)
static vcl::Window * ImplGetSubChildWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex)
vcl::Window * ImplGetChildWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex, bool bTestEnable)
static vcl::Window * ImplGetTopParentOfTabHierarchy(vcl::Window *pParent)
vcl::Window * ImplFindDlgCtrlWindow(vcl::Window *pParent, vcl::Window *pWindow, sal_uInt16 &rIndex, sal_uInt16 &rFormStart, sal_uInt16 &rFormEnd)
uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass()
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_0
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_POINT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SUBTRACT
vcl::Window * getNonLayoutParent(vcl::Window *pWindow)
bool isEnabledInLayout(const vcl::Window *pWindow)
bool isVisibleInLayout(const vcl::Window *pWindow)
bool isContainerWindow(const vcl::Window &rWindow)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
static bool lcl_ToolBoxTabStop(Window *pWindow)
static void ImplDlgCtrlUpdateDefButton(vcl::Window *pParent, vcl::Window *pFocusWindow, bool bGetFocus)
bool ImplCallPreNotify(NotifyEvent &rEvt)
WinBits const WB_DIALOGCONTROL
WinBits const WB_CHILDDLGCTRL
WinBits const WB_DEFBUTTON
WinBits const WB_NODIALOGCONTROL