Gerbview: minor enhancements
This commit is contained in:
parent
1173add9ab
commit
ac97a5746d
|
@ -23,8 +23,9 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
|
||||||
|
|
||||||
fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) );
|
fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) );
|
||||||
|
|
||||||
if( fn != wxEmptyString && Clear_Pcb( true ) )
|
if( fn != wxEmptyString )
|
||||||
{
|
{
|
||||||
|
Erase_Current_Layer( false );
|
||||||
LoadOneGerberFile( fn, false );
|
LoadOneGerberFile( fn, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,11 +38,9 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_LOAD_FILE:
|
case wxID_FILE:
|
||||||
if( Clear_Pcb( true ) )
|
Erase_Current_Layer( false );
|
||||||
{
|
LoadOneGerberFile( wxEmptyString, 0 );
|
||||||
LoadOneGerberFile( wxEmptyString, 0 );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MENU_INC_LAYER_AND_APPEND_FILE:
|
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:
|
* Returns:
|
||||||
* 0 if file not read (cancellation of order ...)
|
* 0 if file not read (cancellation of order ...)
|
||||||
* 1 if OK
|
* 1 if OK
|
||||||
|
|
|
@ -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_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_APPEND_FILE, WinEDA_GerberFrame::Files_io )
|
||||||
EVT_TOOL( ID_INC_LAYER_AND_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 )
|
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 )
|
EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
|
||||||
|
|
||||||
// Menu Files:
|
// 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_APPEND_FILE, WinEDA_GerberFrame::Files_io )
|
||||||
EVT_MENU( ID_MENU_INC_LAYER_AND_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 )
|
EVT_MENU( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io )
|
||||||
|
|
|
@ -45,6 +45,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
|
||||||
|
|
||||||
SetBaseScreen( ActiveScreen = ScreenPcb );
|
SetBaseScreen( ActiveScreen = ScreenPcb );
|
||||||
GetScreen()->Init();
|
GetScreen()->Init();
|
||||||
|
setActiveLayer(LAYER_N_BACK);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +53,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
|
||||||
|
|
||||||
void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
|
void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
|
||||||
{
|
{
|
||||||
int layer = GetScreen()->m_Active_Layer;
|
int layer = getActiveLayer();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
msg.Printf( _( "Delete layer %d?" ), layer + 1 );
|
msg.Printf( _( "Delete layer %d?" ), layer + 1 );
|
||||||
|
|
|
@ -26,8 +26,8 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
|
||||||
menuBar = new wxMenuBar();
|
menuBar = new wxMenuBar();
|
||||||
|
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
filesMenu->Append( ID_LOAD_FILE, _( "Clear All and Load Gerber File" ),
|
filesMenu->Append( wxID_FILE, _( "Load Gerber File" ),
|
||||||
_( "Clear all layers and Load a new Gerber file on first layer" ),
|
_( "Load a new Gerber file on the current layer" ),
|
||||||
FALSE );
|
FALSE );
|
||||||
|
|
||||||
filesMenu->Append( ID_APPEND_FILE, _( "Append Gerber File to Current Layer" ),
|
filesMenu->Append( ID_APPEND_FILE, _( "Append Gerber File to Current Layer" ),
|
||||||
|
@ -156,7 +156,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
|
||||||
wxBitmap( new_xpm ),
|
wxBitmap( new_xpm ),
|
||||||
_( "New world" ) );
|
_( "New world" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString,
|
m_HToolBar->AddTool( wxID_FILE, wxEmptyString,
|
||||||
wxBitmap( open_xpm ),
|
wxBitmap( open_xpm ),
|
||||||
_( "Open existing Layer" ) );
|
_( "Open existing Layer" ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue