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

Gerbview: fix bug 742785.

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