KiCad PCB EDA Suite
dialog_shim.cpp File Reference
#include <dialog_shim.h>
#include <kiway_player.h>
#include <pgm_base.h>
#include <tool/tool_manager.h>
#include <kiplatform/ui.h>
#include <wx/display.h>
#include <wx/evtloop.h>
#include <wx/app.h>
#include <wx/event.h>
#include <wx/grid.h>
#include <wx/bmpbuttn.h>
#include <wx/textctrl.h>
#include <algorithm>
#include <hashtables.h>
#include <typeinfo>

Go to the source code of this file.

Classes

class  WDO_ENABLE_DISABLE
 Toggle a window's "enable" status to disabled, then enabled on destruction. More...
 

Functions

static void selectAllInTextCtrls (wxWindowList &children)
 

Variables

static std::unordered_map< std::string, wxRect > class_map
 

Function Documentation

◆ selectAllInTextCtrls()

static void selectAllInTextCtrls ( wxWindowList &  children)
static

Definition at line 317 of file dialog_shim.cpp.

318 {
319  for( wxWindow* child : children )
320  {
321  if( wxTextCtrl* childTextCtrl = dynamic_cast<wxTextCtrl*>( child ) )
322  {
323 #if defined( __WXMAC__ ) || defined( __WXMSW__ )
324  // Respect an existing selection
325  if( childTextCtrl->GetStringSelection().IsEmpty() )
326  childTextCtrl->SelectAll();
327 #endif
328  }
329 #ifdef __WXMAC__
330  // Temp hack for square (looking) buttons on OSX. Will likely be made redundant
331  // by the image store....
332  else if( dynamic_cast<wxBitmapButton*>( child ) != nullptr )
333  {
334  wxSize minSize( 29, 27 );
335  wxRect rect = child->GetRect();
336 
337  child->ConvertDialogToPixels( minSize );
338 
339  rect.Inflate( std::max( 0, minSize.x - rect.GetWidth() ),
340  std::max( 0, minSize.y - rect.GetHeight() ) );
341 
342  child->SetMinSize( rect.GetSize() );
343  child->SetSize( rect );
344  }
345 #endif
346  else
347  {
348  selectAllInTextCtrls( child->GetChildren() );
349  }
350  }
351 }
const int minSize
Push and Shove router track width and via size dialog.
static void selectAllInTextCtrls(wxWindowList &children)

References minSize.

Referenced by DIALOG_SHIM::OnPaint().

Variable Documentation

◆ class_map

std::unordered_map<std::string, wxRect> class_map
static