KiCad PCB EDA Suite
dialog_shim.cpp File Reference
#include <dialog_shim.h>
#include <eda_rect.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 <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 RECT_MAP 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  // Respect an existing selection
324  if( childTextCtrl->GetStringSelection().IsEmpty() )
325  childTextCtrl->SelectAll();
326  }
327 #ifdef __WXMAC__
328  // Temp hack for square (looking) buttons on OSX. Will likely be made redundant
329  // by the image store....
330  else if( dynamic_cast<wxBitmapButton*>( child ) != nullptr )
331  {
332  wxSize minSize( 29, 27 );
333  wxRect rect = child->GetRect();
334 
335  child->ConvertDialogToPixels( minSize );
336 
337  rect.Inflate( std::max( 0, minSize.x - rect.GetWidth() ),
338  std::max( 0, minSize.y - rect.GetHeight() ) );
339 
340  child->SetMinSize( rect.GetSize() );
341  child->SetSize( rect );
342  }
343 #endif
344  else
345  {
346  selectAllInTextCtrls( child->GetChildren() );
347  }
348  }
349 }
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

RECT_MAP class_map
static