From 67894dd36e32aa45c6b7e90e4cd0cb32b206c9d3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 5 Nov 2010 09:14:00 +0100 Subject: [PATCH] Gerbview: remove useless calls to SetToolbar() which create horizontal toolbar flicker under Windows. --- gerbview/controle.cpp | 1 - gerbview/gerberframe.cpp | 1 + gerbview/initpcb.cpp | 2 ++ gerbview/readgerb.cpp | 7 +++---- gerbview/toolbars_gerber.cpp | 11 ----------- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/gerbview/controle.cpp b/gerbview/controle.cpp index 919e67f0dc..99b4625838 100644 --- a/gerbview/controle.cpp +++ b/gerbview/controle.cpp @@ -110,6 +110,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) wxSafeYield(); } - SetToolbars(); UpdateStatusBar(); } diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 0133c88f5e..94de89d4cb 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -217,6 +217,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ReFillLayerWidget(); // this is near end because contents establish size + SetToolbars(); m_auimgr.Update(); } diff --git a/gerbview/initpcb.cpp b/gerbview/initpcb.cpp index 0db1d5692e..9c33fd60d7 100644 --- a/gerbview/initpcb.cpp +++ b/gerbview/initpcb.cpp @@ -47,6 +47,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) SetBaseScreen( ActiveScreen = ScreenPcb ); GetScreen()->Init(); setActiveLayer(LAYER_N_BACK); + syncLayerBox(); return TRUE; } @@ -81,4 +82,5 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query ) ScreenPcb->SetModify(); ScreenPcb->SetRefreshReq(); + syncLayerBox(); } diff --git a/gerbview/readgerb.cpp b/gerbview/readgerb.cpp index 8739ce8257..526cb99f66 100644 --- a/gerbview/readgerb.cpp +++ b/gerbview/readgerb.cpp @@ -17,9 +17,8 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName, const wxString& D_Code_FullFileName ) { - int G_commande = 0, - D_commande = 0; /* command number for G or D commands - * (like G04 or D02) */ + int G_commande = 0; // command number for G commands like G04 + int D_commande = 0; // command number for D commands like D02 char line[GERBER_BUFZ]; @@ -57,7 +56,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName, SetLocaleTo_C_standard(); - while( TRUE ) + while( true ) { if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL ) { diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index d9bf109b0c..0369948cbd 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -224,17 +224,6 @@ void WinEDA_GerberFrame::SetToolbars() if( m_HToolBar == NULL ) return; - if( GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE ) - { - m_HToolBar->EnableTool( wxID_CUT, true ); - m_HToolBar->EnableTool( wxID_COPY, true ); - } - else - { - m_HToolBar->EnableTool( wxID_CUT, false ); - m_HToolBar->EnableTool( wxID_COPY, false ); - } - if( m_SelLayerBox && (m_SelLayerBox->GetSelection() != screen->m_Active_Layer) ) { m_SelLayerBox->SetSelection( screen->m_Active_Layer );