LibreOffice Module vcl (master)  1
dlgctrl.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 
21 #include <svdata.hxx>
22 #include <window.h>
23 
24 #include "dlgctrl.hxx"
25 #include <vcl/event.hxx>
26 #include <vcl/toolkit/fixed.hxx>
27 #include <vcl/layout.hxx>
28 #include <vcl/svapp.hxx>
29 #include <vcl/tabpage.hxx>
30 #include <vcl/tabctrl.hxx>
31 #include <vcl/toolkit/button.hxx>
32 #include <vcl/settings.hxx>
33 #include <sal/log.hxx>
35 
36 #include <com/sun/star/i18n/XCharacterClassification.hpp>
37 
38 using namespace ::com::sun::star;
39 
40 static bool ImplHasIndirectTabParent( vcl::Window* pWindow )
41 {
42  // The window has indirect tab parent if it is included in tab hierarchy
43  // of the indirect parent window
44 
45  vcl::Window* pNonLayoutParent = getNonLayoutParent(pWindow);
46  return ( pNonLayoutParent
47  && ( pNonLayoutParent->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) );
48 }
49 
51 {
52  // The method allows to find the most close parent containing all the
53  // window from the current tab-hierarchy
54  // The direct parent should be provided as a parameter here
55 
56  vcl::Window* pResult = pParent;
57 
58  if ( pResult )
59  {
60  vcl::Window* pNonLayoutParent = getNonLayoutParent(pResult);
61  while ( pNonLayoutParent && ( pResult->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) )
62  {
63  pResult = pNonLayoutParent;
64  pNonLayoutParent = getNonLayoutParent(pResult);
65  }
66  }
67 
68  return pResult;
69 }
70 
72 {
73  assert(pWindow->GetType() == WindowType::TABCONTROL);
74  const TabControl* pTabControl = static_cast<const TabControl*>(pWindow);
75  // Check if the TabPage is a Child of the TabControl and still exists (by
76  // walking all child windows); because it could be that the TabPage has been
77  // destroyed already by a Dialog-Dtor, event that the TabControl still exists.
78  const TabPage* pTempTabPage = pTabControl->GetTabPage(pTabControl->GetCurPageId());
79  if (pTempTabPage)
80  {
81  vcl::Window* pTempWindow = pTabControl->GetWindow(GetWindowType::FirstChild);
82  while (pTempWindow)
83  {
84  if (pTempWindow->ImplGetWindow() == pTempTabPage)
85  {
86  return const_cast<TabPage*>(pTempTabPage);
87  }
88  pTempWindow = nextLogicalChildOfParent(pTabControl, pTempWindow);
89  }
90  }
91 
92  return nullptr;
93 }
94 
95 static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex )
96 {
97  // ignore all windows with mpClientWindow set
98  for (vcl::Window *pNewParent = pParent->ImplGetWindow();
99  pParent != pNewParent; pParent = pNewParent);
100 
101  vcl::Window* pFoundWindow = nullptr;
102  vcl::Window* pWindow = firstLogicalChildOfParent(pParent);
103  vcl::Window* pNextWindow = pWindow;
104 
105  // process just the current page of a tab control
106  if (pWindow && pParent->GetType() == WindowType::TABCONTROL)
107  {
108  pWindow = ImplGetCurTabWindow(pParent);
109  pNextWindow = lastLogicalChildOfParent(pParent);
110  }
111 
112  while (pWindow)
113  {
114  pWindow = pWindow->ImplGetWindow();
115 
116  // skip invisible and disabled windows
117  if (isVisibleInLayout(pWindow))
118  {
119  // return the TabControl itself, before handling its page
120  if (pWindow->GetType() == WindowType::TABCONTROL)
121  {
122  if (n == nIndex)
123  return pWindow;
124  ++nIndex;
125  }
126  if (pWindow->GetStyle() & (WB_DIALOGCONTROL | WB_CHILDDLGCTRL))
127  pFoundWindow = ImplGetSubChildWindow(pWindow, n, nIndex);
128  else
129  pFoundWindow = pWindow;
130 
131  if (n == nIndex)
132  return pFoundWindow;
133  ++nIndex;
134  }
135 
136  pWindow = nextLogicalChildOfParent(pParent, pNextWindow);
137  pNextWindow = pWindow;
138  }
139 
140  --nIndex;
141  assert(!pFoundWindow || (pFoundWindow == pFoundWindow->ImplGetWindow()));
142  return pFoundWindow;
143 }
144 
145 vcl::Window* ImplGetChildWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, bool bTestEnable )
146 {
147  pParent = ImplGetTopParentOfTabHierarchy( pParent );
148 
149  nIndex = 0;
150  vcl::Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex );
151  if ( bTestEnable )
152  {
153  sal_uInt16 n2 = nIndex;
154  while ( pWindow && (!isEnabledInLayout(pWindow) || !pWindow->IsInputEnabled()) )
155  {
156  n2 = nIndex+1;
157  nIndex = 0;
158  pWindow = ImplGetSubChildWindow( pParent, n2, nIndex );
159  if ( nIndex < n2 )
160  break;
161  }
162 
163  if ( (nIndex < n2) && n )
164  {
165  do
166  {
167  n--;
168  nIndex = 0;
169  pWindow = ImplGetSubChildWindow( pParent, n, nIndex );
170  }
171  while ( pWindow && n && (!isEnabledInLayout(pWindow) || !pWindow->IsInputEnabled()) );
172  }
173  }
174  return pWindow;
175 }
176 
177 static vcl::Window* ImplGetNextWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, bool bTestEnable )
178 {
179  vcl::Window* pWindow = ImplGetChildWindow( pParent, n+1, nIndex, bTestEnable );
180  if ( n == nIndex )
181  {
182  n = 0;
183  pWindow = ImplGetChildWindow( pParent, n, nIndex, bTestEnable );
184  }
185  return pWindow;
186 }
187 
188 namespace vcl {
189 
190 static bool lcl_ToolBoxTabStop( Window* pWindow )
191 {
192  ToolBox* pToolBoxWindow = static_cast<ToolBox*>( pWindow );
193 
194  for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < pToolBoxWindow->GetItemCount(); nPos++ )
195  {
196  ToolBoxItemId nId = pToolBoxWindow->GetItemId( nPos );
197  if ( pToolBoxWindow->IsItemVisible( nId ) && pToolBoxWindow->IsItemEnabled( nId ) )
198  return true;
199  }
200 
201  return false;
202 }
203 
205  sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
206  sal_uInt16* pIndex )
207 {
208  SAL_WARN_IF( (nIndex < nFormStart) || (nIndex > nFormEnd), "vcl",
209  "Window::ImplGetDlgWindow() - nIndex not in Form" );
210 
211  vcl::Window* pWindow = nullptr;
212  sal_uInt16 i;
213  sal_uInt16 nTemp;
214  sal_uInt16 nStartIndex;
215 
216  if ( nType == GetDlgWindowType::Prev )
217  {
218  i = nIndex;
219  do
220  {
221  if ( i > nFormStart )
222  i--;
223  else
224  i = nFormEnd;
225  pWindow = ImplGetChildWindow( this, i, nTemp, true );
226  if ( !pWindow )
227  break;
228  if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) )
229  {
230  if ( WindowType::TOOLBOX == pWindow->GetType() )
231  {
232  if ( lcl_ToolBoxTabStop( pWindow ) )
233  break;
234  }
235  else
236  break;
237  }
238  }
239  while ( i != nIndex );
240  }
241  else
242  {
243  i = nIndex;
244  pWindow = ImplGetChildWindow( this, i, i, (nType == GetDlgWindowType::First) );
245  if ( pWindow )
246  {
247  nStartIndex = i;
248 
249  if ( nType == GetDlgWindowType::Next )
250  {
251  if ( i < nFormEnd )
252  {
253  pWindow = ImplGetNextWindow( this, i, i, true );
254  if ( (i > nFormEnd) || (i < nFormStart) )
255  pWindow = ImplGetChildWindow( this, nFormStart, i, true );
256  }
257  else
258  pWindow = ImplGetChildWindow( this, nFormStart, i, true );
259  }
260 
261  if (i <= nFormEnd && pWindow)
262  {
263  // carry the 2nd index, in case all controls are disabled
264  sal_uInt16 nStartIndex2 = i;
265  sal_uInt16 nOldIndex = i+1;
266 
267  do
268  {
269  if ( pWindow->GetStyle() & WB_TABSTOP )
270  {
271  if ( WindowType::TOOLBOX == pWindow->GetType() )
272  {
273  if ( lcl_ToolBoxTabStop( pWindow ) )
274  break;
275  }
276  else
277  break;
278  }
279  if( i == nOldIndex ) // only disabled controls ?
280  {
281  i = nStartIndex2;
282  break;
283  }
284  nOldIndex = i;
285  if ( (i > nFormEnd) || (i < nFormStart) )
286  pWindow = ImplGetChildWindow( this, nFormStart, i, true );
287  else
288  pWindow = ImplGetNextWindow( this, i, i, true );
289  }
290  while (i != nStartIndex && i != nStartIndex2 && pWindow);
291 
292  if ( (i == nStartIndex2) && pWindow &&
293  (!(pWindow->GetStyle() & WB_TABSTOP) || !isEnabledInLayout(pWindow)) )
294  i = nStartIndex;
295  }
296  }
297 
298  if ( nType == GetDlgWindowType::First )
299  {
300  if ( pWindow )
301  {
302  if ( pWindow->GetType() == WindowType::TABCONTROL )
303  {
305  if ( pNextWindow )
306  {
307  if ( pWindow->IsChild( pNextWindow ) )
308  pWindow = pNextWindow;
309  }
310  }
311 
312  if ( !(pWindow->GetStyle() & WB_TABSTOP) )
313  pWindow = nullptr;
314  }
315  }
316  }
317 
318  if ( pIndex )
319  *pIndex = i;
320 
321  return pWindow;
322 }
323 
324 } /* namespace vcl */
325 
326 vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, sal_uInt16& rIndex,
327  sal_uInt16& rFormStart, sal_uInt16& rFormEnd )
328 {
329  vcl::Window* pSWindow;
330  vcl::Window* pSecondWindow = nullptr;
331  vcl::Window* pTempWindow = nullptr;
332  sal_uInt16 i;
333  sal_uInt16 nSecond_i = 0;
334  sal_uInt16 nFormStart = 0;
335  sal_uInt16 nSecondFormStart = 0;
336  sal_uInt16 nFormEnd;
337 
338  // find focus window in the child list
339  vcl::Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, false );
340 
341  if( pWindow == nullptr )
342  pWindow = pSWindow;
343 
344  while ( pSWindow )
345  {
346  // the DialogControlStart mark is only accepted for the direct children
347  if ( !ImplHasIndirectTabParent( pSWindow )
348  && pSWindow->ImplGetWindow()->IsDialogControlStart() )
349  nFormStart = i;
350 
351  // SecondWindow for composite controls like ComboBoxes and arrays
352  if ( pSWindow->ImplIsWindowOrChild( pWindow ) )
353  {
354  pSecondWindow = pSWindow;
355  nSecond_i = i;
356  nSecondFormStart = nFormStart;
357  if ( pSWindow == pWindow )
358  break;
359  }
360 
361  pSWindow = ImplGetNextWindow( pParent, i, i, false );
362  if ( !i )
363  pSWindow = nullptr;
364  }
365 
366  if ( !pSWindow )
367  {
368  // Window not found; we cannot handle it
369  if ( !pSecondWindow )
370  return nullptr;
371  else
372  {
373  pSWindow = pSecondWindow;
374  i = nSecond_i;
375  nFormStart = nSecondFormStart;
376  }
377  }
378 
379  // initialize
380  rIndex = i;
381  rFormStart = nFormStart;
382 
383  // find end of template
384  sal_Int32 nIteration = 0;
385  do
386  {
387  nFormEnd = i;
388  pTempWindow = ImplGetNextWindow( pParent, i, i, false );
389 
390  // the DialogControlStart mark is only accepted for the direct children
391  if ( !i
392  || ( pTempWindow && !ImplHasIndirectTabParent( pTempWindow )
393  && pTempWindow->ImplGetWindow()->IsDialogControlStart() ) )
394  break;
395 
396  if ( pTempWindow && pTempWindow == pFirstChildWindow )
397  {
398  // It is possible to go through the begin of hierarchy once
399  // while looking for DialogControlStart mark.
400  // If it happens second time, it looks like an endless loop,
401  // that should be impossible, but just for the case...
402  nIteration++;
403  if ( nIteration >= 2 )
404  {
405  // this is an unexpected scenario
406  SAL_WARN( "vcl", "It seems to be an endless loop!" );
407  rFormStart = 0;
408  break;
409  }
410  }
411  }
412  while ( pTempWindow );
413  rFormEnd = nFormEnd;
414 
415  return pSWindow;
416 }
417 
418 vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_Unicode cCharCode,
419  sal_uInt16 nFormStart, sal_uInt16 nFormEnd, bool bCheckEnable )
420 {
421  SAL_WARN_IF( (rIndex < nFormStart) || (rIndex > nFormEnd), "vcl",
422  "Window::ImplFindAccelWindow() - rIndex not in Form" );
423 
424  sal_Unicode cCompareChar;
425  sal_uInt16 nStart = rIndex;
426  sal_uInt16 i = rIndex;
427  vcl::Window* pWindow;
428 
429  uno::Reference<i18n::XCharacterClassification> const& xCharClass(ImplGetCharClass());
430 
431  const css::lang::Locale& rLocale = Application::GetSettings().GetUILanguageTag().getLocale();
432  cCharCode = xCharClass->toUpper( OUString(cCharCode), 0, 1, rLocale )[0];
433 
434  if ( i < nFormEnd )
435  pWindow = ImplGetNextWindow( pParent, i, i, true );
436  else
437  pWindow = ImplGetChildWindow( pParent, nFormStart, i, true );
438  while( pWindow )
439  {
440  const OUString aStr = pWindow->GetText();
441  sal_Int32 nPos = aStr.indexOf( '~' );
442  while (nPos != -1)
443  {
444  cCompareChar = aStr[nPos+1];
445  cCompareChar = xCharClass->toUpper( OUString(cCompareChar), 0, 1, rLocale )[0];
446  if ( cCompareChar == cCharCode )
447  {
448  if (pWindow->GetType() == WindowType::FIXEDTEXT)
449  {
450  FixedText *pFixedText = static_cast<FixedText*>(pWindow);
451  vcl::Window *pMnemonicWidget = pFixedText->get_mnemonic_widget();
452  SAL_WARN_IF(isContainerWindow(pFixedText->GetParent()) && !pMnemonicWidget,
453  "vcl.a11y", "label missing mnemonic_widget?");
454  if (pMnemonicWidget)
455  return pMnemonicWidget;
456  }
457 
458  // skip Static-Controls
459  if ( (pWindow->GetType() == WindowType::FIXEDTEXT) ||
460  (pWindow->GetType() == WindowType::FIXEDLINE) ||
461  (pWindow->GetType() == WindowType::GROUPBOX) )
462  pWindow = pParent->ImplGetDlgWindow( i, GetDlgWindowType::Next );
463  rIndex = i;
464  return pWindow;
465  }
466  nPos = aStr.indexOf( '~', nPos+1 );
467  }
468 
469  // #i93011# it would have made sense to have this really recursive
470  // right from the start. However this would cause unpredictable side effects now
471  // so instead we have a style bit for some child windows, that want their
472  // children checked for accelerators
473  if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 )
474  {
475  sal_uInt16 nChildIndex;
476  sal_uInt16 nChildFormStart;
477  sal_uInt16 nChildFormEnd;
478 
479  // get form start and end
480  ::ImplFindDlgCtrlWindow( pWindow, nullptr,
481  nChildIndex, nChildFormStart, nChildFormEnd );
482  vcl::Window* pAccelWin = ImplFindAccelWindow( pWindow, nChildIndex, cCharCode,
483  nChildFormStart, nChildFormEnd,
484  bCheckEnable );
485  if( pAccelWin )
486  return pAccelWin;
487  }
488 
489  if ( i == nStart )
490  break;
491 
492  if ( i < nFormEnd )
493  {
494  pWindow = ImplGetNextWindow( pParent, i, i, bCheckEnable );
495  if( ! pWindow )
496  pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable );
497  }
498  else
499  pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable );
500  }
501 
502  return nullptr;
503 }
504 
505 namespace vcl {
506 
508 {
509  if (mpWindowImpl) // may be called after dispose
510  {
511  mpWindowImpl->maMnemonicActivateHdl = rLink;
512  }
513 }
514 
516 {
517  if ( nFlags & GetFocusFlags::Mnemonic )
518  {
519  if (mpWindowImpl->maMnemonicActivateHdl.Call(*this))
520  return;
521 
522  if ( GetType() == WindowType::RADIOBUTTON )
523  {
524  if ( !static_cast<RadioButton*>(this)->IsChecked() )
525  static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags );
526  else
527  ImplGrabFocus( nFlags );
528  }
529  else
530  {
531  ImplGrabFocus( nFlags );
532  if ( nFlags & GetFocusFlags::UniqueMnemonic )
533  {
534  if ( GetType() == WindowType::CHECKBOX )
535  static_cast<CheckBox*>(this)->ImplCheck();
536  else if ( mpWindowImpl->mbPushButton )
537  {
538  static_cast<PushButton*>(this)->SetPressed( true );
539  static_cast<PushButton*>(this)->SetPressed( false );
540  static_cast<PushButton*>(this)->Click();
541  }
542  }
543  }
544  }
545  else
546  {
547  if ( GetType() == WindowType::RADIOBUTTON )
548  {
549  if ( !static_cast<RadioButton*>(this)->IsChecked() )
550  static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags );
551  else
552  ImplGrabFocus( nFlags );
553  }
554  else
555  ImplGrabFocus( nFlags );
556  }
557 }
558 
559 } /* namespace vcl */
560 
561 namespace
562 {
563  bool isSuitableDestination(vcl::Window const *pWindow)
564  {
565  return (pWindow && isVisibleInLayout(pWindow) &&
566  isEnabledInLayout(pWindow) && pWindow->IsInputEnabled() &&
567  //Pure window shouldn't get window after controls such as
568  //buttons.
569  (pWindow->GetType() != WindowType::WINDOW &&
570  pWindow->GetType() != WindowType::WORKWINDOW && pWindow->GetType() != WindowType::CONTROL)
571  );
572  }
573 
574  bool focusNextInGroup(const std::vector<VclPtr<RadioButton> >::iterator& aStart, std::vector<VclPtr<RadioButton> > &rGroup)
575  {
576  std::vector<VclPtr<RadioButton> >::iterator aI(aStart);
577 
578  if (aStart != rGroup.end())
579  ++aI;
580 
581  aI = std::find_if(aI, rGroup.end(), isSuitableDestination);
582  if (aI != rGroup.end())
583  {
584  vcl::Window *pWindow = *aI;
586  return true;
587  }
588  aI = std::find_if(rGroup.begin(), aStart, isSuitableDestination);
589  if (aI != aStart)
590  {
591  vcl::Window *pWindow = *aI;
593  return true;
594  }
595  return false;
596  }
597 
598  bool nextInGroup(RadioButton *pSourceWindow, bool bBackward)
599  {
600  std::vector<VclPtr<RadioButton> > aGroup(pSourceWindow->GetRadioButtonGroup());
601 
602  if (aGroup.size() < 2) // have to have at last 2 buttons to be a useful group
603  return false;
604 
605  if (bBackward)
606  std::reverse(aGroup.begin(), aGroup.end());
607 
608  auto aStart(std::find(aGroup.begin(), aGroup.end(), VclPtr<RadioButton>(pSourceWindow)));
609 
610  assert(aStart != aGroup.end());
611 
612  return focusNextInGroup(aStart, aGroup);
613  }
614 }
615 
616 namespace vcl {
617 
618 bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
619 {
620  vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
621  sal_uInt16 nKeyCode = aKeyCode.GetCode();
622  vcl::Window* pSWindow;
623  vcl::Window* pTempWindow;
624  vcl::Window* pButtonWindow;
625  sal_uInt16 i;
626  sal_uInt16 iButton;
627  sal_uInt16 iButtonStart;
628  sal_uInt16 iTemp;
629  sal_uInt16 nIndex;
630  sal_uInt16 nFormStart;
631  sal_uInt16 nFormEnd;
632  DialogControlFlags nDlgCtrlFlags;
633 
634  // we cannot take over control without Focus-window
635  vcl::Window* pFocusWindow = Application::GetFocusWindow();
636  if ( !pFocusWindow || !ImplIsWindowOrChild( pFocusWindow ) )
637  return false;
638 
639  // find Focus-Window in the child list
640  pSWindow = ::ImplFindDlgCtrlWindow( this, pFocusWindow,
641  nIndex, nFormStart, nFormEnd );
642  if ( !pSWindow )
643  return false;
644  i = nIndex;
645 
646  nDlgCtrlFlags = DialogControlFlags::NONE;
647  pTempWindow = pSWindow;
648  do
649  {
650  nDlgCtrlFlags |= pTempWindow->GetDialogControlFlags();
651  if ( pTempWindow == this )
652  break;
653  pTempWindow = pTempWindow->ImplGetParent();
654  }
655  while ( pTempWindow );
656 
657  pButtonWindow = nullptr;
658 
659  if ( nKeyCode == KEY_RETURN )
660  {
661  // search first for a DefPushButton/CancelButton
662  pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, true );
663  iButtonStart = iButton;
664  while ( pButtonWindow )
665  {
666  if ( (pButtonWindow->GetStyle() & WB_DEFBUTTON) &&
667  pButtonWindow->mpWindowImpl->mbPushButton )
668  break;
669 
670  pButtonWindow = ImplGetNextWindow( this, iButton, iButton, true );
671  if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
672  pButtonWindow = nullptr;
673  }
674 
675  if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & DialogControlFlags::Return) )
676  {
678  GetFocusFlags nGetFocusFlags = GetFocusFlags::Tab;
679  sal_uInt16 nNewIndex;
680  sal_uInt16 iStart;
681  if ( aKeyCode.IsShift() )
682  {
683  nType = GetDlgWindowType::Prev;
684  nGetFocusFlags |= GetFocusFlags::Backward;
685  }
686  else
687  {
688  nType = GetDlgWindowType::Next;
689  nGetFocusFlags |= GetFocusFlags::Forward;
690  }
691  iStart = i;
692  pTempWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex );
693  while ( pTempWindow && (pTempWindow != pSWindow) )
694  {
695  if ( !pTempWindow->mpWindowImpl->mbPushButton )
696  {
697  // get Around-Flag
698  if ( nType == GetDlgWindowType::Prev )
699  {
700  if ( nNewIndex > iStart )
701  nGetFocusFlags |= GetFocusFlags::Around;
702  }
703  else
704  {
705  if ( nNewIndex < iStart )
706  nGetFocusFlags |= GetFocusFlags::Around;
707  }
708  pTempWindow->ImplControlFocus( nGetFocusFlags );
709  return true;
710  }
711  else
712  {
713  i = nNewIndex;
714  pTempWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex );
715  }
716  if ( (i <= iStart) || (i > nFormEnd) )
717  pTempWindow = nullptr;
718  }
719  // if this is the same window, simulate a Get/LoseFocus,
720  // in case AROUND is being processed
721  if ( pTempWindow && (pTempWindow == pSWindow) )
722  {
723  NotifyEvent aNEvt1( MouseNotifyEvent::LOSEFOCUS, pSWindow );
724  if ( !ImplCallPreNotify( aNEvt1 ) )
725  pSWindow->CompatLoseFocus();
726  pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GetFocusFlags::Around;
727  NotifyEvent aNEvt2( MouseNotifyEvent::GETFOCUS, pSWindow );
728  if ( !ImplCallPreNotify( aNEvt2 ) )
729  pSWindow->CompatGetFocus();
730  pSWindow->mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;
731  return true;
732  }
733  }
734  }
735  else if ( nKeyCode == KEY_ESCAPE )
736  {
737  // search first for a DefPushButton/CancelButton
738  pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, true );
739  iButtonStart = iButton;
740  while ( pButtonWindow )
741  {
742  if ( pButtonWindow->GetType() == WindowType::CANCELBUTTON )
743  break;
744 
745  pButtonWindow = ImplGetNextWindow( this, iButton, iButton, true );
746  if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
747  pButtonWindow = nullptr;
748  }
749 
750  if ( bKeyInput && mpWindowImpl->mpDlgCtrlDownWindow )
751  {
752  if ( mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow )
753  {
754  static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false );
755  mpWindowImpl->mpDlgCtrlDownWindow = nullptr;
756  return true;
757  }
758  }
759  }
760  else if ( bKeyInput )
761  {
762  if ( nKeyCode == KEY_TAB )
763  {
764  // do not skip Alt key, for MS Windows
765  if ( !aKeyCode.IsMod2() )
766  {
767  sal_uInt16 nNewIndex;
768  bool bForm = false;
769 
770  // for Ctrl-Tab check if we want to jump to next template
771  if ( aKeyCode.IsMod1() )
772  {
773  // search group
774  vcl::Window* pFormFirstWindow = nullptr;
775  vcl::Window* pLastFormFirstWindow = nullptr;
776  pTempWindow = ImplGetChildWindow( this, 0, iTemp, false );
777  vcl::Window* pPrevFirstFormFirstWindow = nullptr;
778  vcl::Window* pFirstFormFirstWindow = pTempWindow;
779  while ( pTempWindow )
780  {
781  if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() )
782  {
783  if ( iTemp != 0 )
784  bForm = true;
785  if ( aKeyCode.IsShift() )
786  {
787  if ( iTemp <= nIndex )
788  pFormFirstWindow = pPrevFirstFormFirstWindow;
789  pPrevFirstFormFirstWindow = pTempWindow;
790  }
791  else
792  {
793  if ( (iTemp > nIndex) && !pFormFirstWindow )
794  pFormFirstWindow = pTempWindow;
795  }
796  pLastFormFirstWindow = pTempWindow;
797  }
798 
799  pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, false );
800  if ( !iTemp )
801  pTempWindow = nullptr;
802  }
803 
804  if ( bForm )
805  {
806  if ( !pFormFirstWindow )
807  {
808  if ( aKeyCode.IsShift() )
809  pFormFirstWindow = pLastFormFirstWindow;
810  else
811  pFormFirstWindow = pFirstFormFirstWindow;
812  }
813 
814  sal_uInt16 nFoundFormStart = 0;
815  sal_uInt16 nFoundFormEnd = 0;
816  sal_uInt16 nTempIndex = 0;
817  if ( ::ImplFindDlgCtrlWindow( this, pFormFirstWindow, nTempIndex,
818  nFoundFormStart, nFoundFormEnd ) )
819  {
820  nTempIndex = nFoundFormStart;
821  pFormFirstWindow = ImplGetDlgWindow( nTempIndex, GetDlgWindowType::First, nFoundFormStart, nFoundFormEnd );
822  if ( pFormFirstWindow )
823  {
824  pFormFirstWindow->ImplControlFocus();
825  return true;
826  }
827  }
828  }
829  }
830 
831  if ( !bForm )
832  {
833  // Only use Ctrl-TAB if it was allowed for the whole
834  // dialog or for the current control (#103667#)
835  if (!aKeyCode.IsMod1() || (pSWindow->GetStyle() & WB_NODIALOGCONTROL))
836  {
838  GetFocusFlags nGetFocusFlags = GetFocusFlags::Tab;
839  if ( aKeyCode.IsShift() )
840  {
841  nType = GetDlgWindowType::Prev;
842  nGetFocusFlags |= GetFocusFlags::Backward;
843  }
844  else
845  {
846  nType = GetDlgWindowType::Next;
847  nGetFocusFlags |= GetFocusFlags::Forward;
848  }
849  vcl::Window* pWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex );
850  // if this is the same window, simulate a Get/LoseFocus,
851  // in case AROUND is being processed
852  if ( pWindow == pSWindow )
853  {
854  NotifyEvent aNEvt1( MouseNotifyEvent::LOSEFOCUS, pSWindow );
855  if ( !ImplCallPreNotify( aNEvt1 ) )
856  pSWindow->CompatLoseFocus();
857  pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GetFocusFlags::Around;
858  NotifyEvent aNEvt2( MouseNotifyEvent::GETFOCUS, pSWindow );
859  if ( !ImplCallPreNotify( aNEvt2 ) )
860  pSWindow->CompatGetFocus();
861  pSWindow->mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;
862  return true;
863  }
864  else if ( pWindow )
865  {
866  // get Around-Flag
867  if ( nType == GetDlgWindowType::Prev )
868  {
869  if ( nNewIndex > i )
870  nGetFocusFlags |= GetFocusFlags::Around;
871  }
872  else
873  {
874  if ( nNewIndex < i )
875  nGetFocusFlags |= GetFocusFlags::Around;
876  }
877  pWindow->ImplControlFocus( nGetFocusFlags );
878  return true;
879  }
880  }
881  }
882  }
883  }
884  else if ( (nKeyCode == KEY_LEFT) || (nKeyCode == KEY_UP) )
885  {
886  if (pSWindow->GetType() == WindowType::RADIOBUTTON)
887  return nextInGroup(static_cast<RadioButton*>(pSWindow), true);
888  else
889  {
890  WinBits nStyle = pSWindow->GetStyle();
891  if ( !(nStyle & WB_GROUP) )
892  {
893  vcl::Window* pWindow = prevLogicalChildOfParent(this, pSWindow);
894  while ( pWindow )
895  {
896  pWindow = pWindow->ImplGetWindow();
897 
898  nStyle = pWindow->GetStyle();
899 
900  if (isSuitableDestination(pWindow))
901  {
902  if ( pWindow != pSWindow )
904  return true;
905  }
906 
907  if ( nStyle & WB_GROUP )
908  break;
909 
910  pWindow = prevLogicalChildOfParent(this, pWindow);
911  }
912  }
913  }
914  }
915  else if ( (nKeyCode == KEY_RIGHT) || (nKeyCode == KEY_DOWN) )
916  {
917  if (pSWindow->GetType() == WindowType::RADIOBUTTON)
918  return nextInGroup(static_cast<RadioButton*>(pSWindow), false);
919  else
920  {
921  vcl::Window* pWindow = nextLogicalChildOfParent(this, pSWindow);
922  while ( pWindow )
923  {
924  pWindow = pWindow->ImplGetWindow();
925 
926  WinBits nStyle = pWindow->GetStyle();
927 
928  if ( nStyle & WB_GROUP )
929  break;
930 
931  if (isSuitableDestination(pWindow))
932  {
934  return true;
935  }
936 
937  pWindow = nextLogicalChildOfParent(this, pWindow);
938  }
939  }
940  }
941  else
942  {
943  sal_Unicode c = rKEvt.GetCharCode();
944  if ( c )
945  {
946  pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd );
947  if ( pSWindow )
948  {
949  GetFocusFlags nGetFocusFlags = GetFocusFlags::Mnemonic;
950  if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) )
951  nGetFocusFlags |= GetFocusFlags::UniqueMnemonic;
952  pSWindow->ImplControlFocus( nGetFocusFlags );
953  return true;
954  }
955  }
956  }
957  }
958 
959  if (isSuitableDestination(pButtonWindow))
960  {
961  if ( bKeyInput )
962  {
963  if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow) )
964  {
965  static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false );
966  mpWindowImpl->mpDlgCtrlDownWindow = nullptr;
967  }
968 
969  static_cast<PushButton*>(pButtonWindow)->SetPressed( true );
970  mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow;
971  }
972  else if ( mpWindowImpl->mpDlgCtrlDownWindow.get() == pButtonWindow )
973  {
974  mpWindowImpl->mpDlgCtrlDownWindow = nullptr;
975  static_cast<PushButton*>(pButtonWindow)->SetPressed( false );
976  static_cast<PushButton*>(pButtonWindow)->Click();
977  }
978 
979  return true;
980  }
981 
982  return false;
983 }
984 
985 // checks if this window has dialog control
987 {
988  vcl::Window* pDlgCtrlParent;
989 
990  // lookup window for dialog control
991  pDlgCtrlParent = ImplGetParent();
992  while ( pDlgCtrlParent &&
993  !pDlgCtrlParent->ImplIsOverlapWindow() &&
994  ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
995  pDlgCtrlParent = pDlgCtrlParent->ImplGetParent();
996 
997  return pDlgCtrlParent && ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL);
998 }
999 
1001 {
1002  vcl::Window* pDlgCtrlParent;
1003  vcl::Window* pDlgCtrl;
1004  vcl::Window* pSWindow;
1005  sal_uInt16 nIndex;
1006  sal_uInt16 nFormStart;
1007  sal_uInt16 nFormEnd;
1008 
1009  // lookup window for dialog control
1010  pDlgCtrl = this;
1011  pDlgCtrlParent = ImplGetParent();
1012  while ( pDlgCtrlParent &&
1013  !pDlgCtrlParent->ImplIsOverlapWindow() &&
1014  ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
1015  pDlgCtrlParent = pDlgCtrlParent->ImplGetParent();
1016 
1017  if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
1018  return;
1019 
1020  // lookup window in child list
1021  pSWindow = ::ImplFindDlgCtrlWindow( pDlgCtrlParent, pDlgCtrl,
1022  nIndex, nFormStart, nFormEnd );
1023  if ( !pSWindow )
1024  return;
1025 
1026  vcl::Window* pWindow = pDlgCtrlParent->ImplGetDlgWindow( nIndex, GetDlgWindowType::Next, nFormStart, nFormEnd );
1027  if ( pWindow && (pWindow != pSWindow) )
1028  pWindow->ImplControlFocus();
1029 }
1030 
1031 static void ImplDlgCtrlUpdateDefButton( vcl::Window* pParent, vcl::Window* pFocusWindow,
1032  bool bGetFocus )
1033 {
1034  PushButton* pOldDefButton = nullptr;
1035  PushButton* pNewDefButton = nullptr;
1036  vcl::Window* pSWindow;
1037  sal_uInt16 i;
1038  sal_uInt16 nFormStart;
1039  sal_uInt16 nFormEnd;
1040 
1041  // find template
1042  pSWindow = ::ImplFindDlgCtrlWindow( pParent, pFocusWindow, i, nFormStart, nFormEnd );
1043  if ( !pSWindow )
1044  {
1045  nFormStart = 0;
1046  nFormEnd = 0xFFFF;
1047  }
1048 
1049  pSWindow = ImplGetChildWindow( pParent, nFormStart, i, false );
1050  while ( pSWindow )
1051  {
1052  if ( pSWindow->ImplIsPushButton() )
1053  {
1054  PushButton* pPushButton = static_cast<PushButton*>(pSWindow);
1055  if ( pPushButton->ImplIsDefButton() )
1056  pOldDefButton = pPushButton;
1057  if ( pPushButton->HasChildPathFocus() )
1058  pNewDefButton = pPushButton;
1059  else if ( !pNewDefButton && (pPushButton->GetStyle() & WB_DEFBUTTON) )
1060  pNewDefButton = pPushButton;
1061  }
1062 
1063  pSWindow = ImplGetNextWindow( pParent, i, i, false );
1064  if ( !i || (i > nFormEnd) )
1065  pSWindow = nullptr;
1066  }
1067 
1068  if ( !bGetFocus )
1069  {
1070  sal_uInt16 nDummy;
1071  vcl::Window* pNewFocusWindow = Application::GetFocusWindow();
1072  if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) )
1073  pNewDefButton = nullptr;
1074  else if ( !::ImplFindDlgCtrlWindow( pParent, pNewFocusWindow, i, nDummy, nDummy ) ||
1075  (i < nFormStart) || (i > nFormEnd) )
1076  pNewDefButton = nullptr;
1077  }
1078 
1079  if ( pOldDefButton != pNewDefButton )
1080  {
1081  if ( pOldDefButton )
1082  pOldDefButton->ImplSetDefButton( false );
1083  if ( pNewDefButton )
1084  pNewDefButton->ImplSetDefButton( true );
1085  }
1086 }
1087 
1088 void Window::ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus )
1089 {
1090  if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus )
1091  {
1092  static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false );
1093  mpWindowImpl->mpDlgCtrlDownWindow = nullptr;
1094  }
1095 
1096  ImplDlgCtrlUpdateDefButton( this, pWindow, bGetFocus );
1097 }
1098 
1100 {
1101  sal_uInt16 nIndex;
1102  sal_uInt16 nFormStart;
1103  sal_uInt16 nFormEnd;
1104 
1105  // find Focus-Window in the Child-List and return
1106  return ::ImplFindDlgCtrlWindow( this, pWindow, nIndex, nFormStart, nFormEnd );
1107 }
1108 
1110 {
1111  KeyEvent aKeyEvent;
1112 
1113  sal_Unicode nAccel = getAccel( GetText() );
1114  if( ! nAccel )
1115  {
1117  if( pWindow )
1118  nAccel = getAccel( pWindow->GetText() );
1119  }
1120  if( nAccel )
1121  {
1122  sal_uInt16 nCode = 0;
1123  if( nAccel >= 'a' && nAccel <= 'z' )
1124  nCode = KEY_A + (nAccel-'a');
1125  else if( nAccel >= 'A' && nAccel <= 'Z' )
1126  nCode = KEY_A + (nAccel-'A');
1127  else if( nAccel >= '0' && nAccel <= '9' )
1128  nCode = KEY_0 + (nAccel-'0');
1129  else if( nAccel == '.' )
1130  nCode = KEY_POINT;
1131  else if( nAccel == '-' )
1132  nCode = KEY_SUBTRACT;
1133  vcl::KeyCode aKeyCode( nCode, false, false, true, false );
1134  aKeyEvent = KeyEvent( nAccel, aKeyCode );
1135  }
1136  return aKeyEvent;
1137 }
1138 
1139 } /* namespace vcl */
1140 
1141 sal_Unicode getAccel( const OUString& rStr )
1142 {
1143  sal_Unicode nChar = 0;
1144  sal_Int32 nPos = 0;
1145  do
1146  {
1147  nPos = rStr.indexOf( '~', nPos );
1148  if( nPos != -1 && nPos < rStr.getLength() )
1149  nChar = rStr[ ++nPos ];
1150  else
1151  nChar = 0;
1152  } while( nChar == '~' );
1153  return nChar;
1154 }
1155 
1156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsInputEnabled() const
Definition: window2.cxx:1121
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:824
sal_Int32 nIndex
bool isVisibleInLayout(const vcl::Window *pWindow)
Definition: layout.cxx:2873
vcl::Window * lastLogicalChildOfParent(const vcl::Window *pTopLevel)
Definition: dialog.cxx:196
bool ImplCallPreNotify(NotifyEvent &rEvt)
Definition: winproc.cxx:63
static vcl::Window * ImplGetNextWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex, bool bTestEnable)
Definition: dlgctrl.cxx:177
SAL_DLLPRIVATE void CompatLoseFocus()
Definition: window.cxx:3873
const LanguageTag & GetUILanguageTag() const
SAL_DLLPRIVATE void ImplSetDefButton(bool bSet)
Definition: button.cxx:1125
WinBits const WB_NODIALOGCONTROL
static void ImplDlgCtrlUpdateDefButton(vcl::Window *pParent, vcl::Window *pFocusWindow, bool bGetFocus)
Definition: dlgctrl.cxx:1031
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:733
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
constexpr sal_uInt16 KEY_0
Definition: keycodes.hxx:45
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
Definition: mouse.cxx:194
sal_Int16 nId
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
KeyEvent GetActivationKey() const
Definition: dlgctrl.cxx:1109
GetDlgWindowType
Definition: window.hxx:368
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:2994
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
DialogControlFlags GetDialogControlFlags() const
Definition: window2.cxx:1051
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:920
SAL_DLLPRIVATE vcl::Window * ImplFindDlgCtrlWindow(vcl::Window *pWindow)
Definition: dlgctrl.cxx:1099
static bool lcl_ToolBoxTabStop(Window *pWindow)
Definition: dlgctrl.cxx:190
sal_Int64 WinBits
sal_uInt16 sal_Unicode
int n2
WinBits const WB_DEFBUTTON
SAL_DLLPRIVATE void CompatGetFocus()
Definition: window.cxx:3865
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
Definition: dialog.cxx:132
virtual OUString GetText() const
Definition: window.cxx:3045
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
Definition: dlgctrl.cxx:515
sal_uInt16 nCode
bool IsItemEnabled(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1265
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
Definition: dlgctrl.cxx:204
GetFocusFlags
Definition: window.hxx:311
bool isContainerWindow(const vcl::Window &rWindow)
Definition: layout.hxx:815
static bool ImplHasIndirectTabParent(vcl::Window *pWindow)
Definition: dlgctrl.cxx:40
DialogControlFlags
Definition: window.hxx:331
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
Definition: dialog.cxx:188
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
vcl::Window * ImplGetChildWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex, bool bTestEnable)
Definition: dlgctrl.cxx:145
WinBits const WB_DIALOGCONTROL
SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged(vcl::Window *pWindow, bool bGetFocus)
Definition: dlgctrl.cxx:1088
bool IsChild(const vcl::Window *pWindow) const
Definition: stacking.cxx:1106
SAL_DLLPRIVATE bool ImplDlgCtrl(const KeyEvent &rKEvt, bool bKeyInput)
Definition: dlgctrl.cxx:618
bool isEnabledInLayout(const vcl::Window *pWindow)
Definition: layout.cxx:2886
int i
static vcl::Window * ImplGetTopParentOfTabHierarchy(vcl::Window *pParent)
Definition: dlgctrl.cxx:50
WinBits const WB_CHILDDLGCTRL
std::vector< VclPtr< RadioButton > > GetRadioButtonGroup(bool bIncludeThis=true) const
GetRadioButtonGroup returns a list of pointers to RadioButtons in the same group. ...
Definition: button.cxx:2232
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:483
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:854
SAL_DLLPRIVATE bool ImplIsPushButton() const
Definition: window2.cxx:915
vcl::Window * ImplFindAccelWindow(vcl::Window *pParent, sal_uInt16 &rIndex, sal_Unicode cCharCode, sal_uInt16 nFormStart, sal_uInt16 nFormEnd, bool bCheckEnable)
Definition: dlgctrl.cxx:418
vcl::Window * GetParent() const
Definition: window2.cxx:1091
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1035
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
SAL_DLLPRIVATE void ImplDlgCtrlNextWindow()
Definition: dlgctrl.cxx:1000
SAL_DLLPRIVATE bool ImplHasDlgCtrl() const
Definition: dlgctrl.cxx:986
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
static vcl::Window * GetFocusWindow()
Get the currently focused window.
Definition: svapp.cxx:1064
bool IsShift() const
Definition: keycod.hxx:54
vcl::Window * ImplFindDlgCtrlWindow(vcl::Window *pParent, vcl::Window *pWindow, sal_uInt16 &rIndex, sal_uInt16 &rFormStart, sal_uInt16 &rFormEnd)
Definition: dlgctrl.cxx:326
constexpr sal_uInt16 KEY_SUBTRACT
Definition: keycodes.hxx:128
uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass()
Definition: field2.cxx:60
vcl::Window * prevLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
Definition: dialog.cxx:160
SAL_DLLPRIVATE bool ImplIsDefButton() const
Definition: button.cxx:1182
#define SAL_WARN_IF(condition, area, stream)
constexpr sal_uInt16 KEY_ESCAPE
Definition: keycodes.hxx:120
bool IsDialogControlStart() const
Definition: window2.cxx:1041
sal_Unicode getAccel(const OUString &rStr)
Definition: dlgctrl.cxx:1141
sal_Unicode GetCharCode() const
Definition: event.hxx:56
bool IsMod1() const
Definition: keycod.hxx:56
static vcl::Window * ImplGetSubChildWindow(vcl::Window *pParent, sal_uInt16 n, sal_uInt16 &nIndex)
Definition: dlgctrl.cxx:95
QPRO_FUNC_TYPE nType
vcl::Window * get_mnemonic_widget() const
Definition: fixed.hxx:76
SAL_DLLPRIVATE bool ImplIsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
Definition: stacking.cxx:699
WinBits const WB_TABSTOP
vcl::Window * getNonLayoutParent(vcl::Window *pWindow)
Definition: layout.cxx:2862
constexpr sal_uInt16 KEY_POINT
Definition: keycodes.hxx:131
WindowType GetType() const
Definition: window2.cxx:968
#define SAL_WARN(area, stream)
static vcl::Window * ImplGetCurTabWindow(const vcl::Window *pWindow)
Definition: dlgctrl.cxx:71
WinBits GetStyle() const
Definition: window2.cxx:947
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
bool IsItemVisible(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1301
WinBits const WB_GROUP
ToolBoxItemId GetItemId(ImplToolItems::size_type nPos) const
Definition: toolbox2.cxx:743
vcl::Window * GetAccessibleRelationLabeledBy() const
void SetMnemonicActivateHdl(const Link< vcl::Window &, bool > &rLink)
Definition: dlgctrl.cxx:507
aStr
ImplToolItems::size_type GetItemCount() const
Definition: toolbox2.cxx:709
sal_uInt16 nPos
constexpr sal_uInt16 KEY_TAB
Definition: keycodes.hxx:121
bool IsMod2() const
Definition: keycod.hxx:58