KiCad PCB EDA Suite
trace_helpers.h File Reference

wxLogTrace helper definitions. More...

#include <wx/arrstr.h>
#include <wx/event.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

wxString dump (const wxKeyEvent &aEvent)
 Debug helper for printing wxKeyEvent information. More...
 
wxString dump (const wxArrayString &aArray)
 Debug helper for printing wxArrayString contents. More...
 

Variables

const wxChar *const traceFindItem
 Flag to enable find debug tracing. More...
 
const wxChar *const traceFindReplace
 Flag to enable find and replace debug tracing. More...
 
const wxChar *const kicadTraceCoords
 Flag to enable draw panel coordinate debug tracing. More...
 
const wxChar *const kicadTraceKeyEvent
 Flag to enable wxKeyEvent debug tracing. More...
 
const wxChar *const kicadTraceToolStack
 Flag to enable tracing of the tool handling stack. More...
 
const wxChar *const traceAutoSave
 Flag to enable auto save feature debug tracing. More...
 
const wxChar *const traceSchLibMem
 Flag to enable schematic library memory deletion debug output. More...
 
const wxChar *const traceSchLegacyPlugin
 Flag to enable legacy schematic plugin debug output. More...
 
const wxChar *const traceKicadPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const traceGedaPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const tracePrinting
 Flag to enable print controller debug output. More...
 
const wxChar *const tracePathsAndFiles
 Flag to enable path and file name debug output. More...
 
const wxChar *const traceLocale
 Flag to enable locale debug output. More...
 
const wxChar *const traceScreen
 Flag to enable debug output of BASE_SCREEN and it's derivatives. More...
 
const wxChar *const traceZoomScroll
 Flag to enable debug output of zoom-scrolling calculations in KIGFX::ZOOM_CONTROLLER and derivatives. More...
 
const wxChar *const traceSymbolResolver
 Flag to enable debug output of symbol library resolver results. More...
 

Detailed Description

wxLogTrace helper definitions.

Definition in file trace_helpers.h.

Function Documentation

◆ dump() [1/2]

wxString dump ( const wxKeyEvent &  aEvent)

Debug helper for printing wxKeyEvent information.

Parameters
aEventis the wxKeyEvent to generate the print string from.
Returns
the wxKeyEvent information.

Definition at line 225 of file trace_helpers.cpp.

226 {
227  wxString msg;
228  wxString eventType = "unknown";
229 
230  if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
231  eventType = "KeyDown";
232  else if( aEvent.GetEventType() == wxEVT_KEY_UP )
233  eventType = "KeyUp";
234  else if( aEvent.GetEventType() == wxEVT_CHAR )
235  eventType = "Char";
236  else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
237  eventType = "Hook";
238 
239  // event key_name KeyCode modifiers Unicode raw_code raw_flags pos
240  msg.Printf( "%7s %15s %5d %c%c%c%c"
241 #if wxUSE_UNICODE
242  "%5d (U+%04x)"
243 #else
244  " none "
245 #endif
246 #ifdef wxHAS_RAW_KEY_CODES
247  " %7lu 0x%08lx"
248 #else
249  " not-set not-set"
250 #endif
251  " (%5d,%5d)"
252  "\n",
253  eventType,
254  GetKeyName( aEvent ),
255  aEvent.GetKeyCode(),
256  aEvent.ControlDown() ? 'C' : '-',
257  aEvent.AltDown() ? 'A' : '-',
258  aEvent.ShiftDown() ? 'S' : '-',
259  aEvent.MetaDown() ? 'M' : '-'
260 #if wxUSE_UNICODE
261  , aEvent.GetUnicodeKey()
262  , aEvent.GetUnicodeKey()
263 #endif
264 #ifdef wxHAS_RAW_KEY_CODES
265  , (unsigned long) aEvent.GetRawKeyCode()
266  , (unsigned long) aEvent.GetRawKeyFlags()
267 #endif
268  , aEvent.GetX()
269  , aEvent.GetY()
270  );
271 
272  return msg;
273 }
wxString GetKeyName(const wxKeyEvent &aEvent)

References GetKeyName().

◆ dump() [2/2]

wxString dump ( const wxArrayString &  aArray)

Debug helper for printing wxArrayString contents.

Parameters
aArrayis the string array to output.
Returns
the wxArrayString contents in a formatted string for debugging output.

Definition at line 51 of file trace_helpers.cpp.

52 {
53  wxString tmp;
54 
55  for( unsigned i = 0; i < aArray.GetCount(); i++ )
56  {
57  if( aArray[i].IsEmpty() )
58  tmp << wxT( "\"\" " );
59  else
60  tmp << aArray[i] << wxT( " " );
61  }
62 
63  return tmp;
64 }
size_t i
Definition: json11.cpp:597

References i.

Referenced by TOOL_DISPATCHER::DispatchWxEvent(), FOOTPRINTS_LISTBOX::OnChar(), LIBRARY_LISTBOX::OnChar(), COMPONENTS_LISTBOX::OnChar(), EDA_BASE_FRAME::OnCharHook(), and GPCB_FPL_CACHE::parseParameters().