KiCad PCB EDA Suite
Loading...
Searching...
No Matches
scintilla_tricks.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020-2023 KiCad Developers, see change_log.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
25#include <string_utils.h>
26#include <scintilla_tricks.h>
27#include <widgets/wx_grid.h>
28#include <widgets/ui_common.h>
29#include <wx/stc/stc.h>
30#include <gal/color4d.h>
31#include <dialog_shim.h>
32#include <wx/clipbrd.h>
33#include <wx/log.h>
34#include <wx/settings.h>
35#include <confirm.h>
36
37SCINTILLA_TRICKS::SCINTILLA_TRICKS( wxStyledTextCtrl* aScintilla, const wxString& aBraces,
38 bool aSingleLine,
39 std::function<void( wxKeyEvent& )> onAcceptFn,
40 std::function<void( wxStyledTextEvent& )> onCharAddedFn ) :
41 m_te( aScintilla ),
42 m_braces( aBraces ),
43 m_lastCaretPos( -1 ),
44 m_lastSelStart( -1 ),
45 m_lastSelEnd( -1 ),
46 m_suppressAutocomplete( false ),
47 m_singleLine( aSingleLine ),
48 m_onAcceptFn( std::move( onAcceptFn ) ),
49 m_onCharAddedFn( std::move( onCharAddedFn ) )
50{
51 // Always use LF as eol char, regardless the platform
52 m_te->SetEOLMode( wxSTC_EOL_LF );
53
54 // A hack which causes Scintilla to auto-size the text editor canvas
55 // See: https://github.com/jacobslusser/ScintillaNET/issues/216
56 m_te->SetScrollWidth( 1 );
57 m_te->SetScrollWidthTracking( true );
58
59 if( m_singleLine )
60 {
61 m_te->SetUseVerticalScrollBar( false );
62 m_te->SetUseHorizontalScrollBar( false );
63 }
64
66
67 // Set up autocomplete
68 m_te->AutoCompSetIgnoreCase( true );
69 m_te->AutoCompSetMaxHeight( 20 );
70
71 if( aBraces.Length() >= 2 )
72 m_te->AutoCompSetFillUps( m_braces[1] );
73
74 // Hook up events
75 m_te->Bind( wxEVT_STC_UPDATEUI, &SCINTILLA_TRICKS::onScintillaUpdateUI, this );
76 m_te->Bind( wxEVT_STC_MODIFIED, &SCINTILLA_TRICKS::onModified, this );
77
78 // Handle autocomplete
79 m_te->Bind( wxEVT_STC_CHARADDED, &SCINTILLA_TRICKS::onChar, this );
80 m_te->Bind( wxEVT_STC_AUTOCOMP_CHAR_DELETED, &SCINTILLA_TRICKS::onChar, this );
81
82 // Dispatch command-keys in Scintilla control.
83 m_te->Bind( wxEVT_CHAR_HOOK, &SCINTILLA_TRICKS::onCharHook, this );
84
85 m_te->Bind( wxEVT_SYS_COLOUR_CHANGED,
86 wxSysColourChangedEventHandler( SCINTILLA_TRICKS::onThemeChanged ), this );
87}
88
89
90void SCINTILLA_TRICKS::onThemeChanged( wxSysColourChangedEvent &aEvent )
91{
93
94 aEvent.Skip();
95}
96
97
99{
100 wxTextCtrl dummy( m_te->GetParent(), wxID_ANY );
101 KIGFX::COLOR4D foreground = dummy.GetForegroundColour();
102 KIGFX::COLOR4D background = dummy.GetBackgroundColour();
103 KIGFX::COLOR4D highlight = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT );
104 KIGFX::COLOR4D highlightText = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT );
105
106 m_te->StyleSetForeground( wxSTC_STYLE_DEFAULT, foreground.ToColour() );
107 m_te->StyleSetBackground( wxSTC_STYLE_DEFAULT, background.ToColour() );
108 m_te->StyleClearAll();
109
110 // Scintilla doesn't handle alpha channel, which at least OSX uses in some highlight colours,
111 // such as "graphite".
112 highlight = highlight.Mix( background, highlight.a ).WithAlpha( 1.0 );
113 highlightText = highlightText.Mix( background, highlightText.a ).WithAlpha( 1.0 );
114
115 m_te->SetSelForeground( true, highlightText.ToColour() );
116 m_te->SetSelBackground( true, highlight.ToColour() );
117 m_te->SetCaretForeground( foreground.ToColour() );
118
119 if( !m_singleLine )
120 {
121 // Set a monospace font with a tab width of 4. This is the closest we can get to having
122 // Scintilla mimic the stroke font's tab positioning.
123 wxFont fixedFont = KIUI::GetMonospacedUIFont();
124
125 for( size_t i = 0; i < wxSTC_STYLE_MAX; ++i )
126 m_te->StyleSetFont( i, fixedFont );
127
128 m_te->SetTabWidth( 4 );
129 }
130
131 // Set up the brace highlighting. Scintilla doesn't handle alpha, so we construct our own
132 // 20% wash by blending with the background.
133 KIGFX::COLOR4D braceText = foreground;
134 KIGFX::COLOR4D braceHighlight = braceText.Mix( background, 0.2 );
135
136 m_te->StyleSetForeground( wxSTC_STYLE_BRACELIGHT, highlightText.ToColour() );
137 m_te->StyleSetBackground( wxSTC_STYLE_BRACELIGHT, braceHighlight.ToColour() );
138 m_te->StyleSetForeground( wxSTC_STYLE_BRACEBAD, *wxRED );
139}
140
141
142bool isCtrlSlash( wxKeyEvent& aEvent )
143{
144 if( !aEvent.ControlDown() || aEvent.MetaDown() )
145 return false;
146
147 if( aEvent.GetUnicodeKey() == '/' )
148 return true;
149
150 // OK, now the wxWidgets hacks start.
151 // (We should abandon these if https://trac.wxwidgets.org/ticket/18911 gets resolved.)
152
153 // Many Latin America and European keyboars have have the / over the 7. We know that
154 // wxWidgets messes this up and returns Shift+7 through GetUnicodeKey(). However, other
155 // keyboards (such as France and Belgium) have 7 in the shifted position, so a Shift+7
156 // *could* be legitimate.
157
158 // However, we *are* checking Ctrl, so to assume any Shift+7 is a Ctrl-/ really only
159 // disallows Ctrl+Shift+7 from doing something else, which is probably OK. (This routine
160 // is only used in the Scintilla editor, not in the rest of Kicad.)
161
162 // The other main shifted loation of / is over : (France and Belgium), so we'll sacrifice
163 // Ctrl+Shift+: too.
164
165 if( aEvent.ShiftDown() && ( aEvent.GetUnicodeKey() == '7' || aEvent.GetUnicodeKey() == ':' ) )
166 return true;
167
168 // A few keyboards have / in an Alt position. Since we're expressly not checking Alt for
169 // up or down, those should work. However, if they don't, there's room below for yet
170 // another hack....
171
172 return false;
173}
174
175
176void SCINTILLA_TRICKS::onChar( wxStyledTextEvent& aEvent )
177{
178 m_onCharAddedFn( aEvent );
179}
180
181
182void SCINTILLA_TRICKS::onModified( wxStyledTextEvent& aEvent )
183{
184 if( m_singleLine )
185 {
186 wxString curr_text = m_te->GetText();
187
188 if( curr_text.Contains( wxS( "\n" ) ) || curr_text.Contains( wxS( "\r" ) ) )
189 {
190 // Scintilla won't allow us to call SetText() from within this event processor,
191 // so we have to delay the processing.
192 CallAfter( [this]()
193 {
194 wxString text = m_te->GetText();
195 int currpos = m_te->GetCurrentPos();
196
197 text.Replace( wxS( "\n" ), wxS( "" ) );
198 text.Replace( wxS( "\r" ), wxS( "" ) );
199 m_te->SetText( text );
200 m_te->GotoPos( currpos-1 );
201 } );
202 }
203 }
204}
205
206
207void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
208{
209 wxString c = aEvent.GetUnicodeKey();
210
211 if( m_te->AutoCompActive() )
212 {
213 if( aEvent.GetKeyCode() == WXK_ESCAPE )
214 {
215 m_te->AutoCompCancel();
216 m_suppressAutocomplete = true; // Don't run autocomplete again on the next char...
217 }
218 else if( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
219 {
220 m_te->AutoCompComplete();
221 }
222 else
223 {
224 aEvent.Skip();
225 }
226
227 return;
228 }
229
230#ifdef __WXMAC__
231 if( aEvent.GetModifiers() == wxMOD_RAW_CONTROL && aEvent.GetKeyCode() == WXK_SPACE )
232#else
233 if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == WXK_SPACE )
234#endif
235 {
237
238 wxStyledTextEvent event;
239 event.SetKey( ' ' );
240 event.SetModifiers( wxMOD_CONTROL );
241 m_onCharAddedFn( event );
242
243 return;
244 }
245
246 if( !isalpha( aEvent.GetKeyCode() ) )
248
249 if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
250 && ( m_singleLine || aEvent.ShiftDown() ) )
251 {
252 m_onAcceptFn( aEvent );
253 }
254 else if( ConvertSmartQuotesAndDashes( &c ) )
255 {
256 m_te->AddText( c );
257 }
258 else if( aEvent.GetKeyCode() == WXK_TAB )
259 {
260 wxWindow* ancestor = m_te->GetParent();
261
262 while( ancestor && !dynamic_cast<WX_GRID*>( ancestor ) )
263 ancestor = ancestor->GetParent();
264
265 if( aEvent.ControlDown() )
266 {
267 int flags = 0;
268
269 if( !aEvent.ShiftDown() )
270 flags |= wxNavigationKeyEvent::IsForward;
271
272 wxWindow* parent = m_te->GetParent();
273
274 while( parent && dynamic_cast<DIALOG_SHIM*>( parent ) == nullptr )
275 parent = parent->GetParent();
276
277 if( parent )
278 parent->NavigateIn( flags );
279 }
280 else if( dynamic_cast<WX_GRID*>( ancestor ) )
281 {
282 WX_GRID* grid = static_cast<WX_GRID*>( ancestor );
283 int row = grid->GetGridCursorRow();
284 int col = grid->GetGridCursorCol();
285
286 if( aEvent.ShiftDown() )
287 {
288 if( col > 0 )
289 {
290 col--;
291 }
292 else if( row > 0 )
293 {
294 col = (int) grid->GetNumberCols() - 1;
295
296 if( row > 0 )
297 row--;
298 else
299 row = (int) grid->GetNumberRows() - 1;
300 }
301 }
302 else
303 {
304 if( col < (int) grid->GetNumberCols() - 1 )
305 {
306 col++;
307 }
308 else if( row < grid->GetNumberRows() - 1 )
309 {
310 col = 0;
311
312 if( row < grid->GetNumberRows() - 1 )
313 row++;
314 else
315 row = 0;
316 }
317 }
318
319 grid->SetGridCursor( row, col );
320 }
321 else
322 {
323 m_te->Tab();
324 }
325 }
326 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'Z' )
327 {
328 m_te->Undo();
329 }
330 else if( ( aEvent.GetModifiers() == wxMOD_SHIFT+wxMOD_CONTROL && aEvent.GetKeyCode() == 'Z' )
331 || ( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'Y' ) )
332 {
333 m_te->Redo();
334 }
335 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'A' )
336 {
337 m_te->SelectAll();
338 }
339 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'X' )
340 {
341 m_te->Cut();
342
343 if( wxTheClipboard->Open() )
344 {
345 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
346 wxTheClipboard->Close();
347 }
348 }
349 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'C' )
350 {
351 m_te->Copy();
352
353 if( wxTheClipboard->Open() )
354 {
355 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
356 wxTheClipboard->Close();
357 }
358 }
359 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'V' )
360 {
361 if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
362 m_te->DeleteBack();
363
364 wxLogNull doNotLog; // disable logging of failed clipboard actions
365
366 if( wxTheClipboard->Open() )
367 {
368 if( wxTheClipboard->IsSupported( wxDF_TEXT ) ||
369 wxTheClipboard->IsSupported( wxDF_UNICODETEXT ) )
370 {
371 wxTextDataObject data;
372 wxString str;
373
374 wxTheClipboard->GetData( data );
375 str = data.GetText();
376
378
379 if( m_singleLine )
380 {
381 str.Replace( wxS( "\n" ), wxEmptyString );
382 str.Replace( wxS( "\r" ), wxEmptyString );
383 }
384
385 m_te->BeginUndoAction();
386 m_te->AddText( str );
387 m_te->EndUndoAction();
388 }
389
390 wxTheClipboard->Close();
391 }
392 }
393 else if( aEvent.GetKeyCode() == WXK_BACK )
394 {
395 if( aEvent.GetModifiers() == wxMOD_CONTROL )
396#ifdef __WXMAC__
397 m_te->HomeExtend();
398 else if( aEvent.GetModifiers() == wxMOD_ALT )
399#endif
400 m_te->WordLeftExtend();
401
402 m_te->DeleteBack();
403 }
404 else if( aEvent.GetKeyCode() == WXK_DELETE )
405 {
406 if( m_te->GetSelectionEnd() == m_te->GetSelectionStart() )
407 m_te->CharRightExtend();
408
409 if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
410 m_te->DeleteBack();
411 }
412 else if( isCtrlSlash( aEvent ) )
413 {
414 int startLine = m_te->LineFromPosition( m_te->GetSelectionStart() );
415 int endLine = m_te->LineFromPosition( m_te->GetSelectionEnd() );
416 bool comment = firstNonWhitespace( startLine ) != '#';
417 int whitespaceCount;
418
419 m_te->BeginUndoAction();
420
421 for( int ii = startLine; ii <= endLine; ++ii )
422 {
423 if( comment )
424 m_te->InsertText( m_te->PositionFromLine( ii ), wxT( "#" ) );
425 else if( firstNonWhitespace( ii, &whitespaceCount ) == '#' )
426 m_te->DeleteRange( m_te->PositionFromLine( ii ) + whitespaceCount, 1 );
427 }
428
429 m_te->SetSelection( m_te->PositionFromLine( startLine ),
430 m_te->PositionFromLine( endLine ) + m_te->GetLineLength( endLine ) );
431
432 m_te->EndUndoAction();
433 }
434#ifdef __WXMAC__
435 else if( aEvent.GetModifiers() == wxMOD_RAW_CONTROL && aEvent.GetKeyCode() == 'A' )
436 {
437 m_te->HomeWrap();
438 }
439 else if( aEvent.GetModifiers() == wxMOD_RAW_CONTROL && aEvent.GetKeyCode() == 'E' )
440 {
441 m_te->LineEndWrap();
442 }
443 else if( ( aEvent.GetModifiers() & wxMOD_RAW_CONTROL ) && aEvent.GetKeyCode() == 'B' )
444 {
445 if( aEvent.GetModifiers() & wxMOD_ALT )
446 m_te->WordLeft();
447 else
448 m_te->CharLeft();
449 }
450 else if( ( aEvent.GetModifiers() & wxMOD_RAW_CONTROL ) && aEvent.GetKeyCode() == 'F' )
451 {
452 if( aEvent.GetModifiers() & wxMOD_ALT )
453 m_te->WordRight();
454 else
455 m_te->CharRight();
456 }
457 else if( aEvent.GetModifiers() == wxMOD_RAW_CONTROL && aEvent.GetKeyCode() == 'D' )
458 {
459 if( m_te->GetSelectionEnd() == m_te->GetSelectionStart() )
460 m_te->CharRightExtend();
461
462 if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
463 m_te->DeleteBack();
464 }
465#endif
466 else if( aEvent.GetKeyCode() == WXK_SPECIAL20 )
467 {
468 // Proxy for a wxSysColourChangedEvent
469 setupStyles();
470 }
471 else
472 {
473 aEvent.Skip();
474 }
475}
476
477
478int SCINTILLA_TRICKS::firstNonWhitespace( int aLine, int* aWhitespaceCharCount )
479{
480 int lineStart = m_te->PositionFromLine( aLine );
481
482 if( aWhitespaceCharCount )
483 *aWhitespaceCharCount = 0;
484
485 for( int ii = 0; ii < m_te->GetLineLength( aLine ); ++ii )
486 {
487 int c = m_te->GetCharAt( lineStart + ii );
488
489 if( c == ' ' || c == '\t' )
490 {
491 if( aWhitespaceCharCount )
492 *aWhitespaceCharCount += 1;
493
494 continue;
495 }
496 else
497 {
498 return c;
499 }
500 }
501
502 return '\r';
503}
504
505
506void SCINTILLA_TRICKS::onScintillaUpdateUI( wxStyledTextEvent& aEvent )
507{
508 auto isBrace = [this]( int c ) -> bool
509 {
510 return m_braces.Find( (wxChar) c ) >= 0;
511 };
512
513 // Has the caret changed position?
514 int caretPos = m_te->GetCurrentPos();
515 int selStart = m_te->GetSelectionStart();
516 int selEnd = m_te->GetSelectionEnd();
517
518 if( m_lastCaretPos != caretPos || m_lastSelStart != selStart || m_lastSelEnd != selEnd )
519 {
520 m_lastCaretPos = caretPos;
521 m_lastSelStart = selStart;
522 m_lastSelEnd = selEnd;
523 int bracePos1 = -1;
524 int bracePos2 = -1;
525
526 // Is there a brace to the left or right?
527 if( caretPos > 0 && isBrace( m_te->GetCharAt( caretPos-1 ) ) )
528 bracePos1 = ( caretPos - 1 );
529 else if( isBrace( m_te->GetCharAt( caretPos ) ) )
530 bracePos1 = caretPos;
531
532 if( bracePos1 >= 0 )
533 {
534 // Find the matching brace
535 bracePos2 = m_te->BraceMatch( bracePos1 );
536
537 if( bracePos2 == -1 )
538 {
539 m_te->BraceBadLight( bracePos1 );
540 m_te->SetHighlightGuide( 0 );
541 }
542 else
543 {
544 m_te->BraceHighlight( bracePos1, bracePos2 );
545 m_te->SetHighlightGuide( m_te->GetColumn( bracePos1 ) );
546 }
547 }
548 else
549 {
550 // Turn off brace matching
551 m_te->BraceHighlight( -1, -1 );
552 m_te->SetHighlightGuide( 0 );
553 }
554 }
555}
556
557
559 const std::function<void( const wxString& xRef, wxArrayString* tokens )>& getTokensFn )
560{
561 wxArrayString autocompleteTokens;
562 int text_pos = m_te->GetCurrentPos();
563 int start = m_te->WordStartPosition( text_pos, true );
564 wxString partial;
565
566 auto textVarRef =
567 [&]( int pos )
568 {
569 return pos >= 2 && m_te->GetCharAt( pos-2 ) == '$' && m_te->GetCharAt( pos-1 ) == '{';
570 };
571
572 // Check for cross-reference
573 if( start > 1 && m_te->GetCharAt( start-1 ) == ':' )
574 {
575 int refStart = m_te->WordStartPosition( start-1, true );
576
577 if( textVarRef( refStart ) )
578 {
579 partial = m_te->GetRange( start, text_pos );
580 getTokensFn( m_te->GetRange( refStart, start-1 ), &autocompleteTokens );
581 }
582 }
583 else if( textVarRef( start ) )
584 {
585 partial = m_te->GetTextRange( start, text_pos );
586 getTokensFn( wxEmptyString, &autocompleteTokens );
587 }
588
589 DoAutocomplete( partial, autocompleteTokens );
590 m_te->SetFocus();
591}
592
593
594void SCINTILLA_TRICKS::DoAutocomplete( const wxString& aPartial, const wxArrayString& aTokens )
595{
597 return;
598
599 wxArrayString matchedTokens;
600
601 wxString filter = wxT( "*" ) + aPartial.Lower() + wxT( "*" );
602
603 for( const wxString& token : aTokens )
604 {
605 if( token.Lower().Matches( filter ) )
606 matchedTokens.push_back( token );
607 }
608
609 if( matchedTokens.size() > 0 )
610 {
611 // NB: tokens MUST be in alphabetical order because the Scintilla engine is going
612 // to do a binary search on them
613 matchedTokens.Sort( []( const wxString& first, const wxString& second ) -> int
614 {
615 return first.CmpNoCase( second );
616 });
617
618 m_te->AutoCompShow( aPartial.size(), wxJoin( matchedTokens, m_te->AutoCompGetSeparator() ) );
619 }
620}
621
622
624{
625 m_te->AutoCompCancel();
626}
627
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:88
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:395
wxColour ToColour() const
Definition: color4d.cpp:220
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition: color4d.h:295
void onChar(wxStyledTextEvent &aEvent)
int firstNonWhitespace(int aLine, int *aWhitespaceCount=nullptr)
virtual void onCharHook(wxKeyEvent &aEvent)
std::function< void(wxKeyEvent &aEvent)> m_onAcceptFn
void onThemeChanged(wxSysColourChangedEvent &aEvent)
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
void onScintillaUpdateUI(wxStyledTextEvent &aEvent)
void DoTextVarAutocomplete(const std::function< void(const wxString &xRef, wxArrayString *tokens)> &getTokensFn)
std::function< void(wxStyledTextEvent &aEvent)> m_onCharAddedFn
void onModified(wxStyledTextEvent &aEvent)
SCINTILLA_TRICKS(wxStyledTextCtrl *aScintilla, const wxString &aBraces, bool aSingleLine, std::function< void(wxKeyEvent &)> onAcceptHandler=[](wxKeyEvent &aEvent) { }, std::function< void(wxStyledTextEvent &)> onCharAddedHandler=[](wxStyledTextEvent &) { })
wxStyledTextCtrl * m_te
This file is part of the common library.
KICOMMON_API wxFont GetMonospacedUIFont()
Definition: ui_common.cpp:92
STL namespace.
bool isCtrlSlash(wxKeyEvent &aEvent)
std::vector< FAB_LAYER_COLOR > dummy
bool ConvertSmartQuotesAndDashes(wxString *aString)
Convert curly quotes and em/en dashes to straight quotes and dashes.
Functions to provide common constants and other functions to assist in making a consistent UI.