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...
 

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

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

50 {
51  wxString tmp;
52 
53  for( unsigned i = 0; i < aArray.GetCount(); i++ )
54  {
55  if( aArray[i].IsEmpty() )
56  tmp << wxT( "\"\" " );
57  else
58  tmp << aArray[i] << wxT( " " );
59  }
60 
61  return tmp;
62 }
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().