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