Gerbview: minor enhancements

This commit is contained in:
charras 2010-02-04 11:03:31 +00:00
parent 1173add9ab
commit ac97a5746d
4 changed files with 15 additions and 14 deletions

View File

@ -23,8 +23,9 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) );
if( fn != wxEmptyString && Clear_Pcb( true ) )
if( fn != wxEmptyString )
{
Erase_Current_Layer( false );
LoadOneGerberFile( fn, false );
}
}
@ -37,11 +38,9 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
switch( id )
{
case ID_LOAD_FILE:
if( Clear_Pcb( true ) )
{
case wxID_FILE:
Erase_Current_Layer( false );
LoadOneGerberFile( wxEmptyString, 0 );
}
break;
case ID_MENU_INC_LAYER_AND_APPEND_FILE:
@ -173,8 +172,9 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
/*
* Read a PCB file.
*
* Read a DCode file (not used with RX274X files , just with RS274D old files).
* Note: there is no standard for DCode file.
* Just read a file format created by early versions of Pcbnew.
* Returns:
* 0 if file not read (cancellation of order ...)
* 1 if OK

View File

@ -29,7 +29,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_GerberFrame::OnZoom )
EVT_TOOL( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( wxID_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io )
@ -38,7 +38,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
// Menu Files:
EVT_MENU( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( wxID_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io )

View File

@ -45,6 +45,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
SetBaseScreen( ActiveScreen = ScreenPcb );
GetScreen()->Init();
setActiveLayer(LAYER_N_BACK);
return TRUE;
}
@ -52,7 +53,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
{
int layer = GetScreen()->m_Active_Layer;
int layer = getActiveLayer();
wxString msg;
msg.Printf( _( "Delete layer %d?" ), layer + 1 );

View File

@ -26,8 +26,8 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
menuBar = new wxMenuBar();
wxMenu* filesMenu = new wxMenu;
filesMenu->Append( ID_LOAD_FILE, _( "Clear All and Load Gerber File" ),
_( "Clear all layers and Load a new Gerber file on first layer" ),
filesMenu->Append( wxID_FILE, _( "Load Gerber File" ),
_( "Load a new Gerber file on the current layer" ),
FALSE );
filesMenu->Append( ID_APPEND_FILE, _( "Append Gerber File to Current Layer" ),
@ -156,7 +156,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
wxBitmap( new_xpm ),
_( "New world" ) );
m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString,
m_HToolBar->AddTool( wxID_FILE, wxEmptyString,
wxBitmap( open_xpm ),
_( "Open existing Layer" ) );