KiCad PCB EDA Suite
dialog_shim.cpp File Reference
#include <dialog_shim.h>
#include <kiway_player.h>
#include <wx/evtloop.h>
#include <pgm_base.h>
#include <eda_rect.h>
#include <wx/display.h>
#include <hashtables.h>
#include <base_struct.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...
 
class  EVENT_LOOP
 

Functions

static void recursiveDescent (wxWindowList &children, const bool selectTextInTextCtrls, wxWindow *&firstTextCtrl, wxWindow *&windowWithFocus)
 

Variables

static RECT_MAP class_map
 

Function Documentation

static void recursiveDescent ( wxWindowList &  children,
const bool  selectTextInTextCtrls,
wxWindow *&  firstTextCtrl,
wxWindow *&  windowWithFocus 
)
static

Definition at line 221 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::OnPaint().

223 {
224  for( wxWindowList::iterator it = children.begin(); it != children.end(); ++it )
225  {
226  wxWindow* child = *it;
227 
228  if( child->HasFocus() )
229  windowWithFocus = child;
230 
231  wxTextCtrl* childTextCtrl = dynamic_cast<wxTextCtrl*>( child );
232  if( childTextCtrl )
233  {
234  if( !firstTextCtrl && childTextCtrl->IsEnabled() && childTextCtrl->IsEditable() )
235  firstTextCtrl = childTextCtrl;
236 
237  if( selectTextInTextCtrls )
238  {
239  wxTextEntry* asTextEntry = dynamic_cast<wxTextEntry*>( childTextCtrl );
240  // Respect an existing selection
241  if( asTextEntry->GetStringSelection().IsEmpty() )
242  asTextEntry->SelectAll();
243  }
244  }
245 
246  recursiveDescent( child->GetChildren(), selectTextInTextCtrls, firstTextCtrl,
247  windowWithFocus );
248  }
249 }
static void recursiveDescent(wxWindowList &children, const bool selectTextInTextCtrls, wxWindow *&firstTextCtrl, wxWindow *&windowWithFocus)

Variable Documentation

RECT_MAP class_map
static

Definition at line 144 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::Show().