From c2662b0e11bb2bcd5f0758e0616c313cc6168785 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 31 May 2019 18:37:07 +0100 Subject: [PATCH] Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. --- .../3d_cache/dialogs/panel_prev_model.cpp | 8 - 3d-viewer/CMakeLists.txt | 1 - common/CMakeLists.txt | 9 - common/dialogs/dialog_page_settings.cpp | 1 - common/eda_dockart.cpp | 2 - common/legacy_gal/eda_draw_frame.cpp | 10 +- common/legacy_wx/eda_draw_frame.cpp | 980 ------------------ common/legacy_wx/eda_draw_panel.cpp | 82 -- cvpcb/CMakeLists.txt | 3 +- cvpcb/dialogs/dialog_display_options.cpp | 3 - cvpcb/display_footprints_frame.cpp | 3 +- eeschema/dialogs/dialog_set_grid.cpp | 3 - .../dialogs/panel_libedit_display_options.cpp | 1 - eeschema/eeschema.cpp | 6 - eeschema/eeschema_config.cpp | 4 +- eeschema/libedit/lib_edit_frame.cpp | 2 +- eeschema/sch_base_frame.cpp | 6 +- eeschema/sch_base_frame.h | 22 +- eeschema/sch_draw_panel.cpp | 22 +- eeschema/sch_draw_panel.h | 13 +- eeschema/sch_edit_frame.cpp | 20 +- eeschema/sch_view.h | 7 +- eeschema/sheet.cpp | 2 +- eeschema/viewlib_frame.cpp | 6 +- gerbview/CMakeLists.txt | 5 +- gerbview/clear_gbr_drawlayers.cpp | 2 - gerbview/dcode.cpp | 2 - gerbview/dialogs/dialog_print_gerbview.cpp | 5 - .../panel_gerbview_display_options.cpp | 3 - gerbview/dialogs/panel_gerbview_settings.cpp | 1 - gerbview/events_called_functions.cpp | 8 - gerbview/files.cpp | 3 - gerbview/gbr_layout.cpp | 6 - gerbview/gerber_draw_item.cpp | 6 - gerbview/gerber_file_image.cpp | 3 - gerbview/gerbview.cpp | 2 - gerbview/gerbview_config.cpp | 6 - gerbview/gerbview_frame.cpp | 3 +- gerbview/gerbview_layer_widget.cpp | 4 - gerbview/gerbview_printout.cpp | 10 - gerbview/hotkeys.cpp | 6 - gerbview/job_file_reader.cpp | 3 - include/draw_frame.h | 10 - include/legacy_gal/class_drawpanel.h | 32 - include/legacy_wx/class_drawpanel.h | 56 - pagelayout_editor/CMakeLists.txt | 5 +- .../dialogs/dialog_new_dataitem.cpp | 2 - .../dialogs/dialogs_for_printing.cpp | 6 +- pagelayout_editor/files.cpp | 1 - pagelayout_editor/hotkeys.cpp | 2 - pagelayout_editor/pl_editor_frame.cpp | 2 +- pagelayout_editor/pl_editor_frame.h | 1 - pagelayout_editor/pl_editor_undo_redo.cpp | 5 +- pagelayout_editor/properties_frame.cpp | 5 +- pagelayout_editor/tools/pl_editor_control.cpp | 2 +- pagelayout_editor/tools/pl_point_editor.cpp | 2 +- pagelayout_editor/tools/pl_selection_tool.cpp | 4 +- pcbnew/CMakeLists.txt | 3 +- pcbnew/autorouter/ar_autoplacer.cpp | 6 - pcbnew/autorouter/spread_footprints.cpp | 3 - pcbnew/class_dimension.cpp | 5 - pcbnew/class_drawsegment.cpp | 9 - pcbnew/class_edge_mod.cpp | 1 - pcbnew/class_marker_pcb.cpp | 2 - pcbnew/class_module.cpp | 8 - pcbnew/class_pad.h | 1 - pcbnew/class_pcb_target.cpp | 2 - pcbnew/class_pcb_text.cpp | 1 - pcbnew/class_text_mod.cpp | 9 - pcbnew/class_track.cpp | 7 - pcbnew/class_zone.cpp | 8 - .../dialog_cleanup_tracks_and_vias.cpp | 1 - pcbnew/dialogs/dialog_drc.h | 3 - pcbnew/dialogs/dialog_drclistbox.h | 11 - .../dialog_edit_footprint_for_BoardEditor.cpp | 2 - .../dialog_edit_footprint_for_fp_editor.cpp | 2 - pcbnew/dialogs/dialog_exchange_footprints.cpp | 2 - pcbnew/dialogs/dialog_find.cpp | 6 +- .../dialog_fp_browser_display_options.cpp | 3 - pcbnew/dialogs/dialog_global_deletion.cpp | 4 - .../dialog_global_edit_text_and_graphics.cpp | 1 - .../dialog_global_edit_tracks_and_vias.cpp | 1 - .../dialog_graphic_item_properties.cpp | 1 - pcbnew/dialogs/dialog_pad_properties.cpp | 5 - pcbnew/dialogs/dialog_pad_properties.h | 4 - pcbnew/dialogs/dialog_print_pcbnew.cpp | 1 - .../dialogs/dialog_select_net_from_list.cpp | 2 - pcbnew/dialogs/dialog_set_grid.cpp | 9 - pcbnew/dialogs/dialog_swap_layers.cpp | 1 - pcbnew/dialogs/dialog_target_properties.cpp | 3 - pcbnew/dialogs/dialog_text_properties.cpp | 5 - pcbnew/dialogs/dialog_update_pcb.cpp | 2 - .../dialogs/panel_modedit_display_options.cpp | 1 - .../dialogs/panel_pcbnew_display_options.cpp | 2 - pcbnew/dialogs/panel_setup_mask_and_paste.cpp | 2 - pcbnew/dialogs/panel_setup_netclasses.cpp | 3 - .../dialogs/panel_setup_text_and_graphics.cpp | 3 - .../dialogs/panel_setup_tracks_and_vias.cpp | 1 - pcbnew/edit.cpp | 1 - pcbnew/edit_track_width.cpp | 2 - pcbnew/exporters/export_d356.cpp | 3 - pcbnew/exporters/export_gencad.cpp | 4 - pcbnew/files.cpp | 8 +- pcbnew/footprint_edit_frame.cpp | 5 +- pcbnew/footprint_editor_options.cpp | 8 - pcbnew/footprint_editor_utils.cpp | 1 - pcbnew/footprint_libraries_utils.cpp | 2 - pcbnew/footprint_viewer_frame.cpp | 3 +- pcbnew/footprint_wizard_frame.cpp | 7 +- pcbnew/footprint_wizard_frame_functions.cpp | 5 - pcbnew/load_select_footprint.cpp | 1 - pcbnew/microwave.cpp | 9 - pcbnew/netinfo_item.cpp | 2 - pcbnew/netinfo_list.cpp | 6 - pcbnew/netlist.cpp | 3 - pcbnew/pad_edit_functions.cpp | 1 - pcbnew/pad_print_functions.cpp | 1 - pcbnew/pcb_base_frame.cpp | 4 - pcbnew/pcb_edit_frame.cpp | 5 +- pcbnew/pcb_layer_widget.cpp | 5 - pcbnew/pcb_legacy_draw_utils.cpp | 4 - pcbnew/pcbnew.cpp | 3 - pcbnew/pcbnew_config.cpp | 1 - pcbnew/ratsnest.cpp | 20 +- pcbnew/sel_layer.cpp | 1 - .../specctra_import.cpp | 2 - pcbnew/swig/pcbnew_action_plugins.cpp | 1 - pcbnew/swig/pcbnew_scripting_helpers.cpp | 1 - pcbnew/toolbars_pcb_editor.cpp | 9 - pcbnew/tracks_cleaner.cpp | 1 - pcbnew/undo_redo.cpp | 2 - pcbnew/zones_by_polygon.cpp | 5 - pcbnew/zones_by_polygon_fill_functions.cpp | 7 - pcbnew/zones_functions_for_undo_redo.cpp | 1 - qa/pcbnew/CMakeLists.txt | 2 +- qa/pcbnew_tools/CMakeLists.txt | 2 +- qa/pcbnew_utils/CMakeLists.txt | 1 - qa/qa_utils/mocks.cpp | 13 - 138 files changed, 82 insertions(+), 1655 deletions(-) delete mode 100644 common/legacy_wx/eda_draw_frame.cpp delete mode 100644 common/legacy_wx/eda_draw_panel.cpp delete mode 100644 include/legacy_gal/class_drawpanel.h delete mode 100644 include/legacy_wx/class_drawpanel.h diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp index 5d5f2fbdee..0c6e5a01c1 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp @@ -24,20 +24,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file panel_prev_model.cpp - */ - #include "panel_prev_model.h" - #include <3d_canvas/eda_3d_canvas.h> #include - #include - #include #include -#include #include #include #include diff --git a/3d-viewer/CMakeLists.txt b/3d-viewer/CMakeLists.txt index 3a0c78151d..274e7349b2 100644 --- a/3d-viewer/CMakeLists.txt +++ b/3d-viewer/CMakeLists.txt @@ -6,7 +6,6 @@ configure_file( 3d_plugin_dir.h.in 3d_plugin_dir.h @ONLY ) include_directories(BEFORE ${INC_BEFORE}) include_directories( ${CMAKE_CURRENT_BINARY_DIR} - ../include/legacy_wx ../pcbnew 3d_canvas 3d_cache diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f179c6069b..5a564a58ad 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -74,19 +74,11 @@ set( LEGACY_GAL_SRCS legacy_gal/eda_draw_frame.cpp ) -set( LEGACY_WX_SRCS - legacy_wx/eda_draw_frame.cpp - legacy_wx/eda_draw_panel.cpp - ) - add_library( gal STATIC ${GAL_SRCS} ) add_library( legacy_gal STATIC ${LEGACY_GAL_SRCS} ) -add_library( legacy_wx STATIC ${LEGACY_WX_SRCS} ) -target_include_directories( legacy_wx PUBLIC ../include/legacy_wx ) target_include_directories( legacy_gal PUBLIC ../include/legacy_gal ) -target_link_libraries( legacy_wx PRIVATE bitmaps polygon ) target_link_libraries( legacy_gal PRIVATE bitmaps polygon ) target_link_libraries( gal @@ -507,7 +499,6 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} ) target_include_directories( pcbcommon PUBLIC - ../include/legacy_wx ) target_link_libraries( pcbcommon PUBLIC diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 90d6e24ba9..c78eceb791 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/common/eda_dockart.cpp b/common/eda_dockart.cpp index c1640afda3..7bca5f5aac 100644 --- a/common/eda_dockart.cpp +++ b/common/eda_dockart.cpp @@ -24,8 +24,6 @@ #include #include #include -//#include -//#include #include void EDA_DOCKART::DrawBorder( wxDC& aDC, wxWindow* aWindow, const wxRect& aRect, diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index b6a1f4ada1..46463ff383 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -82,6 +81,7 @@ BEGIN_EVENT_TABLE( EDA_DRAW_FRAME, KIWAY_PLAYER ) EVT_MENU_OPEN( EDA_DRAW_FRAME::OnMenuOpen ) EVT_MENU_CLOSE( EDA_DRAW_FRAME::OnMenuOpen ) EVT_MENU_HIGHLIGHT_ALL( EDA_DRAW_FRAME::OnMenuOpen ) + EVT_MENU_RANGE( ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_USER, EDA_DRAW_FRAME::OnSelectGrid ) END_EVENT_TABLE() @@ -99,7 +99,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_zoomSelectBox = NULL; m_hotkeysDescrList = NULL; - m_canvas = NULL; m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; m_galCanvas = NULL; m_actions = NULL; @@ -359,6 +358,7 @@ int EDA_DRAW_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, void EDA_DRAW_FRAME::PrintPage( wxDC* aDC, LSET aPrintMask, bool aPrintMirrorMode, void* aData ) { + wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") ); } @@ -416,6 +416,12 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event ) } +double EDA_DRAW_FRAME::GetZoom() +{ + return GetScreen()->GetZoom(); +} + + void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg ) { m_toolMsg = msg; diff --git a/common/legacy_wx/eda_draw_frame.cpp b/common/legacy_wx/eda_draw_frame.cpp deleted file mode 100644 index 89fd03e97d..0000000000 --- a/common/legacy_wx/eda_draw_frame.cpp +++ /dev/null @@ -1,980 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2004-2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2008 Wayne Stambaugh - * Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Definition for enabling and disabling scroll bar setting trace output. See the - * wxWidgets documentation on useing the WXTRACE environment variable. - */ -static const wxString traceScrollSettings( wxT( "KicadScrollSettings" ) ); - - -///@{ -/// \ingroup config -static const wxString FirstRunShownKeyword( wxT( "FirstRunShown" ) ); - -///@} - -/** - * Integer to set the maximum number of undo items on the stack. If zero, - * undo items are unlimited. - * - * Present as: - * - * - SchematicFrameDevelMaxUndoItems (file: eeschema) - * - LibeditFrameDevelMaxUndoItems (file: eeschema) - * - PcbFrameDevelMaxUndoItems (file: pcbnew) - * - ModEditFrameDevelMaxUndoItems (file: pcbnew) - * - * \ingroup develconfig - */ -static const wxString MaxUndoItemsEntry(wxT( "DevelMaxUndoItems" ) ); - -BEGIN_EVENT_TABLE( EDA_DRAW_FRAME, KIWAY_PLAYER ) - EVT_CHAR_HOOK( EDA_DRAW_FRAME::OnCharHook ) - - EVT_MENU_OPEN( EDA_DRAW_FRAME::OnMenuOpen ) - EVT_MENU_CLOSE( EDA_DRAW_FRAME::OnMenuOpen ) - EVT_MENU_HIGHLIGHT_ALL( EDA_DRAW_FRAME::OnMenuOpen ) - - EVT_MENU_RANGE( ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_USER, - EDA_DRAW_FRAME::OnSelectGrid ) -END_EVENT_TABLE() - - -EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, - FRAME_T aFrameType, - const wxString& aTitle, - const wxPoint& aPos, const wxSize& aSize, - long aStyle, const wxString & aFrameName ) : - KIWAY_PLAYER( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ) -{ - m_socketServer = nullptr; - m_mainToolBar = NULL; - m_drawToolBar = NULL; - m_optionsToolBar = NULL; - m_auxiliaryToolBar = NULL; - m_gridSelectBox = NULL; - m_zoomSelectBox = NULL; - m_hotkeysDescrList = NULL; - - m_canvas = NULL; - m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - m_galCanvas = NULL; - m_actions = NULL; - m_toolManager = NULL; - m_toolDispatcher = NULL; - m_messagePanel = NULL; - m_currentScreen = NULL; - m_toolId = ID_NO_TOOL_SELECTED; - m_lastDrawToolId = ID_NO_TOOL_SELECTED; - m_showAxis = false; // true to draw axis. - m_showBorderAndTitleBlock = false; // true to display reference sheet. - m_showGridAxis = false; // true to draw the grid axis - m_showOriginAxis = false; // true to draw the grid origin - m_LastGridSizeId = 0; - m_drawGrid = true; // hide/Show grid. default = show - m_gridColor = COLOR4D( DARKGRAY ); // Default grid color - m_showPageLimits = false; - m_drawBgColor = COLOR4D( BLACK ); // the background color of the draw canvas: - // BLACK for Pcbnew, BLACK or WHITE for eeschema - m_MsgFrameHeight = EDA_MSG_PANEL::GetRequiredHeight(); - m_movingCursorWithKeyboard = false; - m_zoomLevelCoeff = 1.0; - - m_auimgr.SetFlags(wxAUI_MGR_DEFAULT); - - CreateStatusBar( 6 ); - - // set the size of the status bar subwindows: - - wxWindow* stsbar = GetStatusBar(); - - int dims[] = { - - // remainder of status bar on far left is set to a default or whatever is left over. - -1, - - // When using GetTextSize() remember the width of character '1' is not the same - // as the width of '0' unless the font is fixed width, and it usually won't be. - - // zoom: - GetTextSize( wxT( "Z 762000" ), stsbar ).x + 10, - - // cursor coords - GetTextSize( wxT( "X 0234.567890 Y 0234.567890" ), stsbar ).x + 10, - - // delta distances - GetTextSize( wxT( "dx 0234.567890 dx 0234.567890 d 0234.567890" ), stsbar ).x + 10, - - // units display, Inches is bigger than mm - GetTextSize( _( "Inches" ), stsbar ).x + 10, - - // Size for the "Current Tool" panel; longest string from SetToolID() - GetTextSize( wxT( "Add layer alignment target" ), stsbar ).x + 10, - }; - - SetStatusWidths( arrayDim( dims ), dims ); - - // Create child subwindows. - GetClientSize( &m_FrameSize.x, &m_FrameSize.y ); - m_FramePos.x = m_FramePos.y = 0; - m_FrameSize.y -= m_MsgFrameHeight; - - m_canvas = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize ); - m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ), - wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); - - m_messagePanel->SetBackgroundColour( COLOR4D( LIGHTGRAY ).ToColour() ); -} - - -EDA_DRAW_FRAME::~EDA_DRAW_FRAME() -{ - delete m_socketServer; - for( auto socket : m_sockets ) - { - socket->Shutdown(); - socket->Destroy(); - } - - saveCanvasTypeSetting( m_canvasType ); - - delete m_actions; - delete m_toolManager; - delete m_toolDispatcher; - delete m_galCanvas; - - delete m_currentScreen; - m_currentScreen = NULL; - - m_auimgr.UnInit(); - - ReleaseFile(); -} - - -void EDA_DRAW_FRAME::OnCharHook( wxKeyEvent& event ) -{ - wxLogTrace( kicadTraceKeyEvent, "EDA_DRAW_FRAME::OnCharHook %s", dump( event ) ); - // Key events can be filtered here. - // Currently no filtering is made. - event.Skip(); -} - - -void EDA_DRAW_FRAME::ReleaseFile() -{ - m_file_checker = nullptr; -} - - -bool EDA_DRAW_FRAME::LockFile( const wxString& aFileName ) -{ - m_file_checker = ::LockFile( aFileName ); - - return bool( m_file_checker ); -} - - -void EDA_DRAW_FRAME::unitsChangeRefresh() -{ - UpdateStatusBar(); - UpdateMsgPanel(); -} - -void EDA_DRAW_FRAME::CommonSettingsChanged() -{ - EDA_BASE_FRAME::CommonSettingsChanged(); - - wxConfigBase* settings = Pgm().CommonSettings(); - KIGFX::VIEW_CONTROLS* viewControls = GetGalCanvas()->GetViewControls(); - - int autosaveInterval; - settings->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval ); - SetAutoSaveInterval( autosaveInterval ); - - int historySize; - settings->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE ); - Kiface().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) ); - - bool option; - settings->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option ); - viewControls->EnableMousewheelPan( option ); - - settings->Read( ENBL_ZOOM_NO_CENTER_KEY, &option ); - viewControls->EnableCursorWarping( !option ); - - settings->Read( ENBL_AUTO_PAN_KEY, &option ); - viewControls->EnableAutoPan( option ); - - m_galDisplayOptions.ReadCommonConfig( *settings, this ); -} - - -void EDA_DRAW_FRAME::EraseMsgBox() -{ - if( m_messagePanel ) - m_messagePanel->EraseMsgBox(); -} - - -void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) -{ - // On wxWidgets 3.0.x Windows, EVT_MENU_OPEN ( and other EVT_MENU_xx) events are not - // captured by the ACTON_MENU menus. While it is fixed in wxWidgets 3.1.x, we still - // need a solution for the earlier verions. - // - // This could be made conditional, but for now I'm going to use the same strategy - // everywhere so it gets wider testing. - // Note that if the conditional compilation is reactivated, the Connect() lines in - // ACTION_MENU::setupEvents() will need to be re-enabled. -//#if defined( __WINDOWS__ ) && wxCHECK_VERSION( 3, 0, 0 ) && !wxCHECK_VERSION( 3, 1, 0 ) - - // As if things weren't bad enough, wxWidgets doesn't pass the menu pointer when the - // event is a wxEVT_MENU_HIGHLIGHT, so we store the menu from the EVT_MENU_OPEN call. - static ACTION_MENU* currentMenu; - - if( event.GetEventType() == wxEVT_MENU_OPEN ) - { - currentMenu = dynamic_cast( event.GetMenu() ); - - if( currentMenu ) - currentMenu->OnMenuEvent( event ); - } - else if( event.GetEventType() == wxEVT_MENU_HIGHLIGHT ) - { - if( currentMenu ) - currentMenu->OnMenuEvent( event ); - } - else // if( event.GetEventType() == wxEVT_MENU_CLOSE ) - { - currentMenu = nullptr; - } -//#endif - - event.Skip(); -} - - -bool EDA_DRAW_FRAME::GetToolToggled( int aToolId ) -{ - // Checks all the toolbars and returns true if the given tool id is toggled. - return ( ( m_mainToolBar && m_mainToolBar->GetToolToggled( aToolId ) ) || - ( m_optionsToolBar && m_optionsToolBar->GetToolToggled( aToolId ) ) || - ( m_drawToolBar && m_drawToolBar->GetToolToggled( aToolId ) ) || - ( m_auxiliaryToolBar && m_auxiliaryToolBar->GetToolToggled( aToolId ) ) - ); -} - - -void EDA_DRAW_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) -{ - // No need to update the grid select box if it doesn't exist or the grid setting change - // was made using the select box. - if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL ) - return; - - int select = wxNOT_FOUND; - - for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) - { - if( GetScreen()->GetGridCmdId() == GetScreen()->GetGrid( i ).m_CmdId ) - { - select = (int) i; - break; - } - } - - if( select != m_gridSelectBox->GetSelection() ) - m_gridSelectBox->SetSelection( select ); -} - - -void EDA_DRAW_FRAME::ReCreateAuxiliaryToolbar() -{ -} - - -void EDA_DRAW_FRAME::ReCreateMenuBar() -{ -} - - -int EDA_DRAW_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, - wxString* aFullFileName ) -{ - int result = EDA_BASE_FRAME::WriteHotkeyConfig( aDescList, aFullFileName ); - - GetToolManager()->UpdateHotKeys(); - - return result; -} - -void EDA_DRAW_FRAME::PrintPage( wxDC* aDC, LSET aPrintMask, bool aPrintMirrorMode, void* aData ) -{ - wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") ); -} - - -void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) -{ - wxCHECK_RET( m_gridSelectBox, "m_gridSelectBox uninitialized" ); - - int id = m_gridSelectBox->GetCurrentSelection() + ID_POPUP_GRID_FIRST; - - if( id == ID_POPUP_GRID_SEPARATOR ) - { - // wxWidgets will check the separator, which we don't want. - // Re-check the current grid. - wxUpdateUIEvent dummy; - OnUpdateSelectGrid( dummy ); - } - else if( id == ID_POPUP_GRID_SETTINGS ) - { - // wxWidgets will check the Grid Settings... entry, which we don't want. - // R-check the current grid. - wxUpdateUIEvent dummy; - OnUpdateSelectGrid( dummy ); - // Now run the Grid Settings... dialog - wxCommandEvent dummy2; - OnGridSettings( dummy2 ); - } - else if( id >= ID_POPUP_GRID_FIRST && id < ID_POPUP_GRID_SEPARATOR ) - { - m_toolManager->RunAction( ACTIONS::gridPreset, true, id ); - } - - UpdateStatusBar(); - m_galCanvas->Refresh(); -} - - -void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event ) -{ - wxCHECK_RET( m_zoomSelectBox, "m_zoomSelectBox uninitialized" ); - - int id = m_zoomSelectBox->GetCurrentSelection(); - - if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) ) - return; - - m_toolManager->RunAction( "common.Control.zoomPreset", true, id ); - UpdateStatusBar(); - m_galCanvas->Refresh(); -} - - -double EDA_DRAW_FRAME::GetZoom() -{ - return GetScreen()->GetZoom(); -} - - -void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg ) -{ - m_toolMsg = msg; - SetStatusText( msg, 5 ); -} - - -void EDA_DRAW_FRAME::DisplayUnitsMsg() -{ - wxString msg; - - switch( m_UserUnits ) - { - case INCHES: msg = _( "Inches" ); break; - case MILLIMETRES: msg = _( "mm" ); break; - default: msg = _( "Units" ); break; - } - - SetStatusText( msg, 4 ); -} - - -void EDA_DRAW_FRAME::OnSize( wxSizeEvent& SizeEv ) -{ - m_FrameSize = GetClientSize( ); - - SizeEv.Skip(); -} - - -void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg ) -{ - // Keep default cursor in toolbars - SetCursor( wxNullCursor ); - - // Change GAL canvas cursor if requested. - if( aCursor >= 0 ) - GetGalCanvas()->SetCurrentCursor( aCursor ); - - DisplayToolMsg( aToolMsg ); - - if( aId < 0 ) - return; - - wxCHECK2_MSG( aId >= ID_NO_TOOL_SELECTED, aId = ID_NO_TOOL_SELECTED, - wxString::Format( wxT( "Current tool ID cannot be set to %d." ), aId ) ); - - m_toolId = aId; -} - - -void EDA_DRAW_FRAME::SetNoToolSelected() -{ - // Select the ID_NO_TOOL_SELECTED id tool (Idle tool) - SetToolID( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor(), wxEmptyString ); -} - - -void EDA_DRAW_FRAME::UpdateStatusBar() -{ - SetStatusText( GetZoomLevelIndicator(), 1 ); - - // Absolute and relative cursor positions are handled by overloading this function and - // handling the internal to user units conversion at the appropriate level. - - // refresh units display - DisplayUnitsMsg(); -} - - -const wxString EDA_DRAW_FRAME::GetZoomLevelIndicator() const -{ - wxString Line; - double level = m_galCanvas->GetGAL()->GetZoomFactor(); - - // returns a human readable value which can be displayed as zoom - // level indicator in dialogs. - Line.Printf( wxT( "Z %.2f" ), level ); - - return Line; -} - - -void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg ) -{ - EDA_BASE_FRAME::LoadSettings( aCfg ); - - wxString baseCfgName = ConfigBaseName(); - wxConfigBase* cmnCfg = Pgm().CommonSettings(); - - // Read units used in dialogs and toolbars - EDA_UNITS_T unitsTmp; - - if( aCfg->Read( baseCfgName + UserUnitsEntryKeyword, (int*) &unitsTmp ) ) - SetUserUnits( unitsTmp ); - else - SetUserUnits( MILLIMETRES ); - - // Read show/hide grid entry - bool btmp; - if( aCfg->Read( baseCfgName + ShowGridEntryKeyword, &btmp ) ) - SetGridVisibility( btmp ); - - // Read grid color: - COLOR4D wtmp = COLOR4D::UNSPECIFIED; - - if( wtmp.SetFromWxString( aCfg->Read( baseCfgName + GridColorEntryKeyword, wxT( "NONE" ) ) ) ) - SetGridColor( wtmp ); - - aCfg->Read( baseCfgName + LastGridSizeIdKeyword, &m_LastGridSizeId, 0L ); - - // m_LastGridSizeId is an offset, expected to be >= 0 - if( m_LastGridSizeId < 0 ) - m_LastGridSizeId = 0; - - m_UndoRedoCountMax = aCfg->Read( baseCfgName + MaxUndoItemsEntry, long( DEFAULT_MAX_UNDO_ITEMS ) ); - - aCfg->Read( baseCfgName + FirstRunShownKeyword, &m_firstRunDialogSetting, 0L ); - - m_galDisplayOptions.ReadConfig( *cmnCfg, *aCfg, baseCfgName, this ); -} - - -void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg ) -{ - EDA_BASE_FRAME::SaveSettings( aCfg ); - - wxString baseCfgName = ConfigBaseName(); - - aCfg->Write( baseCfgName + UserUnitsEntryKeyword, (int) m_UserUnits ); - aCfg->Write( baseCfgName + ShowGridEntryKeyword, IsGridVisible() ); - aCfg->Write( baseCfgName + GridColorEntryKeyword, - GetGridColor().ToColour().GetAsString( wxC2S_CSS_SYNTAX ) ); - aCfg->Write( baseCfgName + LastGridSizeIdKeyword, ( long ) m_LastGridSizeId ); - aCfg->Write( baseCfgName + FirstRunShownKeyword, m_firstRunDialogSetting ); - - if( GetScreen() ) - aCfg->Write( baseCfgName + MaxUndoItemsEntry, long( GetScreen()->GetMaxUndoItems() ) ); - - m_galDisplayOptions.WriteConfig( *aCfg, baseCfgName ); -} - - -void EDA_DRAW_FRAME::AppendMsgPanel( const wxString& textUpper, const wxString& textLower, - COLOR4D color, int pad ) -{ - if( m_messagePanel == NULL ) - return; - - m_messagePanel->AppendMessage( textUpper, textLower, color, pad ); -} - - -void EDA_DRAW_FRAME::ClearMsgPanel() -{ - if( m_messagePanel == NULL ) - return; - - m_messagePanel->EraseMsgBox(); -} - - -void EDA_DRAW_FRAME::SetMsgPanel( const MSG_PANEL_ITEMS& aList ) -{ - if( m_messagePanel == NULL ) - return; - - ClearMsgPanel(); - - for( MSG_PANEL_ITEM item : aList ) - m_messagePanel->AppendMessage( item ); -} - - -void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem ) -{ - wxCHECK_RET( aItem != NULL, wxT( "Invalid EDA_ITEM pointer. Bad programmer." ) ); - - MSG_PANEL_ITEMS items; - aItem->GetMsgPanelInfo( m_UserUnits, items ); - SetMsgPanel( items ); -} - - -void EDA_DRAW_FRAME::UpdateMsgPanel() -{ - GetToolManager()->PostEvent( EVENTS::SelectedItemsModified ); -} - - -void EDA_DRAW_FRAME::ActivateGalCanvas() -{ - KIGFX::GAL* gal = GetGalCanvas()->GetGAL(); - - // Set up grid settings - gal->SetGridVisibility( IsGridVisible() ); - gal->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) ); - gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) ); - - m_canvas->SetEvtHandlerEnabled( false ); - GetGalCanvas()->SetEvtHandlerEnabled( true ); - - GetGalCanvas()->StartDrawing(); - - // Reset current tool on switch(); - SetNoToolSelected(); -} - - -void EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) -{ - GetGalCanvas()->SwitchBackend( aCanvasType ); - m_canvasType = GetGalCanvas()->GetBackend(); - - ActivateGalCanvas(); -} - - -EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting() -{ - EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - wxConfigBase* cfg = Kiface().KifaceSettings(); - - if( cfg ) - { - canvasType = (EDA_DRAW_PANEL_GAL::GAL_TYPE) - cfg->ReadLong( GetCanvasTypeKey(), EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ); - } - - if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE - || canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST ) - { - assert( false ); - canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - } - - // Coerce the value into a GAL type when Legacy is not available - // Default to Cairo, and on the first, user will be prompted for OpenGL - if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE - && !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() ) - { -#ifdef __WXMAC__ - // Cairo renderer doesn't handle Retina displays - canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; -#else - canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; -#endif - } - - return canvasType; -} - - -bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) -{ - // Not all classes derived from EDA_DRAW_FRAME can save the canvas type, because some - // have a fixed type, or do not have a option to set the canvas type (they inherit from - // a parent frame) - FRAME_T allowed_frames[] = - { - FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR, FRAME_GERBER - }; - - bool allow_save = false; - - for( FRAME_T frame : allowed_frames ) - { - if( m_Ident == frame ) - { - allow_save = true; - break; - } - } - - if( !allow_save ) - return false; - - if( aCanvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE - || aCanvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST ) - { - wxASSERT( false ); - return false; - } - - wxConfigBase* cfg = Kiface().KifaceSettings(); - - if( cfg ) - return cfg->Write( GetCanvasTypeKey(), (long) aCanvasType ); - - return false; -} - -//-----< BASE_SCREEN API moved here >-------------------------------------------- - -wxPoint EDA_DRAW_FRAME::GetCrossHairPosition( bool aInvertY ) const -{ - // subject to change, borrow from old BASE_SCREEN for now. - VECTOR2I cursor = GetGalCanvas()->GetViewControls()->GetCursorPosition(); - - return wxPoint( cursor.x, cursor.y ); -} - - -void EDA_DRAW_FRAME::SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid ) -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - screen->setCrossHairPosition( aPosition, GetGridOrigin(), aSnapToGrid ); -} - - -wxPoint EDA_DRAW_FRAME::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize ) const -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - return screen->getCursorPosition( aOnGrid, GetGridOrigin(), aGridSize ); -} - - -wxPoint EDA_DRAW_FRAME::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize ) const -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - return screen->getNearestGridPosition( aPosition, GetGridOrigin(), aGridSize ); -} - - -void EDA_DRAW_FRAME::SetMousePosition( const wxPoint& aPosition ) -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - screen->setMousePosition( aPosition ); -} - - -wxPoint EDA_DRAW_FRAME::RefPos( bool useMouse ) const -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - return screen->refPos( useMouse ); -} - - -const wxPoint& EDA_DRAW_FRAME::GetScrollCenterPosition() const -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - return screen->getScrollCenterPosition(); -} - - -void EDA_DRAW_FRAME::SetScrollCenterPosition( const wxPoint& aPoint ) -{ - BASE_SCREEN* screen = GetScreen(); // virtual call - screen->setScrollCenterPosition( aPoint ); -} - -//------------------------------------------------- - -bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename, - const wxString& wildcard, const wxString& ext, - bool isDirectory ) -{ - wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" ); - aFilename.SetExt( ext ); - -#ifndef __WXMAC__ - if( isDirectory && doOpen ) - { - wxDirDialog dlg( this, prompt, Prj().GetProjectPath(), - wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return false; - - aFilename = dlg.GetPath(); - aFilename.SetExt( ext ); - } - else -#endif - { - wxFileDialog dlg( this, prompt, Prj().GetProjectPath(), aFilename.GetFullName() , - wildcard, doOpen ? wxFD_OPEN | wxFD_FILE_MUST_EXIST - : wxFD_SAVE | wxFD_CHANGE_DIR | wxFD_OVERWRITE_PROMPT ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return false; - - aFilename = dlg.GetPath(); - aFilename.SetExt( ext ); - } - - return true; -} - - -void EDA_DRAW_FRAME::HardRedraw() -{ - GetGalCanvas()->Refresh(); - GetGalCanvas()->Update(); -} - - -// Factor out the calculation portion of the various BestZoom() implementations. -// -// Note that like it's forerunners this routine has an intentional side-effect: it -// sets the scroll centre position. While I'm not happy about that, it's probably -// not worth fixing as its days are numbered (GAL canvases use a different method). -double EDA_DRAW_FRAME::bestZoom( double sizeX, double sizeY, double scaleFactor, wxPoint centre ) -{ - double bestzoom = std::max( sizeX * scaleFactor / (double) m_canvas->GetClientSize().x, - sizeY * scaleFactor / (double) m_canvas->GetClientSize().y ); - - // Take scrollbars into account - DSIZE scrollbarSize = m_canvas->GetSize() - m_canvas->GetClientSize(); - centre.x -= int( bestzoom * scrollbarSize.x / 2.0 ); - centre.y -= int( bestzoom * scrollbarSize.y / 2.0 ); - - SetScrollCenterPosition( centre ); - - return bestzoom; -} - - -// JEY TODO: Obsolete; replace with ACTIONS::zoomFitScreen -// JEY TODO: This is the last caller of BestZoom() too.... -void EDA_DRAW_FRAME::Zoom_Automatique( bool aWarpPointer ) -{ - BASE_SCREEN* screen = GetScreen(); - - // Set the best zoom and get center point. - - // BestZoom() can compute an illegal zoom if the client window size - // is small, say because frame is not maximized. So use the clamping form - // of SetZoom(): - double bestzoom = BestZoom(); - screen->SetScalingFactor( bestzoom ); - - if( !screen->m_Initialized ) - SetCrossHairPosition( GetScrollCenterPosition() ); - - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); -} - - -// Find the first child dialog. -wxWindow* findDialog( wxWindowList& aList ) -{ - for( wxWindow* window : aList ) - { - if( dynamic_cast( window ) ) - return window; - } - return NULL; -} - - -void EDA_DRAW_FRAME::FocusOnLocation( const wxPoint& aPos, bool aWarpCursor, bool aCenterView ) -{ - if( aCenterView ) - { - wxWindow* dialog = findDialog( GetChildren() ); - - // If a dialog partly obscures the window, then center on the uncovered area. - if( dialog ) - { - wxRect dialogRect( GetGalCanvas()->ScreenToClient( dialog->GetScreenPosition() ), - dialog->GetSize() ); - GetGalCanvas()->GetView()->SetCenter( aPos, dialogRect ); - } - else - GetGalCanvas()->GetView()->SetCenter( aPos ); - } - - if( aWarpCursor ) - GetGalCanvas()->GetViewControls()->SetCursorPosition( aPos ); - else - GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( aPos ); -} - - -void PrintPageLayout( wxDC* aDC, const PAGE_INFO& aPageInfo, const wxString& aFullSheetName, - const wxString& aFileName, const TITLE_BLOCK& aTitleBlock, int aSheetCount, - int aSheetNumber, int aPenWidth, double aScalar, COLOR4D aColor, - const wxString& aSheetLayer ) -{ - WS_DRAW_ITEM_LIST drawList; - - drawList.SetDefaultPenSize( aPenWidth ); - drawList.SetMilsToIUfactor( aScalar ); - drawList.SetSheetNumber( aSheetNumber ); - drawList.SetSheetCount( aSheetCount ); - drawList.SetFileName( aFileName ); - drawList.SetSheetName( aFullSheetName ); - drawList.SetSheetLayer( aSheetLayer ); - - drawList.BuildWorkSheetGraphicList( aPageInfo, aTitleBlock ); - - // Draw item list - drawList.Print( aDC, aColor ); -} - - -void EDA_DRAW_FRAME::PrintWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth, - double aScalar, const wxString &aFilename, - const wxString &aSheetLayer, COLOR4D aColor ) -{ - if( !m_showBorderAndTitleBlock ) - return; - - COLOR4D color = ( aColor != COLOR4D::UNSPECIFIED ) ? aColor : COLOR4D( RED ); - - wxPoint origin = aDC->GetDeviceOrigin(); - - if( origin.y > 0 ) - { - aDC->SetDeviceOrigin( 0, 0 ); - aDC->SetAxisOrientation( true, false ); - } - - PrintPageLayout( aDC, GetPageSettings(), GetScreenDesc(), aFilename, GetTitleBlock(), - aScreen->m_NumberOfScreens, aScreen->m_ScreenNumber, aLineWidth, aScalar, - color, aSheetLayer ); - - if( origin.y > 0 ) - { - aDC->SetDeviceOrigin( origin.x, origin.y ); - aDC->SetAxisOrientation( true, true ); - } -} - - -wxString EDA_DRAW_FRAME::GetScreenDesc() const -{ - // Virtual function. In basic class, returns an empty string. - return wxEmptyString; -} - - -const BOX2I EDA_DRAW_FRAME::GetDocumentExtents() const -{ - BOX2I rv; - rv.SetMaximum(); - return rv; -} - - -bool EDA_DRAW_FRAME::saveCanvasImageToFile( const wxString& aFileName, wxBitmapType aBitmapType ) -{ - return SaveCanvasImageToFile( this, aFileName, aBitmapType ); -} diff --git a/common/legacy_wx/eda_draw_panel.cpp b/common/legacy_wx/eda_draw_panel.cpp deleted file mode 100644 index 43e4ee7485..0000000000 --- a/common/legacy_wx/eda_draw_panel.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2007 Wayne Stambaugh - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - - -#ifdef __WXMAC__ -const int drawPanelStyle = wxHSCROLL | wxVSCROLL | wxALWAYS_SHOW_SB; -#else -const int drawPanelStyle = wxHSCROLL | wxVSCROLL; -#endif - -EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, const wxPoint& pos, - const wxSize& size ) : - wxScrolledWindow( parent, id, pos, size, drawPanelStyle ) -{ - wxASSERT( parent ); - - ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS ); - DisableKeyboardScrolling(); - - SetLayoutDirection( wxLayout_LeftToRight ); - - SetBackgroundColour( parent->GetDrawBgColor().ToColour() ); -} - - -EDA_DRAW_PANEL::~EDA_DRAW_PANEL() -{ -} - - -EDA_DRAW_FRAME* EDA_DRAW_PANEL::GetParent() const -{ - wxWindow* mom = wxScrolledWindow::GetParent(); - return (EDA_DRAW_FRAME*) mom; -} - - -BASE_SCREEN* EDA_DRAW_PANEL::GetScreen() -{ - EDA_DRAW_FRAME* parentFrame = GetParent(); - - return parentFrame->GetScreen(); -} - - -void EDA_DRAW_PANEL::Refresh( bool eraseBackground, const wxRect* rect ) -{ - GetParent()->GetGalCanvas()->Refresh(); -} - diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 1c92bfe422..13dd33df27 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -7,7 +7,6 @@ add_definitions( -DCVPCB ) include_directories( BEFORE ${INC_BEFORE} ) include_directories( - ../include/legacy_wx ./dialogs ../3d-viewer ../pcbnew @@ -145,7 +144,7 @@ target_link_libraries( cvpcb_kiface pcad2kicadpcb 3d-viewer gal - legacy_wx + legacy_gal common ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES} diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp index 9c8ff78c10..a809c00309 100644 --- a/cvpcb/dialogs/dialog_display_options.cpp +++ b/cvpcb/dialogs/dialog_display_options.cpp @@ -22,12 +22,9 @@ */ #include - #include #include -#include #include - #include diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 7767311ac3..6b977b62c9 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -167,7 +166,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa auto& galOpts = GetGalDisplayOptions(); galOpts.m_axesEnabled = true; - GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); diff --git a/eeschema/dialogs/dialog_set_grid.cpp b/eeschema/dialogs/dialog_set_grid.cpp index e7715822a1..7e33d73ea3 100644 --- a/eeschema/dialogs/dialog_set_grid.cpp +++ b/eeschema/dialogs/dialog_set_grid.cpp @@ -22,16 +22,13 @@ */ #include - #include #include -#include #include #include #include - class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE { SCH_BASE_FRAME* m_frame; diff --git a/eeschema/dialogs/panel_libedit_display_options.cpp b/eeschema/dialogs/panel_libedit_display_options.cpp index 1867a4bb5a..fca1c0dbca 100644 --- a/eeschema/dialogs/panel_libedit_display_options.cpp +++ b/eeschema/dialogs/panel_libedit_display_options.cpp @@ -17,7 +17,6 @@ * with this program. If not, see . */ -#include #include #include #include diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index b8caab9997..9b3d33748b 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -23,15 +23,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file eeschema.cpp - * @brief the main file - */ - #include #include #include -#include #include #include #include diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 407d2b52bb..c6a2c199b1 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -199,7 +199,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) if( ShowPreferences( g_Eeschema_Hotkeys_Descr, g_Schematic_Hotkeys_Descr, wxT( "eeschema" ) ) ) { SaveSettings( config() ); // save values shared by eeschema applications. - m_canvas->Refresh( true ); + GetGalCanvas()->Refresh( true ); } } @@ -613,7 +613,7 @@ void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) if( ShowPreferences( g_Eeschema_Hotkeys_Descr, g_Libedit_Hotkeys_Descr, wxT( "eeschema" ) ) ) { SaveSettings( config() ); // save values shared by eeschema applications. - m_canvas->Refresh( true ); + GetGalCanvas()->Refresh( true ); } } diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 527479c8e5..ea0ca001ad 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -211,7 +211,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : .BestSize( m_defaultLibWidth, -1 ).Resizable() ); m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) ); - m_auimgr.AddPane( m_canvas->GetWindow(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() ); + m_auimgr.AddPane( GetGalCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() ); m_auimgr.Update(); diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 13c02ee395..28b664f77d 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -394,10 +394,8 @@ void SCH_BASE_FRAME::createCanvas() m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; } - m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize, - GetGalDisplayOptions(), m_canvasType ); - - SetGalCanvas( static_cast( m_canvas ) ); + SetGalCanvas( new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize, + GetGalDisplayOptions(), m_canvasType ) ); ActivateGalCanvas(); } diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 7a4b963087..0f561fedcf 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -86,16 +86,16 @@ class SCH_BASE_FRAME : public EDA_DRAW_FRAME { protected: TEMPLATES m_templateFieldNames; - - wxPoint m_repeatStep; ///< the increment value of the position of an item - ///< when it is repeated - int m_repeatDeltaLabel; ///< the increment value of labels like bus members - ///< when they are repeated - bool m_showPinElectricalTypeName; - bool m_moveTakesCursorAsOrigin; ///< eemodern: always take the cursor (instead of item origin) as move anchor - bool m_dragActionIsMove; ///< eemodern: if true, drag action defaults to move, otherwise it's drag - bool m_dragAlwaysSelects; ///< eemodern: if true, drag action only selects items (and never drags/moves) - bool m_moveWarpsCursor; ///< eemodern: if true, cursor is warped to move/drag origin + wxPoint m_repeatStep; // the increment value of the position of an item + // when it is repeated + int m_repeatDeltaLabel; // the increment value of labels like bus members + // when they are repeated + bool m_showPinElectricalTypeName; + bool m_moveTakesCursorAsOrigin; // always take the cursor (instead of item origin) as + // the move anchor + bool m_dragActionIsMove; // drag action defaults to move, otherwise it's drag + bool m_dragAlwaysSelects; // drag action selects items (and never drags/moves) + bool m_moveWarpsCursor; // cursor is warped to move/drag origin public: SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, @@ -108,7 +108,7 @@ public: void createCanvas(); - SCH_DRAW_PANEL* GetCanvas() const override; + SCH_DRAW_PANEL* GetCanvas() const; SCH_SCREEN* GetScreen() const override; void SetScreen( BASE_SCREEN* aScreen ) override; diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 5175d264d3..e9199247b3 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -168,32 +168,16 @@ KIGFX::SCH_VIEW* SCH_DRAW_PANEL::view() const return static_cast( m_view ); } -BASE_SCREEN* SCH_DRAW_PANEL::GetScreen() -{ - return GetParent()->GetScreen(); -} - -EDA_DRAW_FRAME* SCH_DRAW_PANEL::GetParent() const -{ - return static_cast(m_parent); // static_cast (m_parent); -} - - -void SCH_DRAW_PANEL::Refresh( bool aEraseBackground, const wxRect* aRect ) -{ - EDA_DRAW_PANEL_GAL::Refresh( aEraseBackground, aRect ); -} - void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent ) { + // The first wxPaintEvent can be fired at startup before the GAL engine is fully initialized + // (depending on platforms). Do nothing in this case if( !m_gal->IsInitialized() || !m_gal->IsVisible() ) - // The first wxPaintEvent can be fired at startup before the GAL engine is fully initialized - // (depending on platforms). Do nothing in this case return; if( m_painter ) - static_cast(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr ); + static_cast( m_painter.get() )->GetSettings()->ImportLegacyColors( nullptr ); EDA_DRAW_PANEL_GAL::onPaint( aEvent ); } diff --git a/eeschema/sch_draw_panel.h b/eeschema/sch_draw_panel.h index b127841283..cad5baea51 100644 --- a/eeschema/sch_draw_panel.h +++ b/eeschema/sch_draw_panel.h @@ -6,8 +6,6 @@ #include #include -#include - namespace KIGFX { @@ -26,7 +24,7 @@ class COLORS_DESIGN_SETTINGS; class SCH_EDIT_FRAME; -class SCH_DRAW_PANEL : public EDA_DRAW_PANEL, public EDA_DRAW_PANEL_GAL +class SCH_DRAW_PANEL : public EDA_DRAW_PANEL_GAL { public: SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition, @@ -35,22 +33,13 @@ public: ~SCH_DRAW_PANEL(); - virtual wxWindow* GetWindow() override { return this; } - void DisplayComponent( const LIB_PART *aComponent ); void DisplaySheet( const SCH_SCREEN *aScreen ); bool SwitchBackend( GAL_TYPE aGalType ) override; - BASE_SCREEN* GetScreen() override; - virtual EDA_DRAW_FRAME* GetParent() const override; - KIGFX::SCH_VIEW* GetView() const { return view(); } - /// @copydoc wxWindow::Refresh() - void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ) override; - - protected: virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override; diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index b628ed4304..3aed303e74 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -323,7 +323,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) ); - m_auimgr.AddPane( m_canvas->GetWindow(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); + m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); m_auimgr.Update(); @@ -505,15 +505,14 @@ void SCH_EDIT_FRAME::SetCurrentSheet( const SCH_SHEET_PATH& aSheet ) if( aSheet != *g_CurrentSheet ) { *g_CurrentSheet = aSheet; - - static_cast( m_canvas )->DisplaySheet( g_CurrentSheet->LastScreen() ); + GetCanvas()->DisplaySheet( g_CurrentSheet->LastScreen() ); } } void SCH_EDIT_FRAME::HardRedraw() { - static_cast( m_canvas )->DisplaySheet( g_CurrentSheet->LastScreen() ); + GetCanvas()->DisplaySheet( g_CurrentSheet->LastScreen() ); GetGalCanvas()->ForceRefresh(); } @@ -669,7 +668,7 @@ void SCH_EDIT_FRAME::OnModify() if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity && CONNECTION_GRAPH::m_allowRealTime ) RecalculateConnections( false ); - m_canvas->Refresh(); + GetCanvas()->Refresh(); } @@ -852,7 +851,7 @@ void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile( wxCommandEvent& event ) { LoadCmpToFootprintLinkFile(); - m_canvas->Refresh(); + GetCanvas()->Refresh(); } @@ -867,7 +866,7 @@ void SCH_EDIT_FRAME::OnUpdateFields( wxCommandEvent& event ) } if( InvokeDialogUpdateFields( this, components, true ) == wxID_OK ) - m_canvas->Refresh(); + GetCanvas()->Refresh(); } @@ -1045,7 +1044,7 @@ void SCH_EDIT_FRAME::OnRemapSymbols( wxCommandEvent& event ) dlgRemap.ShowQuasiModal(); - m_canvas->Refresh( true ); + GetCanvas()->Refresh( true ); } @@ -1057,7 +1056,7 @@ void SCH_EDIT_FRAME::OnRemapSymbols( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnEditComponentSymbolsId( wxCommandEvent& event ) { InvokeDialogEditComponentsLibId( this ); - m_canvas->Refresh( true ); + GetCanvas()->Refresh( true ); } @@ -1292,8 +1291,7 @@ void SCH_EDIT_FRAME::ShowChangedLanguage() void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen ) { SCH_BASE_FRAME::SetScreen( aScreen ); - auto c = static_cast(m_canvas); - c->DisplaySheet( static_cast( aScreen ) ); + GetCanvas()->DisplaySheet( static_cast( aScreen ) ); } diff --git a/eeschema/sch_view.h b/eeschema/sch_view.h index f78ad593a1..f1bd734c0d 100644 --- a/eeschema/sch_view.h +++ b/eeschema/sch_view.h @@ -105,10 +105,11 @@ public: private: SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly // to know the sheet path name when drawing the page layout - std::unique_ptr m_worksheet; + + std::unique_ptr m_worksheet; std::unique_ptr m_selectionArea; - std::unique_ptr m_preview; - std::vector m_ownedItems; + std::unique_ptr m_preview; + std::vector m_ownedItems; }; }; // namespace diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 8e4a846a0c..85953f43c8 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -407,7 +407,7 @@ SCH_HIERLABEL* SCH_EDIT_FRAME::ImportHierLabel( SCH_SHEET* aSheet ) void SCH_EDIT_FRAME::DrawCurrentSheetToClipboard( wxCommandEvent& aEvt ) { wxRect DrawArea; - BASE_SCREEN* screen = GetCanvas()->GetScreen(); + BASE_SCREEN* screen = GetScreen(); DrawArea.SetSize( GetPageSizeIU() ); diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 00f7d1d460..512b40328f 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -186,7 +186,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_auimgr.AddPane( m_cmpList, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1) .CaptionVisible( false ).MinSize( 80, -1 ).BestSize( m_cmpListWidth, -1 ) ); - m_auimgr.AddPane( m_canvas->GetWindow(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); + m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); m_auimgr.GetPane( m_libList ).Show( aLibraryName.empty() ); @@ -555,7 +555,7 @@ bool LIB_VIEW_FRAME::ReCreateListLib() bool cmp_changed = ReCreateListCmp(); DisplayLibInfos(); - m_canvas->Refresh(); + GetCanvas()->Refresh(); return cmp_changed; } @@ -631,7 +631,7 @@ void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName ) m_libraryName = aLibraryName; ReCreateListCmp(); - m_canvas->Refresh(); + GetCanvas()->Refresh(); DisplayLibInfos(); // Ensure the corresponding line in m_libList is selected diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index 902277b7b5..006116fe96 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -7,7 +7,6 @@ add_definitions(-DGERBVIEW) include_directories( BEFORE ${INC_BEFORE} ) include_directories( - ../include/legacy_wx ../pcbnew dialogs ../common @@ -113,7 +112,7 @@ target_link_libraries( gerbview #singletop # replaces common, giving us restrictive control and link warnings. # There's way too much crap coming in from common yet. gal - legacy_wx + legacy_gal common ${wxWidgets_LIBRARIES} ) @@ -137,7 +136,7 @@ set_target_properties( gerbview_kiface PROPERTIES ) target_link_libraries( gerbview_kiface gal - legacy_wx + legacy_gal common ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES} diff --git a/gerbview/clear_gbr_drawlayers.cpp b/gerbview/clear_gbr_drawlayers.cpp index 1a1ffa4db7..69ee56385a 100644 --- a/gerbview/clear_gbr_drawlayers.cpp +++ b/gerbview/clear_gbr_drawlayers.cpp @@ -28,9 +28,7 @@ */ #include -#include #include - #include #include #include diff --git a/gerbview/dcode.cpp b/gerbview/dcode.cpp index 5539058410..c7c8e71d16 100644 --- a/gerbview/dcode.cpp +++ b/gerbview/dcode.cpp @@ -30,9 +30,7 @@ #include #include -#include #include - #include #include #include diff --git a/gerbview/dialogs/dialog_print_gerbview.cpp b/gerbview/dialogs/dialog_print_gerbview.cpp index 09a49fbd79..8b0a532dc4 100644 --- a/gerbview/dialogs/dialog_print_gerbview.cpp +++ b/gerbview/dialogs/dialog_print_gerbview.cpp @@ -25,20 +25,15 @@ */ #include - #include #include -#include #include - #include #include - #include #include #include #include - #include #include diff --git a/gerbview/dialogs/panel_gerbview_display_options.cpp b/gerbview/dialogs/panel_gerbview_display_options.cpp index 478329ad4f..47719ff193 100644 --- a/gerbview/dialogs/panel_gerbview_display_options.cpp +++ b/gerbview/dialogs/panel_gerbview_display_options.cpp @@ -18,11 +18,8 @@ * with this program. If not, see . */ - #include #include -#include - #include #include #include diff --git a/gerbview/dialogs/panel_gerbview_settings.cpp b/gerbview/dialogs/panel_gerbview_settings.cpp index df40a60845..b50a739ccf 100644 --- a/gerbview/dialogs/panel_gerbview_settings.cpp +++ b/gerbview/dialogs/panel_gerbview_settings.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index b933533f2e..f8846b0596 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -22,16 +22,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file events_called_functions.cpp - * @brief GerbView command event functions. - */ - #include #include -#include #include - #include #include #include @@ -40,7 +33,6 @@ #include #include #include - #include #include #include diff --git a/gerbview/files.cpp b/gerbview/files.cpp index d5c838bad4..35e1042453 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -26,12 +26,9 @@ #include #include #include - #include -#include #include #include - #include #include #include diff --git a/gerbview/gbr_layout.cpp b/gerbview/gbr_layout.cpp index 03dbbc373c..f471b66ac2 100644 --- a/gerbview/gbr_layout.cpp +++ b/gerbview/gbr_layout.cpp @@ -22,16 +22,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file gbr_layout.cpp - * @brief GBR_LAYOUT class functions. - */ - #include #include #include #include -#include #include #include #include diff --git a/gerbview/gerber_draw_item.cpp b/gerbview/gerber_draw_item.cpp index bd6671438e..959449b794 100644 --- a/gerbview/gerber_draw_item.cpp +++ b/gerbview/gerber_draw_item.cpp @@ -22,20 +22,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file gerber_draw_item.cpp - */ - #include #include #include #include #include -#include #include #include #include - #include #include #include diff --git a/gerbview/gerber_file_image.cpp b/gerbview/gerber_file_image.cpp index e40ced885f..052055056d 100644 --- a/gerbview/gerber_file_image.cpp +++ b/gerbview/gerber_file_image.cpp @@ -29,15 +29,12 @@ #include #include -#include #include #include - #include #include #include #include - #include #include diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index d50151aa5f..dbeb05bb3b 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -29,8 +29,6 @@ #include #include #include -#include - #include #include #include diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index b263ba2986..19017339c3 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -23,15 +23,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file gerbview_config.cpp - * @brief GerbView configuration. -*/ - #include #include #include -#include #include #include #include diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index b4ae294513..16050cc643 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -123,7 +122,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): SetScreen( new GBR_SCREEN( GetPageSettings().GetSizeIU() ) ); // Create the PCB_LAYER_WIDGET *after* SetLayout(): - m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas ); + m_LayersManager = new GERBER_LAYER_WIDGET( this, GetGalCanvas() ); // LoadSettings() *after* creating m_LayersManager, because LoadSettings() // initialize parameters in m_LayersManager diff --git a/gerbview/gerbview_layer_widget.cpp b/gerbview/gerbview_layer_widget.cpp index e2531a9bc5..6523726ddd 100644 --- a/gerbview/gerbview_layer_widget.cpp +++ b/gerbview/gerbview_layer_widget.cpp @@ -23,20 +23,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include #include -#include #include #include #include - #include #include #include #include #include - #include #include #include diff --git a/gerbview/gerbview_printout.cpp b/gerbview/gerbview_printout.cpp index 45bb017f7f..e72ed95f3b 100644 --- a/gerbview/gerbview_printout.cpp +++ b/gerbview/gerbview_printout.cpp @@ -22,25 +22,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file printout_control.cpp - * @brief Board print handler implementation file. - */ - - #include #include #include -#include #include #include - #include #include #include - #include "gerbview_printout.h" - #include #include #include diff --git a/gerbview/hotkeys.cpp b/gerbview/hotkeys.cpp index d2cc5ca66b..d1f12dd6c4 100644 --- a/gerbview/hotkeys.cpp +++ b/gerbview/hotkeys.cpp @@ -22,17 +22,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file gerbview/hotkeys.cpp - */ - #include #include #include - #include #include -#include #include #include diff --git a/gerbview/job_file_reader.cpp b/gerbview/job_file_reader.cpp index 419d190a46..abe8d0951a 100644 --- a/gerbview/job_file_reader.cpp +++ b/gerbview/job_file_reader.cpp @@ -29,10 +29,8 @@ #include #include #include - #include #include -#include #include #include #include @@ -40,7 +38,6 @@ #include #include #include - #include "json11.hpp" // A light JSON parser /** diff --git a/include/draw_frame.h b/include/draw_frame.h index 100e7d3e36..9a66c70e2b 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -37,7 +37,6 @@ class wxSingleInstanceChecker; class EDA_HOTKEY; class ACTION_TOOLBAR; -class EDA_DRAW_PANEL; using KIGFX::COLOR4D; @@ -82,10 +81,6 @@ namespace KIGFX */ class EDA_DRAW_FRAME : public KIWAY_PLAYER { - /// Let the #EDA_DRAW_PANEL object have access to the protected data since - /// it is closely tied to the #EDA_DRAW_FRAME. - friend class EDA_DRAW_PANEL; - ///< Id of active button on the vertical toolbar. int m_toolId; wxString m_toolMsg; @@ -121,9 +116,6 @@ protected: EDA_UNITS_T m_UserUnits; bool m_PolarCoords; //< for those frames that support polar coordinates - /// The area to draw on. - EDA_DRAW_PANEL* m_canvas; - TOOL_MANAGER* m_toolManager; TOOL_DISPATCHER* m_toolDispatcher; ACTIONS* m_actions; @@ -376,8 +368,6 @@ public: bool ShowPageLimits() const { return m_showPageLimits; } void SetShowPageLimits( bool aShow ) { m_showPageLimits = aShow; } - virtual EDA_DRAW_PANEL* GetCanvas() const { return m_canvas; } - virtual wxString GetScreenDesc() const; /** diff --git a/include/legacy_gal/class_drawpanel.h b/include/legacy_gal/class_drawpanel.h deleted file mode 100644 index e8f26fbdda..0000000000 --- a/include/legacy_gal/class_drawpanel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __EDA_DRAW_PANEL_H -#define __EDA_DRAW_PANEL_H - -#include -#include -#include -#include - -class BASE_SCREEN; - - -class EDA_DRAW_PANEL -{ -public: - EDA_DRAW_PANEL() - {}; - - virtual ~EDA_DRAW_PANEL(){}; - - virtual BASE_SCREEN* GetScreen() = 0; - - virtual EDA_DRAW_FRAME* GetParent() const = 0; - - // Only used for printing, so no clipping - virtual EDA_RECT* GetClipBox() { return nullptr; } - - virtual void Refresh( bool eraseBackground = true, const wxRect* rect = NULL ) {} - - virtual wxWindow* GetWindow() = 0; -}; - -#endif diff --git a/include/legacy_wx/class_drawpanel.h b/include/legacy_wx/class_drawpanel.h deleted file mode 100644 index 3d998c3d49..0000000000 --- a/include/legacy_wx/class_drawpanel.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 2011 Wayne Stambaugh - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * 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 - */ - -#ifndef PANEL_WXSTRUCT_H -#define PANEL_WXSTRUCT_H - -#include -#include -#include - - -class BASE_SCREEN; -class PCB_SCREEN; - - -class EDA_DRAW_PANEL : public wxScrolledWindow -{ -public: - EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, const wxPoint& pos, const wxSize& size ); - ~EDA_DRAW_PANEL(); - - BASE_SCREEN* GetScreen(); - - EDA_DRAW_FRAME* GetParent() const; - - // Only used for printing, so no clipping - virtual EDA_RECT* GetClipBox() { return nullptr; } - - /// @copydoc wxWindow::Refresh() - void Refresh( bool eraseBackground = true, const wxRect* rect = NULL ) override; -}; - - -#endif /* #ifndef PANEL_WXSTRUCT_H */ diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index 461b95dfe4..9d500e9a44 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -7,7 +7,6 @@ add_definitions(-DPL_EDITOR) include_directories(BEFORE ${INC_BEFORE}) include_directories( - ../include/legacy_wx dialogs ../common/dialogs ${INC_AFTER} @@ -81,7 +80,7 @@ set_source_files_properties( ../common/single_top.cpp PROPERTIES target_link_libraries( pl_editor #singletop # replaces common, giving us restrictive control and link warnings. # There's way too much crap coming in from common yet. - legacy_wx + legacy_gal gal common ${wxWidgets_LIBRARIES} @@ -100,7 +99,7 @@ add_library( pl_editor_kiface MODULE ${PL_EDITOR_EXTRA_SRCS} ) target_link_libraries( pl_editor_kiface - legacy_wx + legacy_gal gal common ${wxWidgets_LIBRARIES} diff --git a/pagelayout_editor/dialogs/dialog_new_dataitem.cpp b/pagelayout_editor/dialogs/dialog_new_dataitem.cpp index 72a28416b7..4a122d8f56 100644 --- a/pagelayout_editor/dialogs/dialog_new_dataitem.cpp +++ b/pagelayout_editor/dialogs/dialog_new_dataitem.cpp @@ -24,8 +24,6 @@ #include #include -#include - #include #include #include diff --git a/pagelayout_editor/dialogs/dialogs_for_printing.cpp b/pagelayout_editor/dialogs/dialogs_for_printing.cpp index a5d6e895c5..20018e2d8e 100644 --- a/pagelayout_editor/dialogs/dialogs_for_printing.cpp +++ b/pagelayout_editor/dialogs/dialogs_for_printing.cpp @@ -28,9 +28,7 @@ #include #include -#include #include - #include #include #include @@ -58,7 +56,7 @@ public: bool OnPrintPage( int aPageNum ) override; bool HasPage( int aPageNum ) override { return ( aPageNum <= 2 ); } void GetPageInfo( int* minPage, int* maxPage, int* selPageFrom, int* selPageTo ) override; - void DrawPage( int aPageNum ); + void PrintPage( int aPageNum ); }; /** @@ -132,7 +130,7 @@ END_EVENT_TABLE() bool PLEDITOR_PRINTOUT::OnPrintPage( int aPageNum ) { - DrawPage( aPageNum ); + PrintPage( aPageNum ); return true; } diff --git a/pagelayout_editor/files.cpp b/pagelayout_editor/files.cpp index 0aeda8e34d..8a3d319975 100644 --- a/pagelayout_editor/files.cpp +++ b/pagelayout_editor/files.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/pagelayout_editor/hotkeys.cpp b/pagelayout_editor/hotkeys.cpp index b5d00c5a97..0bc098c733 100644 --- a/pagelayout_editor/hotkeys.cpp +++ b/pagelayout_editor/hotkeys.cpp @@ -26,8 +26,6 @@ #include #include #include - -#include #include #include #include diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index df24d5a4ce..5c6e45eb04 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -174,7 +174,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); - GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); m_auimgr.Update(); diff --git a/pagelayout_editor/pl_editor_frame.h b/pagelayout_editor/pl_editor_frame.h index 5e695d84f2..f0a2aa40cb 100644 --- a/pagelayout_editor/pl_editor_frame.h +++ b/pagelayout_editor/pl_editor_frame.h @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/pagelayout_editor/pl_editor_undo_redo.cpp b/pagelayout_editor/pl_editor_undo_redo.cpp index 8b71573304..01e01fe0cb 100644 --- a/pagelayout_editor/pl_editor_undo_redo.cpp +++ b/pagelayout_editor/pl_editor_undo_redo.cpp @@ -24,7 +24,6 @@ */ #include -#include #include #include #include @@ -121,7 +120,7 @@ void PL_EDITOR_FRAME::GetLayoutFromUndoList() HardRedraw(); // items based off of corners will need re-calculating } else - GetCanvas()->Refresh(); + GetGalCanvas()->Refresh(); OnModify(); } @@ -153,5 +152,5 @@ void PL_EDITOR_FRAME::RollbackFromUndo() HardRedraw(); // items based off of corners will need re-calculating } else - GetCanvas()->Refresh(); + GetGalCanvas()->Refresh(); } diff --git a/pagelayout_editor/properties_frame.cpp b/pagelayout_editor/properties_frame.cpp index d1a4181117..6cb84d595b 100644 --- a/pagelayout_editor/properties_frame.cpp +++ b/pagelayout_editor/properties_frame.cpp @@ -24,7 +24,6 @@ */ #include -#include #include #include #include @@ -309,7 +308,7 @@ void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event ) CopyPrmsFromGeneralToPanel(); m_parent->OnModify(); - m_parent->GetCanvas()->Refresh(); + m_parent->GetGalCanvas()->Refresh(); } @@ -322,7 +321,7 @@ void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event ) model.m_DefaultTextThickness = 0.15; CopyPrmsFromGeneralToPanel(); - m_parent->GetCanvas()->Refresh(); + m_parent->GetGalCanvas()->Refresh(); } diff --git a/pagelayout_editor/tools/pl_editor_control.cpp b/pagelayout_editor/tools/pl_editor_control.cpp index 69e6821afe..1f5704ddfa 100644 --- a/pagelayout_editor/tools/pl_editor_control.cpp +++ b/pagelayout_editor/tools/pl_editor_control.cpp @@ -140,7 +140,7 @@ int PL_EDITOR_CONTROL::ToggleBackgroundColor( const TOOL_EVENT& aEvent ) getView()->GetPainter()->GetSettings()->SetBackgroundColor( m_frame->GetDrawBgColor() ); m_frame->GetGalCanvas()->GetView()->UpdateAllLayersColor(); - m_frame->GetCanvas()->Refresh(); + m_frame->GetGalCanvas()->Refresh(); return 0; } diff --git a/pagelayout_editor/tools/pl_point_editor.cpp b/pagelayout_editor/tools/pl_point_editor.cpp index 9ac7966124..a9d5111fb0 100644 --- a/pagelayout_editor/tools/pl_point_editor.cpp +++ b/pagelayout_editor/tools/pl_point_editor.cpp @@ -254,7 +254,7 @@ int PL_POINT_EDITOR::Main( const TOOL_EVENT& aEvent ) m_frame->OnModify(); m_editPoints.reset(); - m_frame->GetCanvas()->Refresh(); + m_frame->GetGalCanvas()->Refresh(); } return 0; diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index be98ce9bec..a4e2463e6a 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -591,7 +591,7 @@ bool PL_SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector ) } getView()->UpdateItems(); - m_frame->GetCanvas()->Refresh(); + m_frame->GetGalCanvas()->Refresh(); } if( current ) @@ -599,7 +599,7 @@ bool PL_SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector ) unhighlight( current, BRIGHTENED ); getView()->UpdateItems(); - m_frame->GetCanvas()->Refresh(); + m_frame->GetGalCanvas()->Refresh(); aCollector->Empty(); aCollector->Append( current ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 92e1b67fba..0bc9b59c32 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -37,7 +37,6 @@ endif() include_directories( BEFORE ${INC_BEFORE} ) include_directories( - ../include/legacy_wx ./dialogs ./autorouter ../3d-viewer @@ -644,7 +643,7 @@ set( PCBNEW_KIFACE_LIBRARIES pcbcommon pnsrouter pcad2kicadpcb - legacy_wx + legacy_gal common gal lib_dxf diff --git a/pcbnew/autorouter/ar_autoplacer.cpp b/pcbnew/autorouter/ar_autoplacer.cpp index 0f77543bc7..530dbba80e 100644 --- a/pcbnew/autorouter/ar_autoplacer.cpp +++ b/pcbnew/autorouter/ar_autoplacer.cpp @@ -26,27 +26,21 @@ */ #include -#include #include #include #include #include #include #include - #include #include #include #include #include - #include - #include #include - #include - #include "ar_matrix.h" #include "ar_cell.h" #include "ar_autoplacer.h" diff --git a/pcbnew/autorouter/spread_footprints.cpp b/pcbnew/autorouter/spread_footprints.cpp index d7d12e3e65..aa3c10813e 100644 --- a/pcbnew/autorouter/spread_footprints.cpp +++ b/pcbnew/autorouter/spread_footprints.cpp @@ -35,16 +35,13 @@ */ #include - #include #include -#include #include #include #include #include #include - #include struct TSubRect : public CRectPlacement::TRect diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index af5bfb94de..a19931d722 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -24,15 +24,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_dimension.cpp - */ - #include #include #include #include -#include #include #include #include diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 14e5ff89e6..799f85e764 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -24,25 +24,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_drawsegment.cpp - * @brief Class and functions to handle a graphic segments. - */ - #include #include #include #include -#include #include #include #include #include - #include - #include - #include #include #include diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index de5643d03c..ca3d65add0 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/class_marker_pcb.cpp b/pcbnew/class_marker_pcb.cpp index e1e8d6676b..eb405996a1 100644 --- a/pcbnew/class_marker_pcb.cpp +++ b/pcbnew/class_marker_pcb.cpp @@ -30,12 +30,10 @@ #include #include -#include #include #include #include #include - #include #include #include diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 96d667f0ff..c328d62224 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -24,15 +24,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_module.cpp - * @brief MODULE class implementation. - */ - #include #include #include -#include #include #include #include @@ -44,13 +38,11 @@ #include #include #include - #include #include #include #include #include - #include MODULE::MODULE( BOARD* parent ) : diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 16c57a7e58..4fbebbe1ff 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -49,7 +49,6 @@ enum CUST_PAD_SHAPE_IN_ZONE class LINE_READER; class EDA_3D_CANVAS; -class EDA_DRAW_PANEL; class MODULE; class EDGE_MODULE; class TRACK; diff --git a/pcbnew/class_pcb_target.cpp b/pcbnew/class_pcb_target.cpp index 17e0e7dec7..5de0aa757b 100644 --- a/pcbnew/class_pcb_target.cpp +++ b/pcbnew/class_pcb_target.cpp @@ -32,14 +32,12 @@ #include #include #include -#include #include #include #include #include #include #include - #include #include #include diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index bc0f26464d..756f9351b4 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 0bcdc6a7e5..f2da0ebef9 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -23,15 +23,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_module.cpp - * @brief TEXT_MODULE class implementation. - */ - #include #include #include -#include #include #include #include @@ -40,12 +34,9 @@ #include #include #include - #include #include - #include - #include diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 9fc790d176..92e43b4af2 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -24,18 +24,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_track.h - * @brief Functions relatives to tracks, vias and segments used to fill zones. - */ - - #include #include #include #include #include -#include #include #include #include diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index e72be58c54..340c2e406f 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -23,13 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_zone.cpp - * @brief Implementation of class to handle copper zones. - */ - #include -#include #include #include #include @@ -39,11 +33,9 @@ #include #include #include - #include #include #include - #include #include #include diff --git a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp index 6e91185f98..9a04fa2681 100644 --- a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include "dialog_drclistbox.h" diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index e9702b3956..2260c287a6 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -28,14 +28,11 @@ #define _DIALOG_DRC_H_ #include - #include #include -#include #include #include #include - #include #include #include diff --git a/pcbnew/dialogs/dialog_drclistbox.h b/pcbnew/dialogs/dialog_drclistbox.h index cf9f263150..b90a467b7d 100644 --- a/pcbnew/dialogs/dialog_drclistbox.h +++ b/pcbnew/dialogs/dialog_drclistbox.h @@ -27,25 +27,14 @@ #define _DIALOG_DRCLISTBOX_H_ #include - #include #include -#include #include #include #include - #include -// outside @end control identifiers since wxFormBuilder knows not DRCLISTBOX -#define ID_DRCLISTCTRL 14000 -#define ID_POPUP_UNCONNECTED_A 14001 -#define ID_POPUP_UNCONNECTED_B 14002 -#define ID_POPUP_MARKERS_A 14003 -#define ID_POPUP_MARKERS_B 14004 - - /** * Class DRC_LIST_MARKERS * is an implementation of the interface named DRC_ITEM_LIST which uses diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp index b292c63624..c7ee11043c 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -24,12 +24,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include #include #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 6ffd1b1cd8..6bb7d03c62 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -24,11 +24,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index a2bd589ef5..441e081f76 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -36,7 +35,6 @@ #include #include #include - #include diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index b818bdc657..d56f7e33b2 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include #include #include - #include #include #include @@ -97,7 +95,7 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) prevSearchString = searchString; - parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); + parent->GetGalCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); int count = 0; @@ -159,7 +157,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent ) foundItem = NULL; parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); - parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); + parent->GetGalCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); MARKER_PCB* marker = parent->GetBoard()->GetMARKER( markerCount++ ); diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options.cpp b/pcbnew/dialogs/dialog_fp_browser_display_options.cpp index ea8a46a022..2a81763d0a 100644 --- a/pcbnew/dialogs/dialog_fp_browser_display_options.cpp +++ b/pcbnew/dialogs/dialog_fp_browser_display_options.cpp @@ -22,11 +22,8 @@ */ #include - #include -#include #include - #include diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index a02920629f..4195f40ba3 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -25,21 +25,17 @@ using namespace std::placeholders; #include -#include #include #include #include #include #include - #include #include #include #include - #include #include - #include diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index bcdf6e6890..1c1023c5c0 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -23,7 +23,6 @@ */ #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index 0d449d3743..21daf39f99 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index 469ef4bb22..d656d5b06c 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 128d128e27..5bd23e4b5e 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -30,24 +30,19 @@ #include #include #include -#include #include #include #include #include #include #include - #include #include #include #include - #include - #include #include - #include // for enum RECT_CHAMFER_POSITIONS definition diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index b8bd7d73ed..68ddb9e856 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -32,18 +32,14 @@ #ifndef _DIALOG_PAD_PROPERTIES_H_ #define _DIALOG_PAD_PROPERTIES_H_ -#include #include #include #include #include - #include #include #include - #include - #include #include #include diff --git a/pcbnew/dialogs/dialog_print_pcbnew.cpp b/pcbnew/dialogs/dialog_print_pcbnew.cpp index 54edf26152..cc213beebe 100644 --- a/pcbnew/dialogs/dialog_print_pcbnew.cpp +++ b/pcbnew/dialogs/dialog_print_pcbnew.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_select_net_from_list.cpp b/pcbnew/dialogs/dialog_select_net_from_list.cpp index dd0e3a387c..f46ec6db37 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list.cpp +++ b/pcbnew/dialogs/dialog_select_net_from_list.cpp @@ -24,14 +24,12 @@ #include #include -#include #include #include #include #include #include #include - #include #include #include diff --git a/pcbnew/dialogs/dialog_set_grid.cpp b/pcbnew/dialogs/dialog_set_grid.cpp index cbe73cd4c2..a38d8ce932 100644 --- a/pcbnew/dialogs/dialog_set_grid.cpp +++ b/pcbnew/dialogs/dialog_set_grid.cpp @@ -21,25 +21,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file dialog_set_grid.cpp - * @brief Manage user grid. - */ - #include - #include #include #include #include #include -#include #include - #include #include #include - #include // Max values for grid size diff --git a/pcbnew/dialogs/dialog_swap_layers.cpp b/pcbnew/dialogs/dialog_swap_layers.cpp index f7eb2e0bb6..dff1ae0ee8 100644 --- a/pcbnew/dialogs/dialog_swap_layers.cpp +++ b/pcbnew/dialogs/dialog_swap_layers.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_target_properties.cpp b/pcbnew/dialogs/dialog_target_properties.cpp index acef5f2ec3..939b3a08e1 100644 --- a/pcbnew/dialogs/dialog_target_properties.cpp +++ b/pcbnew/dialogs/dialog_target_properties.cpp @@ -24,16 +24,13 @@ */ #include -#include #include #include #include #include #include - #include #include - #include #include #include diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 6496b0a357..4369b84571 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -23,16 +23,12 @@ */ #include - -#include #include #include #include #include - #include #include - #include #include #include @@ -42,7 +38,6 @@ #include #include #include - #include diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index 9d7b06c60b..4bcd383974 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -35,11 +35,9 @@ #include #include #include -#include #include #include #include - #include #include diff --git a/pcbnew/dialogs/panel_modedit_display_options.cpp b/pcbnew/dialogs/panel_modedit_display_options.cpp index 2bf670cb96..c44cb9b9f2 100644 --- a/pcbnew/dialogs/panel_modedit_display_options.cpp +++ b/pcbnew/dialogs/panel_modedit_display_options.cpp @@ -17,7 +17,6 @@ * with this program. If not, see . */ -#include #include #include #include diff --git a/pcbnew/dialogs/panel_pcbnew_display_options.cpp b/pcbnew/dialogs/panel_pcbnew_display_options.cpp index c19281a75f..8bc14a83e5 100644 --- a/pcbnew/dialogs/panel_pcbnew_display_options.cpp +++ b/pcbnew/dialogs/panel_pcbnew_display_options.cpp @@ -19,7 +19,6 @@ */ #include -#include #include #include #include @@ -30,7 +29,6 @@ #include #include #include - #include diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp index 8e64a2a129..96e52b8e93 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp @@ -23,12 +23,10 @@ #include -#include #include #include #include #include - #include diff --git a/pcbnew/dialogs/panel_setup_netclasses.cpp b/pcbnew/dialogs/panel_setup_netclasses.cpp index 7d0416e107..9263a89184 100644 --- a/pcbnew/dialogs/panel_setup_netclasses.cpp +++ b/pcbnew/dialogs/panel_setup_netclasses.cpp @@ -23,9 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include -#include #include #include #include @@ -33,7 +31,6 @@ #include #include #include - #include diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index f7e65575e9..35540ddb14 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -21,15 +21,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include #include -#include #include #include #include #include - #include diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp index 53f8458a4a..6d9d7d6635 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index d77514267b..34cb5d6f84 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/edit_track_width.cpp b/pcbnew/edit_track_width.cpp index 20d2304de3..1d80928ad1 100644 --- a/pcbnew/edit_track_width.cpp +++ b/pcbnew/edit_track_width.cpp @@ -24,12 +24,10 @@ #include #include -#include #include #include #include #include - #include #include diff --git a/pcbnew/exporters/export_d356.cpp b/pcbnew/exporters/export_d356.cpp index 6bb616c04f..0788ca6586 100644 --- a/pcbnew/exporters/export_d356.cpp +++ b/pcbnew/exporters/export_d356.cpp @@ -28,7 +28,6 @@ */ #include -#include #include #include #include @@ -37,9 +36,7 @@ #include #include #include - #include - #include #include #include diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 7ddbd83441..637b26a0a8 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -30,7 +30,6 @@ */ #include -#include #include #include #include @@ -38,15 +37,12 @@ #include #include #include - #include #include - #include #include #include #include - #include static bool CreateHeaderInfoData( FILE* aFile, PCB_EDIT_FRAME* frame ); diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 6689751c80..3dda17735c 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -23,13 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcbnew/files.cpp - * @brief Read and write board files. - */ - #include -#include #include #include #include @@ -620,7 +614,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in * This is more a workaround than a fix. */ SetFocus(); - GetCanvas()->SetFocus(); + GetGalCanvas()->SetFocus(); } return true; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 158048d1e2..4bcc2d8ea2 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -215,7 +214,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, // no net in footprint editor: make it non visible GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false ); - m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), true ); + m_Layers = new PCB_LAYER_WIDGET( this, GetGalCanvas(), true ); // LoadSettings() *after* creating m_LayersManager, because LoadSettings() // initialize parameters in m_LayersManager @@ -274,7 +273,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, GetGalCanvas()->GetGAL()->SetAxesEnabled( true ); - GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); m_auimgr.Update(); diff --git a/pcbnew/footprint_editor_options.cpp b/pcbnew/footprint_editor_options.cpp index 8253eceb56..2594f145fa 100644 --- a/pcbnew/footprint_editor_options.cpp +++ b/pcbnew/footprint_editor_options.cpp @@ -24,19 +24,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file footprint_editor_options.cpp - * @brief footprint editor options (events from left vertical option toolbar). - */ - #include -#include - #include #include #include #include - #include diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index a0b44b297c..42e541291a 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index e2200abb73..e291a78b33 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -28,11 +28,9 @@ #include #include - #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 24e09eaff2..846ba2393d 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include <3d_viewer/eda_3d_viewer.h> #include @@ -233,7 +232,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent GetGalCanvas()->GetGAL()->SetAxesEnabled( true ); - GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.) diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index f98240ede4..3758823060 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -24,14 +24,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file footprint_wizard_frame.cpp - */ - #include #include #include -#include #include #include #include @@ -228,7 +223,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent galOpts.m_forceDisplayCursor = true; galOpts.m_axesEnabled = true; - GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); updateView(); diff --git a/pcbnew/footprint_wizard_frame_functions.cpp b/pcbnew/footprint_wizard_frame_functions.cpp index 5f32fd47e8..5601a19337 100644 --- a/pcbnew/footprint_wizard_frame_functions.cpp +++ b/pcbnew/footprint_wizard_frame_functions.cpp @@ -23,13 +23,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file footprint_wizard_frame_functions.cpp - */ - #include #include -#include #include #include diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 2577cb886b..7fa760345e 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -27,7 +27,6 @@ using namespace std::placeholders; #include -#include #include #include #include diff --git a/pcbnew/microwave.cpp b/pcbnew/microwave.cpp index ca63ddbe64..727e7b8574 100644 --- a/pcbnew/microwave.cpp +++ b/pcbnew/microwave.cpp @@ -24,13 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file microwave.cpp - * @brief Microwave pcb layout code. - */ - #include -#include #include #include #include @@ -44,13 +38,10 @@ #include #include #include - #include #include #include - #include - #include static std::vector< wxRealPoint > PolyEdges; diff --git a/pcbnew/netinfo_item.cpp b/pcbnew/netinfo_item.cpp index 616fa2e9aa..512884677d 100644 --- a/pcbnew/netinfo_item.cpp +++ b/pcbnew/netinfo_item.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include #include - #include #include #include diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index 611fd92751..e21d242434 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -21,17 +21,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_netinfolist.cpp - */ - #include #include #include -#include #include #include - #include #include #include diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index 7f7b7be152..e072da44a6 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -32,7 +32,6 @@ using namespace std::placeholders; #include #include -#include #include #include #include @@ -43,14 +42,12 @@ using namespace std::placeholders; #include #include #include - #include #include #include #include #include #include - #include #include #include diff --git a/pcbnew/pad_edit_functions.cpp b/pcbnew/pad_edit_functions.cpp index b28b15a843..a5af6f6d17 100644 --- a/pcbnew/pad_edit_functions.cpp +++ b/pcbnew/pad_edit_functions.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/pcbnew/pad_print_functions.cpp b/pcbnew/pad_print_functions.cpp index b7d43280c6..673098ccd8 100644 --- a/pcbnew/pad_print_functions.cpp +++ b/pcbnew/pad_print_functions.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 4316e8a2ab..fb0121f8cd 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -35,7 +35,6 @@ #include #include #include <3d_viewer/eda_3d_viewer.h> // To include VIEWER3D_FRAMENAME - #include #include #include @@ -43,15 +42,12 @@ #include #include #include - #include -#include #include #include #include #include #include - #include #include #include diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 147da9e29e..b3b0ad55c3 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -288,7 +287,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetBoard( new BOARD() ); // Create the PCB_LAYER_WIDGET *after* SetBoard(): - m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() ); + m_Layers = new PCB_LAYER_WIDGET( this, GetGalCanvas() ); m_drc = new DRC( this ); // these 2 objects point to each other @@ -393,7 +392,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : GetGalCanvas()->SwitchBackend( m_canvasType ); - galCanvas->GetView()->SetScale( GetZoomLevelCoeff() / m_canvas->GetScreen()->GetZoom() ); + galCanvas->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); // disable Export STEP item if kicad2step does not exist diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index e657e0f8cf..cc4490ef58 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -31,11 +31,9 @@ #include #include -#include #include #include #include - #include #include #include @@ -47,14 +45,11 @@ #include #include #include - #include #include - #include #include #include - #include diff --git a/pcbnew/pcb_legacy_draw_utils.cpp b/pcbnew/pcb_legacy_draw_utils.cpp index d2dc03af29..7520cc8926 100644 --- a/pcbnew/pcb_legacy_draw_utils.cpp +++ b/pcbnew/pcb_legacy_draw_utils.cpp @@ -25,20 +25,16 @@ */ #include -#include #include #include - #include #include #include #include #include - #include #include #include - #include diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index ee93295dd3..139571e66f 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -39,16 +39,13 @@ #include #include #include -#include #include #include #include - #include #include #include #include - #include #include #include diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index effa3a7592..b287c6a7f1 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index 5671f29826..1420f1ed29 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -22,24 +22,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file ratsnest.cpp - * @brief Ratsnets functions. - */ - #include #include #include -#include #include #include - #include #include #include - #include - #include /** @@ -129,14 +120,17 @@ void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode ) if( enable && show ) { - if (curved_ratsnest) { + if (curved_ratsnest) + { auto dx = d.x - s.x; auto dy = d.y - s.y; auto cx = s.x + 0.5 * dx + 1.2 * dy; auto cy = s.y + 0.5 * dy - 1.2 * dx; - GRArc1( m_canvas->GetClipBox(), aDC, s.x, s.y, d.x, d.y, cx, cy, 0, color); - } else { - GRLine( m_canvas->GetClipBox(), aDC, s.x, s.y, d.x, d.y, 0, color ); + GRArc1( nullptr, aDC, s.x, s.y, d.x, d.y, cx, cy, 0, color); + } + else + { + GRLine( nullptr, aDC, s.x, s.y, d.x, d.y, 0, color ); } } } diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index dd35edb2b1..1e4b5837be 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include #include diff --git a/pcbnew/specctra_import_export/specctra_import.cpp b/pcbnew/specctra_import_export/specctra_import.cpp index dc8b1dff54..3d548c5167 100644 --- a/pcbnew/specctra_import_export/specctra_import.cpp +++ b/pcbnew/specctra_import_export/specctra_import.cpp @@ -32,12 +32,10 @@ */ -#include // m_canvas #include // DisplayError() #include // EDA_FileSelector() #include #include - #include #include #include diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/swig/pcbnew_action_plugins.cpp index 4d6c82670a..6522554d66 100644 --- a/pcbnew/swig/pcbnew_action_plugins.cpp +++ b/pcbnew/swig/pcbnew_action_plugins.cpp @@ -32,7 +32,6 @@ #include #include #include -#include // m_canvas #include #include #include diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index 40f7fd5db0..490952239e 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index c8feb0975f..7306dc2082 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -682,14 +681,6 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) { case ID_TB_OPTIONS_DRC_OFF: Settings().m_legacyDrcOn = !state; - - if( GetToolId() == ID_TRACK_BUTT ) - { - if( Settings().m_legacyDrcOn ) - m_canvas->SetCursor( wxCURSOR_PENCIL ); - else - m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW ); - } break; case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE: diff --git a/pcbnew/tracks_cleaner.cpp b/pcbnew/tracks_cleaner.cpp index 584be339e3..7b120d7e47 100644 --- a/pcbnew/tracks_cleaner.cpp +++ b/pcbnew/tracks_cleaner.cpp @@ -30,7 +30,6 @@ #include -#include #include #include #include diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index d33277bc85..72fee88af0 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -28,10 +28,8 @@ #include using namespace std::placeholders; #include -#include #include #include - #include #include #include diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index 964c498c31..cba66d5df1 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -26,24 +26,19 @@ #include #include -#include #include #include #include #include - #include #include - #include #include #include #include #include #include - #include - #include // Local variables diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index 5d2dee01c2..8399e1164a 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -27,27 +27,20 @@ */ #include - #include #include -#include #include #include #include #include - #include #include - #include #include #include - #include #include - #include - #include #include diff --git a/pcbnew/zones_functions_for_undo_redo.cpp b/pcbnew/zones_functions_for_undo_redo.cpp index 7b14cd7a20..c8d23412da 100644 --- a/pcbnew/zones_functions_for_undo_redo.cpp +++ b/pcbnew/zones_functions_for_undo_redo.cpp @@ -43,7 +43,6 @@ #include #include -#include #include #include diff --git a/qa/pcbnew/CMakeLists.txt b/qa/pcbnew/CMakeLists.txt index 1d18073fea..f95c140297 100644 --- a/qa/pcbnew/CMakeLists.txt +++ b/qa/pcbnew/CMakeLists.txt @@ -61,7 +61,7 @@ target_link_libraries( qa_pcbnew pcbcommon pnsrouter pcad2kicadpcb - legacy_wx + legacy_gal gal common qa_utils diff --git a/qa/pcbnew_tools/CMakeLists.txt b/qa/pcbnew_tools/CMakeLists.txt index 905ecc4cde..e46cb8551d 100644 --- a/qa/pcbnew_tools/CMakeLists.txt +++ b/qa/pcbnew_tools/CMakeLists.txt @@ -49,7 +49,7 @@ target_link_libraries( qa_pcbnew_tools pcbcommon pnsrouter pcad2kicadpcb - legacy_wx + legacy_gal gal lib_dxf idf3 diff --git a/qa/pcbnew_utils/CMakeLists.txt b/qa/pcbnew_utils/CMakeLists.txt index f8aab26569..dd9aeb6d79 100644 --- a/qa/pcbnew_utils/CMakeLists.txt +++ b/qa/pcbnew_utils/CMakeLists.txt @@ -63,7 +63,6 @@ target_link_libraries( qa_pcbnew_utils PUBLIC # pcad2kicadpcb # common # pcbcommon -# legacy_wx # gal # qa_utils # lib_dxf diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index 8d7c9a8496..1248e1d0a1 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -31,16 +31,13 @@ #include #include #include -#include #include #include #include - #include #include #include #include - #include #include #include @@ -356,13 +353,3 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I&, GENERAL_COLLECTOR& { } -EDA_DRAW_FRAME* EDA_DRAW_PANEL::GetParent() const -{ - return nullptr; -} - -BASE_SCREEN* EDA_DRAW_PANEL::GetScreen() -{ - return nullptr; -} -