KiCad PCB EDA Suite
trace_helpers.h File Reference

wxLogTrace helper definitions. More...

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

Detailed Description

wxLogTrace helper definitions.

Definition in file trace_helpers.h.

Function Documentation

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

References GetKeyName().

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

References i.

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

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