diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index e4fb0140f0..d3a5c39045 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -71,10 +71,7 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS ) EVT_MIDDLE_DOWN( EDA_3D_CANVAS::OnMiddleDown) EVT_MOUSEWHEEL( EDA_3D_CANVAS::OnMouseWheel ) EVT_MOTION( EDA_3D_CANVAS::OnMouseMove ) - -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) EVT_MAGNIFY( EDA_3D_CANVAS::OnMagnify ) -#endif // other events EVT_ERASE_BACKGROUND( EDA_3D_CANVAS::OnEraseBackground ) @@ -156,9 +153,7 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList, wxEVT_RIGHT_UP, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_DCLICK, wxEVT_MIDDLE_UP, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_DCLICK, wxEVT_MOTION, wxEVT_MOUSEWHEEL, wxEVT_CHAR, wxEVT_CHAR_HOOK, -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) wxEVT_MAGNIFY, -#endif wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT }; @@ -613,7 +608,6 @@ void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event ) } -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event ) { SetFocus(); @@ -631,7 +625,6 @@ void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event ) DisplayStatus(); Request_refresh(); } -#endif void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.h b/3d-viewer/3d_canvas/eda_3d_canvas.h index dc189f9796..293855370d 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.h +++ b/3d-viewer/3d_canvas/eda_3d_canvas.h @@ -228,10 +228,7 @@ private: void OnMouseWheel( wxMouseEvent& event ); -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) void OnMagnify( wxMouseEvent& event ); -#endif - void OnMouseMove( wxMouseEvent& event ); void OnLeftDown( wxMouseEvent& event ); void OnLeftUp( wxMouseEvent& event ); diff --git a/CMakeLists.txt b/CMakeLists.txt index 36ebda993c..357f90c60d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -960,6 +960,9 @@ find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core # Include wxWidgets macros. include( ${wxWidgets_USE_FILE} ) +if( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.2 ) + message( FATAL_ERROR "wxWidgets 3.2.0 or greater is required" ) + if( MINGW ) # This needs to be on a separate line to protect against a broken FindWxWidgets.cmake in vcpkg if( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.1 ) diff --git a/common/bitmap.cpp b/common/bitmap.cpp index 71a1aef2ef..68a3627977 100644 --- a/common/bitmap.cpp +++ b/common/bitmap.cpp @@ -122,7 +122,7 @@ wxBitmap KiBitmap( const BITMAP_OPAQUE* aBitmap ) int KiIconScale( wxWindow* aWindow ) { - #if defined( __WXMSW__) && wxCHECK_VERSION( 3, 1, 6 ) + #if defined( __WXMSW__) // Basically don't try and scale within kicad and let wx do its thing // with wx introducing bitmap bundles, it will auto scale automatically with dpi // the issue is, none of the scaling factors have any tie to system scaling diff --git a/common/bitmap_base.cpp b/common/bitmap_base.cpp index af8f93bf9e..c45816ef32 100644 --- a/common/bitmap_base.cpp +++ b/common/bitmap_base.cpp @@ -310,10 +310,6 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const VECTOR2I& aPos, // Be carefull before changing the code. bool useTransform = aDC->CanUseTransformMatrix(); - #if wxCHECK_VERSION( 3, 1, 6 ) && !wxCHECK_VERSION( 3, 1, 7 ) - useTransform = false; - #endif - wxAffineMatrix2D init_matrix = aDC->GetTransformMatrix(); // Note: clipping bitmap area was made to fix a minor issue in old versions of diff --git a/common/build_version.cpp b/common/build_version.cpp index 78a983f723..107df3128e 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -53,16 +53,7 @@ extern std::string GetCurlLibVersion(); wxString GetPlatformGetBitnessName() { wxPlatformInfo platform; -// TODO (ISM): Read conditional once our wx fork and flatpaks are running released 3.1.5 -// On Windows, use GetBitnessName if exists -// I (J-PC) hope 3.1.6 has no problem -#if defined( __WINDOWS__ ) && wxCHECK_VERSION( 3, 1, 5 ) return platform.GetBitnessName(); -#elif wxCHECK_VERSION( 3, 1, 6 ) - return platform.GetBitnessName(); -#else - return platform.GetArchName(); -#endif } @@ -146,17 +137,7 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) wxPlatformInfo platform; aMsg << "Application: " << aTitle; - #if wxCHECK_VERSION( 3, 1, 6 ) aMsg << " " << wxGetCpuArchitectureName() << " on " << wxGetNativeCpuArchitectureName(); - #elif defined( KICAD_BUILD_ARCH_X64 ) - aMsg << " (64-bit)"; - #elif defined( KICAD_BUILD_ARCH_X86 ) - aMsg << " (32-bit)"; - #elif defined( KICAD_BUILD_ARCH_ARM ) - aMsg << " (ARM 32-bit)"; - #elif defined( KICAD_BUILD_ARCH_ARM64 ) - aMsg << " (ARM 64-bit)"; - #endif aMsg << eol << eol; diff --git a/common/dialogs/dialog_color_picker.cpp b/common/dialogs/dialog_color_picker.cpp index b17ea93ed4..41ec8f051f 100644 --- a/common/dialogs/dialog_color_picker.cpp +++ b/common/dialogs/dialog_color_picker.cpp @@ -396,7 +396,7 @@ void DIALOG_COLOR_PICKER::drawRGBPalette() // Use Y axis from bottom to top and origin to center bitmapDC.SetAxisOrientation( true, true ); -#if wxCHECK_VERSION( 3, 1, 7 ) && defined( __WXMSW__) +#if defined( __WXMSW__) // For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7 bitmapDC.SetDeviceOrigin( half_size, -half_size ); #else @@ -466,7 +466,7 @@ void DIALOG_COLOR_PICKER::drawHSVPalette() // Use Y axis from bottom to top and origin to center bitmapDC.SetAxisOrientation( true, true ); -#if wxCHECK_VERSION( 3, 1, 7 ) && defined( __WXMSW__) +#if defined( __WXMSW__) // For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7 bitmapDC.SetDeviceOrigin( half_size, -half_size ); #else diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index a4572ffe2f..1adf9b523f 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -138,15 +138,8 @@ PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( wxWindow* aParent ) // Hide the option of icons in menus for platforms that do not support them m_checkBoxIconsInMenus->Show( KIPLATFORM::UI::AllowIconsInMenus() ); - /* - * Font scaling hacks are only needed on GTK under wxWidgets 3.0. - */ -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - m_fontScalingHelp->SetFont( KIUI::GetInfoFont( this ).Italic() ); -#else m_scaleFonts->Show( false ); m_fontScalingHelp->Show( false ); -#endif if( m_iconScaleSlider ) { diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 4dc1f1a86d..75dbac0c33 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -142,9 +142,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin wxEVT_MOUSEWHEEL, wxEVT_CHAR, wxEVT_CHAR_HOOK, -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) wxEVT_MAGNIFY, -#endif KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE }; diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index fd6438f0dd..e3c70976cc 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -445,22 +445,8 @@ void EDA_BASE_FRAME::HandleUpdateUIEvent( wxUpdateUIEvent& aEvent, EDA_BASE_FRAM aEvent.Enable( enableRes ); aEvent.Show( showRes ); - // wxWidgets 3.1.5+ includes a field in the event that says if the event supports being - // checked, since wxMenuItems don't want to be checked unless they actually are checkable -#if wxCHECK_VERSION( 3, 1, 5 ) if( aEvent.IsCheckable() ) aEvent.Check( checkRes ); -#else - bool canCheck = true; - - // wxMenuItems don't want to be checked unless they actually are checkable, so we have to - // check to see if they can be and can't just universally apply a check in this event. - if( wxMenu* menu = dynamic_cast( aEvent.GetEventObject() ) ) - canCheck = menu->FindItem( aEvent.GetId() )->IsCheckable(); - - if( canCheck ) - aEvent.Check( checkRes ); -#endif } diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 5a471ff5eb..93d4cdd14c 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -172,7 +172,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_messagePanel->SetBackgroundColour( COLOR4D( LIGHTGRAY ).ToColour() ); -#if wxCHECK_VERSION( 3, 1, 3 ) Bind( wxEVT_DPI_CHANGED, [&]( wxDPIChangedEvent& ) { @@ -189,7 +188,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_messagePanel->SetPosition( wxPoint( 0, m_frameSize.y ) ); m_messagePanel->SetSize( m_frameSize.x, m_msgFrameHeight ); } ); -#endif } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 160e4cea16..93221809c5 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -314,9 +314,7 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent, Connect( wxEVT_AUX2_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); Connect( wxEVT_AUX2_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) Connect( wxEVT_MAGNIFY, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); -#endif #if defined _WIN32 || defined _WIN64 Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); #endif @@ -2556,15 +2554,6 @@ void OPENGL_GAL::init() wxASSERT_MSG( m_isContextLocked, "This should only be called from within a locked context." ); -// IsDisplayAttr() handles WX_GL_{MAJOR,MINOR}_VERSION correctly only in 3.0.4 -// starting with 3.1.0 one should use wxGLContext::IsOk() (done by GL_CONTEXT_MANAGER) -#if wxCHECK_VERSION( 3, 0, 3 ) and !wxCHECK_VERSION( 3, 1, 0 ) - const int attr[] = { WX_GL_MAJOR_VERSION, 2, WX_GL_MINOR_VERSION, 1, 0 }; - - if( !IsDisplaySupported( attr ) ) - throw std::runtime_error( "OpenGL 2.1 or higher is required!" ); -#endif /* wxCHECK_VERSION( 3, 0, 3 ) */ - // Check correct initialization from the constructor if( m_tesselator == nullptr ) throw std::runtime_error( "Could not create the tesselator" ); diff --git a/common/gl_context_mgr.cpp b/common/gl_context_mgr.cpp index dbbe0531e0..20eaa07044 100644 --- a/common/gl_context_mgr.cpp +++ b/common/gl_context_mgr.cpp @@ -40,13 +40,11 @@ wxGLContext* GL_CONTEXT_MANAGER::CreateCtx( wxGLCanvas* aCanvas, const wxGLConte wxGLContext* context = new wxGLContext( aCanvas, aOther ); wxCHECK( context, nullptr ); -#if wxCHECK_VERSION( 3, 1, 0 ) if( !context->IsOK() ) { delete context; return nullptr; } -#endif /* wxCHECK_VERSION( 3, 1, 0 ) */ m_glContexts.insert( std::make_pair( context, aCanvas ) ); diff --git a/common/launch_ext.cpp b/common/launch_ext.cpp index 1f543a981d..fc37d68455 100644 --- a/common/launch_ext.cpp +++ b/common/launch_ext.cpp @@ -29,27 +29,6 @@ bool LaunchExternal( const wxString& aPath ) const wchar_t* args[] = { L"open", aPath.wc_str(), nullptr }; return wxExecute( const_cast( args ) ) != -1; -#elif defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 1 ) - // On Unix systems `wxLaunchDefaultApplication()` before wxWidgets 3.1.1 mistakenly uses - // `wxExecute(xdg_open + " " + document)`, thereby failing for filenames with spaces. Below is - // a backport of the fixed `wxLaunchDefaultApplication()`, to be used until we switch to a - // newer version of wxWidgets. - - wxString PATH, xdg_open; - - if( wxGetEnv( "PATH", &PATH ) && wxFindFileInPath( &xdg_open, PATH, "xdg-open" ) ) - { - const char* argv[3]; - argv[0] = xdg_open.fn_str(); - argv[1] = aPath.fn_str(); - argv[2] = nullptr; - - if( wxExecute( const_cast( argv ) ) ) - return true; - } - - return false; - #else wxString path( aPath ); diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 58c7b206e6..30d32f36c5 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -830,11 +830,7 @@ wxString PGM_BASE::GetLanguageTag() return ""; else { - #if wxCHECK_VERSION( 3, 1, 6 ) wxString str = langInfo->GetCanonicalWithRegion(); - #else - wxString str = langInfo->CanonicalName; - #endif str.Replace( "_", "-" ); return str; @@ -911,16 +907,7 @@ bool PGM_BASE::IsGUI() if( !wxTheApp ) return false; -#if wxCHECK_VERSION( 3, 1, 6 ) return wxTheApp->IsGUI(); -#else - // wxWidgets older than version 3.1.6 do not have a way to know if the app - // has a GUI or is a console application. - // So the trick is to set the App class name when starting kicad-cli, and when - // the app class name is the kicad-cli class name the app is a console app - bool run_gui = wxTheApp->GetClassName() != KICAD_CLI_APP_NAME; - return run_gui; -#endif } diff --git a/common/properties/pg_cell_renderer.cpp b/common/properties/pg_cell_renderer.cpp index 58b59a3f6f..ac97e55a1c 100644 --- a/common/properties/pg_cell_renderer.cpp +++ b/common/properties/pg_cell_renderer.cpp @@ -64,11 +64,7 @@ bool PG_CELL_RENDERER::Render( wxDC &aDC, const wxRect &aRect, const wxPropertyG text = wxControl::Ellipsize( text, aDC, wxELLIPSIZE_MIDDLE, aRect.GetWidth() ); -#if wxCHECK_VERSION( 3, 1, 6 ) int imageWidth = PreDrawCell( aDC, aRect, aGrid, cell, preDrawFlags ); -#else - int imageWidth = PreDrawCell( aDC, aRect, cell, preDrawFlags ); -#endif int imageOffset = aProperty->GetImageOffset( imageWidth ); diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp index 2e44b2f1e8..7d614ef819 100644 --- a/common/settings/common_settings.cpp +++ b/common/settings/common_settings.cpp @@ -102,12 +102,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() : /* * Font scaling hacks are only needed on GTK under wxWidgets 3.0. */ -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - m_params.emplace_back( new PARAM( "appearance.apply_icon_scale_to_fonts", - &m_Appearance.apply_icon_scale_to_fonts, false ) ); -#else m_Appearance.apply_icon_scale_to_fonts = false; -#endif m_params.emplace_back( new PARAM( "appearance.show_scrollbars", &m_Appearance.show_scrollbars, false ) ); diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 7f87bccc02..1621879edd 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -492,16 +492,7 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) FindItem( m_selected, &menu ); // This conditional compilation is probably not needed. - // It will be removed later, for the Kicad V 6.x version. - // But in "old" 3.0 version, the "&& menu != this" contition was added to avoid - // hang. This hang is no longer encountered in wxWidgets 3.0.4 version, and this - // condition is no longer needed. And in 3.1.2, we have to remove it, as - // "menu != this" never happens ("menu != this" always happens in 3.1.1 and older!). -#if wxCHECK_VERSION( 3, 1, 2 ) if( menu ) -#else - if( menu && menu != this ) -#endif { ACTION_MENU* cxmenu = static_cast( menu ); evt = cxmenu->eventHandler( aEvent ); diff --git a/common/tool/action_toolbar.cpp b/common/tool/action_toolbar.cpp index f24c405e01..d634b0a362 100644 --- a/common/tool/action_toolbar.cpp +++ b/common/tool/action_toolbar.cpp @@ -191,12 +191,6 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP { m_paletteTimer = new wxTimer( this ); -#if !wxCHECK_VERSION( 3, 1, 0 ) - // Custom art provider makes dark mode work on wx < 3.1 - WX_AUI_TOOLBAR_ART* newArt = new WX_AUI_TOOLBAR_ART(); - SetArtProvider( newArt ); -#endif - Connect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ), nullptr, this ); Connect( wxEVT_AUITOOLBAR_RIGHT_CLICK, @@ -335,12 +329,8 @@ void ACTION_TOOLBAR::doSelectAction( ACTION_GROUP* aGroup, const TOOL_ACTION& aA // Update the item information item->SetShortHelp( aAction.GetTooltip() ); item->SetBitmap( KiScaledBitmap( aAction.GetIcon(), GetParent() ) ); -#if wxCHECK_VERSION( 3, 1, 6 ) item->SetDisabledBitmap( MakeDisabledBitmap( item->GetBitmapBundle().GetBitmapFor( GetParent() ) ) ); -#else - item->SetDisabledBitmap( MakeDisabledBitmap( item->GetBitmap() ) ); -#endif // Register a new handler with the new UI conditions if( m_toolManager ) diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 363a4b0725..90dc407774 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -463,9 +463,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) // Mouse handling // Note: wxEVT_LEFT_DOWN event must always be skipped. if( type == wxEVT_MOTION || type == wxEVT_MOUSEWHEEL || -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) type == wxEVT_MAGNIFY || -#endif isMouseClick( type ) || // Event issued when mouse retains position in screen coordinates, // but changes in world coordinates (e.g. autopanning) diff --git a/common/validators.cpp b/common/validators.cpp index 65e6c35101..50f735269d 100644 --- a/common/validators.cpp +++ b/common/validators.cpp @@ -393,7 +393,6 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent ) { wxArrayString badCharsFound; -#if wxCHECK_VERSION( 3, 1, 3 ) for( const wxUniCharRef& excludeChar : GetCharExcludes() ) { if( val.Find( excludeChar ) != wxNOT_FOUND ) @@ -410,24 +409,6 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent ) badCharsFound.Add( wxString::Format( wxT( "'%c'" ), excludeChar ) ); } } -#else - for( const wxString& excludeChar : GetExcludes() ) - { - if( val.Find( excludeChar ) != wxNOT_FOUND ) - { - if( excludeChar == wxT( "\r" ) ) - badCharsFound.Add( _( "carriage return" ) ); - else if( excludeChar == wxT( "\n" ) ) - badCharsFound.Add( _( "line feed" ) ); - else if( excludeChar == wxT( "\t" ) ) - badCharsFound.Add( _( "tab" ) ); - else if( excludeChar == wxT( " " ) ) - badCharsFound.Add( _( "space" ) ); - else - badCharsFound.Add( wxString::Format( wxT( "'%s'" ), excludeChar ) ); - } - } -#endif wxString badChars; diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 8868ce92d0..c7ee06fd69 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -89,10 +89,8 @@ WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, EDA_DRAW_PANEL_GAL* aParentPane m_parentPanel->Connect( wxEVT_MOTION, wxMouseEventHandler( WX_VIEW_CONTROLS::onMotion ), nullptr, this ); -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) m_parentPanel->Connect( wxEVT_MAGNIFY, wxMouseEventHandler( WX_VIEW_CONTROLS::onMagnify ), nullptr, this ); -#endif m_parentPanel->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( WX_VIEW_CONTROLS::onWheel ), nullptr, this ); m_parentPanel->Connect( wxEVT_MIDDLE_UP, @@ -423,7 +421,6 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent ) } -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) void WX_VIEW_CONTROLS::onMagnify( wxMouseEvent& aEvent ) { // Scale based on the magnification from our underlying magnification event. @@ -432,7 +429,6 @@ void WX_VIEW_CONTROLS::onMagnify( wxMouseEvent& aEvent ) aEvent.Skip(); } -#endif void WX_VIEW_CONTROLS::setState( STATE aNewState ) diff --git a/common/widgets/app_progress_dialog.cpp b/common/widgets/app_progress_dialog.cpp index 43311c040c..7cec661f89 100644 --- a/common/widgets/app_progress_dialog.cpp +++ b/common/widgets/app_progress_dialog.cpp @@ -30,31 +30,24 @@ APP_PROGRESS_DIALOG::APP_PROGRESS_DIALOG( const wxString& aTitle, const wxString bool aIndeterminateTaskBarStatus, int aStyle ) : wxProgressDialog( aTitle, aMessage == wxEmptyString ? wxString( wxT( " " ) ) : aMessage, - aMaximum, aParent, aStyle ) -#if wxCHECK_VERSION( 3, 1, 0 ) - , + aMaximum, aParent, aStyle ), m_appProgressIndicator( aParent, aMaximum ), m_indeterminateTaskBarStatus( aIndeterminateTaskBarStatus ) -#endif { -#if wxCHECK_VERSION( 3, 1, 0 ) if( m_indeterminateTaskBarStatus ) { m_appProgressIndicator.Pulse(); } -#endif } bool APP_PROGRESS_DIALOG::Update( int aValue, const wxString& aNewMsg, bool* aSkip ) { -#if wxCHECK_VERSION( 3, 1, 0 ) if( !m_indeterminateTaskBarStatus ) { m_appProgressIndicator.SetValue( aValue ); } -#endif return wxProgressDialog::Update( aValue, aNewMsg, aSkip ); } diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index fee2c8bc53..ceef6ed4b8 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -115,11 +115,7 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, const wxString& aRecentSearchesKey, LIB_T m_query_ctrl->Bind( wxEVT_TEXT, &LIB_TREE::onQueryText, this ); -#if wxCHECK_VERSION( 3, 1, 1 ) m_query_ctrl->Bind( wxEVT_SEARCH_CANCEL, &LIB_TREE::onQueryText, this ); -#else - m_query_ctrl->Bind( wxEVT_SEARCHCTRL_CANCEL_BTN, &LIB_TREE::onQueryText, this ); -#endif m_query_ctrl->Bind( wxEVT_CHAR_HOOK, &LIB_TREE::onQueryCharHook, this ); m_query_ctrl->Bind( wxEVT_MOTION, &LIB_TREE::onQueryMouseMoved, this ); m_query_ctrl->Bind( wxEVT_LEAVE_WINDOW, @@ -748,11 +744,6 @@ void LIB_TREE::onHeaderContextMenu( wxDataViewEvent& aEvent ) if( dlg.ShowModal() == wxID_OK ) m_adapter->SetShownColumns( dlg.EnabledList() ); } - -#if !wxCHECK_VERSION( 3, 1, 0 ) - // wxGTK 3.0 sends item right click events for header right clicks - m_skipNextRightClick = true; -#endif } diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 8cb91e9457..465af6d7d7 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -1285,9 +1285,7 @@ EVT_SIZE( mpWindow::OnSize ) EVT_MIDDLE_DOWN( mpWindow::OnMouseMiddleDown ) // JLB EVT_RIGHT_UP( mpWindow::OnShowPopupMenu ) EVT_MOUSEWHEEL( mpWindow::OnMouseWheel ) // JLB -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) EVT_MAGNIFY( mpWindow::OnMagnify ) -#endif EVT_MOTION( mpWindow::OnMouseMove ) // JLB EVT_LEFT_DOWN( mpWindow::OnMouseLeftDown ) EVT_LEFT_UP( mpWindow::OnMouseLeftRelease ) @@ -1412,7 +1410,6 @@ void mpWindow::OnMouseMiddleDown( wxMouseEvent& event ) } -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) void mpWindow::OnMagnify( wxMouseEvent& event ) { if( !m_enableMouseNavigation ) @@ -1429,7 +1426,6 @@ void mpWindow::OnMagnify( wxMouseEvent& event ) else if( zoom < 1.0f ) ZoomOut( pos, 1.0f / zoom ); } -#endif // Process mouse wheel events diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index 818485924c..5c2d40e303 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -221,18 +221,6 @@ bool PAGED_DIALOG::TransferDataToWindow() if( !DIALOG_SHIM::TransferDataToWindow() ) return false; - // On wxWidgets 3.0, TransferDataFromWindow() is not called recursively - // so we have to call it for each page -#if !wxCHECK_VERSION( 3, 1, 0 ) - for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) - { - wxWindow* page = m_treebook->GetPage( i ); - - if( !page->TransferDataToWindow() ) - return false; - } -#endif - // Search for a page matching the lastParentPageTitle/lastPageTitle hierarchy wxString lastPage = g_lastPage[ m_title ]; wxString lastParentPage = g_lastParentPage[ m_title ]; @@ -274,22 +262,6 @@ bool PAGED_DIALOG::TransferDataFromWindow() if( !DIALOG_SHIM::TransferDataFromWindow() ) ret = false; - // On wxWidgets 3.0, TransferDataFromWindow() is not called recursively - // so we have to call it for each page -#if !wxCHECK_VERSION( 3, 1, 0 ) - for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) - { - wxWindow* page = m_treebook->GetPage( i ); - - if( !page->TransferDataFromWindow() ) - { - m_treebook->ChangeSelection( i ); - ret = false; - break; - } - } -#endif - return ret; } diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index 6253518769..0dbc38550e 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -40,12 +40,7 @@ SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& a { if( aSize == wxDefaultSize ) { - #if wxCHECK_VERSION( 3, 1, 3 ) - wxSize defaultSize = wxButton::GetDefaultSize( aParent ); - #else - wxSize defaultSize = wxButton::GetDefaultSize(); - #endif - + wxSize defaultSize = wxButton::GetDefaultSize( aParent ); wxSize textSize = GetTextExtent( m_label ); SetMinSize( wxSize( std::max( textSize.GetWidth(), defaultSize.GetWidth() + 1 ), defaultSize.GetHeight() + 1 ) ); diff --git a/common/widgets/std_bitmap_button.cpp b/common/widgets/std_bitmap_button.cpp index 42cee643f5..d66a489b54 100644 --- a/common/widgets/std_bitmap_button.cpp +++ b/common/widgets/std_bitmap_button.cpp @@ -40,12 +40,7 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, { if( aSize == wxDefaultSize ) { - #if wxCHECK_VERSION( 3, 1, 3 ) - wxSize defaultSize = wxButton::GetDefaultSize( aParent ); - #else - wxSize defaultSize = wxButton::GetDefaultSize(); - #endif - + wxSize defaultSize = wxButton::GetDefaultSize( aParent ); SetMinSize( wxSize( defaultSize.GetWidth() + 1, defaultSize.GetHeight() + 1 ) ); } diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index ae61cd415e..99e163f1ff 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -587,33 +587,17 @@ void WIDGET_HOTKEY_LIST::updateColumnWidths() col->SetWidth( wxCOL_WIDTH_AUTOSIZE ); col->SetWidth( col->GetWidth() ); -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - col->SetResizeable( true ); -#endif - col = GetDataView()->GetColumn( 1 ); col->SetWidth( wxCOL_WIDTH_AUTOSIZE ); col->SetWidth( col->GetWidth() ); -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - col->SetResizeable( true ); -#endif - col = GetDataView()->GetColumn( 2 ); col->SetWidth( wxCOL_WIDTH_AUTOSIZE ); col->SetWidth( col->GetWidth() ); -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - col->SetResizeable( true ); -#endif - col = GetDataView()->GetColumn( 3 ); col->SetWidth( wxCOL_WIDTH_AUTOSIZE ); col->SetWidth( col->GetWidth() ); - -#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 ) - col->SetResizeable( true ); -#endif } diff --git a/common/widgets/wx_aui_art_providers.cpp b/common/widgets/wx_aui_art_providers.cpp index 7b7899c30e..19b3c4b583 100644 --- a/common/widgets/wx_aui_art_providers.cpp +++ b/common/widgets/wx_aui_art_providers.cpp @@ -124,13 +124,11 @@ void WX_AUI_TOOLBAR_ART::DrawButton( wxDC& aDc, wxWindow* aWindow, const wxAuiTo WX_AUI_DOCK_ART::WX_AUI_DOCK_ART() : wxAuiDefaultDockArt() { #if defined( _WIN32 ) - #if wxCHECK_VERSION( 3, 1, 0 ) // Use normal control font, wx likes to use "small" m_captionFont = *wxNORMAL_FONT; // Increase the box the caption rests in size a bit m_captionSize = wxWindow::FromDIP( 20, nullptr ); -#endif #endif SetColour( wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR, diff --git a/common/widgets/wx_grid.cpp b/common/widgets/wx_grid.cpp index f1b57ec3e3..e27d134316 100644 --- a/common/widgets/wx_grid.cpp +++ b/common/widgets/wx_grid.cpp @@ -108,10 +108,7 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS if( GetColLabelSize() > 0 ) SetColLabelSize( GetColLabelSize() + 4 ); -#if wxCHECK_VERSION( 3, 1, 3 ) Connect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this ); -#endif - Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr, this ); Connect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ), nullptr, this ); } @@ -122,14 +119,11 @@ WX_GRID::~WX_GRID() if( m_weOwnTable ) DestroyTable( GetTable() ); -#if wxCHECK_VERSION( 3, 1, 3 ) Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this ); -#endif } -#if wxCHECK_VERSION( 3, 1, 3 ) void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt) { /// This terrible hack is a way to avoid the incredibly disruptive resizing of grids that happens on Macs @@ -138,7 +132,6 @@ void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt) aEvt.Skip(); #endif } -#endif void WX_GRID::SetColLabelSize( int aHeight ) @@ -345,14 +338,8 @@ void WX_GRID::DrawCornerLabel( wxDC& dc ) // It is reported that we need to erase the background to avoid display // artifacts, see #12055. { - // wxWidgets renamed this variable between 3.1.2 and 3.1.3 ... -#if wxCHECK_VERSION( 3, 1, 3 ) wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() ); wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() ); -#else - wxDCBrushChanger setBrush( dc, m_colWindow->GetBackgroundColour() ); - wxDCPenChanger setPen( dc, m_colWindow->GetBackgroundColour() ); -#endif dc.DrawRectangle( rect.Inflate( 1 ) ); } @@ -375,14 +362,8 @@ void WX_GRID::DrawColLabel( wxDC& dc, int col ) // It is reported that we need to erase the background to avoid display // artifacts, see #12055. { - // wxWidgets renamed this variable between 3.1.2 and 3.1.3 ... -#if wxCHECK_VERSION( 3, 1, 3 ) wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() ); wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() ); -#else - wxDCBrushChanger setBrush( dc, m_colWindow->GetBackgroundColour() ); - wxDCPenChanger setPen( dc, m_colWindow->GetBackgroundColour() ); -#endif dc.DrawRectangle( rect.Inflate( 1 ) ); } @@ -417,14 +398,8 @@ void WX_GRID::DrawRowLabel( wxDC& dc, int row ) // It is reported that we need to erase the background to avoid display // artifacts, see #12055. { - // wxWidgets renamed this variable between 3.1.2 and 3.1.3 ... -#if wxCHECK_VERSION( 3, 1, 3 ) wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() ); wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() ); -#else - wxDCBrushChanger setBrush( dc, m_colWindow->GetBackgroundColour() ); - wxDCPenChanger setPen( dc, m_colWindow->GetBackgroundColour() ); -#endif dc.DrawRectangle( rect.Inflate( 1 ) ); } diff --git a/common/widgets/wx_progress_reporters.cpp b/common/widgets/wx_progress_reporters.cpp index 9e588bdac2..49d0f05b4b 100644 --- a/common/widgets/wx_progress_reporters.cpp +++ b/common/widgets/wx_progress_reporters.cpp @@ -40,17 +40,13 @@ WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& a // up another event loop on completion which // causes all sorts of grief ( aCanAbort ? wxPD_CAN_ABORT : 0 ) | wxPD_ELAPSED_TIME ), -#if wxCHECK_VERSION( 3, 1, 0 ) m_appProgressIndicator( aParent ), -#endif m_messageWidth( 0 ) { -#if wxCHECK_VERSION( 3, 1, 0 ) // wxAppProgressIndicator doesn't like value > max, ever. However there are some risks // with multithreaded setting of those values making a mess // the cop out is just to set the progress to "indeterminate" m_appProgressIndicator.Pulse(); -#endif } diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 89741636f2..61c1bf0a14 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -892,11 +892,7 @@ wxPGProperty* DIALOG_SIM_MODEL::newParamProperty( SIM_MODEL* prop->SetAttribute( wxPG_ATTR_UNITS, wxString::FromUTF8( param.info.unit.c_str() ) ); // Legacy due to the way we extracted the parameters from Ngspice. - #if wxCHECK_VERSION( 3, 1, 0 ) - prop->SetCell( 3, wxString::FromUTF8( param.info.defaultValue ) ); - #else - prop->SetCell( 3, wxString::FromUTF8( param.info.defaultValue.c_str() ) ); - #endif + prop->SetCell( 3, wxString::FromUTF8( param.info.defaultValue ) ); wxString typeStr; diff --git a/eeschema/dialogs/panel_eeschema_editing_options.cpp b/eeschema/dialogs/panel_eeschema_editing_options.cpp index c913f142cb..25b1551987 100644 --- a/eeschema/dialogs/panel_eeschema_editing_options.cpp +++ b/eeschema/dialogs/panel_eeschema_editing_options.cpp @@ -45,9 +45,7 @@ PANEL_EESCHEMA_EDITING_OPTIONS::PANEL_EESCHEMA_EDITING_OPTIONS( wxWindow* aWindo m_hint2->SetFont( helpFont ); m_spinLabelRepeatStep->SetRange( -100000, 100000 ); -#if wxCHECK_VERSION( 3, 1, 6 ) m_spinLabelRepeatStep->SetIncrement( 1 ); -#endif #ifdef __WXOSX_MAC__ m_leftClickCmdsBook->SetSelection( 1 ); diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index aed020ebbd..75470b72eb 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -73,11 +73,7 @@ #include -#if wxCHECK_VERSION( 3, 1, 7 ) #include "widgets/filedlg_hook_save_project.h" -#else -#include "widgets/legacyfiledlg_save_project.h" -#endif bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, int aCtl ) { @@ -860,18 +856,12 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs ) savePath.GetFullName(), KiCadSchematicFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); -#if wxCHECK_VERSION( 3, 1, 7 ) FILEDLG_HOOK_SAVE_PROJECT newProjectHook; -#endif // Add a "Create a project" checkbox in standalone mode and one isn't loaded if( Kiface().IsSingle() || aSaveAs ) { -#if wxCHECK_VERSION( 3, 1, 7 ) dlg.SetCustomizeHook( newProjectHook ); -#else - dlg.SetExtraControlCreator( &LEGACYFILEDLG_SAVE_PROJECT::Create ); -#endif } if( dlg.ShowModal() == wxID_CANCEL ) @@ -893,13 +883,8 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs ) return false; } -#if wxCHECK_VERSION( 3, 1, 7 ) if( newProjectHook.IsAttachedToDialog() ) createNewProject = newProjectHook.GetCreateNewProject(); -#else - if( wxWindow* ec = dlg.GetExtraControl() ) - createNewProject = static_cast( ec )->GetValue(); -#endif if( !saveCopy ) { diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 217d200e0e..19910c6f28 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -48,12 +48,7 @@ #include #include "symbol_saveas_type.h" -#if wxCHECK_VERSION( 3, 1, 7 ) #include -#else -#include -SYMBOL_SAVEAS_TYPE SYMBOL_LEGACYFILEDLG_SAVE_AS::m_option = SYMBOL_SAVEAS_TYPE::NORMAL_SAVE_AS; -#endif void SYMBOL_EDIT_FRAME::updateTitle() @@ -1059,12 +1054,8 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile ) default_path, fn.GetFullName(), wildcards, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); -#if wxCHECK_VERSION( 3, 1, 7 ) SYMBOL_FILEDLG_SAVE_AS saveAsHook( type ); dlg.SetCustomizeHook( saveAsHook ); -#else - dlg.SetExtraControlCreator( &SYMBOL_LEGACYFILEDLG_SAVE_AS::Create ); -#endif if( dlg.ShowModal() == wxID_CANCEL ) return false; @@ -1076,15 +1067,7 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile ) if( fn.GetExt().IsEmpty() ) fn.SetExt( KiCadSymbolLibFileExtension ); -#if wxCHECK_VERSION( 3, 1, 7 ) type = saveAsHook.GetOption(); -#else - const SYMBOL_LEGACYFILEDLG_SAVE_AS* sah = - dynamic_cast( dlg.GetExtraControl() ); - wxCHECK( sah, false ); - - type = sah->GetOption(); -#endif } else { diff --git a/eeschema/widgets/legacyfiledlg_save_project.h b/eeschema/widgets/legacyfiledlg_save_project.h deleted file mode 100644 index cb5bad3c12..0000000000 --- a/eeschema/widgets/legacyfiledlg_save_project.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* This program source code file is part of KiCad, a free EDA CAD application. -* -* Copyright (C) 2022 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 3 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, see . -*/ - -#ifndef LEGACYFILEDLG_SAVE_PROJ_H -#define LEGACYFILEDLG_SAVE_PROJ_H - -#include -#include -#include - -///< Helper widget to select whether a new project should be created for a file when saving -class LEGACYFILEDLG_SAVE_PROJECT : public wxPanel -{ -public: - LEGACYFILEDLG_SAVE_PROJECT( wxWindow* aParent ) : wxPanel( aParent ) - { - m_cbCreateProject = - new wxCheckBox( this, wxID_ANY, _( "Create a new project for this schematic" ) ); - m_cbCreateProject->SetValue( true ); - m_cbCreateProject->SetToolTip( _( "Creating a project will enable features such as " - "text variables, net classes, and ERC exclusions" ) ); - - wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL ); - sizer->Add( m_cbCreateProject, 0, wxALL, 8 ); - - SetSizerAndFit( sizer ); - } - - bool GetValue() const { return m_cbCreateProject->GetValue(); } - - static wxWindow* Create( wxWindow* aParent ) - { - return new LEGACYFILEDLG_SAVE_PROJECT( aParent ); - } - -protected: - wxCheckBox* m_cbCreateProject; -}; - -#endif diff --git a/eeschema/widgets/symbol_legacyfiledlg_save_as.h b/eeschema/widgets/symbol_legacyfiledlg_save_as.h deleted file mode 100644 index fd2953e58a..0000000000 --- a/eeschema/widgets/symbol_legacyfiledlg_save_as.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -* This program source code file is part of KiCad, a free EDA CAD application. -* -* Copyright (C) 2022 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 3 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, see . -*/ - -#ifndef SYMBOL_LEGACYFILEDLG_SAVE_AS_ -#define SYMBOL_LEGACYFILEDLG_SAVE_AS_ - -#include - -#include -#include -#include - -/** - * Helper control to inquire user what to do on library save as operation. - */ -class SYMBOL_LEGACYFILEDLG_SAVE_AS : public wxPanel -{ -public: - SYMBOL_LEGACYFILEDLG_SAVE_AS( wxWindow* aParent ) : wxPanel( aParent ) - { - m_simpleSaveAs = new wxRadioButton( this, wxID_ANY, _( "Do not update library tables" ), - wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_simpleSaveAs->SetToolTip( _( "Do not perform any additional operations after saving " - "library." ) ); - m_replaceTableEntry = - new wxRadioButton( this, wxID_ANY, _( "Update existing library table entry" ) ); - m_replaceTableEntry->SetToolTip( _( "Update symbol library table entry to point to new " - "library.\n\n" - "The original library will no longer be available " - "for use." ) ); - m_addGlobalTableEntry = - new wxRadioButton( this, wxID_ANY, _( "Add new global library table entry" ) ); - m_addGlobalTableEntry->SetToolTip( _( "Add new entry to the global symbol library table." - "\n\nThe symbol library table nickname is suffixed " - "with\nan integer to prevent duplicate table " - "entries." ) ); - m_addProjectTableEntry = - new wxRadioButton( this, wxID_ANY, _( "Add new project library table entry" ) ); - m_addProjectTableEntry->SetToolTip( _( "Add new entry to the project symbol library table." - "\n\nThe symbol library table nickname is suffixed " - "with\nan integer to prevent duplicate table " - "entries." ) ); - - wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); - sizer->Add( m_simpleSaveAs, 0, wxLEFT | wxRIGHT | wxTOP, 5 ); - sizer->Add( m_replaceTableEntry, 0, wxLEFT | wxRIGHT | wxTOP, 5 ); - sizer->Add( m_addGlobalTableEntry, 0, wxLEFT | wxRIGHT | wxTOP, 5 ); - sizer->Add( m_addProjectTableEntry, 0, wxLEFT | wxRIGHT | wxTOP | wxBOTTOM, 5 ); - - SetSizerAndFit( sizer ); - - SetOption( m_option ); - } - - ~SYMBOL_LEGACYFILEDLG_SAVE_AS() { m_option = GetOption(); } - - void SetOption( SYMBOL_SAVEAS_TYPE aOption ) - { - m_simpleSaveAs->SetValue( aOption == SYMBOL_SAVEAS_TYPE::NORMAL_SAVE_AS ); - m_replaceTableEntry->SetValue( aOption == SYMBOL_SAVEAS_TYPE::REPLACE_TABLE_ENTRY ); - m_addGlobalTableEntry->SetValue( aOption == SYMBOL_SAVEAS_TYPE::ADD_GLOBAL_TABLE_ENTRY ); - m_addProjectTableEntry->SetValue( aOption == SYMBOL_SAVEAS_TYPE::ADD_PROJECT_TABLE_ENTRY ); - } - - SYMBOL_SAVEAS_TYPE GetOption() const - { - if( m_replaceTableEntry->GetValue() ) - return SYMBOL_SAVEAS_TYPE::REPLACE_TABLE_ENTRY; - else if( m_addGlobalTableEntry->GetValue() ) - return SYMBOL_SAVEAS_TYPE::ADD_GLOBAL_TABLE_ENTRY; - else if( m_addProjectTableEntry->GetValue() ) - return SYMBOL_SAVEAS_TYPE::ADD_PROJECT_TABLE_ENTRY; - else - return SYMBOL_SAVEAS_TYPE::NORMAL_SAVE_AS; - } - - /** - * Create a new panel to add to a wxFileDialog object. - * - * The caller owns the created object and is responsible for deleting it. - * - * @param aParent is the parent window that will own the created object. - * @return the newly created panel to add to the wxFileDialog. - */ - static wxWindow* Create( wxWindow* aParent ) - { - wxCHECK( aParent, nullptr ); - - return new SYMBOL_LEGACYFILEDLG_SAVE_AS( aParent ); - } - -private: - static SYMBOL_SAVEAS_TYPE m_option; - - wxRadioButton* m_simpleSaveAs; - wxRadioButton* m_replaceTableEntry; - wxRadioButton* m_addGlobalTableEntry; - wxRadioButton* m_addProjectTableEntry; -}; - -#endif \ No newline at end of file diff --git a/include/view/wx_view_controls.h b/include/view/wx_view_controls.h index 3147049cc5..1a7980bcd0 100644 --- a/include/view/wx_view_controls.h +++ b/include/view/wx_view_controls.h @@ -57,9 +57,7 @@ public: /// Handler functions void onWheel( wxMouseEvent& aEvent ); void onMotion( wxMouseEvent& aEvent ); -#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT ) void onMagnify( wxMouseEvent& aEvent ); -#endif void onButton( wxMouseEvent& aEvent ); void onEnter( wxMouseEvent& WXUNUSED( aEvent ) ); void onLeave( wxMouseEvent& WXUNUSED( aEvent ) ); diff --git a/include/widgets/app_progress_dialog.h b/include/widgets/app_progress_dialog.h index 0c89263821..e976114a5f 100644 --- a/include/widgets/app_progress_dialog.h +++ b/include/widgets/app_progress_dialog.h @@ -25,10 +25,7 @@ #define __APP_PROGRESS_REPORTER #include - -#if wxCHECK_VERSION( 3, 1, 0 ) #include -#endif /** * wxProgressDialog with the option to also update the application progress on the taskbar @@ -45,10 +42,8 @@ public: private: -#if wxCHECK_VERSION( 3, 1, 0 ) wxAppProgressIndicator m_appProgressIndicator; bool m_indeterminateTaskBarStatus; -#endif }; #endif diff --git a/include/widgets/wx_grid.h b/include/widgets/wx_grid.h index 7e2961f25e..9fe4709801 100644 --- a/include/widgets/wx_grid.h +++ b/include/widgets/wx_grid.h @@ -172,10 +172,7 @@ protected: void onCellEditorShown( wxGridEvent& aEvent ); void onCellEditorHidden( wxGridEvent& aEvent ); - -#if wxCHECK_VERSION( 3, 1, 3 ) void onDPIChanged(wxDPIChangedEvent& event); -#endif protected: bool m_weOwnTable; diff --git a/include/widgets/wx_progress_reporters.h b/include/widgets/wx_progress_reporters.h index 3a18b218f9..49f64faabc 100644 --- a/include/widgets/wx_progress_reporters.h +++ b/include/widgets/wx_progress_reporters.h @@ -29,9 +29,7 @@ #include #include -#if wxCHECK_VERSION( 3, 1, 0 ) #include -#endif #include @@ -75,10 +73,7 @@ private: bool updateUI() override; private: -#if wxCHECK_VERSION( 3, 1, 0 ) wxAppProgressIndicator m_appProgressIndicator; -#endif - int m_messageWidth; }; diff --git a/kicad/pcm/dialogs/dialog_pcm_progress.cpp b/kicad/pcm/dialogs/dialog_pcm_progress.cpp index cc2497bfc6..0e268422c4 100644 --- a/kicad/pcm/dialogs/dialog_pcm_progress.cpp +++ b/kicad/pcm/dialogs/dialog_pcm_progress.cpp @@ -32,15 +32,10 @@ DIALOG_PCM_PROGRESS::DIALOG_PCM_PROGRESS( wxWindow* parent, bool aShowDownloadSe m_currentProgress( 0 ), m_currentProgressTotal( 0 ), m_finished( false ), - m_disabler( this ) -#if wxCHECK_VERSION( 3, 1, 0 ) - , + m_disabler( this ), m_appProgressIndicator( parent->GetParent(), GAUGE_RANGE ) -#endif { -#if wxCHECK_VERSION( 3, 1, 0 ) m_appProgressIndicator.Pulse(); -#endif m_reporter->SetImmediateMode(); m_downloadGauge->SetRange( GAUGE_RANGE ); @@ -124,9 +119,7 @@ bool DIALOG_PCM_PROGRESS::updateUI() current = 1.0; m_overallGauge->SetValue( current * GAUGE_RANGE ); -#if wxCHECK_VERSION( 3, 1, 0 ) m_appProgressIndicator.SetValue( current * GAUGE_RANGE ); -#endif if( m_downloadTotal.load() == 0 ) { diff --git a/kicad/pcm/dialogs/dialog_pcm_progress.h b/kicad/pcm/dialogs/dialog_pcm_progress.h index 4c22242107..ea4fc6a636 100644 --- a/kicad/pcm/dialogs/dialog_pcm_progress.h +++ b/kicad/pcm/dialogs/dialog_pcm_progress.h @@ -26,9 +26,7 @@ #include "reporter.h" #include #include -#if wxCHECK_VERSION( 3, 1, 0 ) #include -#endif /** @@ -81,9 +79,7 @@ private: wxWindowDisabler m_disabler; -#if wxCHECK_VERSION( 3, 1, 0 ) wxAppProgressIndicator m_appProgressIndicator; -#endif }; #endif // DIALOG_PCM_PROGRESS_H_ diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index be525be578..973db53caa 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -47,11 +47,7 @@ #include #include -#if wxCHECK_VERSION( 3, 1, 7 ) #include "widgets/filedlg_new_project.h" -#else -#include "widgets/legacyfiledlg_new_project.h" -#endif KICAD_MANAGER_CONTROL::KICAD_MANAGER_CONTROL() : TOOL_INTERACTIVE( "kicad.Control" ), @@ -73,12 +69,8 @@ int KICAD_MANAGER_CONTROL::NewProject( const TOOL_EVENT& aEvent ) ProjectFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); // Add a "Create a new directory" checkbox -#if wxCHECK_VERSION( 3, 1, 7 ) FILEDLG_NEW_PROJECT newProjectHook; dlg.SetCustomizeHook( newProjectHook ); -#else - dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create ); -#endif if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -98,11 +90,7 @@ int KICAD_MANAGER_CONTROL::NewProject( const TOOL_EVENT& aEvent ) // Append a new directory with the same name of the project file. bool createNewDir = false; -#if wxCHECK_VERSION( 3, 1, 7 ) createNewDir = newProjectHook.GetCreateNewDir(); -#else - createNewDir = static_cast( dlg.GetExtraControl() )->CreateNewDir(); -#endif if( createNewDir ) pro.AppendDir( pro.GetName() ); @@ -182,13 +170,8 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent ) wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); // Add a "Create a new directory" checkbox -#if wxCHECK_VERSION( 3, 1, 7 ) FILEDLG_NEW_PROJECT newProjectHook; dlg.SetCustomizeHook( newProjectHook ); -#else - dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create ); -#endif - if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -206,11 +189,7 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent ) fn.MakeAbsolute(); bool createNewDir = false; -#if wxCHECK_VERSION( 3, 1, 7 ) createNewDir = newProjectHook.GetCreateNewDir(); -#else - createNewDir = static_cast( dlg.GetExtraControl() )->CreateNewDir(); -#endif // Append a new directory with the same name of the project file. if( createNewDir ) diff --git a/kicad/widgets/legacyfiledlg_new_project.h b/kicad/widgets/legacyfiledlg_new_project.h deleted file mode 100644 index c8b87c98f9..0000000000 --- a/kicad/widgets/legacyfiledlg_new_project.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -* This program source code file is part of KiCad, a free EDA CAD application. -* -* Copyright (C) 2022-2023 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 3 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, see . -*/ - -#ifndef LEGACY_DIR_CHECKBOX_H_ -#define LEGACY_DIR_CHECKBOX_H_ - -#include -#include -#include - -///< Helper widget to select whether a new directory should be created for a project. -class LEGACYFILEDLG_NEW_PROJECT : public wxPanel -{ -public: - LEGACYFILEDLG_NEW_PROJECT( wxWindow* aParent ) : wxPanel( aParent ) - { - m_cbCreateDir = - new wxCheckBox( this, wxID_ANY, _( "Create a new folder for the project" ) ); - m_cbCreateDir->SetValue( true ); - - wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL ); - sizer->Add( m_cbCreateDir, 0, wxALL, 8 ); - - SetSizerAndFit( sizer ); - } - - bool CreateNewDir() const { return m_cbCreateDir->GetValue(); } - - static wxWindow* Create( wxWindow* aParent ) - { - return new LEGACYFILEDLG_NEW_PROJECT( aParent ); - } - -protected: - wxCheckBox* m_cbCreateDir; -}; - -#endif diff --git a/libs/core/include/core/wx_stl_compat.h b/libs/core/include/core/wx_stl_compat.h index 654edf0dfc..ed18918aee 100644 --- a/libs/core/include/core/wx_stl_compat.h +++ b/libs/core/include/core/wx_stl_compat.h @@ -25,20 +25,6 @@ #include #include -// Some wxWidgets versions (for instance before 3.1.0) do not include -// this function, so add it if missing -#if !wxCHECK_VERSION( 3, 1, 0 ) -#define USE_KICAD_WXSTRING_HASH // for common.cpp -///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map) -namespace std -{ - template<> struct hash - { - size_t operator()( const wxString& s ) const; - }; -} -#endif - /// Required to use wxPoint as key type in maps #define USE_KICAD_WXPOINT_LESS_AND_HASH // for common.cpp namespace std diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 089cd49dc5..da06cd8a5b 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -789,7 +789,6 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) } else { -#if wxCHECK_VERSION( 3, 1, 4 ) // 3.1.4 required for wxDD_MULTIPLE wxDirDialog dlg( nullptr, title, openDir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE ); @@ -799,42 +798,6 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) return; dlg.GetPaths( files ); -#else - wxDirDialog dlg( nullptr, title, openDir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST ); - - int result = dlg.ShowModal(); - - if( result == wxID_CANCEL ) - return; - - // is there a file extension configured to hunt out their containing folders? - if( !fileDesc.m_ExtensionsInDir.empty() ) - { - wxDir rootDir( dlg.GetPath() ); - - LIBRARY_TRAVERSER traverser( fileDesc.m_ExtensionsInDir, rootDir.GetName() ); - rootDir.Traverse( traverser ); - - traverser.GetPaths( files ); - - if( traverser.HasDirectoryOpenFailures() ) - { - wxArrayString failedDirs; - traverser.GetPaths( failedDirs ); - wxString detailedMsg = _( "The following directories could not be opened: \n" ); - - for( const wxString& path : failedDirs ) - detailedMsg << path << wxT( "\n" ); - - DisplayErrorMessage( this, _( "Failed to open directories to look for libraries" ), - detailedMsg ); - } - } - else - { - files.Add( dlg.GetPath() ); - } -#endif if( !files.IsEmpty() ) { diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 5ee5065695..0e6a7b7430 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -68,11 +68,7 @@ #include #include -#if wxCHECK_VERSION( 3, 1, 7 ) #include "widgets/filedlg_hook_save_project.h" -#else -#include "widgets/legacyfiledlg_save_project.h" -#endif //#define USE_INSTRUMENTATION 1 #define USE_INSTRUMENTATION 0 @@ -202,16 +198,10 @@ bool AskSaveBoardFileName( PCB_EDIT_FRAME* aParent, wxString* aFileName, bool* a wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); // Add a "Create a project" checkbox in standalone mode and one isn't loaded -#if wxCHECK_VERSION( 3, 1, 7 ) FILEDLG_HOOK_SAVE_PROJECT newProjectHook; if( Kiface().IsSingle() && aParent->Prj().IsNullProject() ) dlg.SetCustomizeHook( newProjectHook ); -#else - if( Kiface().IsSingle() && aParent->Prj().IsNullProject() ) - dlg.SetExtraControlCreator( &LEGACYFILEDLG_SAVE_PROJECT::Create ); -#endif - if( dlg.ShowModal() != wxID_OK ) return false; @@ -219,17 +209,10 @@ bool AskSaveBoardFileName( PCB_EDIT_FRAME* aParent, wxString* aFileName, bool* a *aFileName = dlg.GetPath(); *aFileName = EnsureFileExtension( *aFileName, KiCadPcbFileExtension ); -#if wxCHECK_VERSION( 3, 1, 7 ) if( newProjectHook.IsAttachedToDialog() ) *aCreateProject = newProjectHook.GetCreateNewProject(); else if( !aParent->Prj().IsNullProject() ) *aCreateProject = true; -#else - if( wxWindow* ec = dlg.GetExtraControl() ) - *aCreateProject = static_cast( ec )->GetValue(); - else if( !aParent->Prj().IsNullProject() ) - *aCreateProject = true; -#endif return true; } diff --git a/pcbnew/widgets/legacyfiledlg_save_project.h b/pcbnew/widgets/legacyfiledlg_save_project.h deleted file mode 100644 index 236f0136e3..0000000000 --- a/pcbnew/widgets/legacyfiledlg_save_project.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* This program source code file is part of KiCad, a free EDA CAD application. -* -* Copyright (C) 2022 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 3 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, see . -*/ - -#ifndef LEGACYFILEDLG_SAVE_PROJ_H_ -#define LEGACYFILEDLG_SAVE_PROJ_H_ - -#include -#include -#include - -///< Helper widget to select whether a new project should be created for a file when saving -class LEGACYFILEDLG_SAVE_PROJECT : public wxPanel -{ -public: - LEGACYFILEDLG_SAVE_PROJECT( wxWindow* aParent ) : wxPanel( aParent ) - { - m_cbCreateProject = - new wxCheckBox( this, wxID_ANY, _( "Create a new project for this board" ) ); - m_cbCreateProject->SetValue( true ); - m_cbCreateProject->SetToolTip( _( "Creating a project will enable features such as " - "design rules, net classes, and layer presets" ) ); - - wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL ); - sizer->Add( m_cbCreateProject, 0, wxALL, 8 ); - - SetSizerAndFit( sizer ); - } - - bool GetValue() const { return m_cbCreateProject->GetValue(); } - - static wxWindow* Create( wxWindow* aParent ) - { - return new LEGACYFILEDLG_SAVE_PROJECT( aParent ); - } - -protected: - wxCheckBox* m_cbCreateProject; -}; - -#endif \ No newline at end of file