KiCad PCB EDA Suite
dialog_shim.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5  * Copyright (C) 2012-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <dialog_shim.h>
26 #include <ignore.h>
27 #include <kiway_player.h>
28 #include <pgm_base.h>
29 #include <tool/tool_manager.h>
30 #include <kiplatform/ui.h>
31 
32 #include <wx/display.h>
33 #include <wx/evtloop.h>
34 #include <wx/app.h>
35 #include <wx/event.h>
36 #include <wx/grid.h>
37 #include <wx/bmpbuttn.h>
38 #include <wx/textctrl.h>
39 #include <wx/stc/stc.h>
40 
41 #include <algorithm>
42 
45 {
46  wxWindow* m_win;
47 
48 public:
49 
50  WDO_ENABLE_DISABLE( wxWindow* aWindow ) :
51  m_win( aWindow )
52  {
53  if( m_win )
54  m_win->Disable();
55  }
56 
58  {
59  if( m_win )
60  {
61  m_win->Enable();
62  m_win->SetFocus(); // let's focus back on the parent window
63  }
64  }
65 };
66 
67 
68 BEGIN_EVENT_TABLE( DIALOG_SHIM, wxDialog )
69  // If dialog has a grid and the grid has an active cell editor
70  // Esc key closes cell editor, otherwise Esc key closes the dialog.
71  EVT_GRID_EDITOR_SHOWN( DIALOG_SHIM::OnGridEditorShown )
72  EVT_GRID_EDITOR_HIDDEN( DIALOG_SHIM::OnGridEditorHidden )
73  EVT_CHAR_HOOK( DIALOG_SHIM::OnCharHook )
74 END_EVENT_TABLE()
75 
76 
77 DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& title,
78  const wxPoint& pos, const wxSize& size, long style,
79  const wxString& name ) :
80  wxDialog( aParent, id, title, pos, size, style, name ),
81  KIWAY_HOLDER( nullptr, KIWAY_HOLDER::DIALOG ),
82  m_units( EDA_UNITS::MILLIMETRES ),
83  m_useCalculatedSize( false ),
84  m_firstPaintEvent( true ),
85  m_initialFocusTarget( nullptr ),
86  m_qmodal_loop( nullptr ),
87  m_qmodal_showing( false ),
88  m_qmodal_parent_disabler( nullptr ),
89  m_parentFrame( nullptr )
90 {
91  KIWAY_HOLDER* kiwayHolder = nullptr;
92  m_initialSize = size;
93 
94  if( aParent )
95  {
96  kiwayHolder = dynamic_cast<KIWAY_HOLDER*>( aParent );
97 
98  while( !kiwayHolder && aParent->GetParent() )
99  {
100  aParent = aParent->GetParent();
101  kiwayHolder = dynamic_cast<KIWAY_HOLDER*>( aParent );
102  }
103  }
104 
105  // Inherit units from parent
106  if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
107  m_units = static_cast<EDA_BASE_FRAME*>( kiwayHolder )->GetUserUnits();
108  else if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::DIALOG )
109  m_units = static_cast<DIALOG_SHIM*>( kiwayHolder )->GetUserUnits();
110 
111  // Don't mouse-warp after a dialog run from the context menu
112  if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
113  {
114  m_parentFrame = static_cast<EDA_BASE_FRAME*>( kiwayHolder );
115  TOOL_MANAGER* toolMgr = m_parentFrame->GetToolManager();
116 
117  if( toolMgr && toolMgr->IsContextMenuActive() )
118  toolMgr->VetoContextMenuMouseWarp();
119  }
120 
121  // Set up the message bus
122  if( kiwayHolder )
123  SetKiway( this, &kiwayHolder->Kiway() );
124 
125  Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this );
126  Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
127 
128 #ifdef __WINDOWS__
129  // On Windows, the app top windows can be brought to the foreground (at least temporarily)
130  // in certain circumstances such as when calling an external tool in Eeschema BOM generation.
131  // So set the parent frame (if exists) to top window to avoid this annoying behavior.
132  if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
133  Pgm().App().SetTopWindow( (EDA_BASE_FRAME*) kiwayHolder );
134 #endif
135 
136  Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_SHIM::OnPaint ) );
137 }
138 
139 
141 {
142  // if the dialog is quasi-modal, this will end its event loop
143  if( IsQuasiModal() )
144  EndQuasiModal( wxID_CANCEL );
145 
147  delete m_qmodal_parent_disabler; // usually NULL by now
148 }
149 
150 
152 {
153  // must be called from the constructor of derived classes,
154  // when all widgets are initialized, and therefore their size fixed
155 
156  // SetSizeHints fixes the minimal size of sizers in the dialog
157  // (SetSizeHints calls Fit(), so no need to call it)
158  GetSizer()->SetSizeHints( this );
159 }
160 
161 
162 void DIALOG_SHIM::setSizeInDU( int x, int y )
163 {
164  wxSize sz( x, y );
165  SetSize( ConvertDialogToPixels( sz ) );
166 }
167 
168 
170 {
171  wxSize sz( x, 0 );
172  return ConvertDialogToPixels( sz ).x;
173 }
174 
175 
177 {
178  wxSize sz( 0, y );
179  return ConvertDialogToPixels( sz ).y;
180 }
181 
182 
183 // our hashtable is an implementation secret, don't need or want it in a header file
184 #include <hashtables.h>
185 #include <typeinfo>
186 
187 static std::unordered_map<std::string, wxRect> class_map;
188 
189 
190 void DIALOG_SHIM::SetPosition( const wxPoint& aNewPosition )
191 {
192  wxDialog::SetPosition( aNewPosition );
193 
194  // Now update the stored position:
195  const char* hash_key;
196 
197  if( m_hash_key.size() )
198  {
199  // a special case like EDA_LIST_DIALOG, which has multiple uses.
200  hash_key = m_hash_key.c_str();
201  }
202  else
203  {
204  hash_key = typeid(*this).name();
205  }
206 
207  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
208 
209  if( it == class_map.end() )
210  return;
211 
212  wxRect rect = it->second;
213  rect.SetPosition( aNewPosition );
214 
215  class_map[ hash_key ] = rect;
216 }
217 
218 
219 bool DIALOG_SHIM::Show( bool show )
220 {
221  bool ret;
222  const char* hash_key;
223 
224  if( m_hash_key.size() )
225  {
226  // a special case like EDA_LIST_DIALOG, which has multiple uses.
227  hash_key = m_hash_key.c_str();
228  }
229  else
230  {
231  hash_key = typeid(*this).name();
232  }
233 
234  // Show or hide the window. If hiding, save current position and size.
235  // If showing, use previous position and size.
236  if( show )
237  {
238 #ifndef __WINDOWS__
239  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
240 #endif
241  ret = wxDialog::Show( show );
242 
243  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
244  wxRect savedDialogRect = class_map[ hash_key ];
245 
246  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
247  {
248  if( m_useCalculatedSize )
249  {
250  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
251  wxDialog::GetSize().x, wxDialog::GetSize().y, 0 );
252  }
253  else
254  {
255  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
256  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
257  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
258  0 );
259  }
260  }
261  else if( m_initialSize != wxDefaultSize )
262  SetSize( m_initialSize );
263 
264  // Be sure that the dialog appears in a visible area
265  // (the dialog position might have been stored at the time when it was
266  // shown on another display)
267  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
268  Centre();
269  }
270  else
271  {
272  // Save the dialog's position & size before hiding, using classname as key
273  class_map[ hash_key ] = wxRect( wxDialog::GetPosition(), wxDialog::GetSize() );
274 
275 #ifdef __WXMAC__
276  if ( m_eventLoop )
277  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
278 #endif
279 
280  ret = wxDialog::Show( show );
281  }
282 
283  return ret;
284 }
285 
286 
288 {
289  const char* hash_key;
290 
291  if( m_hash_key.size() )
292  {
293  // a special case like EDA_LIST_DIALOG, which has multiple uses.
294  hash_key = m_hash_key.c_str();
295  }
296  else
297  {
298  hash_key = typeid(*this).name();
299  }
300 
301  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
302 
303  if( it == class_map.end() )
304  return;
305 
306  wxRect rect = it->second;
307  rect.SetSize( wxSize( 0, 0 ) );
308  class_map[ hash_key ] = rect;
309 }
310 
311 
312 bool DIALOG_SHIM::Enable( bool enable )
313 {
314  // so we can do logging of this state change:
315  return wxDialog::Enable( enable );
316 }
317 
318 
319 // Recursive descent doing a SelectAll() in wxTextCtrls.
320 // MacOS User Interface Guidelines state that when tabbing to a text control all its
321 // text should be selected. Since wxWidgets fails to implement this, we do it here.
322 static void selectAllInTextCtrls( wxWindowList& children )
323 {
324  for( wxWindow* child : children )
325  {
326  if( wxTextCtrl* childTextCtrl = dynamic_cast<wxTextCtrl*>( child ) )
327  {
328  // We don't currently run this on GTK because some window managers don't hide the
329  // selection in non-active controls, and other window managers do the selection
330  // automatically anyway.
331 #if defined( __WXMAC__ ) || defined( __WXMSW__ )
332  if( !childTextCtrl->GetStringSelection().IsEmpty() )
333  {
334  // Respect an existing selection
335  }
336  else
337  {
338  childTextCtrl->SelectAll();
339  }
340 #else
341  ignore_unused( childTextCtrl );
342 #endif
343  }
344  else if( wxStyledTextCtrl* scintilla = dynamic_cast<wxStyledTextCtrl*>( child ) )
345  {
346  if( !scintilla->GetSelectedText().IsEmpty() )
347  {
348  // Respect an existing selection
349  }
350  else
351  {
352  scintilla->SelectAll();
353  }
354  }
355 #ifdef __WXMAC__
356  // Temp hack for square (looking) buttons on OSX. Will likely be made redundant
357  // by the image store....
358  else if( dynamic_cast<wxBitmapButton*>( child ) != nullptr )
359  {
360  wxSize minSize( 29, 27 );
361  wxRect rect = child->GetRect();
362 
363  child->ConvertDialogToPixels( minSize );
364 
365  rect.Inflate( std::max( 0, minSize.x - rect.GetWidth() ),
366  std::max( 0, minSize.y - rect.GetHeight() ) );
367 
368  child->SetMinSize( rect.GetSize() );
369  child->SetSize( rect );
370  }
371 #endif
372  else
373  {
374  selectAllInTextCtrls( child->GetChildren() );
375  }
376  }
377 }
378 
379 
380 void DIALOG_SHIM::OnPaint( wxPaintEvent &event )
381 {
382  if( m_firstPaintEvent )
383  {
385 
386  selectAllInTextCtrls( GetChildren() );
387 
390  else
391  KIPLATFORM::UI::ForceFocus( this ); // Focus the dialog itself
392 
393  m_firstPaintEvent = false;
394  }
395 
396  event.Skip();
397 }
398 
399 
401 {
402  if( !GetTitle().StartsWith( wxT( "*" ) ) )
403  SetTitle( wxT( "*" ) + GetTitle() );
404 }
405 
406 
407 /*
408  Quasi-Modal Mode Explained:
409 
410  The gtk calls in wxDialog::ShowModal() cause event routing problems if that
411  modal dialog then tries to use KIWAY_PLAYER::ShowModal(). The latter shows up
412  and mostly works but does not respond to the window decoration close button.
413  There is no way to get around this without reversing the gtk calls temporarily.
414 
415  Quasi-Modal mode is our own almost modal mode which disables only the parent
416  of the DIALOG_SHIM, leaving other frames operable and while staying captured in the
417  nested event loop. This avoids the gtk calls and leaves event routing pure
418  and sufficient to operate the KIWAY_PLAYER::ShowModal() properly. When using
419  ShowQuasiModal() you have to use EndQuasiModal() in your dialogs and not
420  EndModal(). There is also IsQuasiModal() but its value can only be true
421  when the nested event loop is active. Do not mix the modal and quasi-modal
422  functions. Use one set or the other.
423 
424  You might find this behavior preferable over a pure modal mode, and it was said
425  that only the Mac has this natively, but now other platforms have something
426  similar. You CAN use it anywhere for any dialog. But you MUST use it when
427  you want to use KIWAY_PLAYER::ShowModal() from a dialog event.
428 */
429 
431 {
432  // This is an exception safe way to zero a pointer before returning.
433  // Yes, even though DismissModal() clears this first normally, this is
434  // here in case there's an exception before the dialog is dismissed.
435  struct NULLER
436  {
437  void*& m_what;
438  NULLER( void*& aPtr ) : m_what( aPtr ) {}
439  ~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
440  } clear_this( (void*&) m_qmodal_loop );
441 
442  // release the mouse if it's currently captured as the window having it
443  // will be disabled when this dialog is shown -- but will still keep the
444  // capture making it impossible to do anything in the modal dialog itself
445  wxWindow* win = wxWindow::GetCapture();
446  if( win )
447  win->ReleaseMouse();
448 
449  // Get the optimal parent
450  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
451 
452  wxASSERT_MSG( !m_qmodal_parent_disabler,
453  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
454 
455  // quasi-modal: disable only my "optimal" parent
457 
458  // Apple in its infinite wisdom will raise a disabled window before even passing
459  // us the event, so we have no way to stop it. Instead, we must set an order on
460  // the windows so that the quasi-modal will be pushed in front of the disabled
461  // window when it is raised.
463 
464  Show( true );
465 
466  m_qmodal_showing = true;
467 
468  WX_EVENT_LOOP event_loop;
469 
470  m_qmodal_loop = &event_loop;
471 
472  event_loop.Run();
473 
474  m_qmodal_showing = false;
475 
476  return GetReturnCode();
477 }
478 
479 
480 void DIALOG_SHIM::EndQuasiModal( int retCode )
481 {
482  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
483  // handle validation in the same way as other dialogs.
484  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
485  return;
486 
487  SetReturnCode( retCode );
488 
489  if( !IsQuasiModal() )
490  {
491  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal" )
492  wxT( "wasn't called" ) );
493  return;
494  }
495 
496  if( m_qmodal_loop )
497  {
498  if( m_qmodal_loop->IsRunning() )
499  m_qmodal_loop->Exit( 0 );
500  else
501  m_qmodal_loop->ScheduleExit( 0 );
502 
503  m_qmodal_loop = nullptr;
504  }
505 
507  m_qmodal_parent_disabler = nullptr;
508 
509  Show( false );
510 }
511 
512 
513 void DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
514 {
515  if( IsQuasiModal() )
516  {
517  EndQuasiModal( wxID_CANCEL );
518  return;
519  }
520 
521  // This is mandatory to allow wxDialogBase::OnCloseWindow() to be called.
522  aEvent.Skip();
523 }
524 
525 
526 void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
527 {
528  const int id = aEvent.GetId();
529 
530  // If we are pressing a button to exit, we need to enable the escapeID
531  // otherwise the dialog does not process cancel
532  if( id == wxID_CANCEL )
533  SetEscapeId( wxID_ANY );
534 
535  if( IsQuasiModal() )
536  {
537  if( id == GetAffirmativeId() )
538  {
539  EndQuasiModal( id );
540  }
541  else if( id == wxID_APPLY )
542  {
543  // Dialogs that provide Apply buttons should make sure data is valid before
544  // allowing a transfer, as there is no other way to indicate failure
545  // (i.e. the dialog can't refuse to close as it might with OK, because it
546  // isn't closing anyway)
547  if( Validate() )
548  {
549  ignore_unused( TransferDataFromWindow() );
550  }
551  }
552  else if( id == GetEscapeId() ||
553  (id == wxID_CANCEL && GetEscapeId() == wxID_ANY) )
554  {
555  EndQuasiModal( wxID_CANCEL );
556  }
557  else // not a standard button
558  {
559  aEvent.Skip();
560  }
561 
562  return;
563  }
564 
565  // This is mandatory to allow wxDialogBase::OnButton() to be called.
566  aEvent.Skip();
567 }
568 
569 
570 void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
571 {
572  if( aEvt.GetKeyCode() == 'U' && aEvt.GetModifiers() == wxMOD_CONTROL )
573  {
574  if( m_parentFrame )
575  {
577  return;
578  }
579  }
580  // shift-return (Mac default) or Ctrl-Return (GTK) for OK
581  else if( aEvt.GetKeyCode() == WXK_RETURN && ( aEvt.ShiftDown() || aEvt.ControlDown() ) )
582  {
583  wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
584  return;
585  }
586  else if( aEvt.GetKeyCode() == WXK_TAB && !aEvt.ControlDown() )
587  {
588  wxWindow* currentWindow = wxWindow::FindFocus();
589  int currentIdx = -1;
590  int delta = aEvt.ShiftDown() ? -1 : 1;
591 
592  auto advance = [&]( int& idx )
593  {
594  // Wrap-around modulus
595  int size = m_tabOrder.size();
596  idx = ( ( idx + delta ) % size + size ) % size;
597  };
598 
599  for( size_t i = 0; i < m_tabOrder.size(); ++i )
600  {
601  if( m_tabOrder[i] == currentWindow )
602  {
603  currentIdx = (int) i;
604  break;
605  }
606  }
607 
608  if( currentIdx >= 0 )
609  {
610  advance( currentIdx );
611 
612  //todo: We don't currently have non-textentry dialog boxes but this will break if
613  // we add them.
614 #ifdef __APPLE__
615  while( dynamic_cast<wxTextEntry*>( m_tabOrder[ currentIdx ] ) == nullptr )
616  advance( currentIdx );
617 #endif
618 
619  m_tabOrder[ currentIdx ]->SetFocus();
620  return;
621  }
622  }
623 
624  aEvt.Skip();
625 }
626 
627 
628 void DIALOG_SHIM::OnGridEditorShown( wxGridEvent& event )
629 {
630  SetEscapeId( wxID_NONE );
631  event.Skip();
632 }
633 
634 
635 void DIALOG_SHIM::OnGridEditorHidden( wxGridEvent& event )
636 {
637  SetEscapeId( wxID_ANY );
638  event.Skip();
639 }
bool m_qmodal_showing
Definition: dialog_shim.h:215
A mix in class which holds the location of a wxWindow's KIWAY.
Definition: kiway_holder.h:36
void setSizeInDU(int x, int y)
Set the dialog to the given dimensions in "dialog units".
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void OnModify()
void OnButton(wxCommandEvent &aEvent)
Properly handle the default button events when in the quasimodal mode when not calling EndQuasiModal ...
std::string m_hash_key
Definition: dialog_shim.h:201
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:220
HOLDER_TYPE GetType() const
Definition: kiway_holder.h:46
bool IsQuasiModal() const
Definition: dialog_shim.h:106
static std::unordered_map< std::string, wxRect > class_map
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:211
int horizPixelsFromDU(int x) const
Convert an integer number of dialog units to pixels, horizontally.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
void OnGridEditorShown(wxGridEvent &event)
const int minSize
Push and Shove router track width and via size dialog.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void OnGridEditorHidden(wxGridEvent &event)
bool m_firstPaintEvent
Definition: dialog_shim.h:210
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:213
Master controller class:
Definition: tool_manager.h:54
void OnCloseWindow(wxCloseEvent &aEvent)
Properly handle the wxCloseEvent when in the quasimodal mode when not calling EndQuasiModal which is ...
void SetPosition(const wxPoint &aNewPosition)
Force the position of the dialog to a new position.
EDA_BASE_FRAME * m_parentFrame
Definition: dialog_shim.h:218
int ShowQuasiModal()
bool IsContextMenuActive() const
True while processing a context menu.
Definition: tool_manager.h:411
void OnPaint(wxPaintEvent &event)
bool Show(bool show) override
EDA_UNITS
Definition: eda_units.h:38
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:216
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void OnCharHook(wxKeyEvent &aEvt)
void EndQuasiModal(int retCode)
virtual void ToggleUserUnits()
see class PGM_BASE
const char * name
Definition: DXF_plotter.cpp:56
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: gtk/ui.cpp:44
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:71
The base frame for deriving all KiCad main window classes.
void VetoContextMenuMouseWarp()
Disable mouse warping after the current context menu is closed.
Definition: tool_manager.h:422
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:44
void resetSize()
Clear the existing dialog size and position.
void ignore_unused(const T &)
Definition: ignore.h:24
int vertPixelsFromDU(int y) const
Convert an integer number of dialog units to pixels, vertically.
constexpr int delta
bool Enable(bool enable) override
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:65
WDO_ENABLE_DISABLE(wxWindow *aWindow)
Definition: dialog_shim.cpp:50
bool m_useCalculatedSize
Definition: dialog_shim.h:205
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
wxSize m_initialSize
Definition: dialog_shim.h:223
static void selectAllInTextCtrls(wxWindowList &children)