pcbnew_control.cpp 17.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2014 CERN
 * @author Maciej Suminski <maciej.suminski@cern.ch>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#include "pcbnew_control.h"
#include "common_actions.h"

#include <pcbnew_id.h>
#include <wxPcbStruct.h>
#include <class_board.h>
31
#include <class_module.h>
32
#include <class_track.h>
33
#include <class_zone.h>
34
#include <class_draw_panel_gal.h>
35
#include <class_pcb_screen.h>
36
#include <pcbcommon.h>
37
#include <confirm.h>
38

39 40 41
#include <gal/graphics_abstraction_layer.h>
#include <view/view_controls.h>
#include <pcb_painter.h>
42 43

PCBNEW_CONTROL::PCBNEW_CONTROL() :
44
    TOOL_INTERACTIVE( "pcbnew.Control" )
45 46 47 48
{
}


49 50
void PCBNEW_CONTROL::Reset( RESET_REASON aReason )
{
51
    m_frame = getEditFrame<PCB_BASE_FRAME>();
52 53 54
}


55 56 57 58 59 60 61 62
bool PCBNEW_CONTROL::Init()
{
    setTransitions();

    return true;
}


63
int PCBNEW_CONTROL::ZoomInOut( TOOL_EVENT& aEvent )
64
{
65
    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
66
    double zoomScale = 1.0;
67 68

    if( aEvent.IsAction( &COMMON_ACTIONS::zoomIn ) )
69
        zoomScale = 1.3;
70
    else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOut ) )
71
        zoomScale = 0.7;
72

73
    view->SetScale( view->GetScale() * zoomScale, getViewControls()->GetCursorPosition() );
74 75 76 77 78 79
    setTransitions();

    return 0;
}


80
int PCBNEW_CONTROL::ZoomInOutCenter( TOOL_EVENT& aEvent )
81
{
82
    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
83
    double zoomScale = 1.0;
84

85
    if( aEvent.IsAction( &COMMON_ACTIONS::zoomInCenter ) )
86
        zoomScale = 1.3;
87
    else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOutCenter ) )
88
        zoomScale = 0.7;
89

90
    view->SetScale( view->GetScale() * zoomScale );
91 92 93 94 95 96 97 98
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::ZoomCenter( TOOL_EVENT& aEvent )
{
99 100
    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
    view->SetCenter( getViewControls()->GetCursorPosition() );
101 102 103 104 105 106 107 108
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent )
{
109 110
    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
    KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
111
    BOX2I boardBBox = getModel<BOARD>()->ViewBBox();
112 113 114 115 116 117 118 119 120 121 122
    VECTOR2I screenSize = gal->GetScreenPixelSize();

    double iuPerX = screenSize.x ? boardBBox.GetWidth() / screenSize.x : 1.0;
    double iuPerY = screenSize.y ? boardBBox.GetHeight() / screenSize.y : 1.0;

    double bestZoom = std::max( iuPerX, iuPerY );
    double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
    double zoom = 1.0 / ( zoomFactor * bestZoom );

    view->SetScale( zoom );
    view->SetCenter( boardBBox.Centre() );
123 124 125 126 127 128 129 130
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent )
{
131 132 133
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
134
            static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
135 136 137 138 139 140

    // Apply new display options to the GAL canvas
    DisplayOpt.DisplayPcbTrackFill = !DisplayOpt.DisplayPcbTrackFill;
    m_frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
    settings->LoadDisplayOptions( DisplayOpt );

141 142 143 144 145
    for( TRACK* track = getModel<BOARD>()->m_Track; track; track = track->Next() )
    {
        if( track->Type() == PCB_TRACE_T )
            track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
    }
146

147
    m_frame->GetGalCanvas()->Refresh();
148 149 150 151 152 153 154 155
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::PadDisplayMode( TOOL_EVENT& aEvent )
{
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
            static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );

    // Apply new display options to the GAL canvas
    DisplayOpt.DisplayPadFill = !DisplayOpt.DisplayPadFill;
    m_frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill;
    settings->LoadDisplayOptions( DisplayOpt );

    for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() )
    {
        for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
            pad->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
    }

    m_frame->GetGalCanvas()->Refresh();
173 174 175 176 177 178 179 180
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent )
{
181 182 183
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
184
            static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
185 186 187 188 189 190

    // Apply new display options to the GAL canvas
    DisplayOpt.DisplayViaFill = !DisplayOpt.DisplayViaFill;
    m_frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill;
    settings->LoadDisplayOptions( DisplayOpt );

191
    for( TRACK* track = getModel<BOARD>()->m_Track; track; track = track->Next() )
192 193 194 195 196
    {
        if( track->Type() == PCB_VIA_T )
            track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
    }

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
    m_frame->GetGalCanvas()->Refresh();
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::ZoneDisplayMode( TOOL_EVENT& aEvent )
{
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
            static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );

    // Apply new display options to the GAL canvas
    if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayEnable ) )
        DisplayOpt.DisplayZonesMode = 0;
    else if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayDisable ) )
        DisplayOpt.DisplayZonesMode = 1;
    else if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayOutlines ) )
        DisplayOpt.DisplayZonesMode = 2;
    else
        assert( false );

    settings->LoadDisplayOptions( DisplayOpt );

    BOARD* board = getModel<BOARD>();
    for( int i = 0; i < board->GetAreaCount(); ++i )
        board->GetArea( i )->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );

    m_frame->GetGalCanvas()->Refresh();
228 229 230 231 232 233 234 235
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::HighContrastMode( TOOL_EVENT& aEvent )
{
236 237 238 239 240 241 242
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
            static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );

    DisplayOpt.ContrastModeDisplay = !DisplayOpt.ContrastModeDisplay;
    settings->LoadDisplayOptions( DisplayOpt );
243
    m_frame->GetGalCanvas()->SetHighContrastLayer( m_frame->GetActiveLayer() );
244

245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::HighContrastInc( TOOL_EVENT& aEvent )
{
    std::cout << __PRETTY_FUNCTION__ << std::endl;
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::HighContrastDec( TOOL_EVENT& aEvent )
{
    std::cout << __PRETTY_FUNCTION__ << std::endl;
    setTransitions();

    return 0;
}


// Layer control
int PCBNEW_CONTROL::LayerTop( TOOL_EVENT& aEvent )
{
272 273
    m_frame->SwitchLayer( NULL, F_Cu );
    m_frame->GetGalCanvas()->SetFocus();
274 275 276 277 278 279 280 281
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner1( TOOL_EVENT& aEvent )
{
282 283
    m_frame->SwitchLayer( NULL, In1_Cu );
    m_frame->GetGalCanvas()->SetFocus();
284 285 286 287 288 289 290 291
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner2( TOOL_EVENT& aEvent )
{
292 293
    m_frame->SwitchLayer( NULL, In2_Cu );
    m_frame->GetGalCanvas()->SetFocus();
294 295 296 297 298 299 300 301
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner3( TOOL_EVENT& aEvent )
{
302 303
    m_frame->SwitchLayer( NULL, In3_Cu );
    m_frame->GetGalCanvas()->SetFocus();
304 305 306 307 308 309 310 311
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner4( TOOL_EVENT& aEvent )
{
312 313
    m_frame->SwitchLayer( NULL, In4_Cu );
    m_frame->GetGalCanvas()->SetFocus();
314 315 316 317 318 319 320 321
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner5( TOOL_EVENT& aEvent )
{
322 323
    m_frame->SwitchLayer( NULL, In5_Cu );
    m_frame->GetGalCanvas()->SetFocus();
324 325 326 327 328 329 330 331
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerInner6( TOOL_EVENT& aEvent )
{
332 333
    m_frame->SwitchLayer( NULL, In6_Cu );
    m_frame->GetGalCanvas()->SetFocus();
334 335 336 337 338 339 340 341
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerBottom( TOOL_EVENT& aEvent )
{
342 343
    m_frame->SetActiveLayer( B_Cu );
    m_frame->GetGalCanvas()->SetFocus();
344 345 346 347 348 349 350 351
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerNext( TOOL_EVENT& aEvent )
{
352 353
    PCB_BASE_FRAME* editFrame = m_frame;
    LAYER_NUM layer = editFrame->GetActiveLayer();
354

Dick Hollenbeck's avatar
Dick Hollenbeck committed
355
    if( layer < F_Cu || layer >= B_Cu )
356 357 358 359 360 361
    {
        setTransitions();
        return 0;
    }

    if( getModel<BOARD>()->GetCopperLayerCount() < 2 ) // Single layer
Dick Hollenbeck's avatar
Dick Hollenbeck committed
362
        layer = B_Cu;
363
    else if( layer >= getModel<BOARD>()->GetCopperLayerCount() - 2 )
364
        layer = F_Cu;
365 366
    else
        ++layer;
367

Dick Hollenbeck's avatar
Dick Hollenbeck committed
368
    editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) );
369 370 371 372 373 374 375 376 377
    editFrame->GetGalCanvas()->SetFocus();
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerPrev( TOOL_EVENT& aEvent )
{
378 379
    PCB_BASE_FRAME* editFrame = m_frame;
    LAYER_NUM layer = editFrame->GetActiveLayer();
380

Dick Hollenbeck's avatar
Dick Hollenbeck committed
381
    if( layer <= F_Cu || layer > B_Cu )
382 383 384 385 386 387
    {
        setTransitions();
        return 0;
    }

    if( getModel<BOARD>()->GetCopperLayerCount() < 2 ) // Single layer
Dick Hollenbeck's avatar
Dick Hollenbeck committed
388 389 390
        layer = B_Cu;
    else if( layer == B_Cu )
        layer = std::max( int( F_Cu ), getModel<BOARD>()->GetCopperLayerCount() - 2 );
391 392
    else
        --layer;
393 394

    assert( IsCopperLayer( layer ) );
Dick Hollenbeck's avatar
Dick Hollenbeck committed
395
    editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) );
396 397 398 399 400 401 402 403 404
    editFrame->GetGalCanvas()->SetFocus();
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerAlphaInc( TOOL_EVENT& aEvent )
{
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
            static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );

    LAYER_NUM currentLayer = m_frame->GetActiveLayer();
    KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer );

    if( currentColor.a <= 0.95 )
    {
        currentColor.a += 0.05;
        settings->SetLayerColor( currentLayer, currentColor );
        m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer );
    }

420 421 422 423 424 425 426 427
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::LayerAlphaDec( TOOL_EVENT& aEvent )
{
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
    KIGFX::PCB_PAINTER* painter =
            static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
    KIGFX::PCB_RENDER_SETTINGS* settings =
            static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );

    LAYER_NUM currentLayer = m_frame->GetActiveLayer();
    KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer );

    if( currentColor.a >= 0.05 )
    {
        currentColor.a -= 0.05;
        settings->SetLayerColor( currentLayer, currentColor );
        m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer );
    }

443 444 445 446 447 448 449 450 451
    setTransitions();

    return 0;
}


// Grid control
int PCBNEW_CONTROL::GridFast1( TOOL_EVENT& aEvent )
{
452
    m_frame->SetFastGrid1();
453 454 455 456 457 458 459 460
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::GridFast2( TOOL_EVENT& aEvent )
{
461
    m_frame->SetFastGrid2();
462 463 464 465 466 467 468 469
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::GridNext( TOOL_EVENT& aEvent )
{
470
    m_frame->SetNextGrid();
471 472 473 474 475 476 477 478
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::GridPrev( TOOL_EVENT& aEvent )
{
479
    m_frame->SetPrevGrid();
480 481 482 483 484 485
    setTransitions();

    return 0;
}


486 487 488
int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent )
{
    Activate();
489
    m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL,
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504
                                               _( "Adjust grid origin" ) );

    KIGFX::VIEW_CONTROLS* controls = getViewControls();
    controls->ShowCursor( true );
    controls->SetSnapping( true );
    controls->SetAutoPan( true );

    while( OPT_TOOL_EVENT evt = Wait() )
    {
        if( evt->IsClick( BUT_LEFT ) )
        {
            getView()->GetGAL()->SetGridOrigin( controls->GetCursorPosition() );
            getView()->MarkDirty();
        }

505
        else if( evt->IsCancel() || evt->IsActivate() )
506 507 508 509 510 511 512 513 514 515 516 517 518
            break;
    }

    controls->SetAutoPan( false );
    controls->SetSnapping( false );
    controls->ShowCursor( false );
    setTransitions();
    m_frame->SetToolID( ID_NO_TOOL_SELECTED, wxCURSOR_DEFAULT, wxEmptyString );

    return 0;
}


519 520 521
// Miscellaneous
int PCBNEW_CONTROL::ResetCoords( TOOL_EVENT& aEvent )
{
522 523 524 525
    VECTOR2I cursorPos = getViewControls()->GetCursorPosition();

    m_frame->GetScreen()->m_O_Curseur = wxPoint( cursorPos.x, cursorPos.y );
    m_frame->UpdateStatusBar();
526 527 528 529 530 531 532 533
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::SwitchUnits( TOOL_EVENT& aEvent )
{
534 535 536 537 538 539 540 541 542
    // TODO should not it be refactored to pcb_frame member function?
    wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );

    if( g_UserUnit == INCHES )
        evt.SetId( ID_TB_OPTIONS_SELECT_UNIT_MM );
    else
        evt.SetId( ID_TB_OPTIONS_SELECT_UNIT_INCH );

    m_frame->ProcessEvent( evt );
543 544 545 546 547 548 549 550
    setTransitions();

    return 0;
}


int PCBNEW_CONTROL::ShowHelp( TOOL_EVENT& aEvent )
{
551 552
    // TODO
    DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
553 554 555 556 557 558
    setTransitions();

    return 0;
}


559 560 561 562 563 564 565 566 567
int PCBNEW_CONTROL::ToBeDone( TOOL_EVENT& aEvent )
{
    DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
    setTransitions();

    return 0;
}


568 569 570
void PCBNEW_CONTROL::setTransitions()
{
    // View controls
571 572 573 574
    Go( &PCBNEW_CONTROL::ZoomInOut,          COMMON_ACTIONS::zoomIn.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoomInOut,          COMMON_ACTIONS::zoomOut.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoomInOutCenter,    COMMON_ACTIONS::zoomInCenter.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoomInOutCenter,    COMMON_ACTIONS::zoomOutCenter.MakeEvent() );
575 576 577 578 579 580 581
    Go( &PCBNEW_CONTROL::ZoomCenter,         COMMON_ACTIONS::zoomCenter.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoomFitScreen,      COMMON_ACTIONS::zoomFitScreen.MakeEvent() );

    // Display modes
    Go( &PCBNEW_CONTROL::TrackDisplayMode,   COMMON_ACTIONS::trackDisplayMode.MakeEvent() );
    Go( &PCBNEW_CONTROL::PadDisplayMode,     COMMON_ACTIONS::padDisplayMode.MakeEvent() );
    Go( &PCBNEW_CONTROL::ViaDisplayMode,     COMMON_ACTIONS::viaDisplayMode.MakeEvent() );
582 583 584
    Go( &PCBNEW_CONTROL::ZoneDisplayMode,    COMMON_ACTIONS::zoneDisplayEnable.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoneDisplayMode,    COMMON_ACTIONS::zoneDisplayDisable.MakeEvent() );
    Go( &PCBNEW_CONTROL::ZoneDisplayMode,    COMMON_ACTIONS::zoneDisplayOutlines.MakeEvent() );
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
    Go( &PCBNEW_CONTROL::HighContrastMode,   COMMON_ACTIONS::highContrastMode.MakeEvent() );
    Go( &PCBNEW_CONTROL::HighContrastInc,    COMMON_ACTIONS::highContrastInc.MakeEvent() );
    Go( &PCBNEW_CONTROL::HighContrastDec,    COMMON_ACTIONS::highContrastDec.MakeEvent() );

    // Layer control
    Go( &PCBNEW_CONTROL::LayerTop,           COMMON_ACTIONS::layerTop.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner1,        COMMON_ACTIONS::layerInner1.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner2,        COMMON_ACTIONS::layerInner2.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner3,        COMMON_ACTIONS::layerInner3.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner4,        COMMON_ACTIONS::layerInner4.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner5,        COMMON_ACTIONS::layerInner5.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerInner6,        COMMON_ACTIONS::layerInner6.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerBottom,        COMMON_ACTIONS::layerBottom.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerNext,          COMMON_ACTIONS::layerNext.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerPrev,          COMMON_ACTIONS::layerPrev.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerAlphaInc,      COMMON_ACTIONS::layerAlphaInc.MakeEvent() );
    Go( &PCBNEW_CONTROL::LayerAlphaDec ,     COMMON_ACTIONS::layerAlphaDec.MakeEvent() );

    // Grid control
    Go( &PCBNEW_CONTROL::GridFast1,          COMMON_ACTIONS::gridFast1.MakeEvent() );
    Go( &PCBNEW_CONTROL::GridFast2,          COMMON_ACTIONS::gridFast2.MakeEvent() );
    Go( &PCBNEW_CONTROL::GridNext,           COMMON_ACTIONS::gridNext.MakeEvent() );
    Go( &PCBNEW_CONTROL::GridPrev,           COMMON_ACTIONS::gridPrev.MakeEvent() );
608
    Go( &PCBNEW_CONTROL::GridSetOrigin,      COMMON_ACTIONS::gridSetOrigin.MakeEvent() );
609 610 611 612 613

    // Miscellaneous
    Go( &PCBNEW_CONTROL::ResetCoords,        COMMON_ACTIONS::resetCoords.MakeEvent() );
    Go( &PCBNEW_CONTROL::SwitchUnits,        COMMON_ACTIONS::switchUnits.MakeEvent() );
    Go( &PCBNEW_CONTROL::ShowHelp,           COMMON_ACTIONS::showHelp.MakeEvent() );
614
    Go( &PCBNEW_CONTROL::ToBeDone,           COMMON_ACTIONS::toBeDone.MakeEvent() );
615
}