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
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 ) )
continue;
......
......@@ -113,7 +113,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
}
INSTALL_DC( dc, DrawPanel );
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
switch( id )
{
......@@ -139,7 +139,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_TOOLBARH_GERBVIEW_SELECT_LAYER:
setActiveLayer(m_SelLayerBox->GetChoice());
DrawPanel->Refresh();
DrawPanel->ReDraw( &dc, false );
break;
case ID_TOOLBARH_GERBER_SELECT_TOOL:
......@@ -149,7 +149,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( tool != gerber_layer->m_Selected_Tool )
{
gerber_layer->m_Selected_Tool = tool;
DrawPanel->Refresh();
DrawPanel->ReDraw( &dc, false );
}
}
break;
......
......@@ -51,7 +51,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_EXIT, GERBVIEW_FRAME::Process_Special_Functions )
// menu Preferences
EVT_MENU( ID_CONFIG_REQ, GERBVIEW_FRAME::Process_Config )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
GERBVIEW_FRAME::Process_Config )
......
......@@ -66,8 +66,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
for( ii = 0; ii < 32; ii++ )
{
wxString msg;
msg = _( "Layer " ); msg << ii + 1;
msg.Printf( _( "Layer %d" ), ii + 1);
choices.Add( msg );
}
......@@ -80,14 +79,11 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
m_DCodesList.Alloc(TOOLS_MAX_COUNT+1);
m_DCodesList.Add( _( "No tool" ) );
msg = _( "Tool " );
wxString text;
for( ii = FIRST_DCODE; ii < TOOLS_MAX_COUNT; ii++ )
{
text = msg;
text << ii;
m_DCodesList.Add( text );
msg = _( "Tool " );
msg << ii;
m_DCodesList.Add( msg );
}
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