From e21fa31f64d32d0b752741430f4d2a617686a484 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Jan 2022 22:09:56 +0000 Subject: [PATCH] Rip out rest of macHack architecture. --- common/widgets/paged_dialog.cpp | 3 --- eeschema/dialogs/dialog_schematic_setup.cpp | 3 --- eeschema/dialogs/dialog_schematic_setup.h | 2 -- include/widgets/paged_dialog.h | 2 -- pcb_calculator/pcb_calculator_frame.cpp | 24 +------------------ pcb_calculator/pcb_calculator_frame.h | 1 - pcbnew/dialogs/dialog_board_setup.cpp | 6 ----- pcbnew/dialogs/dialog_board_setup.h | 2 -- .../dialogs/dialog_footprint_properties.cpp | 16 ------------- pcbnew/dialogs/dialog_footprint_properties.h | 1 - 10 files changed, 1 insertion(+), 59 deletions(-) diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index 89068552d8..c156459398 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -113,9 +113,6 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aSho void PAGED_DIALOG::finishInitialization() { - for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) - m_macHack.push_back( true ); - // For some reason adding page labels to the treeCtrl doesn't invalidate its bestSize // cache so we have to do it by hand m_treebook->GetTreeCtrl()->InvalidateBestSize(); diff --git a/eeschema/dialogs/dialog_schematic_setup.cpp b/eeschema/dialogs/dialog_schematic_setup.cpp index 0df2e9bdea..7157930bdf 100644 --- a/eeschema/dialogs/dialog_schematic_setup.cpp +++ b/eeschema/dialogs/dialog_schematic_setup.cpp @@ -80,10 +80,7 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) : m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) ); for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) - { m_treebook->ExpandNode( i ); - m_macHack.push_back( true ); - } finishDialogSettings(); diff --git a/eeschema/dialogs/dialog_schematic_setup.h b/eeschema/dialogs/dialog_schematic_setup.h index 645bf5829b..78ea9b3b66 100644 --- a/eeschema/dialogs/dialog_schematic_setup.h +++ b/eeschema/dialogs/dialog_schematic_setup.h @@ -53,8 +53,6 @@ protected: PANEL_SETUP_NETCLASSES* m_netclasses; PANEL_TEXT_VARIABLES* m_textVars; std::shared_ptr m_pinToPinError; - - std::vector m_macHack; }; diff --git a/include/widgets/paged_dialog.h b/include/widgets/paged_dialog.h index b27657c8a9..693465f1e9 100644 --- a/include/widgets/paged_dialog.h +++ b/include/widgets/paged_dialog.h @@ -71,8 +71,6 @@ private: bool m_dirty; wxBoxSizer* m_buttonsSizer; - - std::vector m_macHack; }; diff --git a/pcb_calculator/pcb_calculator_frame.cpp b/pcb_calculator/pcb_calculator_frame.cpp index 658eec3366..a20c46edea 100644 --- a/pcb_calculator/pcb_calculator_frame.cpp +++ b/pcb_calculator/pcb_calculator_frame.cpp @@ -51,8 +51,7 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : wxSize( 646,361 ), // Default size wxDEFAULT_FRAME_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE | wxTAB_TRAVERSAL, wxT( "pcb_calculator" ) ), // Window name - m_lastNotebookPage( -1 ), - m_macHack( true ) + m_lastNotebookPage( -1 ) { SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include // some methods in code and avoid link errors @@ -204,28 +203,7 @@ void PCB_CALCULATOR_FRAME::OnUpdateUI( wxUpdateUIEvent& event ) // Until it's shown on screen the above won't work; but doing it anyway at least keeps // putting new OnUpdateUI events into the queue until it *is* shown on screen. if( m_notebook->IsShownOnScreen() ) - { - // Work around an OSX bug where the wxGrid children don't get placed correctly until - // the first resize event. -#ifdef __WXMAC__ - if( m_macHack ) - { - wxSize pageSize = elecSpacingPanel->GetSize(); - - pageSize.x -= 100; - elecSpacingPanel->SetSize( pageSize ); - elecSpacingPanel->Layout(); - - pageSize.x += 100; - elecSpacingPanel->SetSize( pageSize ); - elecSpacingPanel->Layout(); - - m_macHack = false; - } -#endif - m_lastNotebookPage = m_notebook->GetSelection(); - } } } diff --git a/pcb_calculator/pcb_calculator_frame.h b/pcb_calculator/pcb_calculator_frame.h index 93f6991d8b..9512bcef85 100644 --- a/pcb_calculator/pcb_calculator_frame.h +++ b/pcb_calculator/pcb_calculator_frame.h @@ -81,7 +81,6 @@ private: wxBoxSizer* m_mainSizer; int m_lastNotebookPage; - bool m_macHack; std::vector m_panels; std::map m_panelTypes; diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index 8f31bffd2e..a797d74614 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -111,12 +111,6 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_treebook->AddSubPage( m_rules, _( "Custom Rules" ) ); m_treebook->AddSubPage( m_severities, _( "Violation Severity" ) ); - for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) - { - m_treebook->ExpandNode( i ); - m_macHack.push_back( true ); - } - m_treebook->SetMinSize( wxSize( -1, 480 ) ); finishDialogSettings(); diff --git a/pcbnew/dialogs/dialog_board_setup.h b/pcbnew/dialogs/dialog_board_setup.h index 9aac0f4f8d..bf89d7a325 100644 --- a/pcbnew/dialogs/dialog_board_setup.h +++ b/pcbnew/dialogs/dialog_board_setup.h @@ -64,8 +64,6 @@ protected: PANEL_SETUP_SEVERITIES* m_severities; PANEL_TEXT_VARIABLES* m_textVars; - std::vector m_macHack; - private: int m_currentPage; // the current page index int m_physicalStackupPage; // the page index of the PANEL_SETUP_BOARD_STACKUP page diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 232b962fea..57f1d8768f 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -79,9 +79,6 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen m_posX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD ); m_posY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD ); - for( size_t i = 0; i < m_NoteBook->GetPageCount(); ++i ) - m_macHack.push_back( true ); - m_texts = new FP_TEXT_GRID_TABLE( m_frame ); m_delayedErrorMessage = wxEmptyString; @@ -659,19 +656,6 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnPageChange( wxNotebookEvent& aEvent ) // Shouldn't be necessary, but is on at least OSX if( page >= 0 ) m_NoteBook->ChangeSelection( (unsigned) page ); - -#ifdef __WXMAC__ - // Work around an OSX bug where the wxGrid children don't get placed correctly until - // the first resize event - if( m_macHack[ page ] ) - { - wxSize pageSize = m_NoteBook->GetPage( page )->GetSize(); - pageSize.x -= 1; - - m_NoteBook->GetPage( page )->SetSize( pageSize ); - m_macHack[ page ] = false; - } -#endif } diff --git a/pcbnew/dialogs/dialog_footprint_properties.h b/pcbnew/dialogs/dialog_footprint_properties.h index 7a6a99b37c..0a8aefde42 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.h +++ b/pcbnew/dialogs/dialog_footprint_properties.h @@ -98,7 +98,6 @@ private: int m_delayedFocusColumn; bool m_initialFocus; - std::vector m_macHack; enum FP_PROPS_RETVALUE m_returnValue; // the option that closed the dialog PANEL_FP_PROPERTIES_3D_MODEL* m_3dPanel;