Commit 9a27065f authored by jean-pierre charras's avatar jean-pierre charras

Gerbview: fix bug 742785.

parent 89ff6c64
...@@ -28,7 +28,6 @@ CvPCB ...@@ -28,7 +28,6 @@ CvPCB
EESchema EESchema
-------- --------
* Use collector classes.
* Drag and drop between two EESchema windows. * Drag and drop between two EESchema windows.
Wayne: Wayne:
...@@ -45,11 +44,6 @@ E6) Start initial work for changing component library file format to use Dick's ...@@ -45,11 +44,6 @@ E6) Start initial work for changing component library file format to use Dick's
support to the library editor. support to the library editor.
GerbView
--------
* List control for layer sort on the fly
* Add excellon2 drill file support (small good library)
PCBNew PCBNew
------ ------
......
...@@ -142,18 +142,13 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) ...@@ -142,18 +142,13 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
{ {
int rowCount; int rowCount;
int menuId = event.GetId(); int menuId = event.GetId();
bool visible; bool visible = (menuId == ID_SHOW_ALL_COPPERS) ? true : false;;
int visibleLayers = 0; int visibleLayers = 0;
switch( menuId ) switch( menuId )
{ {
case ID_SHOW_ALL_COPPERS: case ID_SHOW_ALL_COPPERS:
visible = true;
goto L_change_coppers;
case ID_SHOW_NO_COPPERS: case ID_SHOW_NO_COPPERS:
visible = false;
L_change_coppers:
rowCount = GetLayerRowCount(); rowCount = GetLayerRowCount();
for( int row=0; row < rowCount; ++row ) for( int row=0; row < rowCount; ++row )
{ {
...@@ -182,7 +177,8 @@ void GERBER_LAYER_WIDGET::ReFill() ...@@ -182,7 +177,8 @@ void GERBER_LAYER_WIDGET::ReFill()
{ {
wxString msg; wxString msg;
msg.Printf( _("Layer %d"), layer+1 ); msg.Printf( _("Layer %d"), layer+1 );
AppendLayerRow( LAYER_WIDGET::ROW( msg, layer, brd->GetLayerColor( layer ), wxEmptyString, true ) ); AppendLayerRow( LAYER_WIDGET::ROW( msg, layer,
brd->GetLayerColor( layer ), wxEmptyString, true ) );
} }
installRightLayerClickHandler(); installRightLayerClickHandler();
...@@ -213,7 +209,6 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) ...@@ -213,7 +209,6 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal ) void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
{ {
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
int visibleLayers = brd->GetVisibleLayers(); int visibleLayers = brd->GetVisibleLayers();
if( isVisible ) if( isVisible )
......
...@@ -19,13 +19,8 @@ ...@@ -19,13 +19,8 @@
void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos;
wxString FullFileName; wxString FullFileName;
pos = GetPosition();
pos.x += 20;
pos.y += 20;
switch( id ) switch( id )
{ {
/* Hotkey IDs */ /* Hotkey IDs */
......
...@@ -62,6 +62,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father, ...@@ -62,6 +62,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
SetBoard( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
GetBoard()->SetEnabledLayers( FULL_LAYERS ); // All 32 layers enabled at first. GetBoard()->SetEnabledLayers( FULL_LAYERS ); // All 32 layers enabled at first.
GetBoard()->SetVisibleLayers( FULL_LAYERS ); // All 32 layers visible.
// Create the PCB_LAYER_WIDGET *after* SetBoard(): // Create the PCB_LAYER_WIDGET *after* SetBoard():
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
...@@ -244,8 +245,8 @@ void GERBVIEW_FRAME::SaveSettings() ...@@ -244,8 +245,8 @@ void GERBVIEW_FRAME::SaveSettings()
config->Write( GerbviewShowPageSizeOption, pageSize_opt ); config->Write( GerbviewShowPageSizeOption, pageSize_opt );
config->Write( GerbviewShowDCodes, IsElementVisible( DCODES_VISIBLE ) ); config->Write( GerbviewShowDCodes, IsElementVisible( DCODES_VISIBLE ) );
// Save the drill file history list // Save the drill file history list.
// because we have 2 file historues, we must save this one // Because we have 2 file histories, we must save this one
// in a specific path // in a specific path
config->SetPath(wxT("drl_files") ); config->SetPath(wxT("drl_files") );
m_drillFileHistory.Save( *config ); m_drillFileHistory.Save( *config );
...@@ -334,7 +335,7 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const ...@@ -334,7 +335,7 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const
{ {
int layer = aLayer; int layer = aLayer;
for( int i = 0; i < NB_LAYERS; i++ ) for( int i = 0; i < LAYER_COUNT; i++ )
{ {
GERBER_IMAGE* gerber = g_GERBER_List[ layer ]; GERBER_IMAGE* gerber = g_GERBER_List[ layer ];
...@@ -343,7 +344,7 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const ...@@ -343,7 +344,7 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const
layer++; layer++;
if( layer >= NB_LAYERS ) if( layer >= LAYER_COUNT )
layer = 0; layer = 0;
} }
......
...@@ -15,7 +15,7 @@ enum gerbview_ids ...@@ -15,7 +15,7 @@ enum gerbview_ids
{ {
ID_MAIN_MENUBAR = ID_END_LIST, ID_MAIN_MENUBAR = ID_END_LIST,
ID_GERBVIEW_SHOW_LIST_DCODES = 1, ID_GERBVIEW_SHOW_LIST_DCODES,
ID_GERBVIEW_LOAD_DRILL_FILE, ID_GERBVIEW_LOAD_DRILL_FILE,
ID_GERBVIEW_LOAD_DCODE_FILE, ID_GERBVIEW_LOAD_DCODE_FILE,
ID_GERBVIEW_ERASE_ALL, ID_GERBVIEW_ERASE_ALL,
......
...@@ -28,7 +28,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query ) ...@@ -28,7 +28,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query )
SetCurItem( NULL ); SetCurItem( NULL );
GetBoard()->m_Drawings.DeleteAll(); GetBoard()->m_Drawings.DeleteAll();
for( layer = 0; layer < 32; layer++ ) for( layer = 0; layer < LAYER_COUNT; layer++ )
{ {
if( g_GERBER_List[layer] ) if( g_GERBER_List[layer] )
{ {
...@@ -45,7 +45,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query ) ...@@ -45,7 +45,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query )
SetScreen( ScreenPcb ); SetScreen( ScreenPcb );
GetScreen()->Init(); GetScreen()->Init();
setActiveLayer(LAYER_N_BACK); setActiveLayer(FIRST_COPPER_LAYER);
syncLayerBox(); syncLayerBox();
return TRUE; return TRUE;
} }
......
...@@ -140,10 +140,10 @@ void PCB_LAYER_WIDGET::onRightDownLayers( wxMouseEvent& event ) ...@@ -140,10 +140,10 @@ void PCB_LAYER_WIDGET::onRightDownLayers( wxMouseEvent& event )
// menu text is capitalized: // menu text is capitalized:
// http://library.gnome.org/devel/hig-book/2.20/design-text-labels.html.en#layout-capitalization // http://library.gnome.org/devel/hig-book/2.20/design-text-labels.html.en#layout-capitalization
menu.Append( new wxMenuItem( &menu, ID_SHOW_ALL_COPPERS, menu.Append( new wxMenuItem( &menu, ID_SHOW_ALL_COPPERS,
_("Show All Cu") ) ); _("Show All Copper Layers") ) );
menu.Append( new wxMenuItem( &menu, ID_SHOW_NO_COPPERS, menu.Append( new wxMenuItem( &menu, ID_SHOW_NO_COPPERS,
_( "Hide All Cu" ) ) ); _( "Hide All Copper Layers" ) ) );
PopupMenu( &menu ); PopupMenu( &menu );
......
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