From 2553dd2942f526691055ac33b474f240494866b2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 5 Sep 2019 23:05:20 +0100 Subject: [PATCH] Bail on our custom dockart provider. It appears that it was causing some crashes, and it was never clear that it looked better anyway. --- common/CMakeLists.txt | 1 - common/eda_dockart.cpp | 95 --------------------------- cvpcb/display_footprints_frame.cpp | 3 - eeschema/libedit/lib_edit_frame.cpp | 2 - eeschema/sch_edit_frame.cpp | 2 - eeschema/viewlib_frame.cpp | 2 - gerbview/gerbview_frame.cpp | 2 - include/eda_dockart.h | 52 --------------- pagelayout_editor/pl_editor_frame.cpp | 2 - pcbnew/footprint_edit_frame.cpp | 2 - pcbnew/footprint_viewer_frame.cpp | 2 - pcbnew/footprint_wizard_frame.cpp | 4 -- pcbnew/pcb_edit_frame.cpp | 2 - 13 files changed, 171 deletions(-) delete mode 100644 common/eda_dockart.cpp delete mode 100644 include/eda_dockart.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 84a4cefd79..a1204c5b31 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -282,7 +282,6 @@ set( COMMON_SRCS eda_base_frame.cpp eda_dde.cpp eda_doc.cpp - eda_dockart.cpp eda_draw_frame.cpp eda_pattern_match.cpp eda_size_ctrl.cpp diff --git a/common/eda_dockart.cpp b/common/eda_dockart.cpp deleted file mode 100644 index 2e93170b13..0000000000 --- a/common/eda_dockart.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 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 - -void EDA_DOCKART::DrawBorder( wxDC& aDC, wxWindow* aWindow, const wxRect& aRect, - wxAuiPaneInfo& aPane ) -{ - const wxRect& r = aRect; - aDC.SetPen( m_borderPen ); - aDC.SetBrush( *wxTRANSPARENT_BRUSH ); - - // notebooks draw the border themselves, so they can use native rendering (e.g. tabartgtk) - wxAuiTabArt* art = nullptr; - wxAuiNotebook* nb = wxDynamicCast( aWindow, wxAuiNotebook ); - - if( nb ) - art = nb->GetArtProvider(); - - if( art ) - { - art->DrawBorder( aDC, aWindow, r ); - } - else if( aPane.name == "DrawFrame" ) - { - // We don't want to re-write the layout manager, so we give the canvas a single-pixel - // border and then fill in the top and left with the canvas background colour. - // - // This achieves a right-bottom-bordered canvas, which works reasonably well with - // wxWidgets right-bottom bordered toolbars. - - //wxWindow* window = reinterpret_cast( m_frame->GetCanvas() ); - //wxSize scrollbarSize = window->GetSize() - window->GetClientSize(); - // Not sure why it takes a pen twice as wide as the border to fill it in, but it does. - #if 0 - int borderWidth = GetMetric( wxAUI_DOCKART_PANE_BORDER_SIZE ) * 2; - int borderAdjust = borderWidth; - - aDC.SetPen( wxPen( m_frame->GetDrawBgColor().ToColour(), borderWidth ) ); - - // Yes, this leaves me scratching my head too. - if( m_frame->IsType( FRAME_PCB ) - || m_frame->IsType( FRAME_PCB_MODULE_EDITOR ) - || m_frame->IsType( FRAME_PCB_MODULE_VIEWER ) - || m_frame->IsType( FRAME_PCB_MODULE_VIEWER_MODAL ) - || m_frame->IsType( FRAME_GERBER ) ) - { - borderAdjust += 1; - } - - // left - aDC.DrawLine( r.x + 1, r.y, r.x + 1, r.y + r.height - borderAdjust - scrollbarSize.y ); - // top - aDC.DrawLine( r.x + 1, r.y, r.x + r.width - borderAdjust - scrollbarSize.x, r.y ); - - aDC.SetPen( m_borderPen ); - - // finish off bottom of left side (at end of scrollbar) - aDC.DrawLine( r.x, r.y + r.height - 1 - scrollbarSize.y, r.x, r.y + r.height - 1 ); - // right - aDC.DrawLine( r.x + r.width, r.y, r.x + r.width, r.y + r.height - 1 ); - // bottom - aDC.DrawLine( r.x, r.y + r.height - 1, r.x + r.width - 1, r.y + r.height - 1 ); - #endif - } - else - { - aDC.DrawRectangle( r ); - } -} - - diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index e2b89fe85f..727e05553e 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ #include #include #include - #include #include #include @@ -128,7 +126,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa ReCreateOptToolbar(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); 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) ); diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 0c59186a4d..c8923f7c64 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -155,7 +154,6 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : RebuildSymbolUnitsList(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 35fa87c35f..854d30296f 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -279,7 +278,6 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_pageSetupData.GetPrintData().SetNoCopies( 1 ); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); 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) ); diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 32e4ee6265..c72d2fddcd 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -163,7 +162,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame DisplayLibInfos(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); // Manage main toolbar m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 83cd558d0d..f512ffeac0 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -143,7 +142,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): ReCreateAuxiliaryToolbar(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(4) ); diff --git a/include/eda_dockart.h b/include/eda_dockart.h deleted file mode 100644 index 396dd68be8..0000000000 --- a/include/eda_dockart.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 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 EDA_DOCKART_H -#define EDA_DOCKART_H - -#include -#include -#include - -class EDA_DOCKART : public wxAuiDefaultDockArt -{ -public: - EDA_DOCKART() - { - SetMetric( wxAUI_DOCKART_PANE_BORDER_SIZE, 1 ); - } - - /** - * Draw borders for Kicad AUI panes. - * - * The principal specialization over wxWidgets' default borders is the absence of a - * white single-pixel frame (which looks particularly poor on canvasses with dark - * backgrounds). - */ - void DrawBorder( wxDC& aDC, wxWindow* aWindow, const wxRect& r, - wxAuiPaneInfo& aPane ) override; -}; - - -#endif //EDA_DOCKART_H diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index d59779ccb5..5af58b4ec4 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -155,7 +154,6 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetStatusWidths( arrayDim( dims ), dims ); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); m_propertiesPagelayout = new PROPERTIES_FRAME( this ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index c761a12406..a515bbbdae 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -31,7 +31,6 @@ #include <3d_viewer/eda_3d_viewer.h> #include #include -#include #include #include #include @@ -187,7 +186,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_Layers->OnLayerSelected(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 975696a03e..4513c34889 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -228,7 +227,6 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent drawPanel->DisplayBoard( m_Pcb ); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().VToolbar().Name( "MainToolbar" ).Top().Layer(6) ); diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 3b9d8bcae9..fe14d073ee 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -33,13 +33,10 @@ #include #include #include -#include #include -#include #include #include #include "footprint_wizard_frame.h" -#include #include #include #include @@ -192,7 +189,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent DisplayWizardInfos(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 590df0338e..f8aeeddf23 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include @@ -235,7 +234,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateMicrowaveVToolbar(); m_auimgr.SetManagedWindow( this ); - m_auimgr.SetArtProvider( new EDA_DOCKART() ); // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );