Commit 28774e41 authored by jean-pierre charras's avatar jean-pierre charras

Gerbview: tweaking code: Now the active layer is drawn on top of other layers....

Gerbview: tweaking code: Now the active layer is drawn on top of other layers. This is an enhancement in stacked draw modes.
parent f6669b78
...@@ -150,8 +150,19 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin ...@@ -150,8 +150,19 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
bool doBlit = false; // this flag requests an image transfert to actual screen when true. bool doBlit = false; // this flag requests an image transfert to actual screen when true.
for( int layer = 0; layer < 32; layer++ ) bool end = false;
for( int layer = 0; !end; layer++ )
{ {
int active_layer = ((GERBVIEW_FRAME*)m_PcbFrame)->getActiveLayer();
if( layer == active_layer ) // active layer will be drawn after other layers
continue;
if( layer == 32 ) // last loop: draw active layer
{
end = true;
layer = active_layer;
}
if( !GetBoard()->IsLayerVisible( layer ) ) if( !GetBoard()->IsLayerVisible( layer ) )
continue; continue;
......
...@@ -113,7 +113,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -113,7 +113,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
} }
INSTALL_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, DrawPanel );
switch( id ) switch( id )
{ {
...@@ -139,7 +139,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -139,7 +139,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_TOOLBARH_GERBVIEW_SELECT_LAYER: case ID_TOOLBARH_GERBVIEW_SELECT_LAYER:
setActiveLayer(m_SelLayerBox->GetChoice()); setActiveLayer(m_SelLayerBox->GetChoice());
DrawPanel->Refresh(); DrawPanel->ReDraw( &dc, false );
break; break;
case ID_TOOLBARH_GERBER_SELECT_TOOL: case ID_TOOLBARH_GERBER_SELECT_TOOL:
...@@ -149,7 +149,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -149,7 +149,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( tool != gerber_layer->m_Selected_Tool ) if( tool != gerber_layer->m_Selected_Tool )
{ {
gerber_layer->m_Selected_Tool = tool; gerber_layer->m_Selected_Tool = tool;
DrawPanel->Refresh(); DrawPanel->ReDraw( &dc, false );
} }
} }
break; break;
......
...@@ -51,7 +51,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME ) ...@@ -51,7 +51,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_EXIT, GERBVIEW_FRAME::Process_Special_Functions ) EVT_MENU( ID_EXIT, GERBVIEW_FRAME::Process_Special_Functions )
// menu Preferences // menu Preferences
EVT_MENU( ID_CONFIG_REQ, GERBVIEW_FRAME::Process_Config )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
GERBVIEW_FRAME::Process_Config ) GERBVIEW_FRAME::Process_Config )
......
...@@ -66,8 +66,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) ...@@ -66,8 +66,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
for( ii = 0; ii < 32; ii++ ) for( ii = 0; ii < 32; ii++ )
{ {
wxString msg; msg.Printf( _( "Layer %d" ), ii + 1);
msg = _( "Layer " ); msg << ii + 1;
choices.Add( msg ); choices.Add( msg );
} }
...@@ -80,14 +79,11 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) ...@@ -80,14 +79,11 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
m_DCodesList.Alloc(TOOLS_MAX_COUNT+1); m_DCodesList.Alloc(TOOLS_MAX_COUNT+1);
m_DCodesList.Add( _( "No tool" ) ); m_DCodesList.Add( _( "No tool" ) );
msg = _( "Tool " );
wxString text;
for( ii = FIRST_DCODE; ii < TOOLS_MAX_COUNT; ii++ ) for( ii = FIRST_DCODE; ii < TOOLS_MAX_COUNT; ii++ )
{ {
text = msg; msg = _( "Tool " );
text << ii; msg << ii;
m_DCodesList.Add( text ); m_DCodesList.Add( msg );
} }
m_DCodeSelector = new DCODE_SELECTION_BOX( m_HToolBar, ID_TOOLBARH_GERBER_SELECT_TOOL, m_DCodeSelector = new DCODE_SELECTION_BOX( m_HToolBar, ID_TOOLBARH_GERBER_SELECT_TOOL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment