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 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 224 of file trace_helpers.cpp.

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

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

References i.

Referenced by SCH_FIND_COLLECTOR::Collect(), TOOL_DISPATCHER::DispatchWxEvent(), EDA_DRAW_FRAME::OnCharHook(), EDA_DRAW_PANEL::OnCharHook(), EDA_DRAW_PANEL::OnKeyEvent(), and GPCB_FPL_CACHE::parseParameters().