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 <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 215 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::OnPaint().

217 {
218  for( wxWindowList::iterator it = children.begin(); it != children.end(); ++it )
219  {
220  wxWindow* child = *it;
221 
222  if( child->HasFocus() )
223  windowWithFocus = child;
224 
225  wxTextCtrl* childTextCtrl = dynamic_cast<wxTextCtrl*>( child );
226  if( childTextCtrl )
227  {
228  if( !firstTextCtrl && childTextCtrl->IsEnabled() && childTextCtrl->IsEditable() )
229  firstTextCtrl = childTextCtrl;
230 
231  if( selectTextInTextCtrls )
232  {
233  wxTextEntry* asTextEntry = dynamic_cast<wxTextEntry*>( childTextCtrl );
234  // Respect an existing selection
235  if( asTextEntry->GetStringSelection().IsEmpty() )
236  asTextEntry->SelectAll();
237  }
238  }
239 
240  recursiveDescent( child->GetChildren(), selectTextInTextCtrls, firstTextCtrl,
241  windowWithFocus );
242  }
243 }
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().