This commit is contained in:
Dick Hollenbeck 2010-11-12 09:26:30 -06:00
commit 5a784e2d79
91 changed files with 2754 additions and 2096 deletions

View File

@ -24,6 +24,34 @@
#include "bitmaps.h" #include "bitmaps.h"
// -----------------
// helper function (from wxWidgets, opengl/cube.cpp sample
// -----------------
void CheckGLError()
{
GLenum errLast = GL_NO_ERROR;
for ( ;; )
{
GLenum err = glGetError();
if ( err == GL_NO_ERROR )
return;
// normally the error is reset by the call to glGetError() but if
// glGetError() itself returns an error, we risk looping forever here
// so check that we get a different error than the last time
if ( err == errLast )
{
wxLogError(wxT("OpenGL error state couldn't be reset."));
return;
}
errLast = err;
wxLogError(wxT("OpenGL error %d"), err);
}
}
/* /*
* Pcb3D_GLCanvas implementation * Pcb3D_GLCanvas implementation
*/ */
@ -538,6 +566,8 @@ void Pcb3D_GLCanvas::InitGL()
// Setup light souces: // Setup light souces:
SetLights(); SetLights();
CheckGLError();
} }

View File

@ -20,6 +20,8 @@
#error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif #endif
extern void CheckGLError();
static void Draw3D_FilledCircle( double posx, double posy, double rayon, static void Draw3D_FilledCircle( double posx, double posy, double rayon,
double hole_rayon, double zpos ); double hole_rayon, double zpos );
static void Draw3D_FilledSegment( double startx, double starty, static void Draw3D_FilledSegment( double startx, double starty,
@ -348,9 +350,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glEndList(); glEndList();
/* Test for errors */ /* Test for errors */
GLenum err = glGetError(); CheckGLError();
if( err != GL_NO_ERROR )
DisplayError( this, wxT( "Error in GL commands" ) );
return m_gllist; return m_gllist;
} }
@ -786,8 +787,6 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
delta_cx, delta_cy, delta_cx, delta_cy,
xc, yc; xc, yc;
int angle, delta_angle; int angle, delta_angle;
int coord[4][2];
double fcoord[8][2], f_hole_coord[8][2];
double scale; double scale;
double zpos; double zpos;
wxPoint shape_pos; wxPoint shape_pos;
@ -917,33 +916,18 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
break; break;
case PAD_RECT: case PAD_RECT:
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
{ {
int ddx, ddy; wxPoint coord[5];
ddx = m_DeltaSize.x >> 1; wxRealPoint fcoord[8], f_hole_coord[8];
ddy = m_DeltaSize.y >> 1; BuildPadPolygon( coord, wxSize(0,0), angle );
coord[0][0] = -dx - ddy;
coord[0][1] = +dy + ddx;
coord[1][0] = -dx + ddy;
coord[1][1] = -dy - ddx;
coord[2][0] = +dx - ddy;
coord[2][1] = -dy + ddx;
coord[3][0] = +dx + ddy;
coord[3][1] = +dy - ddx;
for( ii = 0; ii < 4; ii++ ) for( ii = 0; ii < 4; ii++ )
{ {
RotatePoint( &coord[ii][0], &coord[ii][1], angle ); coord[ii].x += ux0;
coord[ii][0] += ux0; coord[ii].y += uy0;
coord[ii][1] += uy0;
ll = ii * 2; ll = ii * 2;
fcoord[ll][0] = coord[ii][0] *scale; fcoord[ll].x = coord[ii].x *scale;
fcoord[ll][1] = coord[ii][1] *scale; fcoord[ll].y = coord[ii].y *scale;
} }
for( ii = 0; ii < 7; ii += 2 ) for( ii = 0; ii < 7; ii += 2 )
@ -951,18 +935,17 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
ll = ii + 2; ll = ii + 2;
if( ll > 7 ) if( ll > 7 )
ll -= 8; ll -= 8;
fcoord[ii + 1][0] = (fcoord[ii][0] + fcoord[ll][0]) / 2; fcoord[ii + 1].x = (fcoord[ii].x + fcoord[ll].x) / 2;
fcoord[ii + 1][1] = (fcoord[ii][1] + fcoord[ll][1]) / 2; fcoord[ii + 1].y = (fcoord[ii].y + fcoord[ll].y) / 2;
} }
for( ii = 0; ii < 8; ii++ ) for( ii = 0; ii < 8; ii++ )
{ {
f_hole_coord[ii][0] = -hole * 0.707; f_hole_coord[ii].x = -hole * 0.707;
f_hole_coord[ii][1] = hole * 0.707; f_hole_coord[ii].y = hole * 0.707;
RotatePoint( &f_hole_coord[ii][0], &f_hole_coord[ii][1], RotatePoint( &f_hole_coord[ii].x, &f_hole_coord[ii].y, angle - (ii * 450) );
angle - (ii * 450) ); f_hole_coord[ii].x += drillx;
f_hole_coord[ii][0] += drillx; f_hole_coord[ii].y += drilly;
f_hole_coord[ii][1] += drilly;
} }
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
@ -991,12 +974,12 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
glBegin( GL_QUAD_STRIP ); glBegin( GL_QUAD_STRIP );
for( ii = 0; ii < 8; ii++ ) for( ii = 0; ii < 8; ii++ )
{ {
glVertex3f( f_hole_coord[ii][0], -f_hole_coord[ii][1], zpos ); glVertex3f( f_hole_coord[ii].x, -f_hole_coord[ii].y, zpos );
glVertex3f( fcoord[ii][0], -fcoord[ii][1], zpos ); glVertex3f( fcoord[ii].x, -fcoord[ii].y, zpos );
} }
glVertex3f( f_hole_coord[0][0], -f_hole_coord[0][1], zpos ); glVertex3f( f_hole_coord[0].x, -f_hole_coord[0].y, zpos );
glVertex3f( fcoord[0][0], -fcoord[0][1], zpos ); glVertex3f( fcoord[0].x, -fcoord[0].y, zpos );
glEnd(); glEnd();
} }
} }

View File

@ -87,11 +87,11 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
_( "Move up ^" ) ); _( "Move up ^" ) );
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, wxBitmap( down_xpm ), m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, wxBitmap( down_xpm ),
_( "Move down" ) ); _( "Move down v" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, wxBitmap( ortho_xpm ), m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, wxBitmap( ortho_xpm ),
_( "Enable/Disable ortographic projection" ), _( "Enable/Disable orthographic projection" ),
wxITEM_CHECK ); wxITEM_CHECK );
m_HToolBar->Realize(); m_HToolBar->Realize();

View File

@ -1,17 +1,13 @@
* Copyright (C) 1992-2009 Jean-Pierre Charras * Copyright (C) 1992-2010 Jean-Pierre Charras
* Copyright (C) 1992-2009 Kicad Developers Team * Copyright (C) 1992-2010 Kicad Developers Team
* under GNU General Public License (see copyright.txt) * under GNU General Public License (see copyright.txt)
== Main Author == Main Authors
Jean-Pierre Charras <jean-pierre.charras[at]gipsa-lab-dot-inpg-dot-fr> Jean-Pierre Charras <jean-pierre.charras[at]gipsa-lab-dot-inpg-dot-fr>
IUT1 GEII2 Dick Hollenbeck <dick[at]softplc-dot-com>
Universite Joseph Fourier (U.J.F.) Wayne Stambaugh <stambaughw[at]verizon-dot-net>
Saint Martin d'Hères (38402)
Laboratiore GIPSA-Lab
Saint Martin d'Hères
== Contributors == Contributors
Dick Hollenbeck <dick[at]softplc-dot-com>
Hauptmech <hauptmech[at]gmail-dot-com> Hauptmech <hauptmech[at]gmail-dot-com>
Jerry Jacobs <xor.gate.engineering[at]gmail-dot-com> Jerry Jacobs <xor.gate.engineering[at]gmail-dot-com>
Jonas Diemer <diemer[at]gmx-dot-de> Jonas Diemer <diemer[at]gmx-dot-de>
@ -21,7 +17,6 @@ Marco Serantoni <marco.serantoni[at]gmail-dot-com> (OSX maintener)
Rok Markovic <rok[at]kanardia.eu> Rok Markovic <rok[at]kanardia.eu>
Tim Hanson <sideskate[at]gmail-dot-com> Tim Hanson <sideskate[at]gmail-dot-com>
Vesa Solonen <vesa.solonen[at]hut-dot-fi> Vesa Solonen <vesa.solonen[at]hut-dot-fi>
Wayne Stambaugh <stambaughw[at]verizon-dot-net>
See also CHANGELOG.txt for contributors. See also CHANGELOG.txt for contributors.

View File

@ -4,7 +4,21 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-oct-15, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-nov-3 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++common
* Initial ground work for using Boost container for storing draw items
instead of internal linked list.
++EESchema
* Move tests for dangling end code back into schematic objects.
* Add clear draw object state helper to SCH_SCREEN object.
* Add support for schematic objects to keep temporary list of connection
objects for dangling end and other connection related tests.
* Rearrange schematic label object code.
* Remove duplicate error message boxes when loading schematic items.
2010-oct-28, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
PolyLine.cpp: PolyLine.cpp:
remove unused method CPolyLine::TestPointInsideContour() which was a duplicate of remove unused method CPolyLine::TestPointInsideContour() which was a duplicate of

View File

@ -161,6 +161,7 @@ set(BITMAP_SRCS
icon_pcbnew.xpm icon_pcbnew.xpm
icon_txt.xpm icon_txt.xpm
import3d.xpm import3d.xpm
import_cmp_from_lib.xpm
import_hierarchical_label.xpm import_hierarchical_label.xpm
Import_Module.xpm Import_Module.xpm
import.xpm import.xpm

View File

@ -0,0 +1,38 @@
/* XPM */
const char *import_cmp_from_lib_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
"O c #76787C",
"$ c #979A9C",
"= c #404440",
"; c #ACB1B5",
"# c #04BA04",
"+ c #CACCCC",
"o c #F5F6F7",
". c #2E3031",
" c None",
"* c #124912",
"@ c #049304",
"& c #505355",
"X c #0C290C",
"% c #046404",
"- c #DADBDB",
": c #83888C",
/* pixels */
" .X ",
" ooO ",
" +o++. ",
" @#X$++.$ ",
" %#@X$+X.& ",
" *##@%%%%=&.=.. ",
" OX######%Oooo-.",
" $&*@@##%Ooo-; ",
" :;+:&%@&ooo+: ",
" O;+$*=-oo-;X ",
" =:$+.oooo+O ",
" &O-+oooo; ",
" X&++--o+: ",
" .=O$$$ ",
" .XX ",
" "
};

View File

@ -20,6 +20,7 @@ set(COMMON_SRCS
block_commande.cpp block_commande.cpp
build_version.cpp build_version.cpp
class_colors_design_settings.cpp class_colors_design_settings.cpp
class_layerchoicebox.cpp
class_marker_base.cpp class_marker_base.cpp
class_plotter.cpp class_plotter.cpp
class_undoredo_container.cpp class_undoredo_container.cpp

View File

@ -542,6 +542,22 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( )
} }
void BASE_SCREEN::AddItem( EDA_BaseStruct* aItem )
{
wxCHECK_RET( aItem != NULL, wxT( "Attempt to add NULL item pointer to " ) + GetClass() +
wxT( "item list" ) );
m_items.push_back( aItem );
}
void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_BaseStruct* aItem )
{
wxCHECK_RET( aItem != NULL, wxT( "Attempt to insert NULL item pointer to " ) + GetClass() +
wxT( "item list" ) );
m_items.insert( aIter, aItem );
}
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show

View File

@ -259,7 +259,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
} }
else else
{ {
msg.Printf( _( "Help file %s not found" ), GetChars( wxGetApp().m_HelpFileName ) ); msg.Printf( _( "Help file %s not found." ), GetChars( wxGetApp().m_HelpFileName ) );
DisplayError( this, msg ); DisplayError( this, msg );
} }

View File

@ -0,0 +1,181 @@
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "hotkeys.h"
#include "help_common_strings.h"
#include <wx/ownerdrw.h>
#include <wx/menuitem.h>
#include <wx/bmpcbox.h>
#include <wx/wx.h>
#include "class_layerchoicebox.h"
/* class to display a layer list.
*
*/
WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[] ) :
wxBitmapComboBox( parent, id, wxEmptyString, pos, size,
n, choices, wxCB_READONLY )
{
m_layerorder = true;
m_layerhotkeys = true;
m_hotkeys = NULL;
if( choices != NULL )
ResyncBitmapOnly();
}
WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices ) :
wxBitmapComboBox( parent, id, wxEmptyString, pos, size,
choices, wxCB_READONLY )
{
m_layerorder = true;
m_layerhotkeys = true;
m_hotkeys = NULL;
if( !choices.IsEmpty() )
ResyncBitmapOnly();
}
bool WinEDALayerChoiceBox::SetLayersOrdered( bool value )
{
m_layerorder = value;
return m_layerorder;
}
bool WinEDALayerChoiceBox::SetLayersHotkeys( bool value )
{
m_layerhotkeys = value;
return m_layerhotkeys;
}
// Get Current Item #
int WinEDALayerChoiceBox::GetChoice()
{
return GetSelection();
}
// Get Current Layer
int WinEDALayerChoiceBox::GetLayerSelection()
{
return (long) GetClientData( GetSelection() );
}
// Set Layer #
int WinEDALayerChoiceBox::SetLayerSelection( int layer )
{
int elements = GetCount();
for( int i = 0; i < elements; i++ )
{
if( GetClientData( i ) == (void*) layer )
{
if( GetSelection() != i ) // Element (i) is not selected
{
SetSelection( i );
return i;
}
else
return i; //If element already selected; do nothing
}
}
// Not Found
SetSelection( -1 );
return -1;
}
// Reload the Layers
void WinEDALayerChoiceBox::Resync()
{
WinEDA_BasePcbFrame* pcbFrame = (WinEDA_BasePcbFrame*) GetParent()->GetParent();
BOARD* board = pcbFrame->GetBoard();
wxASSERT( board != NULL );
Clear();
static DECLARE_LAYERS_ORDER_LIST( layertranscode );
static DECLARE_LAYERS_HOTKEY( layerhk );
for( int i = 0; i < LAYER_COUNT; i++ )
{
wxBitmap layerbmp( 14, 14 );
wxMemoryDC bmpDC;
wxBrush brush;
wxString layername;
int layerid = i;
if( m_layerorder )
layerid = layertranscode[i];
if( !board->IsLayerEnabled( layerid ) )
continue;
// Prepare Bitmap
bmpDC.SelectObject( layerbmp );
brush.SetColour( MakeColour( board->GetLayerColor( layerid ) ) );
brush.SetStyle( wxSOLID );
bmpDC.SetBrush( brush );
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
bmpDC.SetPen( *wxBLACK_PEN );
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
layername = board->GetLayerName( layerid );
if( m_layerhotkeys && m_hotkeys != NULL )
layername = AddHotkeyName( layername, m_hotkeys, layerhk[layerid], false );
Append( layername, layerbmp, (void*) layerid );
}
}
void WinEDALayerChoiceBox::ResyncBitmapOnly()
{
WinEDA_BasePcbFrame* pcbFrame = (WinEDA_BasePcbFrame*) GetParent()->GetParent();
BOARD* board = pcbFrame->GetBoard();
int elements = GetCount();
for( int i = 0; i < elements; i++ )
{
wxBitmap layerbmp( 14, 14 );
wxMemoryDC bmpDC;
wxBrush brush;
wxString layername;
int layerid = i;
// Prepare Bitmap
bmpDC.SelectObject( layerbmp );
brush.SetColour( MakeColour( board->GetLayerColor( layerid ) ) );
brush.SetStyle( wxSOLID );
bmpDC.SetBrush( brush );
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
bmpDC.SetPen( *wxBLACK_PEN );
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
SetItemBitmap(i, layerbmp);
}
}

View File

@ -633,37 +633,43 @@ void WinEDA_DrawFrame::UpdateStatusBar()
} }
/* The following sadly is an if eeschema/if pcbnew */ /* The following sadly is an if eeschema/if pcbnew */
wxString formatter; wxString absformatter;
wxString locformatter;
switch( g_UserUnit ) switch( g_UserUnit )
{ {
case INCHES: case INCHES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
{ {
formatter = wxT( "X %.3f Y %.3f" ); absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f" );
} }
else else
{ {
formatter = wxT( "X %.4f Y %.4f" ); absformatter = wxT( "X %.4f Y %.4f" );
locformatter = wxT( "dx %.4f dy %.4f" );
} }
break; break;
case MILLIMETRES: case MILLIMETRES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
{ {
formatter = wxT( "X %.2f Y %.2f" ); absformatter = wxT( "X %.2f Y %.2f" );
locformatter = wxT( "dx %.2f dy %.2f" );
} }
else else
{ {
formatter = wxT( "X %.3f Y %.3f" ); absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f" );
} }
break; break;
case UNSCALED_UNITS: case UNSCALED_UNITS:
formatter = wxT( "X %f Y %f" ); absformatter = wxT( "X %f Y %f" );
locformatter = wxT( "dx %f dy %f" );
break; break;
} }
Line.Printf( formatter, dXpos, dYpos ); Line.Printf( absformatter, dXpos, dYpos );
SetStatusText( Line, 2 ); SetStatusText( Line, 2 );
/* Display relative coordinates: */ /* Display relative coordinates: */
@ -678,7 +684,7 @@ void WinEDA_DrawFrame::UpdateStatusBar()
} }
/* We already decided the formatter above */ /* We already decided the formatter above */
Line.Printf( formatter, dXpos, dYpos ); Line.Printf( locformatter, dXpos, dYpos );
SetStatusText( Line, 3 ); SetStatusText( Line, 3 );
} }

View File

@ -224,18 +224,18 @@ bool DSNLEXER::IsSymbol( int aTok )
} }
void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError) void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw( IO_ERROR )
{ {
// append to aText, do not overwrite // append to aText, do not overwrite
aText << wxT(" ") << _("in") << wxT(" \"") << CurSource() aText << wxT(" ") << _("in") << wxT(" \"") << CurSource()
<< wxT("\" ") << _("on line") << wxT(" ") << reader->LineNumber() << wxT("\" ") << _("on line") << wxT(" ") << reader->LineNumber()
<< wxT(" ") << _("at offset") << wxT(" ") << charOffset; << wxT(" ") << _("at offset") << wxT(" ") << charOffset;
throw IOError( aText ); throw IO_ERROR( aText );
} }
void DSNLEXER::Expecting( int aTok ) throw( IOError ) void DSNLEXER::Expecting( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText( _("Expecting") );
errText << wxT(" ") << GetTokenString( aTok ); errText << wxT(" ") << GetTokenString( aTok );
@ -243,7 +243,7 @@ void DSNLEXER::Expecting( int aTok ) throw( IOError )
} }
void DSNLEXER::Expecting( const wxString& text ) throw( IOError ) void DSNLEXER::Expecting( const wxString& text ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText( _("Expecting") );
errText << wxT(" '") << text << wxT("'"); errText << wxT(" '") << text << wxT("'");
@ -251,7 +251,7 @@ void DSNLEXER::Expecting( const wxString& text ) throw( IOError )
} }
void DSNLEXER::Unexpected( int aTok ) throw( IOError ) void DSNLEXER::Unexpected( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText( _("Unexpected") );
errText << wxT(" ") << GetTokenString( aTok ); errText << wxT(" ") << GetTokenString( aTok );
@ -259,7 +259,7 @@ void DSNLEXER::Unexpected( int aTok ) throw( IOError )
} }
void DSNLEXER::Unexpected( const wxString& text ) throw( IOError ) void DSNLEXER::Unexpected( const wxString& text ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText( _("Unexpected") );
errText << wxT(" '") << text << wxT("'"); errText << wxT(" '") << text << wxT("'");
@ -267,7 +267,7 @@ void DSNLEXER::Unexpected( const wxString& text ) throw( IOError )
} }
void DSNLEXER::NeedLEFT() throw( IOError ) void DSNLEXER::NeedLEFT() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( tok != DSN_LEFT ) if( tok != DSN_LEFT )
@ -275,7 +275,7 @@ void DSNLEXER::NeedLEFT() throw( IOError )
} }
void DSNLEXER::NeedRIGHT() throw( IOError ) void DSNLEXER::NeedRIGHT() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( tok != DSN_RIGHT ) if( tok != DSN_RIGHT )
@ -283,7 +283,7 @@ void DSNLEXER::NeedRIGHT() throw( IOError )
} }
int DSNLEXER::NeedSYMBOL() throw( IOError ) int DSNLEXER::NeedSYMBOL() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( !IsSymbol( tok ) ) if( !IsSymbol( tok ) )
@ -292,7 +292,7 @@ int DSNLEXER::NeedSYMBOL() throw( IOError )
} }
int DSNLEXER::NeedSYMBOLorNUMBER() throw( IOError ) int DSNLEXER::NeedSYMBOLorNUMBER() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( !IsSymbol( tok ) && tok!=DSN_NUMBER ) if( !IsSymbol( tok ) && tok!=DSN_NUMBER )
@ -312,7 +312,7 @@ static inline bool isSpace( int cc )
} }
int DSNLEXER::NextTok() throw (IOError) int DSNLEXER::NextTok() throw( IO_ERROR )
{ {
char* cur = next; char* cur = next;
char* head = cur; char* head = cur;
@ -1380,7 +1380,7 @@ class DSNTEST : public wxApp
DSNLEXER* lexer; DSNLEXER* lexer;
int nestLevel; int nestLevel;
void recursion() throw( IOError ); void recursion() throw( IO_ERROR );
void indent() void indent()
{ {
@ -1485,7 +1485,7 @@ bool DSNTEST::OnInit()
} }
printf("\n"); printf("\n");
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
fprintf( stderr, "%s\n", CONV_TO_UTF8( ioe.errorText ) ); fprintf( stderr, "%s\n", CONV_TO_UTF8( ioe.errorText ) );
} }
@ -1494,7 +1494,7 @@ bool DSNTEST::OnInit()
} }
void DSNTEST::recursion() throw(IOError) void DSNTEST::recursion() throw( IO_ERROR )
{ {
int tok; int tok;
const char* space = ""; const char* space = "";

View File

@ -626,6 +626,18 @@ void WinEDA_App::GetSettings(bool aReopenLastUsedDirectory)
} }
m_EDA_Config->Read( wxT( "BgColor" ), &g_DrawBgColor ); m_EDA_Config->Read( wxT( "BgColor" ), &g_DrawBgColor );
/* Load per-user search paths from settings file */
wxString upath;
int i = 1;
while( 1 )
{
upath = m_EDA_CommonConfig->Read( wxString::Format( wxT( "LibraryPath%d" ), i ), wxT( "" ) );
if( upath.IsSameAs( wxT( "" ) ) ) break;
m_libSearchPaths.Add( upath );
i ++;
}
} }

View File

@ -90,7 +90,7 @@ FILE_LINE_READER::FILE_LINE_READER( FILE* aFile, const wxString& aFileName, unsi
} }
unsigned FILE_LINE_READER::ReadLine() throw (IOError) unsigned FILE_LINE_READER::ReadLine() throw( IO_ERROR )
{ {
length = 0; length = 0;
line[0] = 0; line[0] = 0;
@ -101,7 +101,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError)
length += strlen( line + length ); length += strlen( line + length );
if( length == maxLineLength ) if( length == maxLineLength )
throw IOError( _("Line length exceeded") ); throw IO_ERROR( _("Line length exceeded") );
// a normal line breaks here, once through while loop // a normal line breaks here, once through while loop
if( length+1 < capacity || line[length-1] == '\n' ) if( length+1 < capacity || line[length-1] == '\n' )
@ -117,7 +117,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError)
} }
unsigned STRING_LINE_READER::ReadLine() throw (IOError) unsigned STRING_LINE_READER::ReadLine() throw( IO_ERROR )
{ {
size_t nlOffset = lines.find( '\n', ndx ); size_t nlOffset = lines.find( '\n', ndx );
@ -129,7 +129,7 @@ unsigned STRING_LINE_READER::ReadLine() throw (IOError)
if( length ) if( length )
{ {
if( length >= maxLineLength ) if( length >= maxLineLength )
throw IOError( _("Line length exceeded") ); throw IO_ERROR( _("Line length exceeded") );
if( length+1 > capacity ) // +1 for terminating nul if( length+1 > capacity ) // +1 for terminating nul
expandCapacity( length+1 ); expandCapacity( length+1 );
@ -186,7 +186,7 @@ const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee, const char* quote
} }
int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IOError ) int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IO_ERROR )
{ {
int ret = vsnprintf( &buffer[0], buffer.size(), fmt, ap ); int ret = vsnprintf( &buffer[0], buffer.size(), fmt, ap );
if( ret >= (int) buffer.size() ) if( ret >= (int) buffer.size() )
@ -202,7 +202,7 @@ int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IOError )
} }
int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IOError ) int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IO_ERROR )
{ {
va_list args; va_list args;
@ -214,7 +214,7 @@ int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IOError )
} }
int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError ) int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IO_ERROR )
{ {
#define NESTWIDTH 2 ///< how many spaces per nestLevel #define NESTWIDTH 2 ///< how many spaces per nestLevel
@ -243,7 +243,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError
} }
const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError ) const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IO_ERROR )
{ {
// derived class's notion of what a quote character is // derived class's notion of what a quote character is
char quote = *GetQuoteChar( "(" ); char quote = *GetQuoteChar( "(" );
@ -268,7 +268,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError )
// a decision was made to make all S-expression strings be on a single // a decision was made to make all S-expression strings be on a single
// line. You can embedd \n (human readable) in the text but not // line. You can embedd \n (human readable) in the text but not
// '\n' which is 0x0a. // '\n' which is 0x0a.
throw IOError( _( "S-expression string has newline" ) ); throw IO_ERROR( _( "S-expression string has newline" ) );
} }
} }
@ -285,7 +285,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError )
//-----<STRING_FORMATTER>---------------------------------------------------- //-----<STRING_FORMATTER>----------------------------------------------------
void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IOError ) void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR )
{ {
mystring.append( aOutBuf, aCount ); mystring.append( aOutBuf, aCount );
} }
@ -314,7 +314,7 @@ const char* STREAM_OUTPUTFORMATTER::GetQuoteChar( const char* wrapee )
} }
void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IOError ) void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR )
{ {
int lastWrite; int lastWrite;
@ -326,7 +326,7 @@ void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IOE
if( !os.IsOk() ) if( !os.IsOk() )
{ {
throw IOError( _( "OUTPUTSTREAM_OUTPUTFORMATTER write error" ) ); throw IO_ERROR( _( "OUTPUTSTREAM_OUTPUTFORMATTER write error" ) );
} }
} }
} }

View File

@ -74,13 +74,27 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
// Ensure the whole frame is visible, whenever the asked position. // Ensure the whole frame is visible, whenever the asked position.
// Moreover with a work station having dual monitors, the asked position can be relative to a monitor
// and this frame can be displayed on the other monitor, with an "out of screen" position.
// Give also a small margin. // Give also a small margin.
wxPoint endCornerPosition = GetPosition();
int margin = 10; int margin = 10;
wxPoint windowPosition = GetPosition();
if( framepos != wxDefaultPosition )
{
if( windowPosition.x < margin )
windowPosition.x = margin;
// Under MACOS, a vertical margin >= 20 is needed by the system menubar
int v_margin = MAX(20, margin);
if( windowPosition.y < v_margin )
windowPosition.y = v_margin;
if( windowPosition != framepos )
SetPosition(windowPosition);
}
wxPoint endCornerPosition = GetPosition();
endCornerPosition.x += GetSize().x + margin; endCornerPosition.x += GetSize().x + margin;
endCornerPosition.y += GetSize().y + margin; endCornerPosition.y += GetSize().y + margin;
wxPoint windowPosition = GetPosition(); windowPosition = GetPosition();
wxRect freeScreenArea( wxGetClientDisplayRect( ) ); wxRect freeScreenArea( wxGetClientDisplayRect( ) );
if( freeScreenArea.GetRight() < endCornerPosition.x ) if( freeScreenArea.GetRight() < endCornerPosition.x )
{ {

View File

@ -13,7 +13,7 @@
WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent, WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent,
wxWindowID id, bool horizontal ): wxWindowID id, bool horizontal ):
wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize, wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | ( ( horizontal ) ? wxAUI_TB_DEFAULT_STYLE | ( ( horizontal ) ?
wxAUI_TB_HORZ_LAYOUT : wxAUI_TB_HORZ_LAYOUT :
wxAUI_TB_VERTICAL ) ) wxAUI_TB_VERTICAL ) )
{ {

View File

@ -29,7 +29,7 @@
typedef wxXmlProperty XATTR; typedef wxXmlProperty XATTR;
void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
switch( GetType() ) switch( GetType() )
{ {
@ -48,7 +48,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
} }
void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
std::string utf8; std::string utf8;

View File

@ -14,6 +14,7 @@
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h"
/* /*
* NOTE: There is something in 3d_viewer.h that causes a compiler error in * NOTE: There is something in 3d_viewer.h that causes a compiler error in

View File

@ -23,7 +23,7 @@ FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX( WinEDA_CvpcbFrame* parent,
{ {
m_UseFootprintFullList = true; m_UseFootprintFullList = true;
m_ActiveFootprintList = NULL; m_ActiveFootprintList = NULL;
SetActiveFootprintList( TRUE ); SetActiveFootprintList( true );
} }
@ -61,8 +61,8 @@ wxString FOOTPRINTS_LISTBOX::GetSelectedFootprint()
if( ii >= 0 ) if( ii >= 0 )
{ {
wxString msg = (*m_ActiveFootprintList)[ii]; wxString msg = (*m_ActiveFootprintList)[ii];
msg.Trim( TRUE ); msg.Trim( true );
msg.Trim( FALSE ); msg.Trim( false );
FootprintName = msg.AfterFirst( wxChar( ' ' ) ); FootprintName = msg.AfterFirst( wxChar( ' ' ) );
} }
@ -121,11 +121,11 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list )
m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg );
} }
SetActiveFootprintList( TRUE ); SetActiveFootprintList( true );
if( ( GetCount() == 0 ) if( ( GetCount() == 0 )
|| ( OldSelection < 0 ) || ( OldSelection >= GetCount() ) ) || ( OldSelection < 0 ) || ( OldSelection >= GetCount() ) )
SetSelection( 0, TRUE ); SetSelection( 0, true );
Refresh(); Refresh();
} }
@ -137,7 +137,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component,
wxString msg; wxString msg;
unsigned jj; unsigned jj;
int OldSelection = GetSelection(); int OldSelection = GetSelection();
bool HasItem = FALSE; bool HasItem = false;
m_FilteredFootprintList.Clear(); m_FilteredFootprintList.Clear();
@ -150,17 +150,17 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component,
msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1, msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
footprint.m_Module.GetData() ); footprint.m_Module.GetData() );
m_FilteredFootprintList.Add( msg ); m_FilteredFootprintList.Add( msg );
HasItem = TRUE; HasItem = true;
} }
} }
if( HasItem ) if( HasItem )
SetActiveFootprintList( FALSE ); SetActiveFootprintList( false );
else else
SetActiveFootprintList( TRUE ); SetActiveFootprintList( true );
if( ( GetCount() == 0 ) || ( OldSelection >= GetCount() ) ) if( ( GetCount() == 0 ) || ( OldSelection >= GetCount() ) )
SetSelection( 0, TRUE ); SetSelection( 0, true );
Refresh(); Refresh();
} }
@ -189,49 +189,35 @@ void FOOTPRINTS_LISTBOX::SetActiveFootprintList( bool FullList, bool Redraw )
{ {
bool new_selection; bool new_selection;
if( FullList ) if( FullList )
new_selection = TRUE; new_selection = true;
else else
new_selection = FALSE; new_selection = false;
if( new_selection != old_selection ) if( new_selection != old_selection )
SetSelection( 0, TRUE ); SetSelection( 0, true );
} }
#endif #endif
if( FullList ) if( FullList )
{ {
m_UseFootprintFullList = TRUE; m_UseFootprintFullList = true;
m_ActiveFootprintList = &m_FullFootprintList; m_ActiveFootprintList = &m_FullFootprintList;
SetItemCount( m_FullFootprintList.GetCount() ); SetItemCount( m_FullFootprintList.GetCount() );
} }
else else
{ {
m_UseFootprintFullList = FALSE; m_UseFootprintFullList = false;
m_ActiveFootprintList = &m_FilteredFootprintList; m_ActiveFootprintList = &m_FilteredFootprintList;
SetItemCount( m_FilteredFootprintList.GetCount() ); SetItemCount( m_FilteredFootprintList.GetCount() );
} }
if( Redraw ) if( Redraw )
{ {
if( !m_UseFootprintFullList if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) )
|| ( m_UseFootprintFullList != old_selection ) )
{ {
Refresh(); Refresh();
} }
} }
if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) ) GetParent()->DisplayStatus();
{
GetParent()->SetStatusText( wxEmptyString, 0 );
GetParent()->SetStatusText( wxEmptyString, 1 );
}
wxString msg;
if( FullList )
msg.Printf( _( "Footprints (All): %d" ),
m_ActiveFootprintList->GetCount() );
else
msg.Printf( _( "Footprints (filtered): %d" ),
m_ActiveFootprintList->GetCount() );
GetParent()->SetStatusText( msg, 2 );
} }
@ -253,6 +239,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints ); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints );
wxASSERT(Module);
if( GetParent()->DrawFrame ) if( GetParent()->DrawFrame )
{ {
GetParent()->CreateScreenCmp(); /* refresh general */ GetParent()->CreateScreenCmp(); /* refresh general */

View File

@ -16,6 +16,7 @@
#include "cvstruct.h" #include "cvstruct.h"
#include "dialog_cvpcb_config.h" #include "dialog_cvpcb_config.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h"
#include "build_version.h" #include "build_version.h"
@ -115,7 +116,6 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
m_KeepCvpcbOpen = false; m_KeepCvpcbOpen = false;
m_undefinedComponentCnt = 0; m_undefinedComponentCnt = 0;
/* Name of the document footprint list /* Name of the document footprint list
* usually located in share/modules/footprints_doc * usually located in share/modules/footprints_doc
* this is of the responsibility to users to create this file * this is of the responsibility to users to create this file
@ -422,9 +422,7 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
m_undefinedComponentCnt = m_components.size(); m_undefinedComponentCnt = m_components.size();
} }
Line.Printf( _( "Components: %d (free: %d)" ), m_components.size(), DisplayStatus();
m_components.size() );
SetStatusText( Line, 1 );
} }
@ -557,6 +555,7 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
m_FootprintList->SetFootprintFilteredList( &m_components[ selection ], m_FootprintList->SetFootprintFilteredList( &m_components[ selection ],
m_footprints ); m_footprints );
DisplayStatus();
} }
@ -585,3 +584,30 @@ void WinEDA_CvpcbFrame::OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event )
{ {
event.Check( m_KeepCvpcbOpen ); event.Check( m_KeepCvpcbOpen );
} }
/** DisplayStatus()
* Displays info to the status line at bottom of the main frame
*/
void WinEDA_CvpcbFrame::DisplayStatus()
{
wxString msg;
msg.Printf( _( "Components: %d (free: %d)" ),
m_components.size(), m_undefinedComponentCnt );
SetStatusText( msg, 0 );
SetStatusText( wxEmptyString, 1 );
if( m_FootprintList )
{
if( m_FootprintList->m_UseFootprintFullList )
msg.Printf( _( "Footprints (All): %d" ),
m_FootprintList->m_ActiveFootprintList->GetCount() );
else
msg.Printf( _( "Footprints (filtered): %d" ),
m_FootprintList->m_ActiveFootprintList->GetCount() );
}
else
msg.Empty();
SetStatusText( msg, 2 );
}

34
cvpcb/cvpcb_id.h Normal file
View File

@ -0,0 +1,34 @@
/**
* @file cvpcb_id.h
*/
/*
* Command IDs for CvPcb.
*
* Please add IDs that are unique to the component library viewer here and
* not in the global id.h file. This will prevent the entire project from
* being rebuilt when adding new commands to the component library viewer.
*/
// Generic IDs:
#include "id.h"
// specific IDs
enum id_cvpcb_frm
{
ID_CVPCB_QUIT = ID_END_LIST,
ID_CVPCB_READ_INPUT_NETLIST,
ID_CVPCB_SAVEQUITCVPCB,
ID_CVPCB_CREATE_CONFIGWINDOW,
ID_CVPCB_CREATE_SCREENCMP,
ID_CVPCB_GOTO_FIRSTNA,
ID_CVPCB_GOTO_PREVIOUSNA,
ID_CVPCB_DEL_ASSOCIATIONS,
ID_CVPCB_AUTO_ASSOCIE,
ID_CVPCB_COMPONENT_LIST,
ID_CVPCB_FOOTPRINT_LIST,
ID_CVPCB_CREATE_STUFF_FILE,
ID_CVPCB_SHOW3D_FRAME,
ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
};

View File

@ -16,36 +16,6 @@ class COMPONENTS_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME; class DISPLAY_FOOTPRINTS_FRAME;
#include "id.h"
/**
* Command IDs for the component library viewer.
*
* Please add IDs that are unique to the component library viewer here and
* not in the global id.h file. This will prevent the entire project from
* being rebuilt when adding new commands to the component library viewer.
*/
enum id_cvpcb_frm
{
ID_CVPCB_QUIT = ID_END_LIST,
ID_CVPCB_READ_INPUT_NETLIST,
ID_CVPCB_SAVEQUITCVPCB,
ID_CVPCB_CREATE_CONFIGWINDOW,
ID_CVPCB_CREATE_SCREENCMP,
ID_CVPCB_GOTO_FIRSTNA,
ID_CVPCB_GOTO_PREVIOUSNA,
ID_CVPCB_DEL_ASSOCIATIONS,
ID_CVPCB_AUTO_ASSOCIE,
ID_CVPCB_COMPONENT_LIST,
ID_CVPCB_FOOTPRINT_LIST,
ID_CVPCB_CREATE_STUFF_FILE,
ID_CVPCB_SHOW3D_FRAME,
ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
};
/** /**
* The CVPcb application main window. * The CVPcb application main window.
@ -120,6 +90,10 @@ public:
void SaveProjectFile( const wxString& fileName ); void SaveProjectFile( const wxString& fileName );
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
/** DisplayStatus()
* Displays info to the status line at bottom of the main frame
*/
void DisplayStatus();
PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );

View File

@ -24,7 +24,7 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
COMPONENT* Component; COMPONENT* Component;
bool isUndefined = false; bool isUndefined = false;
int NumCmp; int NumCmp;
wxString Line; wxString msg;
if( m_components.empty() ) if( m_components.empty() )
return; return;
@ -45,7 +45,7 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
Component->m_Module = package; Component->m_Module = package;
Line.Printf( CMP_FORMAT, NumCmp + 1, msg.Printf( CMP_FORMAT, NumCmp + 1,
GetChars( Component->m_Reference ), GetChars( Component->m_Reference ),
GetChars( Component->m_Value ), GetChars( Component->m_Value ),
GetChars( Component->m_Module ) ); GetChars( Component->m_Module ) );
@ -54,7 +54,7 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
if( isUndefined ) if( isUndefined )
m_undefinedComponentCnt -= 1; m_undefinedComponentCnt -= 1;
m_ListCmp->SetString( NumCmp, Line ); m_ListCmp->SetString( NumCmp, msg );
m_ListCmp->SetSelection( NumCmp, FALSE ); m_ListCmp->SetSelection( NumCmp, FALSE );
// We activate next component: // We activate next component:
@ -62,9 +62,7 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
NumCmp++; NumCmp++;
m_ListCmp->SetSelection( NumCmp, TRUE ); m_ListCmp->SetSelection( NumCmp, TRUE );
Line.Printf( _( "Components: %d (free: %d)" ), DisplayStatus();
m_components.size(), m_undefinedComponentCnt );
SetStatusText( Line, 1 );
} }
@ -112,9 +110,7 @@ bool WinEDA_CvpcbFrame::ReadNetList()
if( !m_components.empty() ) if( !m_components.empty() )
m_ListCmp->SetSelection( 0, TRUE ); m_ListCmp->SetSelection( 0, TRUE );
msg.Printf( _( "Components: %d (free: %d)" ), m_components.size(), DisplayStatus();
m_undefinedComponentCnt );
SetStatusText( msg, 1 );
/* Update the title of the main window. */ /* Update the title of the main window. */
SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() + SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +

View File

@ -9,6 +9,7 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "cvpcb_id.h"
/****************************************************************************** /******************************************************************************
@ -122,7 +123,5 @@ void WinEDA_CvpcbFrame::BuildFOOTPRINTS_LISTBOX()
} }
m_FootprintList->SetFootprintFullList( m_footprints ); m_FootprintList->SetFootprintFullList( m_footprints );
DisplayStatus();
msg.Printf( _( "Footprints: %d" ), m_FootprintList->GetCount() );
SetStatusText( msg, 2 );
} }

View File

@ -10,6 +10,7 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "cvpcb_id.h"
#include "bitmaps.h" #include "bitmaps.h"

View File

@ -11,6 +11,7 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "cvpcb_id.h"
void WinEDA_CvpcbFrame::ReCreateHToolbar() void WinEDA_CvpcbFrame::ReCreateHToolbar()

View File

@ -19,16 +19,11 @@
// Imported functions: // Imported functions:
void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, const wxPoint aMoveVector );
const wxPoint aMoveVector ); void RotateListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& Center );
void RotateListOfItems( PICKED_ITEMS_LIST& aItemsList, void Mirror_X_ListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& aMirrorPoint );
wxPoint& Center ); void MirrorListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& Center );
void Mirror_X_ListOfItems( PICKED_ITEMS_LIST& aItemsList, void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList );
wxPoint& aMirrorPoint );
void MirrorListOfItems( PICKED_ITEMS_LIST& aItemsList,
wxPoint& Center );
void DeleteItemsInList( WinEDA_DrawPanel* panel,
PICKED_ITEMS_LIST& aItemsList );
void DuplicateItemsInList( SCH_SCREEN* screen, void DuplicateItemsInList( SCH_SCREEN* screen,
PICKED_ITEMS_LIST& aItemsList, PICKED_ITEMS_LIST& aItemsList,
const wxPoint aMoveVector ); const wxPoint aMoveVector );
@ -38,9 +33,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint aPosition );
static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem, static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
wxPoint& aPosition, wxPoint& aPosition,
bool aSearchFirst ); bool aSearchFirst );
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
wxDC* DC,
bool erase );
static void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList ); static void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList );
@ -114,8 +107,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{ {
wxString msg; wxString msg;
err = TRUE; err = TRUE;
msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd \ msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
%d, state %d)" ),
block->m_Command, block->m_State ); block->m_Command, block->m_State );
DisplayError( this, msg ); DisplayError( this, msg );
} }
@ -136,10 +128,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
SaveCopyInUndoList( block->m_ItemsSelection, SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector );
UR_MOVED,
block->m_MoveVector );
MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector );
block->ClearItemsList(); block->ClearItemsList();
break; break;
@ -149,13 +138,10 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
DuplicateItemsInList( DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
SaveCopyInUndoList( SaveCopyInUndoList( block->m_ItemsSelection,
block->m_ItemsSelection, ( block->m_Command == BLOCK_PRESELECT_MOVE ) ? UR_CHANGED : UR_NEW );
(block->m_Command ==
BLOCK_PRESELECT_MOVE) ? UR_CHANGED : UR_NEW );
block->ClearItemsList(); block->ClearItemsList();
break; break;
@ -178,12 +164,8 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
OnModify(); OnModify();
/* clear struct.m_Flags */ // clear struct.m_Flags.
SCH_ITEM* Struct; GetScreen()->ClearDrawingState();
for( Struct = GetScreen()->EEDrawList;
Struct != NULL;
Struct = Struct->Next() )
Struct->m_Flags = 0;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
@ -196,13 +178,11 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
if( block->GetCount() ) if( block->GetCount() )
{ {
DisplayError( this, DisplayError( this, wxT( "HandleBlockPLace() error: some items left in buffer" ) );
wxT( "HandleBlockPLace() error: some items left in buffer" ) );
block->ClearItemsList(); block->ClearItemsList();
} }
SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
wxEmptyString );
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
@ -288,11 +268,9 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
if( block->GetCount() ) if( block->GetCount() )
{ {
wxPoint move_vector = wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
-GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
SaveStructListForPaste( block->m_ItemsSelection ); SaveStructListForPaste( block->m_ItemsSelection );
MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector );
move_vector );
ii = -1; ii = -1;
} }
block->ClearItemsList(); block->ClearItemsList();
@ -317,12 +295,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
if( block->m_Command == BLOCK_ABORT ) if( block->m_Command == BLOCK_ABORT )
{ {
/* clear struct.m_Flags */ GetScreen()->ClearDrawingState();
EDA_BaseStruct* Struct;
for( Struct = GetScreen()->EEDrawList;
Struct != NULL;
Struct = Struct->Next() )
Struct->m_Flags = 0;
} }
if( ii <= 0 ) if( ii <= 0 )
@ -333,9 +306,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
SetToolID( m_ID_current_state, SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
DrawPanel->m_PanelDefaultCursor,
wxEmptyString );
} }
if( zoom_command ) if( zoom_command )
@ -415,8 +386,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
if( block->GetCount() ) if( block->GetCount() )
{ {
wxPoint move_vector = wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
-GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
SaveStructListForPaste( block->m_ItemsSelection ); SaveStructListForPaste( block->m_ItemsSelection );
MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector ); MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector );
} }
@ -424,8 +394,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_ZOOM: /* Window Zoom */ case BLOCK_ZOOM: /* Window Zoom */
DrawPanel->ForceCloseManageCurseur( DrawPanel, DC ); DrawPanel->ForceCloseManageCurseur( DrawPanel, DC );
DrawPanel->SetCursor( DrawPanel->SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor );
DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor );
Window_Zoom( GetScreen()->m_BlockLocate ); Window_Zoom( GetScreen()->m_BlockLocate );
break; break;
@ -439,9 +408,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
/* Compute the rotation center and put it on grid */ /* Compute the rotation center and put it on grid */
wxPoint rotationPoint = block->Centre(); wxPoint rotationPoint = block->Centre();
PutOnGrid( &rotationPoint ); PutOnGrid( &rotationPoint );
SaveCopyInUndoList( block->m_ItemsSelection, SaveCopyInUndoList( block->m_ItemsSelection, UR_ROTATED, rotationPoint );
UR_ROTATED,
rotationPoint );
RotateListOfItems( block->m_ItemsSelection, rotationPoint ); RotateListOfItems( block->m_ItemsSelection, rotationPoint );
OnModify(); OnModify();
} }
@ -460,9 +427,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
/* Compute the mirror center and put it on grid */ /* Compute the mirror center and put it on grid */
wxPoint mirrorPoint = block->Centre(); wxPoint mirrorPoint = block->Centre();
PutOnGrid( &mirrorPoint ); PutOnGrid( &mirrorPoint );
SaveCopyInUndoList( block->m_ItemsSelection, SaveCopyInUndoList( block->m_ItemsSelection, UR_MIRRORED_X, mirrorPoint );
UR_MIRRORED_X,
mirrorPoint );
Mirror_X_ListOfItems( block->m_ItemsSelection, mirrorPoint ); Mirror_X_ListOfItems( block->m_ItemsSelection, mirrorPoint );
OnModify(); OnModify();
// block->m_State = STATE_BLOCK_MOVE; // block->m_State = STATE_BLOCK_MOVE;
@ -481,9 +446,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
/* Compute the mirror center and put it on grid */ /* Compute the mirror center and put it on grid */
wxPoint mirrorPoint = block->Centre(); wxPoint mirrorPoint = block->Centre();
PutOnGrid( &mirrorPoint ); PutOnGrid( &mirrorPoint );
SaveCopyInUndoList( block->m_ItemsSelection, SaveCopyInUndoList( block->m_ItemsSelection, UR_MIRRORED_Y, mirrorPoint );
UR_MIRRORED_Y,
mirrorPoint );
MirrorListOfItems( block->m_ItemsSelection, mirrorPoint ); MirrorListOfItems( block->m_ItemsSelection, mirrorPoint );
OnModify(); OnModify();
// block->m_State = STATE_BLOCK_MOVE; // block->m_State = STATE_BLOCK_MOVE;
@ -506,9 +469,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
SetToolID( m_ID_current_state, SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
DrawPanel->m_PanelDefaultCursor,
wxEmptyString );
} }
} }
@ -516,8 +477,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
/* Traces the outline of the search block structures /* Traces the outline of the search block structures
* The entire block follows the cursor * The entire block follows the cursor
*/ */
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
bool erase )
{ {
BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;; BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;;
@ -555,9 +515,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*/ */
void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList ) void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
{ {
g_BlockSaveDataList.ClearListAndDeleteItems(); // delete previous g_BlockSaveDataList.ClearListAndDeleteItems(); // delete previous saved list, if exists
// saved list, if
// exists
/* save the new list: */ /* save the new list: */
ITEM_PICKER item; ITEM_PICKER item;
@ -569,8 +527,7 @@ void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ ) for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
{ {
/* Make a copy of the original picked item. */ /* Make a copy of the original picked item. */
SCH_ITEM* DrawStructCopy = DuplicateStruct( SCH_ITEM* DrawStructCopy = DuplicateStruct( (SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
(SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
DrawStructCopy->SetParent( NULL ); DrawStructCopy->SetParent( NULL );
item.m_PickedItem = DrawStructCopy; item.m_PickedItem = DrawStructCopy;
g_BlockSaveDataList.PushItem( item ); g_BlockSaveDataList.PushItem( item );
@ -599,8 +556,7 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
for( unsigned ii = 0; ii < g_BlockSaveDataList.GetCount(); ii++ ) for( unsigned ii = 0; ii < g_BlockSaveDataList.GetCount(); ii++ )
{ {
Struct = DuplicateStruct( Struct = DuplicateStruct(
(SCH_ITEM*) g_BlockSaveDataList.m_ItemsSelection.GetPickedItem( (SCH_ITEM*) g_BlockSaveDataList.m_ItemsSelection.GetPickedItem( ii ) );
ii ) );
picker.m_PickedItem = Struct; picker.m_PickedItem = Struct;
picklist.PushItem( picker ); picklist.PushItem( picker );
@ -621,10 +577,7 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
MoveItemsInList( picklist, GetScreen()->m_BlockLocate.m_MoveVector ); MoveItemsInList( picklist, GetScreen()->m_BlockLocate.m_MoveVector );
/* clear .m_Flags member for all items */ /* clear .m_Flags member for all items */
for( Struct = GetScreen()->EEDrawList; GetScreen()->ClearDrawingState();
Struct != NULL;
Struct = Struct->Next() )
Struct->m_Flags = 0;
OnModify(); OnModify();
@ -646,11 +599,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
if( pickedlist->GetCount() == 0 ) if( pickedlist->GetCount() == 0 )
return; return;
/* .m_Flags member is used to handle how a wire is exactly selected screen->ClearDrawingState();
* (fully selected, or partially selected by an end point )
*/
for( Struct = screen->EEDrawList; Struct != NULL; Struct = Struct->Next() )
Struct->m_Flags = 0;
for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ ) for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ )
{ {
@ -724,7 +673,8 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
SCH_SHEET* sheet = (SCH_SHEET*) Struct; SCH_SHEET* sheet = (SCH_SHEET*) Struct;
// Add all pins sheets of a selected hierarchical sheet to the list // Add all pins sheets of a selected hierarchical sheet to the list
BOOST_FOREACH( SCH_SHEET_PIN label, sheet->GetSheetPins() ) { BOOST_FOREACH( SCH_SHEET_PIN label, sheet->GetSheetPins() )
{
AddPickedItem( screen, label.m_Pos ); AddPickedItem( screen, label.m_Pos );
} }
} }

View File

@ -898,6 +898,70 @@ void SCH_SHEET::renumberLabels()
} }
void SCH_SHEET::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
{
// Using BOOST_FOREACH here creates problems (bad pointer value to pinsheet).
// I do not know why.
for( unsigned ii = 0; ii < GetSheetPins().size(); ii++ )
{
SCH_SHEET_PIN &pinsheet = GetSheetPins()[ii];
wxCHECK2_MSG( pinsheet.Type() == DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE, continue,
wxT( "Invalid item in schematic sheet pin list. Bad programmer!" ) );
pinsheet.GetEndPoints( aItemList );
}
}
bool SCH_SHEET::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList )
{
bool currentState = IsDangling();
BOOST_FOREACH( SCH_SHEET_PIN& pinsheet, GetSheetPins() )
{
pinsheet.IsDanglingStateChanged( aItemList );
}
return currentState != IsDangling();
}
bool SCH_SHEET::IsDangling() const
{
// If any hierarchical label in the sheet is dangling, then the sheet is dangling.
for( size_t i = 0; i < GetSheetPins().size(); i++ )
{
if( GetSheetPins()[i].IsDangling() )
return true;
}
return false;
}
bool SCH_SHEET::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
EDA_Rect boundingBox = GetBoundingBox();
if( aRect.Intersects( boundingBox ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}
void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
for( size_t i = 0; i < GetSheetPins().size(); i++ )
aPoints.push_back( GetSheetPins()[i].m_Pos );
}
#if defined(DEBUG) #if defined(DEBUG)
void SCH_SHEET::Show( int nestLevel, std::ostream& os ) void SCH_SHEET::Show( int nestLevel, std::ostream& os )

View File

@ -23,7 +23,6 @@ extern SCH_SHEET* g_RootSheet;
* the sheet, it corresponds to a hierarchical label. * the sheet, it corresponds to a hierarchical label.
*/ */
//class SCH_SHEET_PIN : public SCH_ITEM, public EDA_TextStruct
class SCH_SHEET_PIN : public SCH_HIERLABEL class SCH_SHEET_PIN : public SCH_HIERLABEL
{ {
private: private:
@ -31,15 +30,15 @@ private:
///< Sheet label numbering begins at 2. ///< Sheet label numbering begins at 2.
///< 0 is reserved for the sheet name. ///< 0 is reserved for the sheet name.
///< 1 is reserve for the sheet file name. ///< 1 is reserve for the sheet file name.
int m_Edge; /* For pin labels only: sheet edge (0 to 3) of the pin int m_Edge; /* For pin labels only: sheet edge (0 to 3) of the pin
* m_Edge define on which edge the pin is positionned: * m_Edge define on which edge the pin is positionned:
* 0: pin on left side * 0: pin on left side
* 1: pin on right side * 1: pin on right side
* 2: pin on top side * 2: pin on top side
* 3: pin on bottom side * 3: pin on bottom side
* for compatibility reasons, this does not follow same values as text * for compatibility reasons, this does not follow same values as text
* orientation. * orientation.
*/ */
public: public:
SCH_SHEET_PIN( SCH_SHEET* parent, SCH_SHEET_PIN( SCH_SHEET* parent,
@ -168,8 +167,9 @@ public:
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this item matches the search criteria. * @return True if this item matches the search criteria.
*/ */
virtual bool Matches( wxFindReplaceData& aSearchData, virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void* aAuxData, wxPoint * aFindLocation );
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
}; };
@ -251,6 +251,11 @@ public:
SCH_SHEET_PIN_LIST& GetSheetPins() { return m_labels; } SCH_SHEET_PIN_LIST& GetSheetPins() { return m_labels; }
SCH_SHEET_PIN_LIST& GetSheetPins() const
{
return const_cast< SCH_SHEET_PIN_LIST& >( m_labels );
}
/** /**
* Remove a sheet label from this sheet. * Remove a sheet label from this sheet.
* *
@ -412,7 +417,9 @@ public:
virtual void Move( const wxPoint& aMoveVector ) virtual void Move( const wxPoint& aMoveVector )
{ {
m_Pos += aMoveVector; m_Pos += aMoveVector;
BOOST_FOREACH( SCH_SHEET_PIN & label, m_labels ) {
BOOST_FOREACH( SCH_SHEET_PIN & label, m_labels )
{
label.Move( aMoveVector ); label.Move( aMoveVector );
} }
} }
@ -437,8 +444,7 @@ public:
* *
* @return True if this item matches the search criteria. * @return True if this item matches the search criteria.
*/ */
virtual bool Matches( wxFindReplaceData& aSearchData, virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void* aAuxData, wxPoint * aFindLocation );
/** /**
* Resize this sheet to aSize and adjust all of the labels accordingly. * Resize this sheet to aSize and adjust all of the labels accordingly.
@ -457,6 +463,16 @@ public:
*/ */
wxPoint GetFileNamePosition (); wxPoint GetFileNamePosition ();
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
virtual bool IsDangling() const;
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
#if defined(DEBUG) #if defined(DEBUG)
// comment inherited by Doxygen from Base_Struct // comment inherited by Doxygen from Base_Struct

View File

@ -340,6 +340,46 @@ void SCH_SHEET_PIN::Rotate( wxPoint rotationPoint )
} }
/** Virtual Function SCH_SHEET_PIN::CreateGraphicShape
* calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = a buffer to fill with polygon corners coordinates
* @param aPos = Position of the shape
*/
void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
const wxPoint& aPos )
{
/* This is the same icon shapes as SCH_HIERLABEL
* but the graphic icon is slightly different in 2 cases:
* for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL
* for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
*/
int tmp = m_Shape;
switch( m_Shape )
{
case NET_INPUT:
m_Shape = NET_OUTPUT;
break;
case NET_OUTPUT:
m_Shape = NET_INPUT;
break;
default:
break;
}
SCH_HIERLABEL::CreateGraphicShape( aCorner_list, aPos );
m_Shape = tmp;
}
void SCH_SHEET_PIN::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
{
DANGLING_END_ITEM item( SHEET_LABEL_END, this );
item.m_Pos = m_Pos;
aItemList.push_back( item );
}
#if defined(DEBUG) #if defined(DEBUG)
void SCH_SHEET_PIN::Show( int nestLevel, std::ostream& os ) void SCH_SHEET_PIN::Show( int nestLevel, std::ostream& os )
{ {

View File

@ -485,9 +485,8 @@ the current schematic." ),
{ {
versionMajor = (int) major; versionMajor = (int) major;
versionMinor = (int) minor; versionMinor = (int) minor;
// wxLogDebug( wxT( "Component library <%s> is version %d.%d." ),
wxLogDebug( wxT( "Component library <%s> is version %d.%d." ), // GetChars( GetName() ), versionMajor, versionMinor );
GetChars( GetName() ), versionMajor, versionMinor );
} }
} }

View File

@ -180,3 +180,16 @@ void SCH_MARKER::Mirror_Y( int aYaxis_position )
m_Pos.x = -m_Pos.x; m_Pos.x = -m_Pos.x;
m_Pos.x += aYaxis_position; m_Pos.x += aYaxis_position;
} }
bool SCH_MARKER::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
if( aRect.Contains( m_Pos ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}

View File

@ -116,6 +116,8 @@ public:
*/ */
void DisplayInfo( WinEDA_DrawFrame* aFrame ); void DisplayInfo( WinEDA_DrawFrame* aFrame );
virtual bool IsSelectStateChanged( const wxRect& aRect );
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );

View File

@ -973,9 +973,9 @@ bool SCH_COMPONENT::Save( FILE* f ) const
if( GetField( REFERENCE )->m_Text.IsEmpty() ) if( GetField( REFERENCE )->m_Text.IsEmpty() )
strncpy( Name1, CONV_TO_UTF8( m_PrefixString ), sizeof( Name1 ) ); strncpy( Name1, CONV_TO_UTF8( m_PrefixString ), sizeof( Name1 ) );
else else
strncpy( Name1, CONV_TO_UTF8( GetField( REFERENCE )->m_Text ), strncpy( Name1, CONV_TO_UTF8( GetField( REFERENCE )->m_Text ), sizeof( Name1 ) );
sizeof( Name1 ) );
} }
for( ii = 0; ii < (int) strlen( Name1 ); ii++ ) for( ii = 0; ii < (int) strlen( Name1 ); ii++ )
{ {
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
@ -1284,3 +1284,77 @@ bool SCH_COMPONENT::Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxP
return false; return false;
} }
void SCH_COMPONENT::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
{
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
if( Entry == NULL )
return;
for( LIB_PIN* Pin = Entry->GetNextPin(); Pin != NULL; Pin = Entry->GetNextPin( Pin ) )
{
wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE );
if( Pin->GetUnit() && m_Multi && ( m_Multi != Pin->GetUnit() ) )
continue;
if( Pin->GetConvert() && m_Convert && ( m_Convert != Pin->GetConvert() ) )
continue;
DANGLING_END_ITEM item( PIN_END, Pin );
item.m_Pos = GetPinPhysicalPosition( Pin );
aItemList.push_back( item );
}
}
wxPoint SCH_COMPONENT::GetPinPhysicalPosition( LIB_PIN* Pin )
{
wxCHECK_MSG( Pin != NULL && Pin->Type() == COMPONENT_PIN_DRAW_TYPE, wxPoint( 0, 0 ),
wxT( "Cannot get physical position of pin." ) );
return m_Transform.TransformCoordinate( Pin->m_Pos ) + m_Pos;
}
bool SCH_COMPONENT::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
EDA_Rect boundingBox = GetBoundingBox();
if( aRect.Intersects( boundingBox ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}
void SCH_COMPONENT::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
LIB_PIN* pin;
LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
wxCHECK_RET( component != NULL,
wxT( "Cannot add connection points to list. Cannot find component <" ) +
m_ChipName + wxT( "> in any of the loaded libraries." ) );
for( pin = component->GetNextPin( pin ); pin != NULL; pin = component->GetNextPin( pin ) )
{
wxCHECK_RET( pin->Type() == COMPONENT_PIN_DRAW_TYPE,
wxT( "GetNextPin() did not return a pin object. Bad programmer!" ) );
// Skip items not used for this part.
if( m_Multi && pin->GetUnit() && ( pin->GetUnit() != m_Multi ) )
continue;
if( m_Convert && pin->GetConvert() && ( pin->GetConvert() != m_Convert ) )
continue;
// Calculate the pin position relative to the component position and orientation.
aPoints.push_back( m_Transform.TransformCoordinate( pin->m_Pos ) + m_Pos );
}
}

View File

@ -1,6 +1,6 @@
/*****************************************************/ /******************************************************/
/* Definitions for the Component classes for EESchema */ /* Definitions for the Component classes for EESchema */
/*****************************************************/ /******************************************************/
#ifndef COMPONENT_CLASS_H #ifndef COMPONENT_CLASS_H
#define COMPONENT_CLASS_H #define COMPONENT_CLASS_H
@ -85,8 +85,7 @@ private:
void Init( const wxPoint& pos = wxPoint( 0, 0 ) ); void Init( const wxPoint& pos = wxPoint( 0, 0 ) );
public: public:
SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ), SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ), SCH_ITEM* aParent = NULL );
SCH_ITEM* aParent = NULL );
/** /**
* Create schematic component from library component object. * Create schematic component from library component object.
@ -122,6 +121,7 @@ public:
return wxT( "SCH_COMPONENT" ); return wxT( "SCH_COMPONENT" );
} }
TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_Transform ); }
/** /**
* Function Save * Function Save
@ -312,8 +312,7 @@ public:
int GetUnitSelection( SCH_SHEET_PATH* aSheet ); int GetUnitSelection( SCH_SHEET_PATH* aSheet );
// Set the unit selection, for the given sheet path. // Set the unit selection, for the given sheet path.
void SetUnitSelection( SCH_SHEET_PATH* aSheet, void SetUnitSelection( SCH_SHEET_PATH* aSheet, int aUnitSelection );
int aUnitSelection );
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
@ -355,8 +354,15 @@ public:
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this component reference or value field matches the search criteria. * @return True if this component reference or value field matches the search criteria.
*/ */
virtual bool Matches( wxFindReplaceData& aSearchData, virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void* aAuxData, wxPoint * aFindLocation );
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
wxPoint GetPinPhysicalPosition( LIB_PIN* Pin );
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -353,6 +353,13 @@ void SCH_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount
} }
void SCH_SCREEN::ClearDrawingState()
{
for( SCH_ITEM* item = EEDrawList; item != NULL; item = item->Next() )
item->m_Flags = 0;
}
/******************************************************************/ /******************************************************************/
/* Class SCH_SCREENS to handle the list of screens in a hierarchy */ /* Class SCH_SCREENS to handle the list of screens in a hierarchy */
/******************************************************************/ /******************************************************************/

View File

@ -167,12 +167,45 @@ void SCH_BUS_ENTRY::Rotate( wxPoint rotationPoint )
} }
void SCH_BUS_ENTRY::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
{
DANGLING_END_ITEM item( ENTRY_END, this );
item.m_Pos = m_Pos;
DANGLING_END_ITEM item1( ENTRY_END, this );
item1.m_Pos = m_End();
aItemList.push_back( item );
aItemList.push_back( item1 );
}
bool SCH_BUS_ENTRY::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
// If either end of the bus entry is inside the selection rectangle, the entire
// bus entry is selected. Bus entries have a fixed length and angle.
if( aRect.Contains( m_Pos ) || aRect.Contains( m_End() ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}
void SCH_BUS_ENTRY::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
aPoints.push_back( m_Pos );
aPoints.push_back( m_End() );
}
/**********************/ /**********************/
/* class SCH_JUNCTION */ /* class SCH_JUNCTION */
/**********************/ /**********************/
SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) : SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) : SCH_ITEM( NULL, DRAW_JUNCTION_STRUCT_TYPE )
SCH_ITEM( NULL, DRAW_JUNCTION_STRUCT_TYPE )
{ {
#define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between wires */ #define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between wires */
m_Pos = pos; m_Pos = pos;
@ -289,6 +322,33 @@ void SCH_JUNCTION::Rotate( wxPoint rotationPoint )
} }
void SCH_JUNCTION::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
{
DANGLING_END_ITEM item( JUNCTION_END, this );
item.m_Pos = m_Pos;
aItemList.push_back( item );
}
bool SCH_JUNCTION::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
if( aRect.Contains( m_Pos ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}
void SCH_JUNCTION::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
aPoints.push_back( m_Pos );
}
#if defined(DEBUG) #if defined(DEBUG)
void SCH_JUNCTION::Show( int nestLevel, std::ostream& os ) void SCH_JUNCTION::Show( int nestLevel, std::ostream& os )
{ {
@ -306,8 +366,7 @@ void SCH_JUNCTION::Show( int nestLevel, std::ostream& os )
/* class SCH_NO_CONNECT */ /* class SCH_NO_CONNECT */
/************************/ /************************/
SCH_NO_CONNECT::SCH_NO_CONNECT( const wxPoint& pos ) : SCH_NO_CONNECT::SCH_NO_CONNECT( const wxPoint& pos ) : SCH_ITEM( NULL, DRAW_NOCONNECT_STRUCT_TYPE )
SCH_ITEM( NULL, DRAW_NOCONNECT_STRUCT_TYPE )
{ {
#define DRAWNOCONNECT_SIZE 48 /* No symbol connection range. */ #define DRAWNOCONNECT_SIZE 48 /* No symbol connection range. */
m_Pos = pos; m_Pos = pos;
@ -430,6 +489,25 @@ void SCH_NO_CONNECT::Rotate( wxPoint rotationPoint )
} }
bool SCH_NO_CONNECT::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
if( aRect.Contains( m_Pos ) )
m_Flags |= SELECTED;
else
m_Flags &= ~SELECTED;
return previousState != IsSelected();
}
void SCH_NO_CONNECT::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
aPoints.push_back( m_Pos );
}
/******************/ /******************/
/* Class SCH_LINE */ /* Class SCH_LINE */
/******************/ /******************/
@ -634,9 +712,7 @@ bool SCH_LINE::MergeOverlap( SCH_LINE* aLine )
wxCHECK_MSG( aLine != NULL && aLine->Type() == DRAW_SEGMENT_STRUCT_TYPE, false, wxCHECK_MSG( aLine != NULL && aLine->Type() == DRAW_SEGMENT_STRUCT_TYPE, false,
wxT( "Cannot test line segment for overlap." ) ); wxT( "Cannot test line segment for overlap." ) );
if( this == aLine ) if( this == aLine || GetLayer() != aLine->GetLayer() )
return false;
if( GetLayer() != aLine->GetLayer() )
return false; return false;
// Search for a common end, and modify coordinates to ensure RefSegm->m_End // Search for a common end, and modify coordinates to ensure RefSegm->m_End
@ -646,7 +722,7 @@ bool SCH_LINE::MergeOverlap( SCH_LINE* aLine )
if( m_End == aLine->m_End ) if( m_End == aLine->m_End )
return true; return true;
EXCHG( m_Start, aLine->m_End ); EXCHG( m_Start, m_End );
} }
else if( m_Start == aLine->m_End ) else if( m_Start == aLine->m_End )
{ {
@ -658,8 +734,10 @@ bool SCH_LINE::MergeOverlap( SCH_LINE* aLine )
EXCHG( aLine->m_Start, aLine->m_End ); EXCHG( aLine->m_Start, aLine->m_End );
} }
else if( m_End != aLine->m_Start ) else if( m_End != aLine->m_Start )
{
// No common end point, segments cannot be merged. // No common end point, segments cannot be merged.
return false; return false;
}
/* Test alignment: */ /* Test alignment: */
if( m_Start.y == m_End.y ) // Horizontal segment if( m_Start.y == m_End.y ) // Horizontal segment
@ -693,12 +771,86 @@ bool SCH_LINE::MergeOverlap( SCH_LINE* aLine )
} }
/***********************/ void SCH_LINE::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
/* Class SCH_POLYLINE */ {
/***********************/ if( GetLayer() == LAYER_NOTES )
return;
SCH_POLYLINE::SCH_POLYLINE( int layer ) : if( ( GetLayer() == LAYER_BUS ) || ( GetLayer() == LAYER_WIRE ) )
SCH_ITEM( NULL, DRAW_POLYLINE_STRUCT_TYPE ) {
DANGLING_END_ITEM item( (GetLayer() == LAYER_BUS) ? BUS_START_END : WIRE_START_END, this );
item.m_Pos = m_Start;
DANGLING_END_ITEM item1( (GetLayer() == LAYER_BUS) ? BUS_END_END : WIRE_END_END, this );
item1.m_Pos = m_End;
aItemList.push_back( item );
aItemList.push_back( item1 );
}
}
bool SCH_LINE::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList )
{
bool previousStartState = m_StartIsDangling;
bool previousEndState = m_EndIsDangling;
if( GetLayer() == LAYER_WIRE )
{
BOOST_FOREACH( DANGLING_END_ITEM item, aItemList )
{
if( item.m_Item == this )
continue;
if( m_Start == item.m_Pos )
m_StartIsDangling = false;
if( m_End == item.m_Pos )
m_EndIsDangling = false;
if( (m_StartIsDangling == false) && (m_EndIsDangling == false) )
break;
}
}
else if( GetLayer() == LAYER_BUS || GetLayer() == LAYER_NOTES )
{
// Lines on the notes layer and the bus layer cannot be tested for dangling ends.
previousStartState = previousEndState = m_StartIsDangling = m_EndIsDangling = false;
}
return ( previousStartState != m_StartIsDangling ) || ( previousEndState != m_EndIsDangling );
}
bool SCH_LINE::IsSelectStateChanged( const wxRect& aRect )
{
bool previousState = IsSelected();
if( aRect.Contains( m_Start ) )
m_Flags |= STARTPOINT | SELECTED;
else
m_Flags &= ~( STARTPOINT | SELECTED );
if( aRect.Contains( m_End ) )
m_Flags |= ENDPOINT | SELECTED;
else
m_Flags &= ~( ENDPOINT | SELECTED );
return previousState != IsSelected();
}
void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const
{
aPoints.push_back( m_Start );
aPoints.push_back( m_End );
}
/**********************/
/* Class SCH_POLYLINE */
/**********************/
SCH_POLYLINE::SCH_POLYLINE( int layer ) : SCH_ITEM( NULL, DRAW_POLYLINE_STRUCT_TYPE )
{ {
m_Width = 0; m_Width = 0;

View File

@ -108,6 +108,16 @@ public:
*/ */
bool MergeOverlap( SCH_LINE* aLine ); bool MergeOverlap( SCH_LINE* aLine );
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
virtual bool IsDangling() const { return m_StartIsDangling || m_EndIsDangling; }
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
@ -185,6 +195,10 @@ public:
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Mirror_X( int aXaxis_position ); virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
}; };
@ -259,6 +273,12 @@ public:
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Mirror_X( int aXaxis_position ); virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
}; };
class SCH_POLYLINE : public SCH_ITEM class SCH_POLYLINE : public SCH_ITEM
@ -405,6 +425,12 @@ public:
virtual void Mirror_X( int aXaxis_position ); virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
virtual void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList );
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );

File diff suppressed because it is too large Load Diff

View File

@ -167,8 +167,17 @@ public:
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this schematic text item matches the search criteria. * @return True if this schematic text item matches the search criteria.
*/ */
virtual bool Matches( wxFindReplaceData& aSearchData, virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void* aAuxData, wxPoint * aFindLocation );
virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList );
virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
virtual bool IsDangling() const { return m_IsDangling; }
virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );

View File

@ -4,55 +4,14 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h"
#include "program.h" #include "program.h"
#include "general.h" #include "general.h"
#include "netlist.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_libentry.h"
#include "lib_pin.h" #include "lib_pin.h"
enum End_Type {
UNKNOWN = 0,
WIRE_START_END,
WIRE_END_END,
BUS_START_END,
BUS_END_END,
JUNCTION_END,
PIN_END,
LABEL_END,
ENTRY_END,
SHEET_LABEL_END
};
// A helper class to store a list of items that can be connected to something:
class DANGLING_END_ITEM
{
public:
const void* m_Item; // a pointer to the parent
wxPoint m_Pos; // the position of the connecting point
int m_Type; // type of parent
DANGLING_END_ITEM( int type, const void* aItem )
{
m_Item = aItem;
m_Type = type;
}
};
static void TestWireForDangling( std::vector <DANGLING_END_ITEM>& aItemList,
SCH_LINE* DrawRef,
WinEDA_SchematicFrame* frame,
wxDC* aDC );
void TestLabelForDangling( std::vector <DANGLING_END_ITEM>& aItemList,
SCH_TEXT* aLabel,
WinEDA_SchematicFrame* aFrame,
wxDC* aDC );
void RebuildEndPointsList( std::vector <DANGLING_END_ITEM>& aItemList, SCH_ITEM* aDrawList );
/* Returns true if the point P is on the segment S. */ /* Returns true if the point P is on the segment S. */
bool SegmentIntersect( wxPoint aSegStart, wxPoint aSegEnd, wxPoint aTestPoint ) bool SegmentIntersect( wxPoint aSegStart, wxPoint aSegEnd, wxPoint aTestPoint )
{ {
@ -64,60 +23,27 @@ bool SegmentIntersect( wxPoint aSegStart, wxPoint aSegEnd, wxPoint aTestPoint )
return false; /* Cross product non-zero, vectors not parallel */ return false; /* Cross product non-zero, vectors not parallel */
if( ( (long long) vectSeg.x * vectPoint.x + (long long) vectSeg.y * vectPoint.y ) < if( ( (long long) vectSeg.x * vectPoint.x + (long long) vectSeg.y * vectPoint.y ) <
( (long long) vectPoint.x * vectPoint.x + (long long) vectPoint.y * vectPoint.y ) ) ( (long long) vectPoint.x * vectPoint.x + (long long) vectPoint.y * vectPoint.y ) )
return false; /* Point not on segment */ return false; /* Point not on segment */
return true; return true;
} }
void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC ) void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC )
{ {
// this list is static to avoid many useles memory allocation. SCH_ITEM* item;
std::vector <DANGLING_END_ITEM> itemList; std::vector< DANGLING_END_ITEM > endPoints;
RebuildEndPointsList( itemList, DrawList ); for( item = aDrawList; item != NULL; item = item->Next() )
item->GetEndPoints( endPoints );
for( SCH_ITEM* item = DrawList; item; item = item->Next() ) for( item = aDrawList; item; item = item->Next() )
{ {
switch( item->Type() ) if( item->IsDanglingStateChanged( endPoints ) && aDC != NULL )
{ {
case TYPE_SCH_GLOBALLABEL: RedrawOneStruct( DrawPanel, aDC, item, g_XorMode );
case TYPE_SCH_HIERLABEL: RedrawOneStruct( DrawPanel, aDC, item, GR_DEFAULT_DRAWMODE );
case TYPE_SCH_LABEL:
TestLabelForDangling( itemList, (SCH_LABEL*) item, this, DC );
break;
case DRAW_SHEET_STRUCT_TYPE:
{
SCH_SHEET* sheet = (SCH_SHEET*) item;
// Read the hierarchical pins list and teast for dangling pins:
BOOST_FOREACH( SCH_SHEET_PIN & pinsheet, sheet->GetSheetPins() )
{
TestLabelForDangling( itemList, &pinsheet, this, DC );
}
}
break;
case DRAW_SEGMENT_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (SCH_LINE*) item )
if( STRUCT->GetLayer() == LAYER_WIRE )
{
TestWireForDangling( itemList, STRUCT, this, DC );
break;
}
if( STRUCT->GetLayer() == LAYER_NOTES )
break;
if( STRUCT->GetLayer() == LAYER_BUS )
{
STRUCT->m_StartIsDangling = STRUCT->m_EndIsDangling = false;
break;
}
break;
default:
break;
} }
} }
} }
@ -129,8 +55,7 @@ void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC )
* @param DrawList = List of SCH_ITEMs to check. * @param DrawList = List of SCH_ITEMs to check.
* @return a LIB_PIN pointer to the located pin or NULL if no pin was found. * @return a LIB_PIN pointer to the located pin or NULL if no pin was found.
*/ */
LIB_PIN* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList, LIB_PIN* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos )
const wxPoint& pos )
{ {
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LIB_PIN* Pin; LIB_PIN* Pin;
@ -153,234 +78,3 @@ LIB_PIN* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList,
return Pin; return Pin;
return NULL; return NULL;
} }
void TestWireForDangling( std::vector <DANGLING_END_ITEM>& aItemList,
SCH_LINE* DrawRef,
WinEDA_SchematicFrame* frame,
wxDC* DC )
{
bool Sdangstate = true, Edangstate = true;
BOOST_FOREACH( DANGLING_END_ITEM terminal_item, aItemList )
{
if( terminal_item.m_Item == DrawRef )
continue;
if( DrawRef->m_Start == terminal_item.m_Pos )
Sdangstate = false;
if( DrawRef->m_End == terminal_item.m_Pos )
Edangstate = false;
if( (Sdangstate == false) && (Edangstate == false) )
break;
}
if( (Sdangstate != DrawRef->m_StartIsDangling)
|| (Edangstate != DrawRef->m_EndIsDangling) )
{
if( DC )
RedrawOneStruct( frame->DrawPanel, DC, DrawRef, g_XorMode );
DrawRef->m_StartIsDangling = Sdangstate;
DrawRef->m_EndIsDangling = Edangstate;
if( DC )
RedrawOneStruct( frame->DrawPanel, DC, DrawRef,
GR_DEFAULT_DRAWMODE );
}
}
void TestLabelForDangling( std::vector <DANGLING_END_ITEM>& aItemList,
SCH_TEXT* aLabel,
WinEDA_SchematicFrame* aFrame,
wxDC* aDC )
{
bool dangstate = true;
for( unsigned ii = 0; ii < aItemList.size(); ii++ )
{
DANGLING_END_ITEM & terminal_item = aItemList[ii];
if( terminal_item.m_Item == aLabel )
continue;
switch( terminal_item.m_Type )
{
case PIN_END:
case LABEL_END:
case SHEET_LABEL_END:
if( aLabel->m_Pos == terminal_item.m_Pos )
dangstate = false;
break;
case WIRE_START_END:
case BUS_START_END:
{
// these schematic items have created 2 DANGLING_END_ITEM
// one per end.
ii++;
DANGLING_END_ITEM & next_terminal = aItemList[ii];
dangstate = !SegmentIntersect( terminal_item.m_Pos,
next_terminal.m_Pos,
aLabel->m_Pos );
}
break;
case UNKNOWN:
case JUNCTION_END:
case ENTRY_END:
case WIRE_END_END:
case BUS_END_END:
break;
}
if( dangstate == false )
break;
}
if( dangstate != aLabel->m_IsDangling )
{
if( aDC )
RedrawOneStruct( aFrame->DrawPanel, aDC, aLabel, g_XorMode );
aLabel->m_IsDangling = dangstate;
if( aDC )
RedrawOneStruct( aFrame->DrawPanel, aDC, aLabel, GR_DEFAULT_DRAWMODE );
}
}
/* Returns the physical position of the pin relative to the component
* orientation. */
wxPoint ReturnPinPhysicalPosition( LIB_PIN* Pin, SCH_COMPONENT* DrawLibItem )
{
wxPoint PinPos = Pin->m_Pos;
if( DrawLibItem == NULL )
NEGATE( PinPos.y );
else
PinPos = DrawLibItem->m_Transform.TransformCoordinate( Pin->m_Pos ) + DrawLibItem->m_Pos;
return PinPos;
}
void RebuildEndPointsList( std::vector <DANGLING_END_ITEM>& aItemList, SCH_ITEM* aDrawList )
{
SCH_ITEM* schItem;
aItemList.clear();
for( schItem = aDrawList; schItem != NULL; schItem = schItem->Next() )
{
switch( schItem->Type() )
{
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
{
#undef STRUCT
#define STRUCT ( (SCH_LABEL*) schItem )
DANGLING_END_ITEM item( LABEL_END, schItem );
item.m_Pos = STRUCT->m_Pos;
aItemList.push_back( item );
}
break;
case DRAW_SEGMENT_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (SCH_LINE*) schItem )
if( STRUCT->GetLayer() == LAYER_NOTES )
break;
if( ( STRUCT->GetLayer() == LAYER_BUS )
|| (STRUCT->GetLayer() == LAYER_WIRE ) )
{
DANGLING_END_ITEM item( (STRUCT->GetLayer() == LAYER_BUS) ?
BUS_START_END : WIRE_START_END, schItem );
item.m_Pos = STRUCT->m_Start;
DANGLING_END_ITEM item1( (STRUCT->GetLayer() == LAYER_BUS) ?
BUS_END_END : WIRE_END_END, schItem );
item1.m_Pos = STRUCT->m_End;
aItemList.push_back( item );
aItemList.push_back( item1 );
}
break;
case DRAW_JUNCTION_STRUCT_TYPE:
{
#undef STRUCT
#define STRUCT ( (SCH_JUNCTION*) schItem )
DANGLING_END_ITEM item( JUNCTION_END, schItem );
item.m_Pos = STRUCT->m_Pos;
aItemList.push_back( item );
}
break;
case DRAW_BUSENTRY_STRUCT_TYPE:
{
#undef STRUCT
#define STRUCT ( (SCH_BUS_ENTRY*) schItem )
DANGLING_END_ITEM item( ENTRY_END, schItem );
item.m_Pos = STRUCT->m_Pos;
DANGLING_END_ITEM item1( ENTRY_END, schItem );
item1.m_Pos = STRUCT->m_End();
aItemList.push_back( item );
aItemList.push_back( item1 );
}
break;
case TYPE_SCH_COMPONENT:
{
#undef STRUCT
#define STRUCT ( (SCH_COMPONENT*) schItem )
LIB_COMPONENT* Entry;
Entry = CMP_LIBRARY::FindLibraryComponent( STRUCT->m_ChipName );
if( Entry == NULL )
break;
for( LIB_PIN* Pin = Entry->GetNextPin(); Pin != NULL;
Pin = Entry->GetNextPin( Pin ) )
{
wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE );
if( Pin->GetUnit() && STRUCT->m_Multi && ( STRUCT->m_Multi != Pin->GetUnit() ) )
continue;
if( Pin->GetConvert() && STRUCT->m_Convert
&& ( STRUCT->m_Convert != Pin->GetConvert() ) )
continue;
DANGLING_END_ITEM item( PIN_END, Pin );
item.m_Pos = ReturnPinPhysicalPosition( Pin, STRUCT );
aItemList.push_back( item );
}
break;
}
case DRAW_SHEET_STRUCT_TYPE:
{
SCH_SHEET* sheet = (SCH_SHEET*) schItem;
// Using BOOST_FOREACH here creates problems (bad pointer value to pinsheet).
// I do not know why.
for( unsigned ii = 0; ii < sheet->GetSheetPins().size(); ii++ )
{
SCH_SHEET_PIN &pinsheet = sheet->GetSheetPins()[ii];
wxASSERT( pinsheet.Type() == DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE );
DANGLING_END_ITEM item( SHEET_LABEL_END, &pinsheet );
item.m_Pos = pinsheet.m_Pos;
aItemList.push_back( item );
}
}
break;
default:
;
}
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -25,28 +25,24 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_OptionsBoxSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelBasic, wxID_ANY, _("General :") ), wxVERTICAL ); m_OptionsBoxSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelBasic, wxID_ANY, _("General :") ), wxVERTICAL );
m_AsConvertButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("As Convert"), wxDefaultPosition, wxDefaultSize, 0 ); m_AsConvertButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("As Convert"), wxDefaultPosition, wxDefaultSize, 0 );
m_AsConvertButt->SetToolTip( _("Check this option for components that have a De Morgan representation.\nThis is usual for gates.") ); m_AsConvertButt->SetToolTip( _("Check this option for components that have a De Morgan representation.\nThis is usual for gates.") );
m_OptionsBoxSizer->Add( m_AsConvertButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptionsBoxSizer->Add( m_AsConvertButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ShowPinNumButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Num"), wxDefaultPosition, wxDefaultSize, 0 ); m_ShowPinNumButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Num"), wxDefaultPosition, wxDefaultSize, 0 );
m_ShowPinNumButt->SetValue(true); m_ShowPinNumButt->SetValue(true);
m_ShowPinNumButt->SetToolTip( _("Show or hide pin numbers") ); m_ShowPinNumButt->SetToolTip( _("Show or hide pin numbers") );
m_OptionsBoxSizer->Add( m_ShowPinNumButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptionsBoxSizer->Add( m_ShowPinNumButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ShowPinNameButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_ShowPinNameButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Name"), wxDefaultPosition, wxDefaultSize, 0 );
m_ShowPinNameButt->SetValue(true); m_ShowPinNameButt->SetValue(true);
m_ShowPinNameButt->SetToolTip( _("Show or hide pin names") ); m_ShowPinNameButt->SetToolTip( _("Show or hide pin names") );
m_OptionsBoxSizer->Add( m_ShowPinNameButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptionsBoxSizer->Add( m_ShowPinNameButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PinsNameInsideButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Pin Name Inside"), wxDefaultPosition, wxDefaultSize, 0 ); m_PinsNameInsideButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Pin Name Inside"), wxDefaultPosition, wxDefaultSize, 0 );
m_PinsNameInsideButt->SetValue(true); m_PinsNameInsideButt->SetValue(true);
m_PinsNameInsideButt->SetToolTip( _("Check this option to have pin names inside the body and pin number outside.\nIf not checked pins names and pins numbers are outside.") ); m_PinsNameInsideButt->SetToolTip( _("Check this option to have pin names inside the body and pin number outside.\nIf not checked pins names and pins numbers are outside.") );
m_OptionsBoxSizer->Add( m_PinsNameInsideButt, 0, wxALL, 5 ); m_OptionsBoxSizer->Add( m_PinsNameInsideButt, 0, wxALL, 5 );
@ -93,13 +89,11 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
bSizerBasicPanel->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); bSizerBasicPanel->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_OptionPower = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Power Symbol"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptionPower = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Power Symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptionPower->SetToolTip( _("Check this option for power symbols.\nPower symbols have specific properties for Eeschema:\n- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol\n- Reference is updated automatically when a netlist is created (no need to run Annotate)") ); m_OptionPower->SetToolTip( _("Check this option for power symbols.\nPower symbols have specific properties for Eeschema:\n- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol\n- Reference is updated automatically when a netlist is created (no need to run Annotate)") );
bSizerBasicPanel->Add( m_OptionPower, 0, wxALL, 5 ); bSizerBasicPanel->Add( m_OptionPower, 0, wxALL, 5 );
m_OptionPartsLocked = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptionPartsLocked = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptionPartsLocked->SetToolTip( _("Check this option if Eeschema cannot change parts selections inside a given package\nThis happens when parts are different in this package.\nWhen this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count") ); m_OptionPartsLocked->SetToolTip( _("Check this option if Eeschema cannot change parts selections inside a given package\nThis happens when parts are different in this package.\nWhen this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count") );
bSizerBasicPanel->Add( m_OptionPartsLocked, 0, wxALL, 5 ); bSizerBasicPanel->Add( m_OptionPartsLocked, 0, wxALL, 5 );
@ -123,7 +117,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_staticTextKeywords = new wxStaticText( m_PanelDoc, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextKeywords = new wxStaticText( m_PanelDoc, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextKeywords->Wrap( -1 ); m_staticTextKeywords->Wrap( -1 );
m_staticTextKeywords->SetToolTip( _("Enter key words that can be used to select this composant.\nKey words cannot have spaces and are separated by a space.") ); m_staticTextKeywords->SetToolTip( _("Enter key words that can be used to select this component.\nKey words cannot have spaces and are separated by a space.") );
m_PanelDocBoxSizer->Add( m_staticTextKeywords, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_PanelDocBoxSizer->Add( m_staticTextKeywords, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
@ -266,4 +260,5 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
m_ButtonDeleteAllFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this ); m_ButtonDeleteAllFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this );
m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this ); m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this );
m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this ); m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this );
} }

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="9" /> <FileVersion major="1" minor="10" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_python_events">0</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="event_generation">connect</property> <property name="event_generation">connect</property>
<property name="file">dialog_edit_component_in_lib_base</property> <property name="file">dialog_edit_component_in_lib_base</property>
@ -16,13 +18,16 @@
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_python_events">1</property>
<property name="use_enum">0</property> <property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="center"></property> <property name="center"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property> <property name="extra_style"></property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -37,6 +42,10 @@
<property name="subclass"></property> <property name="subclass"></property>
<property name="title">Lib Component Properties</property> <property name="title">Lib Component Properties</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -83,6 +92,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="bitmapsize"></property> <property name="bitmapsize"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -97,6 +107,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -132,6 +146,7 @@
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -145,6 +160,10 @@
<property name="size"></property> <property name="size"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property> <property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
@ -196,6 +215,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -211,6 +231,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Check this option for components that have a De Morgan representation.&#x0A;This is usual for gates.</property> <property name="tooltip">Check this option for components that have a De Morgan representation.&#x0A;This is usual for gates.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -248,6 +272,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">1</property> <property name="checked">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -263,6 +288,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Show or hide pin numbers</property> <property name="tooltip">Show or hide pin numbers</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -300,6 +329,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">1</property> <property name="checked">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -315,6 +345,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Show or hide pin names</property> <property name="tooltip">Show or hide pin names</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -352,6 +386,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">1</property> <property name="checked">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -367,6 +402,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Check this option to have pin names inside the body and pin number outside.&#x0A;If not checked pins names and pins numbers are outside.</property> <property name="tooltip">Check this option to have pin names inside the body and pin number outside.&#x0A;If not checked pins names and pins numbers are outside.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -405,6 +444,7 @@
<object class="wxStaticLine" expanded="1"> <object class="wxStaticLine" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -419,6 +459,10 @@
<property name="style">wxLI_HORIZONTAL</property> <property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -472,6 +516,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -487,6 +532,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">This is the number of parts in this component package.&#x0A;A 74LS00 gate has 4 parts per packages.</property> <property name="tooltip">This is the number of parts in this component package.&#x0A;A 74LS00 gate has 4 parts per packages.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -523,6 +572,7 @@
<object class="wxSpinCtrl" expanded="1"> <object class="wxSpinCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -540,6 +590,10 @@
<property name="style">wxSP_ARROW_KEYS</property> <property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property> <property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -589,6 +643,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -604,6 +659,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Margin (in 0.001 inches) between a pin name position and the component body.&#x0A;A value from 10 to 40 is usually good.</property> <property name="tooltip">Margin (in 0.001 inches) between a pin name position and the component body.&#x0A;A value from 10 to 40 is usually good.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -640,6 +699,7 @@
<object class="wxSpinCtrl" expanded="1"> <object class="wxSpinCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -657,6 +717,10 @@
<property name="style">wxSP_ARROW_KEYS</property> <property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property> <property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -699,6 +763,7 @@
<object class="wxStaticLine" expanded="1"> <object class="wxStaticLine" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -713,6 +778,10 @@
<property name="style">wxLI_HORIZONTAL</property> <property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -749,6 +818,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -764,6 +834,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Check this option for power symbols.&#x0A;Power symbols have specific properties for Eeschema:&#x0A;- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol&#x0A;- Reference is updated automatically when a netlist is created (no need to run Annotate)</property> <property name="tooltip">Check this option for power symbols.&#x0A;Power symbols have specific properties for Eeschema:&#x0A;- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol&#x0A;- Reference is updated automatically when a netlist is created (no need to run Annotate)</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -801,6 +875,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -816,6 +891,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Check this option if Eeschema cannot change parts selections inside a given package&#x0A;This happens when parts are different in this package.&#x0A;When this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count</property> <property name="tooltip">Check this option if Eeschema cannot change parts selections inside a given package&#x0A;This happens when parts are different in this package.&#x0A;When this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -855,6 +934,7 @@
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -868,6 +948,10 @@
<property name="size"></property> <property name="size"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property> <property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
@ -906,6 +990,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -921,6 +1006,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">A short description that is displayed in Eeschema.&#x0A;Can be a very good help when selecting components in libraries components lists.</property> <property name="tooltip">A short description that is displayed in Eeschema.&#x0A;Can be a very good help when selecting components in libraries components lists.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -957,6 +1046,7 @@
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -972,6 +1062,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property> <property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -1012,6 +1106,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1026,7 +1121,11 @@
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Enter key words that can be used to select this composant.&#x0A;Key words cannot have spaces and are separated by a space.</property> <property name="tooltip">Enter key words that can be used to select this component.&#x0A;Key words cannot have spaces and are separated by a space.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1063,6 +1162,7 @@
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1078,6 +1178,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property> <property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -1118,6 +1222,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1133,6 +1238,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Enter the documentation file (a .pdf document) associated to the component.</property> <property name="tooltip">Enter the documentation file (a .pdf document) associated to the component.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1169,6 +1278,7 @@
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1184,6 +1294,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property> <property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -1233,6 +1347,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1249,6 +1364,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1285,6 +1404,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1301,6 +1421,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1342,6 +1466,7 @@
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1355,6 +1480,10 @@
<property name="size"></property> <property name="size"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property> <property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
@ -1402,6 +1531,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1417,6 +1547,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">An alias is a component that uses the body of its root component.&#x0A;It has its own documentation and keywords.&#x0A;A fast way to extend a library with similar components</property> <property name="tooltip">An alias is a component that uses the body of its root component.&#x0A;It has its own documentation and keywords.&#x0A;A fast way to extend a library with similar components</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1454,6 +1588,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property> <property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1468,6 +1603,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1516,6 +1655,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1532,6 +1672,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1568,6 +1712,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1584,6 +1729,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1620,6 +1769,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1636,6 +1786,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1677,6 +1831,7 @@
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1690,6 +1845,10 @@
<property name="size"></property> <property name="size"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property> <property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
@ -1737,6 +1896,7 @@
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1752,6 +1912,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">A list of footprints names that can be used for this component.&#x0A;Footprints names can used jockers.&#x0A;(like sm* to allow all footprints names starting by sm).</property> <property name="tooltip">A list of footprints names that can be used for this component.&#x0A;Footprints names can used jockers.&#x0A;(like sm* to allow all footprints names starting by sm).</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1789,6 +1953,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property> <property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
@ -1803,6 +1968,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1851,6 +2020,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1867,6 +2037,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1903,6 +2077,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1919,6 +2094,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1955,6 +2134,7 @@
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
@ -1971,6 +2151,10 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -91,19 +91,20 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public wxDialog
wxButton* m_sdbSizer2Cancel; wxButton* m_sdbSizer2Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void CopyDocToAlias( wxCommandEvent& event ){ event.Skip(); } virtual void CopyDocToAlias( wxCommandEvent& event ) { event.Skip(); }
virtual void BrowseAndSelectDocFile( wxCommandEvent& event ){ event.Skip(); } virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void AddAliasOfPart( wxCommandEvent& event ){ event.Skip(); } virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteAliasOfPart( wxCommandEvent& event ){ event.Skip(); } virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteAllAliasOfPart( wxCommandEvent& event ){ event.Skip(); } virtual void DeleteAllAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
virtual void AddFootprintFilter( wxCommandEvent& event ){ event.Skip(); } virtual void AddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteOneFootprintFilter( wxCommandEvent& event ){ event.Skip(); } virtual void DeleteOneFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteAllFootprintFilter( wxCommandEvent& event ){ event.Skip(); } virtual void DeleteAllFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Lib Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 546,384 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Lib Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 546,384 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(); ~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE();

View File

@ -80,7 +80,7 @@ void WinEDA_SchematicFrame::LoadLibraries( void )
{ {
wxString prompt; wxString prompt;
prompt.Printf( _( "Component library <%s> failed to load.\n\nError: %s" ), prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ),
GetChars( fn.GetFullPath() ), GetChars( fn.GetFullPath() ),
GetChars( errMsg ) ); GetChars( errMsg ) );
DisplayError( this, prompt ); DisplayError( this, prompt );
@ -104,8 +104,8 @@ void WinEDA_SchematicFrame::LoadLibraries( void )
CMP_LIBRARY::SetSortOrder( sortOrder ); CMP_LIBRARY::SetSortOrder( sortOrder );
CMP_LIBRARY::GetLibraryList().sort(); CMP_LIBRARY::GetLibraryList().sort();
#ifdef __WXDEBUG__ #if 0 // #ifdef __WXDEBUG__
wxLogDebug( wxT( "LoadLibraries () requested component library sort order:" ) ); wxLogDebug( wxT( "LoadLibraries() requested component library sort order:" ) );
for( size_t i = 0; i < sortOrder.GetCount(); i++ ) for( size_t i = 0; i < sortOrder.GetCount(); i++ )
wxLogDebug( wxT( " " ) + sortOrder[i] ); wxLogDebug( wxT( " " ) + sortOrder[i] );

View File

@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::LoadSettings()
{ {
m_TemplateFieldNames.Parse( &lexer ); m_TemplateFieldNames.Parse( &lexer );
} }
catch( IOError e ) catch( IO_ERROR e )
{ {
// @todo show error msg // @todo show error msg
D(printf("templatefieldnames parsing error: '%s'\n", D(printf("templatefieldnames parsing error: '%s'\n",

View File

@ -269,7 +269,7 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN
{ {
wxString prompt; wxString prompt;
prompt.Printf( _( "Component library <%s> failed to load.\n\n Error: %s" ), prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ),
GetChars( fn.GetFullPath() ), GetChars( fn.GetFullPath() ),
GetChars( errMsg ) ); GetChars( errMsg ) );
DisplayError( this, prompt ); DisplayError( this, prompt );

View File

@ -32,7 +32,7 @@
* s_LibEdit_Hotkey_List list or s_Common_Hotkey_List if the same command is * s_LibEdit_Hotkey_List list or s_Common_Hotkey_List if the same command is
* added both in eeschema and libedit) * added both in eeschema and libedit)
* Add the new code in the switch in OnHotKey() function. * Add the new code in the switch in OnHotKey() function.
* when the variable ItemInEdit is true, an item is currently edited. * when the variable itemInEdit is true, an item is currently edited.
* This can be useful if the new function cannot be executed while an item is * This can be useful if the new function cannot be executed while an item is
* currently being edited * currently being edited
* ( For example, one cannot start a new wire when a component is moving.) * ( For example, one cannot start a new wire when a component is moving.)
@ -100,6 +100,7 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL +
// Schematic editor // Schematic editor
static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' ); static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' );
static Ki_HotkeyInfo HkAddJunction( wxT( "add Junction" ), HK_ADD_JUNCTION, 'J' );
static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' ); static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ),
HK_ADD_NEW_COMPONENT, 'A' ); HK_ADD_NEW_COMPONENT, 'A' );
@ -180,6 +181,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] =
&HkEditComponentFootprint, &HkEditComponentFootprint,
&HkBeginWire, &HkBeginWire,
&HkAddLabel, &HkAddLabel,
&HkAddJunction,
&HkAddNoConn, &HkAddNoConn,
NULL NULL
}; };
@ -244,9 +246,13 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
cmd.SetEventObject( this ); cmd.SetEventObject( this );
bool ItemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags;
bool RefreshToolBar = FALSE;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
// itemInEdit == false means no item currently edited. We can ask for editing a new item
bool itemInEdit = screen->GetCurItem() && screen->GetCurItem()->m_Flags;
// notBusy == true means no item currently edited and no other command in progress
// We can change active tool and ask for editing a new item
bool notBusy = (!itemInEdit) && (screen->m_BlockLocate.m_State == STATE_NO_BLOCK);
bool RefreshToolBar = FALSE;
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
@ -306,7 +312,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_UNDO: case HK_UNDO:
case HK_REDO: case HK_REDO:
if( !ItemInEdit ) if( notBusy )
{ {
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent ); wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event ); wxPostEvent( this, event );
@ -318,7 +324,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_DELETE: case HK_DELETE:
if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( notBusy)
{ {
RefreshToolBar = LocateAndDeleteItem( this, DC ); RefreshToolBar = LocateAndDeleteItem( this, DC );
OnModify(); OnModify();
@ -328,12 +334,12 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_REPEAT_LAST: case HK_REPEAT_LAST:
if( !ItemInEdit && g_ItemToRepeat && ( g_ItemToRepeat->m_Flags == 0 ) ) if( notBusy && g_ItemToRepeat && ( g_ItemToRepeat->m_Flags == 0 ) )
RepeatDrawItem( DC ); RepeatDrawItem( DC );
break; break;
case HK_FIND_ITEM: case HK_FIND_ITEM:
if( !ItemInEdit ) if( notBusy )
{ {
wxCommandEvent evt; wxCommandEvent evt;
evt.SetId( ID_FIND_ITEMS ); evt.SetId( ID_FIND_ITEMS );
@ -342,7 +348,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_FIND_NEXT_ITEM: case HK_FIND_NEXT_ITEM:
if( !ItemInEdit ) if( notBusy )
{ {
wxFindDialogEvent event( wxEVT_COMMAND_FIND, GetId() ); wxFindDialogEvent event( wxEVT_COMMAND_FIND, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
@ -353,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_FIND_NEXT_DRC_MARKER: case HK_FIND_NEXT_DRC_MARKER:
if( !ItemInEdit ) if( notBusy )
{ {
wxFindDialogEvent event( EVT_COMMAND_FIND_DRC_MARKER, GetId() ); wxFindDialogEvent event( EVT_COMMAND_FIND_DRC_MARKER, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
@ -364,7 +370,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_NEW_COMPONENT: // Add component case HK_ADD_NEW_COMPONENT: // Add component
if( !ItemInEdit ) if( !itemInEdit )
{ {
// switch to m_ID_current_state = ID_COMPONENT_BUTT; // switch to m_ID_current_state = ID_COMPONENT_BUTT;
if( m_ID_current_state != ID_COMPONENT_BUTT ) if( m_ID_current_state != ID_COMPONENT_BUTT )
@ -374,7 +380,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_LABEL: case HK_ADD_LABEL:
if( !ItemInEdit ) if( notBusy )
{ {
// switch to m_ID_current_state = ID_LABEL_BUTT; // switch to m_ID_current_state = ID_LABEL_BUTT;
if( m_ID_current_state != ID_LABEL_BUTT ) if( m_ID_current_state != ID_LABEL_BUTT )
@ -383,11 +389,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
break; break;
case HK_BEGIN_WIRE: case HK_ADD_JUNCTION:
if( notBusy )
{
// switch to m_ID_current_state = ID_JUNCTION_BUTT;
if( m_ID_current_state != ID_JUNCTION_BUTT )
SetToolID( ID_JUNCTION_BUTT, wxCURSOR_PENCIL, _( "Add Junction" ) );
OnLeftClick( DC, MousePos );
}
break;
/* An item is selected. If edited and not a wire, a new command is not case HK_BEGIN_WIRE:
* possible */ // An item is selected. If not a wire, a new command is not possible
if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( notBusy )
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
{ {
@ -409,7 +423,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_NOCONN_FLAG: // Add a no connected flag case HK_ADD_NOCONN_FLAG: // Add a no connected flag
if( !ItemInEdit ) if( notBusy )
{ {
if( m_ID_current_state != ID_NOCONN_BUTT ) if( m_ID_current_state != ID_NOCONN_BUTT )
SetToolID( ID_NOCONN_BUTT, wxCURSOR_PENCIL, _( "Add \"NoNonnect\" Flags" ) ); SetToolID( ID_NOCONN_BUTT, wxCURSOR_PENCIL, _( "Add \"NoNonnect\" Flags" ) );
@ -532,7 +546,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_DRAG: // Start drag case HK_DRAG: // Start drag
case HK_MOVE_COMPONENT_OR_ITEM: // Start move component or other schematic item case HK_MOVE_COMPONENT_OR_ITEM: // Start move component or other schematic item
case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
@ -627,7 +641,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_EDIT: case HK_EDIT:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
{ {
@ -671,7 +685,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_EDIT_COMPONENT_VALUE: case HK_EDIT_COMPONENT_VALUE:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
@ -682,7 +696,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_EDIT_COMPONENT_FOOTPRINT: case HK_EDIT_COMPONENT_FOOTPRINT:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
@ -711,7 +725,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
cmd.SetEventObject( this ); cmd.SetEventObject( this );
wxPoint MousePos = GetScreen()->m_MousePosition; wxPoint MousePos = GetScreen()->m_MousePosition;
bool ItemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags; bool itemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags;
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
@ -767,7 +781,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
break; break;
case HK_UNDO: case HK_UNDO:
if( !ItemInEdit ) if( !itemInEdit )
{ {
toolCmd.SetId( wxID_UNDO ); toolCmd.SetId( wxID_UNDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );
@ -775,7 +789,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
break; break;
case HK_REDO: case HK_REDO:
if( !ItemInEdit ) if( !itemInEdit )
{ {
toolCmd.SetId( wxID_REDO ); toolCmd.SetId( wxID_REDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );

View File

@ -32,6 +32,7 @@ enum hotkey_id_commnand {
HK_ADD_NEW_COMPONENT, HK_ADD_NEW_COMPONENT,
HK_BEGIN_WIRE, HK_BEGIN_WIRE,
HK_ADD_LABEL, HK_ADD_LABEL,
HK_ADD_JUNCTION,
HK_ADD_NOCONN_FLAG HK_ADD_NOCONN_FLAG
}; };

View File

@ -16,11 +16,11 @@
/* in read_from_file_schematic_items_description.cpp */ /* in read_from_file_schematic_items_description.cpp */
SCH_ITEM* ReadTextDescr( LINE_READER* aLine, wxString& aMsgDiag, int aSchematicFileVersion ); SCH_ITEM* ReadTextDescr( LINE_READER* aLine, wxString& aMsgDiag, int aSchematicFileVersion );
int ReadSheetDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ); int ReadSheetDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window );
bool ReadSchemaDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ); bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window );
int ReadPartDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ); int ReadPartDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window );
static void LoadLayers( LINE_READER* aLine ); static void LoadLayers( LINE_READER* aLine );
@ -29,8 +29,7 @@ static void LoadLayers( LINE_READER* aLine );
* Routine to load an EESchema file. * Routine to load an EESchema file.
* Returns true if file has been loaded (at least partially.) * Returns true if file has been loaded (at least partially.)
*/ */
bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& FullFileName )
const wxString& FullFileName )
{ {
char Name1[256], char Name1[256],
Name2[256]; Name2[256];
@ -122,13 +121,13 @@ again." );
{ {
case '$': // identification block case '$': // identification block
if( line[1] == 'C' ) if( line[1] == 'C' )
Failed = ReadPartDescr( this, &reader, MsgDiag, screen ); Failed = ReadPartDescr( &reader, MsgDiag, screen );
else if( line[1] == 'S' ) else if( line[1] == 'S' )
Failed = ReadSheetDescr( this, &reader, MsgDiag, screen ); Failed = ReadSheetDescr( &reader, MsgDiag, screen );
else if( line[1] == 'D' ) else if( line[1] == 'D' )
Failed = ReadSchemaDescr( this, &reader, MsgDiag, screen ); Failed = ReadSchemaDescr( &reader, MsgDiag, screen );
else if( line[1] == 'T' ) // text part else if( line[1] == 'T' ) // text part
{ {
@ -148,7 +147,7 @@ again." );
break; break;
case 'L': // Its a library item. case 'L': // Its a library item.
Failed = ReadPartDescr( this, &reader, MsgDiag, screen ); Failed = ReadPartDescr( &reader, MsgDiag, screen );
break; break;
case 'W': // Its a Segment (WIRE or BUS) item. case 'W': // Its a Segment (WIRE or BUS) item.

View File

@ -305,13 +305,14 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
/* Global label */ /* Global label */
item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ), item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ),
_( "Place a global label. Warning: all global labels with the same name are connected in whole hierarchy" ), HELP_PLACE_GLOBALLABEL, wxITEM_NORMAL );
wxITEM_NORMAL );
item->SetBitmap( add_glabel_xpm ); item->SetBitmap( add_glabel_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Junction */ /* Junction */
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, _( "Junction" ), text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr,
HK_ADD_JUNCTION, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, text,
HELP_PLACE_JUNCTION, wxITEM_NORMAL ); HELP_PLACE_JUNCTION, wxITEM_NORMAL );
item->SetBitmap( add_junction_xpm ); item->SetBitmap( add_junction_xpm );
placeMenu->Append( item ); placeMenu->Append( item );

View File

@ -1055,7 +1055,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr
STREAM_OUTPUTFORMATTER outputFormatter( os ); STREAM_OUTPUTFORMATTER outputFormatter( os );
xroot->Format( &outputFormatter, 0 ); xroot->Format( &outputFormatter, 0 );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
delete xroot; delete xroot;
goto L_error; goto L_error;

View File

@ -369,14 +369,19 @@ static NETLIST_OBJECT* FindBestNetName( NETLIST_OBJECT_LIST& aLabelItemBuffer )
if( aLabelItemBuffer.size() == 0 ) if( aLabelItemBuffer.size() == 0 )
return NULL; return NULL;
int priority_order[4] = // Define a priority (from low to high) to sort labels:
{ NET_LABEL, NET_HIERLABEL, NET_PINLABEL, NET_GLOBLABEL }; // NET_PINLABEL and NET_GLOBLABEL are global labels
// and priority >= PRIO_MAX-1 is for global connections
// ( i.e. for labels that are not prefixed by a sheetpath)
#define PRIO_MAX 4
int priority_order[PRIO_MAX+1] =
{ NET_ITEM_UNSPECIFIED, NET_LABEL, NET_HIERLABEL, NET_PINLABEL, NET_GLOBLABEL };
NETLIST_OBJECT*item = aLabelItemBuffer[0]; NETLIST_OBJECT*item = aLabelItemBuffer[0];
// Calculate item priority // Calculate item priority (initial priority)
int item_priority = 0; int item_priority = 0;
for( unsigned ii = 0; ii < 4; ii++ ) for( unsigned ii = 0; ii <= PRIO_MAX; ii++ )
{ {
if ( item->m_Type == priority_order[ii] ) if ( item->m_Type == priority_order[ii] )
{ {
@ -388,14 +393,9 @@ static NETLIST_OBJECT* FindBestNetName( NETLIST_OBJECT_LIST& aLabelItemBuffer )
for( unsigned ii = 1; ii < aLabelItemBuffer.size(); ii++ ) for( unsigned ii = 1; ii < aLabelItemBuffer.size(); ii++ )
{ {
NETLIST_OBJECT* candidate = aLabelItemBuffer[ii]; NETLIST_OBJECT* candidate = aLabelItemBuffer[ii];
if( candidate->m_SheetList.Path().Length() < item->m_SheetList.Path().Length() )
{
item = candidate;
continue;
}
// Calculate candidate priority // Calculate candidate priority
int candidate_priority = 0; int candidate_priority = 0;
for( unsigned ii = 0; ii < 4; ii++ ) for( unsigned ii = 0; ii <= PRIO_MAX; ii++ )
{ {
if ( candidate->m_Type == priority_order[ii] ) if ( candidate->m_Type == priority_order[ii] )
{ {
@ -404,13 +404,43 @@ static NETLIST_OBJECT* FindBestNetName( NETLIST_OBJECT_LIST& aLabelItemBuffer )
} }
} }
if( candidate_priority > item_priority ) if( candidate_priority > item_priority )
{
item = candidate; item = candidate;
item_priority = candidate_priority;
}
else if( candidate_priority == item_priority ) else if( candidate_priority == item_priority )
{ {
if( candidate->m_Label.Cmp( item->m_Label ) < 0 ) // for global labels, we select the best candidate by alphabetic order
item = candidate; // because they have no sheetpath as prefix name
// for other labels, we select them before by sheet deep order
// because the actual name is /sheetpath/label
// and for a given path length, by alphabetic order
if( item_priority >= PRIO_MAX-1 ) // global label or pin label
{ // selection by alphabetic order:
if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
item = candidate;
}
else // not global: names are prefixed by their sheetpath
{
// use name defined in highter hierarchical sheet
// (i.e. shorter path because paths are /<timestamp1>/<timestamp2>/...
// and timestamp = 8 letters.
if( candidate->m_SheetList.Path().Length() < item->m_SheetList.Path().Length() )
{
item = candidate;
}
else if( candidate->m_SheetList.Path().Length() == item->m_SheetList.Path().Length() )
{
// For labels on sheets having an equivalent deep in hierarchy, use
// alphabetic label name order:
if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
item = candidate;
}
}
} }
} }
return item; return item;
} }
@ -994,25 +1024,24 @@ static void PointToPointConnect( NETLIST_OBJECT* Ref, int IsBus, int start )
/* /*
* Search if a junction is connected to segments and include the Netcode * Search if a junction is connected to segments and propagate the junction Netcode
* objects connect to the junction. * to objects connected by the junction.
* The junction must have a valid Netcode * The junction must have a valid Netcode
* The list of objects is SUPPOSED class by NumSheet ??? Croissants, * The list of objects is expected sorted by sheets.
* And research is done from the start element, 1st element * Search is done from index aIdxStart to the last element of g_NetObjectslist
* Leaf schema
* (There can be no physical connection between elements of different sheets)
*/ */
static void SegmentToPointConnect( NETLIST_OBJECT* Jonction, static void SegmentToPointConnect( NETLIST_OBJECT* aJonction,
int IsBus, int start ) int aIsBus, int aIdxStart )
{ {
for( unsigned i = start; i < g_NetObjectslist.size(); i++ ) for( unsigned i = aIdxStart; i < g_NetObjectslist.size(); i++ )
{ {
NETLIST_OBJECT* Segment = g_NetObjectslist[i]; NETLIST_OBJECT* Segment = g_NetObjectslist[i];
if( Segment->m_SheetList != Jonction->m_SheetList ) // if different sheets, no physical connection between elements is possible.
if( Segment->m_SheetList != aJonction->m_SheetList )
continue; continue;
if( IsBus == 0 ) if( aIsBus == 0 )
{ {
if( Segment->m_Type != NET_SEGMENT ) if( Segment->m_Type != NET_SEGMENT )
continue; continue;
@ -1023,24 +1052,24 @@ static void SegmentToPointConnect( NETLIST_OBJECT* Jonction,
continue; continue;
} }
if( SegmentIntersect( Segment->m_Start, Segment->m_End, Jonction->m_Start ) ) if( SegmentIntersect( Segment->m_Start, Segment->m_End, aJonction->m_Start ) )
{ {
/* Propagation Netcode has all the objects of the same Netcode. */ /* Propagation Netcode has all the objects of the same Netcode. */
if( IsBus == 0 ) if( aIsBus == 0 )
{ {
if( Segment->GetNet() ) if( Segment->GetNet() )
PropageNetCode( Segment->GetNet(), PropageNetCode( Segment->GetNet(),
Jonction->GetNet(), IsBus ); aJonction->GetNet(), aIsBus );
else else
Segment->SetNet( Jonction->GetNet() ); Segment->SetNet( aJonction->GetNet() );
} }
else else
{ {
if( Segment->m_BusNetCode ) if( Segment->m_BusNetCode )
PropageNetCode( Segment->m_BusNetCode, PropageNetCode( Segment->m_BusNetCode,
Jonction->m_BusNetCode, IsBus ); aJonction->m_BusNetCode, aIsBus );
else else
Segment->m_BusNetCode = Jonction->m_BusNetCode; Segment->m_BusNetCode = aJonction->m_BusNetCode;
} }
} }
} }
@ -1072,10 +1101,11 @@ void LabelConnect( NETLIST_OBJECT* LabelRef )
continue; continue;
} }
//regular labels are sheet-local; // regular labels are sheet-local;
//NET_HIERLABEL are used to connect sheets. // NET_HIERLABEL are used to connect sheets.
//NET_LABEL is sheet-local (***) // NET_LABEL is sheet-local (***)
//NET_GLOBLABEL is global. // NET_GLOBLABEL is global.
// NET_PINLABEL is a kind of global label (generated by a power pin invisible)
NetObjetType ntype = g_NetObjectslist[i]->m_Type; NetObjetType ntype = g_NetObjectslist[i]->m_Type;
if( ntype == NET_LABEL if( ntype == NET_LABEL
|| ntype == NET_GLOBLABEL || ntype == NET_GLOBLABEL

View File

@ -175,7 +175,7 @@ SCH_ITEM* ReadTextDescr( LINE_READER* aLine, wxString& aMsgDiag, int aSchematicF
/* Function used by LoadEEFile(). /* Function used by LoadEEFile().
* Get the lines for a description of a piece of hierarchy. * Get the lines for a description of a piece of hierarchy.
*/ */
int ReadSheetDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ) int ReadSheetDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window )
{ {
int ii, fieldNdx, size; int ii, fieldNdx, size;
char Name1[256], Char1[256], Char2[256]; char Name1[256], Char1[256], Char2[256];
@ -286,7 +286,6 @@ int ReadSheetDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BAS
aLine->LineNumber() ); aLine->LineNumber() );
aMsgDiag << CONV_FROM_UTF8( line ); aMsgDiag << CONV_FROM_UTF8( line );
DisplayError( frame, aMsgDiag );
} }
if( size == 0 ) if( size == 0 )
size = DEFAULT_SIZE_TEXT; size = DEFAULT_SIZE_TEXT;
@ -316,7 +315,6 @@ int ReadSheetDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BAS
aMsgDiag.Printf( wxT( "EESchema file sheet label error at line %d, ignoring.\n" ), aMsgDiag.Printf( wxT( "EESchema file sheet label error at line %d, ignoring.\n" ),
aLine->LineNumber() ); aLine->LineNumber() );
aMsgDiag << CONV_FROM_UTF8( line ); aMsgDiag << CONV_FROM_UTF8( line );
DisplayError( frame, aMsgDiag );
continue; continue;
} }
@ -391,7 +389,7 @@ int ReadSheetDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BAS
/* Read the schematic header. */ /* Read the schematic header. */
bool ReadSchemaDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ) bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window )
{ {
char Text[256], buf[1024]; char Text[256], buf[1024];
int ii; int ii;
@ -427,7 +425,6 @@ bool ReadSchemaDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, B
line %d, \aAbort reading file.\n" ), line %d, \aAbort reading file.\n" ),
aLine->LineNumber() ); aLine->LineNumber() );
aMsgDiag << CONV_FROM_UTF8( line ); aMsgDiag << CONV_FROM_UTF8( line );
DisplayError( frame, aMsgDiag );
} }
Window->m_CurrentSheetDesc = wsheet; Window->m_CurrentSheetDesc = wsheet;
@ -509,7 +506,7 @@ line %d, \aAbort reading file.\n" ),
* Get the lines for a description of a schematic component. * Get the lines for a description of a schematic component.
*/ */
int ReadPartDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ) int ReadPartDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window )
{ {
int ii; int ii;
char Name1[256], Name2[256], char Name1[256], Name2[256],
@ -754,7 +751,6 @@ int ReadPartDescr( wxWindow* frame, LINE_READER* aLine, wxString& aMsgDiag, BASE
aMsgDiag.Printf( aMsgDiag.Printf(
wxT( "Component Field error line %d, aborted" ), wxT( "Component Field error line %d, aborted" ),
aLine->LineNumber() ); aLine->LineNumber() );
DisplayError( frame, aMsgDiag );
continue; continue;
} }

View File

@ -31,7 +31,7 @@ wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
} }
} }
void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
// user may want spaces in his field name, ug, so quote them for the parser. // user may want spaces in his field name, ug, so quote them for the parser.
out->Print( nestLevel, "(field (name \"%s\")", CONV_TO_UTF8(m_Name) ); out->Print( nestLevel, "(field (name \"%s\")", CONV_TO_UTF8(m_Name) );
@ -46,7 +46,7 @@ void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const thr
} }
void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ) void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR )
{ {
TFIELD_T tok; TFIELD_T tok;
@ -87,7 +87,7 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError )
} }
void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
// We'll keep this general, and include the \n, even though the only known // We'll keep this general, and include the \n, even though the only known
// use at this time will not want the newlines or the indentation. // use at this time will not want the newlines or the indentation.
@ -97,7 +97,7 @@ void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOErr
out->Print( 0, ")\n" ); out->Print( 0, ")\n" );
} }
void TEMPLATES::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ) void TEMPLATES::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR )
{ {
TFIELD_T tok; TFIELD_T tok;

View File

@ -66,7 +66,7 @@ struct TEMPLATE_FIELDNAME
* Function Format * Function Format
* serializes this object out as text into the given OUTPUTFORMATTER. * serializes this object out as text into the given OUTPUTFORMATTER.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ); void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR );
/** /**
* Function Parse * Function Parse
@ -81,7 +81,7 @@ struct TEMPLATE_FIELDNAME
* *
* @param aSpec is the input token stream of keywords and symbols. * @param aSpec is the input token stream of keywords and symbols.
*/ */
void Parse( TEMPLATE_FIELDNAMES_LEXER* aSpec ) throw( IOError ); void Parse( TEMPLATE_FIELDNAMES_LEXER* aSpec ) throw( IO_ERROR );
/** /**
* Function GetDefaultFieldName * Function GetDefaultFieldName
@ -106,13 +106,13 @@ public:
* Function Format * Function Format
* serializes this object out as text into the given OUTPUTFORMATTER. * serializes this object out as text into the given OUTPUTFORMATTER.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ); void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR );
/** /**
* Function Parse * Function Parse
* fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_LEXER * fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_LEXER
*/ */
void Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ); void Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR );
/** /**

View File

@ -113,11 +113,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString,
wxBitmap( new_component_xpm ), wxBitmap( new_component_xpm ),
_( "New component" ) ); _( "Create a new component" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString,
wxBitmap( add_component_xpm ), wxBitmap( import_cmp_from_lib_xpm ),
_( "Select component to edit" ) ); _( "Load component to edit from the current lib" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString,
wxBitmap( save_part_in_mem_xpm ), wxBitmap( save_part_in_mem_xpm ),

View File

@ -110,6 +110,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
wxSafeYield(); wxSafeYield();
} }
SetToolbars();
UpdateStatusBar(); UpdateStatusBar();
} }

View File

@ -217,6 +217,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ReFillLayerWidget(); // this is near end because contents establish size ReFillLayerWidget(); // this is near end because contents establish size
SetToolbars();
m_auimgr.Update(); m_auimgr.Update();
} }
@ -239,6 +240,10 @@ void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event )
int WinEDA_GerberFrame::BestZoom() int WinEDA_GerberFrame::BestZoom()
{ {
// gives a minimal value to zoom, if no item in list
if( GetBoard()->m_Drawings == NULL )
return(16 * GetScreen()->m_ZoomScalar) ;
double x, y; double x, y;
EDA_Rect bbox; EDA_Rect bbox;
@ -248,13 +253,14 @@ int WinEDA_GerberFrame::BestZoom()
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
bbox.Merge( gerb_item->GetBoundingBox() ); bbox.Merge( gerb_item->GetBoundingBox() );
} }
bbox.Inflate( GetScreen()->GetGridSize().x * 2, GetScreen()->GetGridSize().y * 2);
wxSize size = DrawPanel->GetClientSize(); wxSize size = DrawPanel->GetClientSize();
x = ( bbox.GetWidth() + GetScreen()->GetGridSize().x ) / (double) size.x; x = bbox.GetWidth() / (double) size.x;
y = ( bbox.GetHeight() + GetScreen()->GetGridSize().y ) / (double) size.y; y = bbox.GetHeight() / (double) size.y;
GetScreen()->m_Curseur = bbox.Centre(); GetScreen()->m_Curseur = bbox.Centre();
return wxRound( MAX( x, y ) * (double) GetScreen()->m_ZoomScalar ); int best_zoom = wxRound( MAX( x, y ) * (double) GetScreen()->m_ZoomScalar ) ;
return best_zoom;
} }
/**************************************/ /**************************************/
@ -508,7 +514,7 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo()
gerber->DisplayImageInfo( ); gerber->DisplayImageInfo( );
// Display Image Name and Layer Name (from the current gerber data): // Display Image Name and Layer Name (from the current gerber data):
text.Printf( _("Image name: \"%s\" Layer name \"%s\""), text.Printf( _("Image name: \"%s\" Layer name: \"%s\""),
GetChars(gerber->m_ImageName), GetChars(gerber->GetLayerParams( ).m_LayerName) ); GetChars(gerber->m_ImageName), GetChars(gerber->GetLayerParams( ).m_LayerName) );
SetStatusText( text, 0 ); SetStatusText( text, 0 );

View File

@ -47,6 +47,7 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
SetBaseScreen( ActiveScreen = ScreenPcb ); SetBaseScreen( ActiveScreen = ScreenPcb );
GetScreen()->Init(); GetScreen()->Init();
setActiveLayer(LAYER_N_BACK); setActiveLayer(LAYER_N_BACK);
syncLayerBox();
return TRUE; return TRUE;
} }
@ -56,7 +57,7 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
int layer = getActiveLayer(); int layer = getActiveLayer();
wxString msg; wxString msg;
msg.Printf( _( "Delete layer %d?" ), layer + 1 ); msg.Printf( _( "Clear layer %d?" ), layer + 1 );
if( query && !IsOK( this, msg ) ) if( query && !IsOK( this, msg ) )
return; return;
@ -81,4 +82,5 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
ScreenPcb->SetModify(); ScreenPcb->SetModify();
ScreenPcb->SetRefreshReq(); ScreenPcb->SetRefreshReq();
syncLayerBox();
} }

View File

@ -97,8 +97,8 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
tools_xpm ); tools_xpm );
miscellaneous_menu->AppendSeparator(); miscellaneous_menu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_GLOBAL_DELETE, ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_GLOBAL_DELETE,
_( "&Delete Layer" ), _( "&Clear Layer" ),
_( "Delete current layer" ), general_deletions_xpm ); _( "Clear current layer" ), general_deletions_xpm );
// Menu Help: // Menu Help:
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;

View File

@ -17,9 +17,8 @@
bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName, bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName ) const wxString& D_Code_FullFileName )
{ {
int G_commande = 0, int G_commande = 0; // command number for G commands like G04
D_commande = 0; /* command number for G or D commands int D_commande = 0; // command number for D commands like D02
* (like G04 or D02) */
char line[GERBER_BUFZ]; char line[GERBER_BUFZ];
@ -57,7 +56,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
SetLocaleTo_C_standard(); SetLocaleTo_C_standard();
while( TRUE ) while( true )
{ {
if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL ) if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL )
{ {
@ -94,7 +93,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
gerber->m_CommandState = CMD_IDLE; gerber->m_CommandState = CMD_IDLE;
while( *text ) while( *text )
text++; text++;
break; break;
case 'G': /* Line type Gxx : command */ case 'G': /* Line type Gxx : command */

View File

@ -455,7 +455,9 @@ bool GERBER_IMAGE::Execute_G_Command( char*& text, int G_commande )
break; break;
case GC_COMMENT: case GC_COMMENT:
text = NULL; // Skip comment
while ( *text && (*text != '*') )
text++;
break; break;
case GC_LINEAR_INTERPOL_10X: case GC_LINEAR_INTERPOL_10X:

View File

@ -13,7 +13,7 @@
#include "gerbview_id.h" #include "gerbview_id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "class_GERBER.h" #include "class_GERBER.h"
#include "class_layerchoicebox.h"
void WinEDA_GerberFrame::ReCreateHToolbar( void ) void WinEDA_GerberFrame::ReCreateHToolbar( void )
{ {
@ -89,7 +89,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
choices.Add( msg ); choices.Add( msg );
} }
m_SelLayerBox = new WinEDAChoiceBox( m_HToolBar, m_SelLayerBox = new WinEDALayerChoiceBox( m_HToolBar,
ID_TOOLBARH_GERBVIEW_SELECT_LAYER, ID_TOOLBARH_GERBVIEW_SELECT_LAYER,
wxDefaultPosition, wxSize( 150, -1 ), wxDefaultPosition, wxSize( 150, -1 ),
choices ); choices );
@ -224,17 +224,6 @@ void WinEDA_GerberFrame::SetToolbars()
if( m_HToolBar == NULL ) if( m_HToolBar == NULL )
return; return;
if( GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{
m_HToolBar->EnableTool( wxID_CUT, true );
m_HToolBar->EnableTool( wxID_COPY, true );
}
else
{
m_HToolBar->EnableTool( wxID_CUT, false );
m_HToolBar->EnableTool( wxID_COPY, false );
}
if( m_SelLayerBox && (m_SelLayerBox->GetSelection() != screen->m_Active_Layer) ) if( m_SelLayerBox && (m_SelLayerBox->GetSelection() != screen->m_Active_Layer) )
{ {
m_SelLayerBox->SetSelection( screen->m_Active_Layer ); m_SelLayerBox->SetSelection( screen->m_Active_Layer );

View File

@ -8,7 +8,7 @@
#include "id.h" #include "id.h"
#include "class_gerbview_layer_widget.h" #include "class_gerbview_layer_widget.h"
#include "class_layerchoicebox.h"
/** /**
* Command IDs for the gerber file viewer. * Command IDs for the gerber file viewer.
@ -44,7 +44,7 @@ protected:
GERBER_LAYER_WIDGET* m_LayersManager; GERBER_LAYER_WIDGET* m_LayersManager;
public: public:
WinEDAChoiceBox* m_SelLayerBox; WinEDALayerChoiceBox* m_SelLayerBox;
WinEDAChoiceBox* m_SelLayerTool; WinEDAChoiceBox* m_SelLayerTool;
wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about
// gerber data (format..) // gerber data (format..)

View File

@ -348,6 +348,7 @@ public:
inline bool IsModified() const { return m_Flags & IS_CHANGED; } inline bool IsModified() const { return m_Flags & IS_CHANGED; }
inline bool IsMoving() const { return m_Flags & IS_MOVED; } inline bool IsMoving() const { return m_Flags & IS_MOVED; }
inline bool IsDragging() const { return m_Flags & IS_DRAGGED; } inline bool IsDragging() const { return m_Flags & IS_DRAGGED; }
inline bool IsSelected() const { return m_Flags & SELECTED; }
int GetState( int type ) const int GetState( int type ) const
{ {

View File

@ -152,6 +152,7 @@ extern const char* icon_gerbview_xpm[];
extern const char* icon_modedit_xpm[]; extern const char* icon_modedit_xpm[];
extern const char* icon_txt_xpm[]; extern const char* icon_txt_xpm[];
extern const char* icon_w3d_xpm[]; extern const char* icon_w3d_xpm[];
extern const char* import_cmp_from_lib_xpm[];
extern const char* import_hierarchical_label_xpm[]; extern const char* import_hierarchical_label_xpm[];
extern const char* import_module_xpm[]; extern const char* import_module_xpm[];
extern const char* import_xpm[]; extern const char* import_xpm[];

View File

@ -14,12 +14,23 @@
#include "block_commande.h" #include "block_commande.h"
#include "common.h" #include "common.h"
#include <boost/ptr_container/ptr_vector.hpp>
// Forward declarations: // Forward declarations:
class SCH_ITEM; class SCH_ITEM;
class Ki_PageDescr; class Ki_PageDescr;
/**
* Define list of drawing items for screens.
*
* The Boost containter was choosen over the statand C++ contain because you can detach
* the pointer from a list with the release method.
*/
typedef boost::ptr_vector< EDA_BaseStruct > EDA_ITEMS;
/* Simple class for handling grid arrays. */ /* Simple class for handling grid arrays. */
class GRID_TYPE class GRID_TYPE
{ {
@ -56,17 +67,16 @@ WX_DECLARE_OBJARRAY( GRID_TYPE, GridArray );
/*******************************************************************/ /*******************************************************************/
class BASE_SCREEN : public EDA_BaseStruct class BASE_SCREEN : public EDA_BaseStruct
{ {
EDA_ITEMS m_items; ///< The drawing items associated with this screen.
public: public:
wxPoint m_DrawOrg; /* offsets for drawing the circuit on the wxPoint m_DrawOrg; /* offsets for drawing the circuit on the screen */
* screen */ wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user units. */
wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user units. */
* units. */
wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user
* units. */
wxPoint m_MousePositionInPixels; wxPoint m_MousePositionInPixels;
wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid) wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid)
* in user units. * in user units.
* (coordinates from last reset position)*/ * (coordinates from last reset position)*/
// Scrollbars management: // Scrollbars management:
int m_ScrollPixelsPerUnitX; /* Pixels per scroll unit in the horizontal direction. */ int m_ScrollPixelsPerUnitX; /* Pixels per scroll unit in the horizontal direction. */
int m_ScrollPixelsPerUnitY; /* Pixels per scroll unit in the vertical direction. */ int m_ScrollPixelsPerUnitY; /* Pixels per scroll unit in the vertical direction. */
@ -280,8 +290,7 @@ public:
/** /**
* Function SetZoomList * Function SetZoomList
* sets the list of zoom factors. * sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero * @param aZoomList An array of zoom factors in ascending order, zero terminated
* terminated
*/ */
void SetZoomList( const wxArrayInt& zoomlist ); void SetZoomList( const wxArrayInt& zoomlist );
@ -300,8 +309,7 @@ public:
bool SetFirstZoom(); bool SetFirstZoom();
bool SetLastZoom(); bool SetLastZoom();
//----<grid //----<grid stuff>----------------------------------------------------------
// stuff>----------------------------------------------------------
/** /**
* Return the command ID of the currently selected grid. * Return the command ID of the currently selected grid.
@ -359,6 +367,13 @@ public:
return wxT( "BASE_SCREEN" ); return wxT( "BASE_SCREEN" );
} }
/**
* Helpers for accessing the draw item list.
*/
EDA_ITEMS::iterator Begin() { return m_items.begin(); }
EDA_ITEMS::iterator End() { return m_items.end(); }
virtual void AddItem( EDA_BaseStruct* aItem );
virtual void InsertItem( EDA_ITEMS::iterator aIter, EDA_BaseStruct* aItem );
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -0,0 +1,65 @@
#ifndef CLASS_LAYERCHOICEBOX_H
#define CLASS_LAYERCHOICEBOX_H 1
#include "hotkeys_basic.h"
#include <wx/bmpcbox.h>
/* class to display a layer list.
*
*/
class WinEDALayerChoiceBox : public wxBitmapComboBox
{
private:
bool m_layerhotkeys;
bool m_layerorder;
public:
WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL );
WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices );
// Get Current Item #
int GetChoice();
// Get Current Layer
int GetLayerSelection();
// Set Layer #
int SetLayerSelection(int layer);
// Reload the Layers
void Resync();
void ResyncBitmapOnly();
bool SetLayersOrdered(bool value);
bool SetLayersHotkeys(bool value);
// Hotkey Info
struct Ki_HotkeyInfoSectionDescriptor* m_hotkeys;
};
#define DECLARE_LAYERS_HOTKEY(list) int list[LAYER_COUNT] = \
{ \
HK_SWITCH_LAYER_TO_COPPER, \
HK_SWITCH_LAYER_TO_INNER1, \
HK_SWITCH_LAYER_TO_INNER2, \
HK_SWITCH_LAYER_TO_INNER3, \
HK_SWITCH_LAYER_TO_INNER4, \
HK_SWITCH_LAYER_TO_INNER5, \
HK_SWITCH_LAYER_TO_INNER6, \
HK_SWITCH_LAYER_TO_INNER7, \
HK_SWITCH_LAYER_TO_INNER8, \
HK_SWITCH_LAYER_TO_INNER9, \
HK_SWITCH_LAYER_TO_INNER10, \
HK_SWITCH_LAYER_TO_INNER11, \
HK_SWITCH_LAYER_TO_INNER12, \
HK_SWITCH_LAYER_TO_INNER13, \
HK_SWITCH_LAYER_TO_INNER14, \
HK_SWITCH_LAYER_TO_COMPONENT \
};
#endif //CLASS_LAYERCHOICEBOX_H

View File

@ -6,7 +6,7 @@
#define CLASS_SCREEN_H #define CLASS_SCREEN_H
#include "macros.h" #include "macros.h"
#include "base_struct.h" #include "sch_item_struct.h"
#include "class_base_screen.h" #include "class_base_screen.h"
@ -17,8 +17,9 @@
class SCH_SCREEN : public BASE_SCREEN class SCH_SCREEN : public BASE_SCREEN
{ {
public: public:
int m_RefCount; /*how many sheets reference this screen? int m_RefCount; ///< Number of sheets referencing this screen.
* delete when it goes to zero. */ ///< Delete when it goes to zero.
SCH_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE ); SCH_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN(); ~SCH_SCREEN();
@ -80,7 +81,7 @@ public:
* items are removed from the beginning of the list. * items are removed from the beginning of the list.
* So this function can be called to remove old commands * So this function can be called to remove old commands
*/ */
virtual void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 ); virtual void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 );
/** /**
* Function Save * Function Save
@ -90,6 +91,17 @@ public:
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/**
* Clear the state flags of all the items in the screen.
*/
void ClearDrawingState();
virtual void AddItem( SCH_ITEM* aItem ) { BASE_SCREEN::AddItem( (EDA_BaseStruct*) aItem ); }
virtual void InsertItem( EDA_ITEMS::iterator aIter, SCH_ITEM* aItem )
{
BASE_SCREEN::InsertItem( aIter, (EDA_BaseStruct*) aItem );
}
}; };

View File

@ -102,7 +102,7 @@ class DSNLEXER
void init(); void init();
int readLine() throw (IOError) int readLine() throw( IO_ERROR )
{ {
unsigned len = reader->ReadLine(); unsigned len = reader->ReadLine();
@ -213,29 +213,29 @@ public:
* this lower level function returning an int (so the enum does not collide * this lower level function returning an int (so the enum does not collide
* with another usage). * with another usage).
* @return int - the type of token found next. * @return int - the type of token found next.
* @throw IOError - only if the LINE_READER throws it. * @throw IO_ERROR - only if the LINE_READER throws it.
*/ */
int NextTok() throw (IOError); int NextTok() throw( IO_ERROR );
/** /**
* Function NeedSYMBOL * Function NeedSYMBOL
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol(). * satisfies bool IsSymbol().
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy IsSymbol() * @throw IO_ERROR, if the next token does not satisfy IsSymbol()
*/ */
int NeedSYMBOL() throw( IOError ); int NeedSYMBOL() throw( IO_ERROR );
/** /**
* Function NeedSYMBOLorNUMBER * Function NeedSYMBOLorNUMBER
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol() or tok==DSN_NUMBER. * satisfies bool IsSymbol() or tok==DSN_NUMBER.
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy the above test * @throw IO_ERROR, if the next token does not satisfy the above test
*/ */
int NeedSYMBOLorNUMBER() throw( IOError ); int NeedSYMBOLorNUMBER() throw( IO_ERROR );
/** /**
* Function CurTok * Function CurTok
@ -311,58 +311,58 @@ public:
* encapsulates the formatting of an error message which contains the exact * encapsulates the formatting of an error message which contains the exact
* location within the input file of something the caller is rejecting. * location within the input file of something the caller is rejecting.
*/ */
void ThrowIOError( wxString aText, int charOffset ) throw (IOError); void ThrowIOError( wxString aText, int charOffset ) throw( IO_ERROR );
/** /**
* Function Expecting * Function Expecting
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aTok is the token/keyword type which was expected at the current input location. * @param aTok is the token/keyword type which was expected at the current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Expecting( int aTok ) throw( IOError ); void Expecting( int aTok ) throw( IO_ERROR );
/** /**
* Function Expecting * Function Expecting
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aErrorMsg is the token/keyword type which was expected at the * @param aErrorMsg is the token/keyword type which was expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Expecting( const wxString& aErrorMsg ) throw( IOError ); void Expecting( const wxString& aErrorMsg ) throw( IO_ERROR );
/** /**
* Function Unexpected * Function Unexpected
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aTok is the token/keyword type which was not expected at the * @param aTok is the token/keyword type which was not expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Unexpected( int aTok ) throw( IOError ); void Unexpected( int aTok ) throw( IO_ERROR );
/** /**
* Function Unexpected * Function Unexpected
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aErrorMsg is the token/keyword type which was not expected at the * @param aErrorMsg is the token/keyword type which was not expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Unexpected( const wxString& aErrorMsg ) throw( IOError ); void Unexpected( const wxString& aErrorMsg ) throw( IO_ERROR );
/** /**
* Function NeedLEFT * Function NeedLEFT
* calls NextTok() and then verifies that the token read in is a DSN_LEFT. * calls NextTok() and then verifies that the token read in is a DSN_LEFT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a DSN_LEFT * @throw IO_ERROR, if the next token is not a DSN_LEFT
*/ */
void NeedLEFT() throw( IOError ); void NeedLEFT() throw( IO_ERROR );
/** /**
* Function NeedRIGHT * Function NeedRIGHT
* calls NextTok() and then verifies that the token read in is a DSN_RIGHT. * calls NextTok() and then verifies that the token read in is a DSN_RIGHT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a DSN_RIGHT * @throw IO_ERROR, if the next token is not a DSN_RIGHT
*/ */
void NeedRIGHT() throw( IOError ); void NeedRIGHT() throw( IO_ERROR );
/** /**
* Function GetTokenText * Function GetTokenText

View File

@ -42,20 +42,20 @@
/** /**
* Struct IOError * Struct IO_ERROR
* is a class used to hold an error message and may be used to throw exceptions * is a class used to hold an error message and may be used to throw exceptions
* containing meaningful error messages. * containing meaningful error messages.
*/ */
struct IOError struct IO_ERROR
{ {
wxString errorText; wxString errorText;
IOError( const wxChar* aMsg ) : IO_ERROR( const wxChar* aMsg ) :
errorText( aMsg ) errorText( aMsg )
{ {
} }
IOError( const wxString& aMsg ) : IO_ERROR( const wxString& aMsg ) :
errorText( aMsg ) errorText( aMsg )
{ {
} }
@ -104,9 +104,9 @@ public:
* counter. If the line is larger than aMaxLineLength passed to the * counter. If the line is larger than aMaxLineLength passed to the
* constructor, then an exception is thrown. The line is nul terminated. * constructor, then an exception is thrown. The line is nul terminated.
* @return unsigned - The number of bytes read, 0 at end of file. * @return unsigned - The number of bytes read, 0 at end of file.
* @throw IOError when a line is too long. * @throw IO_ERROR when a line is too long.
*/ */
virtual unsigned ReadLine() throw( IOError ) = 0; virtual unsigned ReadLine() throw( IO_ERROR ) = 0;
/** /**
* Function GetSource * Function GetSource
@ -181,7 +181,7 @@ public:
fclose( fp ); fclose( fp );
} }
unsigned ReadLine() throw( IOError ); // see LINE_READER::ReadLine() description unsigned ReadLine() throw( IO_ERROR ); // see LINE_READER::ReadLine() description
/** /**
* Function Rewind * Function Rewind
@ -228,31 +228,32 @@ public:
source = aSource; source = aSource;
} }
unsigned ReadLine() throw(IOError); // see LINE_READER::ReadLine() description unsigned ReadLine() throw( IO_ERROR ); // see LINE_READER::ReadLine() description
}; };
/** /**
* Class OUTPUTFORMATTER * Class OUTPUTFORMATTER
* is an important interface (abstract) class used to output UTF8 text in a convenient * is an important interface (abstract) class used to output UTF8 text in
* way. The primary interface is "printf() - like" but with support for indentation * a convenient way. The primary interface is "printf() - like" but
* control. The destination of the 8 bit wide text is up to the implementer. * with support for indentation control. The destination of the 8 bit
* wide text is up to the implementer.
* <p> * <p>
* The implementer only has to implement the write() function, but can also optionaly * The implementer only has to implement the write() function, but can
* re-implement GetQuoteChar(). * also optionally re-implement GetQuoteChar().
* <p> * <p>
* If you want to output a wxString, then use CONV_TO_UTF8() on it before passing * If you want to output a wxString, then use CONV_TO_UTF8() on it
* it as an argument to Print(). * before passing it as an argument to Print().
* <p> * <p>
* Since this is an abstract interface, only classes derived from this one * Since this is an abstract interface, only classes derived from
* may actually be used. * this one may actually be used.
*/ */
class OUTPUTFORMATTER class OUTPUTFORMATTER
{ {
std::vector<char> buffer; std::vector<char> buffer;
int sprint( const char* fmt, ... ) throw( IOError ); int sprint( const char* fmt, ... ) throw( IO_ERROR );
int vprint( const char* fmt, va_list ap ) throw( IOError ); int vprint( const char* fmt, va_list ap ) throw( IO_ERROR );
protected: protected:
@ -283,9 +284,9 @@ protected:
* *
* @param aOutBuf is the start of a byte buffer to write. * @param aOutBuf is the start of a byte buffer to write.
* @param aCount tells how many bytes to write. * @param aCount tells how many bytes to write.
* @throw IOError, if there is a problem outputting, such as a full disk. * @throw IO_ERROR, if there is a problem outputting, such as a full disk.
*/ */
virtual void write( const char* aOutBuf, int aCount ) throw( IOError ) = 0; virtual void write( const char* aOutBuf, int aCount ) throw( IO_ERROR ) = 0;
#if defined(__GNUG__) // The GNU C++ compiler defines this #if defined(__GNUG__) // The GNU C++ compiler defines this
@ -307,14 +308,14 @@ public:
* Function Print * Function Print
* formats and writes text to the output stream. * formats and writes text to the output stream.
* *
* @param nestLevel The multiple of spaces to preceed the output with. * @param nestLevel The multiple of spaces to precede the output with.
* @param fmt A printf() style format string. * @param fmt A printf() style format string.
* @param ... a variable list of parameters that will get blended into * @param ... a variable list of parameters that will get blended into
* the output under control of the format string. * the output under control of the format string.
* @return int - the number of characters output. * @return int - the number of characters output.
* @throw IOError, if there is a problem outputting, such as a full disk. * @throw IO_ERROR, if there is a problem outputting, such as a full disk.
*/ */
int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError ); int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IO_ERROR );
/** /**
* Function GetQuoteChar * Function GetQuoteChar
@ -350,11 +351,11 @@ public:
* *
* @return const char* - useful for passing to printf() style functions that * @return const char* - useful for passing to printf() style functions that
* must output utf8 streams. * must output utf8 streams.
* @throw IOError, if aWrapee has any \r or \n bytes in it which is * @throw IO_ERROR, if aWrapee has any \r or \n bytes in it which is
* illegal according to the DSNLEXER who does not ever want them * illegal according to the DSNLEXER who does not ever want them
* within a string. * within a string.
*/ */
virtual const char* Quoted( std::string* aWrapee ) throw( IOError ); virtual const char* Quoted( std::string* aWrapee ) throw( IO_ERROR );
//-----</interface functions>----------------------------------------- //-----</interface functions>-----------------------------------------
}; };
@ -402,7 +403,7 @@ public:
//-----<OUTPUTFORMATTER>------------------------------------------------ //-----<OUTPUTFORMATTER>------------------------------------------------
protected: protected:
void write( const char* aOutBuf, int aCount ) throw( IOError ); void write( const char* aOutBuf, int aCount ) throw( IO_ERROR );
//-----</OUTPUTFORMATTER>----------------------------------------------- //-----</OUTPUTFORMATTER>-----------------------------------------------
}; };
@ -434,7 +435,7 @@ public:
const char* GetQuoteChar( const char* wrapee ); const char* GetQuoteChar( const char* wrapee );
protected: protected:
void write( const char* aOutBuf, int aCount ) throw( IOError ); void write( const char* aOutBuf, int aCount ) throw( IO_ERROR );
//-----</OUTPUTFORMATTER>----------------------------------------------- //-----</OUTPUTFORMATTER>-----------------------------------------------
}; };

View File

@ -5,11 +5,46 @@
#ifndef SCH_ITEM_STRUCT_H #ifndef SCH_ITEM_STRUCT_H
#define SCH_ITEM_STRUCT_H #define SCH_ITEM_STRUCT_H
#include <vector>
#include <class_base_screen.h>
using namespace std;
class SCH_ITEM;
class WinEDA_SchematicFrame; class WinEDA_SchematicFrame;
class wxFindReplaceData; class wxFindReplaceData;
enum DANGLING_END_T {
UNKNOWN = 0,
WIRE_START_END,
WIRE_END_END,
BUS_START_END,
BUS_END_END,
JUNCTION_END,
PIN_END,
LABEL_END,
ENTRY_END,
SHEET_LABEL_END
};
// A helper class to store a list of items that can be connected to something:
class DANGLING_END_ITEM
{
public:
const void* m_Item; // a pointer to the parent
wxPoint m_Pos; // the position of the connecting point
DANGLING_END_T m_Type; // type of parent
DANGLING_END_ITEM( DANGLING_END_T type, const void* aItem )
{
m_Item = aItem;
m_Type = type;
}
};
/** /**
* Class SCH_ITEM * Class SCH_ITEM
* is a base class for any item which can be embedded within the SCHEMATIC * is a base class for any item which can be embedded within the SCHEMATIC
@ -21,7 +56,7 @@ class SCH_ITEM : public EDA_BaseStruct
{ {
protected: protected:
int m_Layer; int m_Layer;
EDA_ITEMS m_connections; ///< List of items connected to this item.
public: public:
SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ); SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType );
@ -72,15 +107,15 @@ public:
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the deplacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) = 0; virtual void Move( const wxPoint& aMoveVector ) = 0;
/** virtual function Mirror_Y /** virtual function Mirror_Y
* mirror item relative to an Y axis * mirror item relative to an Y axis
* @param aYaxis_position = the y axis position * @param aYaxis_position = the y axis position
*/ */
virtual void Mirror_Y(int aYaxis_position) = 0; virtual void Mirror_Y( int aYaxis_position ) = 0;
virtual void Mirror_X(int aXaxis_position) = 0; virtual void Mirror_X( int aXaxis_position ) = 0;
virtual void Rotate(wxPoint rotationPoint) = 0; virtual void Rotate( wxPoint rotationPoint ) = 0;
/** /**
@ -109,8 +144,7 @@ public:
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL. * @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this schematic text item matches the search criteria. * @return True if this schematic text item matches the search criteria.
*/ */
virtual bool Matches( wxFindReplaceData& aSearchData, virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation )
void * aAuxData, wxPoint * aFindLocation )
{ return false; } { return false; }
/** /**
@ -121,6 +155,62 @@ public:
* @return True if this item matches the search criteria. * @return True if this item matches the search criteria.
*/ */
bool Matches( const wxString& aText, wxFindReplaceData& aSearchData ); bool Matches( const wxString& aText, wxFindReplaceData& aSearchData );
/**
* Add schematic item end points to \a aItemList if the item has endpoints.
*
* The default version doesn't do anything since many of the schematic object cannot
* be tested for dangling ends. If you add a new schematic item that can have a
* dangling end ( no connect ), override this method to provide the correct end
* points.
*
* @param aItemList - List of DANGLING_END_ITEMS to add to.
*/
virtual void GetEndPoints( vector< DANGLING_END_ITEM >& aItemList ) {}
/**
* Test the schematic item to \a aItemList to check if it's dangling state has changed.
*
* Note that the return value only true when the state of the test has changed. Use
* the IsDangling() method to get the current dangling state of the item. Some of
* the schematic objects cannot be tested for a dangling state, the default method
* always returns false. Only override the method if the item can be tested for a
* dangling state.
*
* @param aItemList - List of items to test item against.
* @return True if the dangling state has changed from it's current setting.
*/
virtual bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ) { return false; }
virtual bool IsDangling() const { return false; }
/**
* Check if the selection state of an item inside \a aRect has changed.
*
* The is used by the block selection code to verify if an item is selected or not.
* True is be return anytime the select state changes. If you need to know the
* the current selection state, use the IsSelected() method.
*
* @param aRect - Rectange to test against.
*/
virtual bool IsSelectStateChanged( const wxRect& aRect ) { return false; }
/**
* Get a list of connection points for this item.
*
* Not all schematic items have connection points so the default method does nothing.
*
* @param aPoints - List of connection points to add to.
*/
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const { }
/**
* Clear all of the connection items from the list.
*
* The vector release method is used to prevent the item pointers from being deleted.
* Do not use the vector erase method on the connection list.
*/
void ClearConnections() { m_connections.release(); }
}; };
#endif /* SCH_ITEM_STRUCT_H */ #endif /* SCH_ITEM_STRUCT_H */

View File

@ -9,6 +9,7 @@
#include "wxstruct.h" #include "wxstruct.h"
#include "base_struct.h" #include "base_struct.h"
#include "param_config.h" #include "param_config.h"
#include "class_layerchoicebox.h"
#ifndef PCB_INTERNAL_UNIT #ifndef PCB_INTERNAL_UNIT
#define PCB_INTERNAL_UNIT 10000 #define PCB_INTERNAL_UNIT 10000
@ -114,7 +115,7 @@ protected:
public: public:
WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and WinEDALayerChoiceBox* m_SelLayerBox; // a combo box to display and
// select active layer // select active layer
WinEDAChoiceBox* m_SelTrackWidthBox; // a combo box to display and WinEDAChoiceBox* m_SelTrackWidthBox; // a combo box to display and
// select current track width // select current track width
@ -308,7 +309,7 @@ public:
void ReCreateMicrowaveVToolbar(); void ReCreateMicrowaveVToolbar();
void ReCreateOptToolbar(); void ReCreateOptToolbar();
void ReCreateMenuBar(); void ReCreateMenuBar();
WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); WinEDALayerChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );
/** Virtual Function OnModify() /** Virtual Function OnModify()
* Must be called after a board change * Must be called after a board change

View File

@ -52,9 +52,9 @@ public:
* writes this object as UTF8 out to an OUTPUTFORMATTER as an S-expression. * writes this object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
/** /**
* Function FormatContents * Function FormatContents
@ -62,9 +62,9 @@ public:
* This is the same as Format() except that the outer wrapper is not included. * This is the same as Format() except that the outer wrapper is not included.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
// The following functions did not appear in the base class until recently. // The following functions did not appear in the base class until recently.
// Overload them even if they are present in base class, just to make sure // Overload them even if they are present in base class, just to make sure

View File

@ -44,7 +44,7 @@ add_executable(kicad WIN32 MACOSX_BUNDLE
if(APPLE) if(APPLE)
set_target_properties(kicad PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(kicad PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
target_link_libraries(kicad common bitmaps ${wxWidgets_LIBRARIES}) target_link_libraries(kicad common bitmaps kbool polygon ${wxWidgets_LIBRARIES})
else(APPLE) else(APPLE)
target_link_libraries(kicad common bitmaps kbool polygon ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES}) target_link_libraries(kicad common bitmaps kbool polygon ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
endif(APPLE) endif(APPLE)

View File

@ -418,7 +418,7 @@ protected: ///< derived classes must implement
* part is done, then LIB::ReloadPart() must be called on this same part * part is done, then LIB::ReloadPart() must be called on this same part
* and all parts that inherit it must be reparsed. * and all parts that inherit it must be reparsed.
*/ */
virtual void WritePart( const STRING& aPartName, const STRING& aSExpression ) throw ( IO_ERROR ) = 0; virtual void WritePart( const STRING& aPartName, const STRING& aSExpression ) throw( IO_ERROR ) = 0;
protected: protected:
@ -444,7 +444,7 @@ public:
* will find it and load it into its containing LIB, even if that means * will find it and load it into its containing LIB, even if that means
* having to load a new LIB as given in the library table. * having to load a new LIB as given in the library table.
*/ */
static PART* GetPart( const LPID& aLogicalPartID ) throw ( IO_ERROR ); static PART* GetPart( const LPID& aLogicalPartID ) throw( IO_ERROR );
/** /**
* Function GetLib * Function GetLib
@ -572,9 +572,9 @@ public:
* There can be some self referential issues that mean all the parts in the PARTS_LIST * There can be some self referential issues that mean all the parts in the PARTS_LIST
* have to reparsed. * have to reparsed.
*/ */
virtual void WritePart( PART* aPart ) throw ( IO_ERROR ) = 0; virtual void WritePart( PART* aPart ) throw( IO_ERROR ) = 0;
virtual void SetPartBody( PART* aPart, const STRING& aSExpression ) throw ( IO_ERROR ); virtual void SetPartBody( PART* aPart, const STRING& aSExpression ) throw( IO_ERROR );
/** /**
* Function GetRevisions * Function GetRevisions

View File

@ -861,8 +861,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
itmp = m_SelLayerBox->GetChoice(); setActiveLayer( (size_t) m_SelLayerBox->GetLayerSelection());
setActiveLayer( (size_t) m_SelLayerBox->wxItemContainer::GetClientData( itmp ) );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh( true ); DrawPanel->Refresh( true );
break; break;

View File

@ -449,13 +449,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* aDC, int aHotkeyCode, EDA_BaseStruct* aIte
break; break;
case HK_ADD_VIA: // Switch to alternate layer and Place a via if a track is in progress case HK_ADD_VIA: // Switch to alternate layer and Place a via if a track is in progress
if( m_ID_current_state != ID_TRACK_BUTT )
return;
if( !itemCurrentlyEdited ) // no track in progress: switch layer only if( !itemCurrentlyEdited ) // no track in progress: switch layer only
{ {
Other_Layer_Route( NULL, aDC ); Other_Layer_Route( NULL, aDC );
break; break;
} }
if( m_ID_current_state != ID_TRACK_BUTT )
return;
if( GetCurItem()->Type() != TYPE_TRACK ) if( GetCurItem()->Type() != TYPE_TRACK )
return; return;
if( (GetCurItem()->m_Flags & IS_NEW) == 0 ) if( (GetCurItem()->m_Flags & IS_NEW) == 0 )

View File

@ -44,7 +44,6 @@
#define BUTT_SIZE_Y 18 #define BUTT_SIZE_Y 18
#define BUTT_VOID 4 #define BUTT_VOID 4
/* XPM */ /* XPM */
static const char * clear_xpm[] = { static const char * clear_xpm[] = {
"10 14 1 1", "10 14 1 1",
@ -152,9 +151,13 @@ wxBitmapButton* LAYER_WIDGET::makeColorButton( wxWindow* aParent, int aColor, in
// then create a wxBitmapButton from it. // then create a wxBitmapButton from it.
wxBitmap bitmap = makeBitmap( aColor ); wxBitmap bitmap = makeBitmap( aColor );
#ifndef __WXMAC__
wxBitmapButton* ret = new wxBitmapButton( aParent, aID, bitmap, wxBitmapButton* ret = new wxBitmapButton( aParent, aID, bitmap,
wxDefaultPosition, wxSize(BUTT_SIZE_X, BUTT_SIZE_Y), wxBORDER_RAISED ); wxDefaultPosition, wxSize(BUTT_SIZE_X, BUTT_SIZE_Y), wxBORDER_RAISED );
#else
wxBitmapButton* ret = new wxBitmapButton( aParent, aID, bitmap,
wxDefaultPosition, wxSize(BUTT_SIZE_X, BUTT_SIZE_Y));
#endif
// save the color value in the name, no where else to put it. // save the color value in the name, no where else to put it.
ret->SetName( makeColorTxt( aColor ) ); ret->SetName( makeColorTxt( aColor ) );
return ret; return ret;

View File

@ -32,26 +32,24 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
/** /** Create File Menu */
* File Menu
*/
wxMenu* filesMenu = new wxMenu; wxMenu* filesMenu = new wxMenu;
/* New */ // New
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, item = new wxMenuItem( filesMenu, ID_NEW_BOARD,
_( "&New" ), _( "&New" ),
_( "Clear current board and initialize a new one" ) ); _( "Clear current board and initialize a new one" ) );
item->SetBitmap( new_xpm ); item->SetBitmap( new_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Open */ // Open
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, item = new wxMenuItem( filesMenu, ID_LOAD_FILE,
_( "&Open\tCtrl+O" ), _( "&Open\tCtrl+O" ),
_( "Delete current board and load new board" ) ); _( "Delete current board and load new board" ) );
item->SetBitmap( open_xpm ); item->SetBitmap( open_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Load Recent submenu */ // Load Recent submenu
wxMenu* openRecentMenu = new wxMenu(); wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu ); wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
@ -60,54 +58,50 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
open_project_xpm ); open_project_xpm );
/* PCBNew Board */ // PCBNew Board
item = new wxMenuItem( filesMenu, ID_APPEND_FILE, item = new wxMenuItem( filesMenu, ID_APPEND_FILE,
_( "&Append Board" ), _( "&Append Board" ),
_( "Append another PCBNew board to the current loaded board" ) ); _( "Append another PCBNew board to the current loaded board" ) );
item->SetBitmap( import_xpm ); item->SetBitmap( import_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Separator */ // Separator
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
/* Save */ // Save
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save\tCtrl+S" ), _( "&Save\tCtrl+S" ),
_( "Save current board" ) ); _( "Save current board" ) );
item->SetBitmap( save_xpm ); item->SetBitmap( save_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Save As */ // Save As
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS, item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
_( "Save as..." ), _( "Save as..." ),
_( "Save the current board as.." ) ); _( "Save the current board as.." ) );
item->SetBitmap( save_as_xpm ); item->SetBitmap( save_as_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Separator */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
/* Revert */ // Revert
item = new wxMenuItem( filesMenu, ID_MENU_READ_LAST_SAVED_VERSION_BOARD, item = new wxMenuItem( filesMenu, ID_MENU_READ_LAST_SAVED_VERSION_BOARD,
_( "&Revert" ), _( "&Revert" ),
_( "Clear board and get previous saved version of board" ) ); _( "Clear board and get previous saved version of board" ) );
item->SetBitmap( jigsaw_xpm ); item->SetBitmap( jigsaw_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Rescue */ // Rescue
item = new wxMenuItem( filesMenu, ID_MENU_RECOVER_BOARD, _( "&Rescue" ), item = new wxMenuItem( filesMenu, ID_MENU_RECOVER_BOARD, _( "&Rescue" ),
_( "Clear old board and get last rescue file" ) ); _( "Clear old board and get last rescue file" ) );
item->SetBitmap( hammer_xpm ); item->SetBitmap( hammer_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
/* Separator */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
/* Fabrication Outputs submenu */ /* Fabrication Outputs submenu */
wxMenu* fabricationOutputsMenu = new wxMenu; wxMenu* fabricationOutputsMenu = new wxMenu;
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE, item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
_( "&Modules Position" ), _( "&Modules Position File" ),
_( "Generate modules position file for pick and place" ) ); _( "Generate modules position file for pick and place" ) );
item->SetBitmap( post_compo_xpm ); item->SetBitmap( post_compo_xpm );
fabricationOutputsMenu->Append( item ); fabricationOutputsMenu->Append( item );
@ -118,14 +112,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( post_drill_xpm ); item->SetBitmap( post_drill_xpm );
fabricationOutputsMenu->Append( item ); fabricationOutputsMenu->Append( item );
/* Component File */ // Component File
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_CMP_FILE, item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_CMP_FILE,
_( "&Component File" ), _( "&Component File" ),
_( "(Re)create components file for CvPcb" ) ); _( "(Re)create components file (*.cmp) for CvPcb" ) );
item->SetBitmap( save_cmpstuff_xpm ); item->SetBitmap( save_cmpstuff_xpm );
fabricationOutputsMenu->Append( item ); fabricationOutputsMenu->Append( item );
/* BOM File */ // BOM File
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD, item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
_( "&BOM File" ), _( "&BOM File" ),
_( "Create a bill of materials from schematic" ) ); _( "Create a bill of materials from schematic" ) );
@ -141,51 +135,41 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Import submenu */ /* Import submenu */
wxMenu* submenuImport = new wxMenu(); wxMenu* submenuImport = new wxMenu();
/* Specctra Session */ // Specctra Session
item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION, item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
_( "&Specctra Session" ), _( "&Specctra Session" ),
_( "Import a routed \"Specctra Session\" (*.ses) file" ) ); _( "Import a routed \"Specctra Session\" (*.ses) file" ) );
item->SetBitmap( import_xpm ); // @todo need better bitmap item->SetBitmap( import_xpm ); // @todo need better bitmap
submenuImport->Append( item ); submenuImport->Append( item );
/**
* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in
* specctra_import.cpp
* item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN,
* _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") );
* item->SetBitmap(export_xpm); // @todo need better bitmap
* submenuImport->Append(item);
*/
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ), ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm ); _( "Import files" ), import_xpm );
/* Export submenu */ /* Export submenu */
wxMenu* submenuexport = new wxMenu(); wxMenu* submenuexport = new wxMenu();
/* Specctra DSN */ // Specctra DSN
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_SPECCTRA, item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_SPECCTRA,
_( "&Specctra DSN" ), _( "&Specctra DSN" ),
_( "Export the current board to a \"Specctra DSN\" file" ) ); _( "Export the current board to a \"Specctra DSN\" file" ) );
item->SetBitmap( export_xpm ); item->SetBitmap( export_xpm );
submenuexport->Append( item ); submenuexport->Append( item );
/* GenCAD */ // GenCAD
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT, item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
_( "&GenCAD" ), _( "Export GenCAD format" ) ); _( "&GenCAD" ), _( "Export GenCAD format" ) );
item->SetBitmap( export_xpm ); item->SetBitmap( export_xpm );
submenuexport->Append( item ); submenuexport->Append( item );
/* Module Report */ // Module Report
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT, item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
_( "&Module Report" ), _( "&Module Report" ),
_( "Create a report of all modules on the current board" ) ); _( "Create a report of all modules on the current board" ) );
item->SetBitmap( tools_xpm ); item->SetBitmap( tools_xpm );
submenuexport->Append( item ); submenuexport->Append( item );
/* VRML */ // VRML
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_VRML, item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_VRML,
_( "&VRML" ), _( "&VRML" ),
_( "Export a VRML board representation" ) ); _( "Export a VRML board representation" ) );
@ -196,43 +180,40 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
ID_GEN_EXPORT_FILE, _( "&Export" ), ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm ); _( "Export board" ), export_xpm );
/* Separator */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
/* Print */ // Print
item = new wxMenuItem( filesMenu, wxID_PRINT, item = new wxMenuItem( filesMenu, wxID_PRINT,
_( "&Print\tCtrl+P" ), _( "&Print\tCtrl+P" ),
_( "Print board" ) ); _( "Print board" ) );
item->SetBitmap( print_button ); item->SetBitmap( print_button );
filesMenu->Append( item ); filesMenu->Append( item );
/* Print SVG */ // Create SVG file
item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG, item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG,
_( "Print S&VG" ), _( "Print S&VG" ),
_( "Plot board in Scalable Vector Graphics format" ) ); _( "Plot board in Scalable Vector Graphics format" ) );
item->SetBitmap( print_button ); item->SetBitmap( print_button );
filesMenu->Append( item ); filesMenu->Append( item );
/* Plot */ // Plot
item = new wxMenuItem( filesMenu, ID_GEN_PLOT, item = new wxMenuItem( filesMenu, ID_GEN_PLOT,
_( "&Plot" ), _( "&Plot" ),
_( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) ); _( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) );
item->SetBitmap( plot_xpm ); item->SetBitmap( plot_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
filesMenu->AppendSeparator();
/* Archive Footprints Submenu */
filesMenu->AppendSeparator();
wxMenu* submenuarchive = new wxMenu(); wxMenu* submenuarchive = new wxMenu();
/* Add New Footprints */ // Archive New Footprints
item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_NEW_MODULES, item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_NEW_MODULES,
_( "Add New Footprints" ), _( "Archive New Footprints" ),
_( "Archive new footprints only in a library (keep other footprints in this lib)" ) ); _( "Archive new footprints only in a library (keep other footprints in this lib)" ) );
item->SetBitmap( library_update_xpm ); item->SetBitmap( library_update_xpm );
submenuarchive->Append( item ); submenuarchive->Append( item );
/* Create FootPrint Archive */ // Create FootPrint Archive
item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_ALL_MODULES, item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_ALL_MODULES,
_( "Create Footprint Archive" ), _( "Create Footprint Archive" ),
_( "Archive all footprints in a library (old library will be deleted)" ) ); _( "Archive all footprints in a library (old library will be deleted)" ) );
@ -255,62 +236,54 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
#endif /* !defined( __WXMAC__ ) */ #endif /* !defined( __WXMAC__ ) */
/** Create Edit menu **/
/**
* Edit menu
*/
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
/* Undo */ // Undo
text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO ); text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
item = new wxMenuItem( editMenu, wxID_UNDO, text, item = new wxMenuItem( editMenu, wxID_UNDO, text,
HELP_UNDO, wxITEM_NORMAL ); HELP_UNDO, wxITEM_NORMAL );
item->SetBitmap( undo_xpm ); item->SetBitmap( undo_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Redo */ // Redo
text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO ); text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
item = new wxMenuItem( editMenu, wxID_REDO, text, item = new wxMenuItem( editMenu, wxID_REDO, text,
HELP_REDO, wxITEM_NORMAL ); HELP_REDO, wxITEM_NORMAL );
item->SetBitmap( redo_xpm ); item->SetBitmap( redo_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Delete */ // Delete
item = new wxMenuItem( editMenu, ID_PCB_DELETE_ITEM_BUTT, item = new wxMenuItem( editMenu, ID_PCB_DELETE_ITEM_BUTT,
_( "Delete" ), _( "Delete" ),
_( "Delete items" ) ); _( "Delete items" ) );
item->SetBitmap( delete_body_xpm ); item->SetBitmap( delete_body_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Separator */
editMenu->AppendSeparator(); editMenu->AppendSeparator();
/* Find */ // Find
text = AddHotkeyName( _( "&Find" ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM ); text = AddHotkeyName( _( "&Find" ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, item = new wxMenuItem( editMenu, ID_FIND_ITEMS,
text, HELP_FIND ); text, HELP_FIND );
item->SetBitmap( find_xpm ); item->SetBitmap( find_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Separator */
editMenu->AppendSeparator(); editMenu->AppendSeparator();
/* Global Deletions */ // Global Deletions
item = new wxMenuItem( editMenu, ID_PCB_GLOBAL_DELETE, item = new wxMenuItem( editMenu, ID_PCB_GLOBAL_DELETE,
_( "Global &Deletions" ), _( "Global &Deletions" ),
_( "Delete tracks, modules, texts... on board" ) ); _( "Delete tracks, modules, texts... on board" ) );
item->SetBitmap( general_deletions_xpm ); item->SetBitmap( general_deletions_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Cleanup Tracks and Vias */ // Cleanup Tracks and Vias
item = new wxMenuItem( editMenu, ID_MENU_PCB_CLEAN, item = new wxMenuItem( editMenu, ID_MENU_PCB_CLEAN,
_( "&Cleanup Tracks and Vias" ), _( "&Cleanup Tracks and Vias" ),
_( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) ); _( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
item->SetBitmap( delete_body_xpm ); item->SetBitmap( delete_body_xpm );
editMenu->Append( item ); editMenu->Append( item );
/* Swap Layers */ // Swap Layers
item = new wxMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS, item = new wxMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ), _( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on other layers" ) ); _( "Swap tracks on copper layers or drawings on other layers" ) );
@ -318,9 +291,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
editMenu->Append( item ); editMenu->Append( item );
/** /** Create View menu **/
* View menu
*/
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
/* Important Note for ZOOM IN and ZOOM OUT commands from menubar: /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
@ -334,7 +305,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
* in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators * in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
* for Zoom in and Zoom out sub menus * for Zoom in and Zoom out sub menus
*/ */
/* Zoom In */ // Zoom In
text = AddHotkeyName( _( "Zoom In" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_IN, false ); HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
@ -342,7 +313,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( zoom_in_xpm ); item->SetBitmap( zoom_in_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* Zoom Out */ // Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false ); HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
@ -351,7 +322,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( zoom_out_xpm ); item->SetBitmap( zoom_out_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* Fit on Screen */ // Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Fit on Screen" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO ); HK_ZOOM_AUTO );
@ -362,7 +333,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
/* Redraw */ // Redraw
text = AddHotkeyName( _( "Redraw" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Redraw" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW ); HK_ZOOM_REDRAW );
@ -371,18 +342,16 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxITEM_NORMAL ); wxITEM_NORMAL );
item->SetBitmap( zoom_redraw_xpm ); item->SetBitmap( zoom_redraw_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* Separator */
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
/* 3D Display */ // 3D Display
item = new wxMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME, item = new wxMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME,
_( "3D Display" ), _( "3D Display" ),
_( "Show board in 3D viewer" ) ); _( "Show board in 3D viewer" ) );
item->SetBitmap( show_3d_xpm ); item->SetBitmap( show_3d_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
/* List Nets */ // List Nets
item = new wxMenuItem( viewMenu, ID_MENU_LIST_NETS, item = new wxMenuItem( viewMenu, ID_MENU_LIST_NETS,
_( "&List Nets" ), _( "&List Nets" ),
_( "View a list of nets with names and id's" ) ); _( "View a list of nets with names and id's" ) );
@ -391,163 +360,150 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/** /** Create Place Menu **/
* Place Menu
*/
wxMenu* placeMenu = new wxMenu; wxMenu* placeMenu = new wxMenu;
/* Module */ // Module
text = AddHotkeyName( _( "Module" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Module" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_MODULE ); HK_ADD_MODULE, false );
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text, item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text,
_( "Place a module" ), wxITEM_NORMAL ); _( "Add modules" ), wxITEM_NORMAL );
item->SetBitmap( module_xpm ); item->SetBitmap( module_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Track */ // Track
text = AddHotkeyName( _( "Track" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Track" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK ); HK_ADD_NEW_TRACK, false );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text, item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Place a track" ), wxITEM_NORMAL ); _( "Add tracks and vias" ), wxITEM_NORMAL );
item->SetBitmap( add_tracks_xpm ); item->SetBitmap( add_tracks_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Zone */ // Zone
item = new wxMenuItem( placeMenu, ID_PCB_ZONES_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_ZONES_BUTT,
_( "Zone" ), _( "Zone" ),
_( "Place a filled zone" )); _( "Add filled zones" ));
item->SetBitmap( add_zone_xpm ); item->SetBitmap( add_zone_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Text */ // Text
item = new wxMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT,
_( "Text" ), _( "Text" ),
_( "Place text" ) ); _( "Add text on copper layers or graphic text" ) );
item->SetBitmap( add_text_xpm ); item->SetBitmap( add_text_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Graphics submenu */ // Graphic Arc
wxMenu *graphicsSubMenu = new wxMenu; item = new wxMenuItem( placeMenu, ID_PCB_ARC_BUTT,
/* Graphic Arc */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_ARC_BUTT,
_( "Arc" ), _( "Arc" ),
_( "Place a graphic arc" ) ); _( "Add graphic arc" ) );
item->SetBitmap( add_arc_xpm ); item->SetBitmap( add_arc_xpm );
graphicsSubMenu->Append( item );
/* Graphic Circle */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_CIRCLE_BUTT,
_( "Circle" ),
_( "Place a graphic circle" ));
item->SetBitmap( add_circle_xpm );
graphicsSubMenu->Append( item );
/* Dimension */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_DIMENSION_BUTT,
_( "Dimension" ),
_( "Place a dimension" ) );
item->SetBitmap( add_dimension_xpm );
graphicsSubMenu->Append( item );
/* Line or Polygon */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_ADD_LINE_BUTT,
_( "Line or Polygon" ),
_( "Place a graphic line or polygon" ));
item->SetBitmap( add_dashed_line_xpm );
graphicsSubMenu->Append( item );
/* Append graphics submenu to placeMenu */
placeMenu->AppendSubMenu(graphicsSubMenu, _( "Graphics" ));
/* Separator */
placeMenu->AppendSeparator();
/* Layer alignment target */
item = new wxMenuItem( placeMenu, ID_PCB_MIRE_BUTT,
_( "Layer alignment target" ),
_( "Place a layer alignment target" ));
item->SetBitmap( add_mires_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Drill & Place Offset */ // Graphic Circle
item = new wxMenuItem( placeMenu, ID_PCB_CIRCLE_BUTT,
_( "Circle" ),
_( "Add graphic circle" ));
item->SetBitmap( add_circle_xpm );
placeMenu->Append( item );
// Line or Polygon
item = new wxMenuItem( placeMenu, ID_PCB_ADD_LINE_BUTT,
_( "Line or Polygon" ),
_( "Add graphic line or polygon" ));
item->SetBitmap( add_dashed_line_xpm );
placeMenu->Append( item );
placeMenu->AppendSeparator();
// Dimension
item = new wxMenuItem( placeMenu, ID_PCB_DIMENSION_BUTT,
_( "Dimension" ),
_( "Add dimension" ) );
item->SetBitmap( add_dimension_xpm );
placeMenu->Append( item );
// Layer alignment target
item = new wxMenuItem( placeMenu, ID_PCB_MIRE_BUTT,
_( "Layer alignment target" ),
_( "Add layer alignment target" ));
item->SetBitmap( add_mires_xpm );
placeMenu->Append( item );
placeMenu->AppendSeparator();
// Drill & Place Offset
item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT,
_( "Drill and Place Offset" ), _( "Drill and Place Offset" ),
_( "Place the offset adjust for drill and place files" )); _( "Place the origin point for drill and place files" ));
item->SetBitmap( pcb_offset_xpm ); item->SetBitmap( pcb_offset_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Grid Origin */ // Grid Origin
item = new wxMenuItem( placeMenu, ID_PCB_PLACE_GRID_COORD_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_PLACE_GRID_COORD_BUTT,
_( "Grid Origin" ), _( "Grid Origin" ),
_( "Place origin point for the grid" )); _( "Set the origin point for the grid" ));
item->SetBitmap( grid_select_axis_xpm ); item->SetBitmap( grid_select_axis_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/** /** Create Preferences and configuration menu **/
* Preferences and configuration
*/
wxMenu* configmenu = new wxMenu; wxMenu* configmenu = new wxMenu;
/* Library */ // Library
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, item = new wxMenuItem( configmenu, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Setting libraries, directories and others..." ) ); _( "Setting libraries, directories and others..." ) );
item->SetBitmap( library_xpm ); item->SetBitmap( library_xpm );
configmenu->Append( item ); configmenu->Append( item );
/* Colors and Visibility are handled by the layers manager toolbar // Colors and Visibility are also handled by the layers manager toolbar
* that can be shown or hidden
*/
item = new wxMenuItem( configmenu, ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, item = new wxMenuItem( configmenu, ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
_( "Hide &Layers Manager" ), _( "Hide &Layers Manager" ),
HELP_SHOW_HIDE_LAYERMANAGER ); HELP_SHOW_HIDE_LAYERMANAGER );
item->SetBitmap( layers_manager_xpm ); item->SetBitmap( layers_manager_xpm );
configmenu->Append( item ); configmenu->Append( item );
/* General */ // General
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP,
_( "&General" ), _( "&General" ),
_( "Select general options for PCBnew" ) ); _( "Select general options for PCBnew" ) );
item->SetBitmap( preference_xpm ); item->SetBitmap( preference_xpm );
configmenu->Append( item ); configmenu->Append( item );
/* Display */ //Display
item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
_( "&Display" ), _( "&Display" ),
_( "Select how items (pads, tracks texts ... ) are displayed" ) ); _( "Select how items (pads, tracks texts ... ) are displayed" ) );
item->SetBitmap( display_options_xpm ); item->SetBitmap( display_options_xpm );
configmenu->Append( item ); configmenu->Append( item );
/* Dimensions submenu */ /* Create Dimensions submenu */
wxMenu* dimensionsMenu = new wxMenu; wxMenu* dimensionsMenu = new wxMenu;
/* Grid */ // Grid
item = new wxMenuItem( dimensionsMenu, ID_PCB_USER_GRID_SETUP, item = new wxMenuItem( dimensionsMenu, ID_PCB_USER_GRID_SETUP,
_( "Grid" ), _( "Grid" ),
_( "Adjust user grid dimensions" ) ); _( "Adjust user grid dimensions" ) );
item->SetBitmap( grid_xpm ); item->SetBitmap( grid_xpm );
dimensionsMenu->Append( item ); dimensionsMenu->Append( item );
/* Text and Drawings */ // Text and Drawings
item = new wxMenuItem( dimensionsMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP, item = new wxMenuItem( dimensionsMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Texts and Drawings" ), _( "Texts and Drawings" ),
_( "Adjust dimensions for texts and drawings" ) ); _( "Adjust dimensions for texts and drawings" ) );
item->SetBitmap( options_text_xpm ); item->SetBitmap( options_text_xpm );
dimensionsMenu->Append( item ); dimensionsMenu->Append( item );
/* Pads */ // Pads
item = new wxMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP, item = new wxMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP,
_( "Pads" ), _( "Pads" ),
_( "Adjust default pad characteristics" ) ); _( "Adjust default pad characteristics" ) );
item->SetBitmap( pad_xpm ); item->SetBitmap( pad_xpm );
dimensionsMenu->Append( item ); dimensionsMenu->Append( item );
/* Pads Mask Clearance */ // Pads Mask Clearance
item = new wxMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE, item = new wxMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE,
_( "Pads Mask Clearance" ), _( "Pads Mask Clearance" ),
_( "Adjust the global clearance between pads and the solder resist mask" ) ); _( "Adjust the global clearance between pads and the solder resist mask" ) );
@ -555,7 +511,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
dimensionsMenu->Append( item ); dimensionsMenu->Append( item );
/* Save dimension preferences */ // Save dimension preferences
dimensionsMenu->AppendSeparator(); dimensionsMenu->AppendSeparator();
item = new wxMenuItem( dimensionsMenu, ID_CONFIG_SAVE, item = new wxMenuItem( dimensionsMenu, ID_CONFIG_SAVE,
_( "&Save" ), _( "&Save" ),
@ -569,23 +525,21 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
_( "Global dimensions preferences" ), _( "Global dimensions preferences" ),
add_dimension_xpm ); add_dimension_xpm );
/* Language submenu */ // Language submenu
wxGetApp().AddMenuLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
/* Hotkey submenu */ // Hotkey submenu
AddHotkeyConfigMenu( configmenu ); AddHotkeyConfigMenu( configmenu );
/* Separator */
configmenu->AppendSeparator(); configmenu->AppendSeparator();
/* Save Preferences */ // Save Preferences
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
_( "&Save Preferences" ), _( "&Save Preferences" ),
_( "Save application preferences" ) ); _( "Save application preferences" ) );
item->SetBitmap( save_setup_xpm ); item->SetBitmap( save_setup_xpm );
configmenu->Append( item ); configmenu->Append( item );
/* Read Preferences */ // Read Preferences
item = new wxMenuItem( configmenu, ID_CONFIG_READ, item = new wxMenuItem( configmenu, ID_CONFIG_READ,
_( "&Read Preferences" ), _( "&Read Preferences" ),
_( "Read application preferences" ) ); _( "Read application preferences" ) );
@ -624,7 +578,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Contents */ /* Contents */
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, item = new wxMenuItem( helpMenu, ID_GENERAL_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the PCBnew manual" ) ); _( "Open the on line PCBnew documentation" ) );
item->SetBitmap( online_help_xpm ); item->SetBitmap( online_help_xpm );
helpMenu->Append( item ); helpMenu->Append( item );

View File

@ -341,7 +341,10 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
// wxAuiPaneInfo items to manage them. // wxAuiPaneInfo items to manage them.
vert.TopDockable( false ).BottomDockable( false ); vert.TopDockable( false ).BottomDockable( false );
horiz.LeftDockable( false ).RightDockable( false ); horiz.LeftDockable( false ).RightDockable( false );
horiz.ToolbarPane().Gripper( false );
// Create a template from the horiz wxAuiPaneInfo, specific to horizontal toolbars:
wxAuiPaneInfo horiz_tb( horiz );
horiz_tb.ToolbarPane().Gripper( false );
// Create a wxAuiPaneInfo for the Layers Manager, not derived from the template. // Create a wxAuiPaneInfo for the Layers Manager, not derived from the template.
// LAYER_WIDGET is floatable, but initially docked at far right // LAYER_WIDGET is floatable, but initially docked at far right
@ -356,13 +359,13 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
if( m_HToolBar ) if( m_HToolBar )
{ {
m_auimgr.AddPane( m_HToolBar, m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) ); wxAuiPaneInfo( horiz_tb ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
} }
if( m_AuxiliaryToolBar ) if( m_AuxiliaryToolBar )
{ {
m_auimgr.AddPane( m_AuxiliaryToolBar, m_auimgr.AddPane( m_AuxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_AuxiliaryToolBar" ) ).Top().Row( 1 ) ); wxAuiPaneInfo( horiz_tb ).Name( wxT( "m_AuxiliaryToolBar" ) ).Top().Row( 1 ) );
} }
if( m_AuxVToolBar ) if( m_AuxVToolBar )
@ -379,7 +382,8 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
{ {
m_auimgr.AddPane( m_OptionsToolBar, m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left()
.ToolbarPane().Gripper( false )); .ToolbarPane().Gripper( false ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
m_show_layer_manager_tools ); m_show_layer_manager_tools );
m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools ); m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );

View File

@ -533,7 +533,7 @@ int SPECCTRA_DB::findLayerName( const std::string& aLayerName ) const
} }
void SPECCTRA_DB::ThrowIOError( const wxChar* fmt, ... ) throw( IOError ) void SPECCTRA_DB::ThrowIOError( const wxChar* fmt, ... ) throw( IO_ERROR )
{ {
wxString errText; wxString errText;
va_list args; va_list args;
@ -542,18 +542,18 @@ void SPECCTRA_DB::ThrowIOError( const wxChar* fmt, ... ) throw( IOError )
errText.PrintfV( fmt, args ); errText.PrintfV( fmt, args );
va_end( args ); va_end( args );
throw IOError( errText ); throw IO_ERROR( errText );
} }
void SPECCTRA_DB::expecting( const char* text ) throw( IOError ) void SPECCTRA_DB::expecting( const char* text ) throw( IO_ERROR )
{ {
wxString errText = CONV_FROM_UTF8( text ); wxString errText = CONV_FROM_UTF8( text );
lexer->Expecting( errText ); lexer->Expecting( errText );
} }
void SPECCTRA_DB::unexpected( const char* text ) throw( IOError ) void SPECCTRA_DB::unexpected( const char* text ) throw( IO_ERROR )
{ {
wxString errText = CONV_FROM_UTF8( text ); wxString errText = CONV_FROM_UTF8( text );
lexer->Unexpected( errText ); lexer->Unexpected( errText );
@ -566,7 +566,7 @@ DSN_T SPECCTRA_DB::nextTok()
return ret; return ret;
} }
void SPECCTRA_DB::readCOMPnPIN( std::string* component_id, std::string* pin_id ) throw( IOError ) void SPECCTRA_DB::readCOMPnPIN( std::string* component_id, std::string* pin_id ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -609,7 +609,7 @@ void SPECCTRA_DB::readCOMPnPIN( std::string* component_id, std::string* pin_id )
} }
void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IOError ) void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -675,7 +675,7 @@ void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IOError )
} }
void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IOError ) void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR )
{ {
FILE* fp = wxFopen( filename, wxT("r") ); FILE* fp = wxFopen( filename, wxT("r") );
@ -704,7 +704,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IOError )
} }
void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IOError ) void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR )
{ {
FILE* fp = wxFopen( filename, wxT("r") ); FILE* fp = wxFopen( filename, wxT("r") );
@ -733,7 +733,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IOError )
} }
void SPECCTRA_DB::doPCB( PCB* growth ) throw( IOError ) void SPECCTRA_DB::doPCB( PCB* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -838,7 +838,7 @@ void SPECCTRA_DB::doPCB( PCB* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPARSER( PARSER* growth ) throw( IOError ) void SPECCTRA_DB::doPARSER( PARSER* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
std::string const1; std::string const1;
@ -977,7 +977,7 @@ void SPECCTRA_DB::doPARSER( PARSER* growth ) throw( IOError )
} }
void SPECCTRA_DB::doRESOLUTION( UNIT_RES* growth ) throw(IOError) void SPECCTRA_DB::doRESOLUTION( UNIT_RES* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1004,7 +1004,7 @@ void SPECCTRA_DB::doRESOLUTION( UNIT_RES* growth ) throw(IOError)
} }
void SPECCTRA_DB::doUNIT( UNIT_RES* growth ) throw(IOError) void SPECCTRA_DB::doUNIT( UNIT_RES* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1025,7 +1025,7 @@ void SPECCTRA_DB::doUNIT( UNIT_RES* growth ) throw(IOError)
} }
void SPECCTRA_DB::doLAYER_PAIR( LAYER_PAIR* growth ) throw( IOError ) void SPECCTRA_DB::doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR )
{ {
needSYMBOL(); needSYMBOL();
growth->layer_id0 = lexer->CurText(); growth->layer_id0 = lexer->CurText();
@ -1041,7 +1041,7 @@ void SPECCTRA_DB::doLAYER_PAIR( LAYER_PAIR* growth ) throw( IOError )
} }
void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IOError ) void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -1060,7 +1060,7 @@ void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IOEr
} }
void SPECCTRA_DB::doSTRUCTURE( STRUCTURE* growth ) throw(IOError) void SPECCTRA_DB::doSTRUCTURE( STRUCTURE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -1194,7 +1194,7 @@ L_place:
} }
void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IOError ) void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR )
{ {
/* /*
<structure_out_descriptor >::= <structure_out_descriptor >::=
@ -1237,7 +1237,7 @@ void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IOError )
} }
void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IOError ) void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1326,7 +1326,7 @@ void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IOError )
} }
void SPECCTRA_DB::doWINDOW( WINDOW* growth ) throw( IOError ) void SPECCTRA_DB::doWINDOW( WINDOW* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1378,7 +1378,7 @@ void SPECCTRA_DB::doWINDOW( WINDOW* growth ) throw( IOError )
} }
void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IOError ) void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1425,7 +1425,7 @@ void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPATH( PATH* growth ) throw( IOError ) void SPECCTRA_DB::doPATH( PATH* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1473,7 +1473,7 @@ void SPECCTRA_DB::doPATH( PATH* growth ) throw( IOError )
} }
void SPECCTRA_DB::doRECTANGLE( RECTANGLE* growth ) throw( IOError ) void SPECCTRA_DB::doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR )
{ {
needSYMBOL(); needSYMBOL();
growth->layer_id = lexer->CurText(); growth->layer_id = lexer->CurText();
@ -1498,7 +1498,7 @@ void SPECCTRA_DB::doRECTANGLE( RECTANGLE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCIRCLE( CIRCLE* growth ) throw( IOError ) void SPECCTRA_DB::doCIRCLE( CIRCLE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -1526,7 +1526,7 @@ void SPECCTRA_DB::doCIRCLE( CIRCLE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doQARC( QARC* growth ) throw( IOError ) void SPECCTRA_DB::doQARC( QARC* growth ) throw( IO_ERROR )
{ {
needSYMBOL(); needSYMBOL();
growth->layer_id = lexer->CurText(); growth->layer_id = lexer->CurText();
@ -1550,7 +1550,7 @@ void SPECCTRA_DB::doQARC( QARC* growth ) throw( IOError )
} }
void SPECCTRA_DB::doSTRINGPROP( STRINGPROP* growth ) throw( IOError ) void SPECCTRA_DB::doSTRINGPROP( STRINGPROP* growth ) throw( IO_ERROR )
{ {
needSYMBOL(); needSYMBOL();
growth->value = lexer->CurText(); growth->value = lexer->CurText();
@ -1558,7 +1558,7 @@ void SPECCTRA_DB::doSTRINGPROP( STRINGPROP* growth ) throw( IOError )
} }
void SPECCTRA_DB::doTOKPROP( TOKPROP* growth ) throw( IOError ) void SPECCTRA_DB::doTOKPROP( TOKPROP* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1571,7 +1571,7 @@ void SPECCTRA_DB::doTOKPROP( TOKPROP* growth ) throw( IOError )
} }
void SPECCTRA_DB::doVIA( VIA* growth ) throw( IOError ) void SPECCTRA_DB::doVIA( VIA* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -1600,7 +1600,7 @@ void SPECCTRA_DB::doVIA( VIA* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IOError ) void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -1647,7 +1647,7 @@ void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPROPERTIES( PROPERTIES* growth ) throw( IOError ) void SPECCTRA_DB::doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
PROPERTY property; // construct it once here, append multiple times. PROPERTY property; // construct it once here, append multiple times.
@ -1670,7 +1670,7 @@ void SPECCTRA_DB::doPROPERTIES( PROPERTIES* growth ) throw( IOError )
} }
void SPECCTRA_DB::doLAYER( LAYER* growth ) throw( IOError ) void SPECCTRA_DB::doLAYER( LAYER* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1792,7 +1792,7 @@ void SPECCTRA_DB::doLAYER( LAYER* growth ) throw( IOError )
} }
void SPECCTRA_DB::doRULE( RULE* growth ) throw( IOError ) void SPECCTRA_DB::doRULE( RULE* growth ) throw( IO_ERROR )
{ {
std::string builder; std::string builder;
int bracketNesting = 1; // we already saw the opening T_LEFT int bracketNesting = 1; // we already saw the opening T_LEFT
@ -1838,7 +1838,7 @@ void SPECCTRA_DB::doRULE( RULE* growth ) throw( IOError )
#if 0 #if 0
void SPECCTRA_DB::doPLACE_RULE( PLACE_RULE* growth, bool expect_object_type ) throw( IOError ) void SPECCTRA_DB::doPLACE_RULE( PLACE_RULE* growth, bool expect_object_type ) throw( IO_ERROR )
{ {
/* (place_rule [<structure_place_rule_object> ] /* (place_rule [<structure_place_rule_object> ]
{[<spacing_descriptor> | {[<spacing_descriptor> |
@ -1924,7 +1924,7 @@ void SPECCTRA_DB::doPLACE_RULE( PLACE_RULE* growth, bool expect_object_type ) th
#endif #endif
void SPECCTRA_DB::doREGION( REGION* growth ) throw( IOError ) void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -1993,7 +1993,7 @@ void SPECCTRA_DB::doREGION( REGION* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IOError ) void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2038,7 +2038,7 @@ void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCLASSES( CLASSES* growth ) throw( IOError ) void SPECCTRA_DB::doCLASSES( CLASSES* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2061,7 +2061,7 @@ void SPECCTRA_DB::doCLASSES( CLASSES* growth ) throw( IOError )
} }
void SPECCTRA_DB::doGRID( GRID* growth ) throw( IOError ) void SPECCTRA_DB::doGRID( GRID* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2126,7 +2126,7 @@ void SPECCTRA_DB::doGRID( GRID* growth ) throw( IOError )
} }
void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) throw( IOError ) void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -2151,7 +2151,7 @@ void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IOError ) void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2266,7 +2266,7 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IOError ) void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2296,7 +2296,7 @@ void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IOError ) void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -2355,7 +2355,7 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IOError ) void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2455,7 +2455,7 @@ void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IOError )
} }
void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IOError ) void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -2538,7 +2538,7 @@ L_done_that:
} }
void SPECCTRA_DB::doIMAGE( IMAGE* growth ) throw( IOError ) void SPECCTRA_DB::doIMAGE( IMAGE* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2634,7 +2634,7 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doPIN( PIN* growth ) throw( IOError ) void SPECCTRA_DB::doPIN( PIN* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
@ -2681,7 +2681,7 @@ void SPECCTRA_DB::doPIN( PIN* growth ) throw( IOError )
} }
void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IOError ) void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -2735,7 +2735,7 @@ void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IOError )
} }
void SPECCTRA_DB::doNET( NET* growth ) throw( IOError ) void SPECCTRA_DB::doNET( NET* growth ) throw( IO_ERROR )
{ {
DSN_T tok = nextTok(); DSN_T tok = nextTok();
PIN_REFS* pin_refs; PIN_REFS* pin_refs;
@ -2875,7 +2875,7 @@ L_pins:
} }
void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IOError ) void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -2913,7 +2913,7 @@ void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IOError ) void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3023,7 +3023,7 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IOError )
} }
void SPECCTRA_DB::doNETWORK( NETWORK* growth ) throw( IOError ) void SPECCTRA_DB::doNETWORK( NETWORK* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3068,7 +3068,7 @@ void SPECCTRA_DB::doNETWORK( NETWORK* growth ) throw( IOError )
} }
void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) throw( IOError ) void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3086,7 +3086,7 @@ void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) throw( IOError )
} }
void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IOError ) void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3172,7 +3172,7 @@ void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IOError )
} }
void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IOError ) void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3295,7 +3295,7 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) throw( IOError ) void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
POINT point; POINT point;
@ -3399,7 +3399,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) throw( IOError )
} }
void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IOError ) void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3455,7 +3455,7 @@ void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IOError )
} }
void SPECCTRA_DB::doANCESTOR( ANCESTOR* growth ) throw( IOError ) void SPECCTRA_DB::doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3493,7 +3493,7 @@ void SPECCTRA_DB::doANCESTOR( ANCESTOR* growth ) throw( IOError )
} }
void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IOError ) void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3549,7 +3549,7 @@ void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IOError )
} }
void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IOError ) void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3626,7 +3626,7 @@ void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IOError )
} }
void SPECCTRA_DB::doWAS_IS( WAS_IS* growth ) throw( IOError ) void SPECCTRA_DB::doWAS_IS( WAS_IS* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
PIN_PAIR empty( growth ); PIN_PAIR empty( growth );
@ -3667,7 +3667,7 @@ void SPECCTRA_DB::doWAS_IS( WAS_IS* growth ) throw( IOError )
} }
void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IOError ) void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3743,7 +3743,7 @@ void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IOError )
} }
void SPECCTRA_DB::doNET_OUT( NET_OUT* growth ) throw( IOError ) void SPECCTRA_DB::doNET_OUT( NET_OUT* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
@ -3811,7 +3811,7 @@ void SPECCTRA_DB::doNET_OUT( NET_OUT* growth ) throw( IOError )
} }
void SPECCTRA_DB::doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IOError ) void SPECCTRA_DB::doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IO_ERROR )
{ {
DSN_T tok; DSN_T tok;
PIN_REF empty(growth); PIN_REF empty(growth);
@ -3847,7 +3847,7 @@ void SPECCTRA_DB::doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IOError )
} }
void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IOError ) void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IO_ERROR )
{ {
if( pcb ) if( pcb )
{ {
@ -3938,7 +3938,7 @@ UNIT_RES* ELEM::GetUnits() const
} }
void ELEM::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void ELEM::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s\n", Name() ); out->Print( nestLevel, "(%s\n", Name() );
@ -3948,7 +3948,7 @@ void ELEM::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
} }
void ELEM_HOLDER::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void ELEM_HOLDER::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( int i=0; i<Length(); ++i ) for( int i=0; i<Length(); ++i )
{ {
@ -4061,7 +4061,7 @@ PARSER::PARSER( ELEM* aParent ) :
} }
void PARSER::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void PARSER::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(string_quote %c)\n", string_quote ); out->Print( nestLevel, "(string_quote %c)\n", string_quote );
out->Print( nestLevel, "(space_in_quoted_tokens %s)\n", space_in_quoted_tokens ? "on" : "off" ); out->Print( nestLevel, "(space_in_quoted_tokens %s)\n", space_in_quoted_tokens ? "on" : "off" );
@ -4097,7 +4097,7 @@ void PARSER::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOErro
} }
void PLACE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void PLACE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
bool useMultiLine; bool useMultiLine;

View File

@ -554,9 +554,9 @@ struct POINT
* SPECCTRA DSN format. * SPECCTRA DSN format.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
out->Print( nestLevel, " %.6g %.6g", x, y ); out->Print( nestLevel, " %.6g %.6g", x, y );
} }
@ -576,9 +576,9 @@ struct PROPERTY
* SPECCTRA DSN format. * SPECCTRA DSN format.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
const char* quoteName = out->GetQuoteChar( name.c_str() ); const char* quoteName = out->GetQuoteChar( name.c_str() );
const char* quoteValue = out->GetQuoteChar( value.c_str() ); const char* quoteValue = out->GetQuoteChar( value.c_str() );
@ -654,9 +654,9 @@ public:
* SPECCTRA DSN format. * SPECCTRA DSN format.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
/** /**
@ -666,9 +666,9 @@ public:
* wrapper is not included. * wrapper is not included.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
// overridden in ELEM_HOLDER // overridden in ELEM_HOLDER
} }
@ -700,7 +700,7 @@ public:
{ {
} }
virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
//-----< list operations >-------------------------------------------- //-----< list operations >--------------------------------------------
@ -796,7 +796,7 @@ public:
PARSER( ELEM* aParent ); PARSER( ELEM* aParent );
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
}; };
@ -831,7 +831,7 @@ public:
DSN_T GetEngUnits() const { return units; } DSN_T GetEngUnits() const { return units; }
int GetValue() const { return value; } int GetValue() const { return value; }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( type == T_unit ) if( type == T_unit )
out->Print( nestLevel, "(%s %s)\n", Name(), out->Print( nestLevel, "(%s %s)\n", Name(),
@ -874,7 +874,7 @@ public:
point1.FixNegativeZero(); point1.FixNegativeZero();
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* newline = nestLevel ? "\n" : ""; const char* newline = nestLevel ? "\n" : "";
@ -907,7 +907,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s", Name() ); out->Print( nestLevel, "(%s", Name() );
@ -953,7 +953,7 @@ public:
delete rule; delete rule;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s", Name() ); out->Print( nestLevel, "(%s", Name() );
@ -1012,7 +1012,7 @@ public:
aperture_width = aWidth; aperture_width = aWidth;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* newline = nestLevel ? "\n" : ""; const char* newline = nestLevel ? "\n" : "";
@ -1071,7 +1071,7 @@ public:
delete rectangle; delete rectangle;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s\n", Name() ); out->Print( nestLevel, "(%s\n", Name() );
@ -1104,7 +1104,7 @@ public:
diameter = 0.0; diameter = 0.0;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* newline = nestLevel ? "\n" : ""; const char* newline = nestLevel ? "\n" : "";
@ -1151,7 +1151,7 @@ public:
aperture_width = 0.0; aperture_width = 0.0;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* newline = nestLevel ? "\n" : ""; const char* newline = nestLevel ? "\n" : "";
@ -1233,7 +1233,7 @@ public:
} }
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s ", Name() ); out->Print( nestLevel, "(%s ", Name() );
@ -1316,7 +1316,7 @@ public:
windows.push_back( aWindow ); windows.push_back( aWindow );
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* newline = "\n"; const char* newline = "\n";
@ -1393,7 +1393,7 @@ public:
padstacks.push_back( aViaName ); padstacks.push_back( aViaName );
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const int RIGHTMARGIN = 80; const int RIGHTMARGIN = 80;
int perLine = out->Print( nestLevel, "(%s", Name() ); int perLine = out->Print( nestLevel, "(%s", Name() );
@ -1447,7 +1447,7 @@ public:
{ {
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( STRINGS::iterator i=class_ids.begin(); i!=class_ids.end(); ++i ) for( STRINGS::iterator i=class_ids.begin(); i!=class_ids.end(); ++i )
{ {
@ -1485,7 +1485,7 @@ public:
delete classes; delete classes;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( classes ) if( classes )
classes->Format( out, nestLevel ); classes->Format( out, nestLevel );
@ -1515,7 +1515,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s\n", Name() ); out->Print( nestLevel, "(%s\n", Name() );
@ -1570,7 +1570,7 @@ public:
delete rules; delete rules;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( name.c_str() ); const char* quote = out->GetQuoteChar( name.c_str() );
@ -1644,7 +1644,7 @@ public:
layer_weight = 0.0; layer_weight = 0.0;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote0 = out->GetQuoteChar( layer_id0.c_str() ); const char* quote0 = out->GetQuoteChar( layer_id0.c_str() );
const char* quote1 = out->GetQuoteChar( layer_id1.c_str() ); const char* quote1 = out->GetQuoteChar( layer_id1.c_str() );
@ -1671,7 +1671,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s\n", Name() ); out->Print( nestLevel, "(%s\n", Name() );
@ -1717,7 +1717,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s %s)\n", Name(), out->Print( nestLevel, "(%s %s)\n", Name(),
GetTokenText( value ) ); GetTokenText( value ) );
@ -1743,7 +1743,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( value.c_str() ); const char* quote = out->GetQuoteChar( value.c_str() );
@ -1786,7 +1786,7 @@ public:
delete rules; delete rules;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( region_id.size() ) if( region_id.size() )
{ {
@ -1834,7 +1834,7 @@ public:
image_type= T_NONE; image_type= T_NONE;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s %s %.6g", out->Print( nestLevel, "(%s %s %.6g",
Name(), Name(),
@ -1878,7 +1878,7 @@ public:
delete rules; delete rules;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( LAYERS::iterator i=layers.begin(); i!=layers.end(); ++i ) for( LAYERS::iterator i=layers.begin(); i!=layers.end(); ++i )
i->Format( out, nestLevel ); i->Format( out, nestLevel );
@ -1962,7 +1962,7 @@ public:
place_boundary->SetParent( this ); place_boundary->SetParent( this );
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( unit ) if( unit )
unit->Format( out, nestLevel ); unit->Format( out, nestLevel );
@ -2094,7 +2094,7 @@ public:
rotation = aRotation; rotation = aRotation;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
}; };
typedef boost::ptr_vector<PLACE> PLACES; typedef boost::ptr_vector<PLACE> PLACES;
@ -2131,7 +2131,7 @@ public:
*/ */
// static int Compare( IMAGE* lhs, IMAGE* rhs ); // static int Compare( IMAGE* lhs, IMAGE* rhs );
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( image_id.c_str() ); const char* quote = out->GetQuoteChar( image_id.c_str() );
out->Print( nestLevel, "(%s %s%s%s\n", Name(), out->Print( nestLevel, "(%s %s%s%s\n", Name(),
@ -2142,7 +2142,7 @@ public:
out->Print( nestLevel, ")\n" ); out->Print( nestLevel, ")\n" );
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( PLACES::iterator i=places.begin(); i!=places.end(); ++i ) for( PLACES::iterator i=places.begin(); i!=places.end(); ++i )
i->Format( out, nestLevel ); i->Format( out, nestLevel );
@ -2195,7 +2195,7 @@ public:
return added; return added;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( unit ) if( unit )
unit->Format( out, nestLevel ); unit->Format( out, nestLevel );
@ -2261,7 +2261,7 @@ public:
connect = aConnect; connect = aConnect;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s ", Name() ); out->Print( nestLevel, "(%s ", Name() );
@ -2320,7 +2320,7 @@ public:
vertex.FixNegativeZero(); vertex.FixNegativeZero();
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( padstack_id.c_str() ); const char* quote = out->GetQuoteChar( padstack_id.c_str() );
if( isRotated ) if( isRotated )
@ -2405,7 +2405,7 @@ public:
return image_id; return image_id;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
std::string imageId = GetImageId(); std::string imageId = GetImageId();
@ -2420,7 +2420,7 @@ public:
} }
// this is here for makeHash() // this is here for makeHash()
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( side != T_both ) if( side != T_both )
out->Print( 0, " (side %s)", GetTokenText( side ) ); out->Print( 0, " (side %s)", GetTokenText( side ) );
@ -2520,7 +2520,7 @@ public:
padstack_id = aPadstackId; padstack_id = aPadstackId;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( padstack_id.c_str() ); const char* quote = out->GetQuoteChar( padstack_id.c_str() );
@ -2534,7 +2534,7 @@ public:
// this factored out for use by Compare() // this factored out for use by Compare()
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( unit ) if( unit )
unit->Format( out, nestLevel ); unit->Format( out, nestLevel );
@ -2763,7 +2763,7 @@ public:
return NULL; return NULL;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( unit ) if( unit )
unit->Format( out, nestLevel ); unit->Format( out, nestLevel );
@ -2808,7 +2808,7 @@ struct PIN_REF : public ELEM
* is like Format() but is not virual and returns the number of characters * is like Format() but is not virual and returns the number of characters
* that were output. * that were output.
*/ */
int FormatIt( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) int FormatIt( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
// only print the newline if there is a nest level, and make // only print the newline if there is a nest level, and make
// the quotes unconditional on this one. // the quotes unconditional on this one.
@ -2852,7 +2852,7 @@ public:
delete rules; delete rules;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
// no quoting on these two, the lexer preserved the quotes on input // no quoting on these two, the lexer preserved the quotes on input
out->Print( nestLevel, "(%s %s %s ", out->Print( nestLevel, "(%s %s %s ",
@ -2910,7 +2910,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s", Name() ); out->Print( nestLevel, "(%s", Name() );
@ -2993,7 +2993,7 @@ public:
return -1; return -1;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( net_id.c_str() ); const char* quote = out->GetQuoteChar( net_id.c_str() );
const char* space = " "; const char* space = " ";
@ -3070,7 +3070,7 @@ public:
{ {
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( FROMTOS::iterator i=fromtos.begin(); i!=fromtos.end(); ++i ) for( FROMTOS::iterator i=fromtos.begin(); i!=fromtos.end(); ++i )
i->Format( out, nestLevel ); i->Format( out, nestLevel );
@ -3117,7 +3117,7 @@ public:
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( class_id.c_str() ); const char* quote = out->GetQuoteChar( class_id.c_str() );
@ -3186,7 +3186,7 @@ public:
{ {
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( NETS::iterator i=nets.begin(); i!=nets.end(); ++i ) for( NETS::iterator i=nets.begin(); i!=nets.end(); ++i )
i->Format( out, nestLevel ); i->Format( out, nestLevel );
@ -3267,7 +3267,7 @@ public:
} }
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
out->Print( nestLevel, "(%s ", Name() ); out->Print( nestLevel, "(%s ", Name() );
@ -3351,7 +3351,7 @@ public:
return padstack_id; return padstack_id;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( padstack_id.c_str() ); const char* quote = out->GetQuoteChar( padstack_id.c_str() );
@ -3477,7 +3477,7 @@ public:
delete unit; delete unit;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( unit ) if( unit )
unit->Format( out, nestLevel ); unit->Format( out, nestLevel );
@ -3540,7 +3540,7 @@ public:
delete wiring; delete wiring;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( pcbname.c_str() ); const char* quote = out->GetQuoteChar( pcbname.c_str() );
@ -3603,7 +3603,7 @@ public:
time_stamp = time(NULL); time_stamp = time(NULL);
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
char temp[80]; char temp[80];
struct tm* tmp; struct tm* tmp;
@ -3647,7 +3647,7 @@ public:
time_stamp = time(NULL); time_stamp = time(NULL);
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( ANCESTORS::iterator i=ancestors.begin(); i!=ancestors.end(); ++i ) for( ANCESTORS::iterator i=ancestors.begin(); i!=ancestors.end(); ++i )
i->Format( out, nestLevel ); i->Format( out, nestLevel );
@ -3690,7 +3690,7 @@ public:
{ {
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
bool singleLine = pin_refs.size() <= 1; bool singleLine = pin_refs.size() <= 1;
out->Print( nestLevel, "(%s", Name() ); out->Print( nestLevel, "(%s", Name() );
@ -3749,7 +3749,7 @@ public:
delete rules; delete rules;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( net_id.c_str() ); const char* quote = out->GetQuoteChar( net_id.c_str() );
@ -3816,7 +3816,7 @@ public:
return ELEM::GetUnits(); return ELEM::GetUnits();
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
if( resolution ) if( resolution )
resolution->Format( out, nestLevel ); resolution->Format( out, nestLevel );
@ -3879,7 +3879,7 @@ public:
{ {
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
for( PIN_PAIRS::iterator i=pin_pairs.begin(); i!=pin_pairs.end(); ++i ) for( PIN_PAIRS::iterator i=pin_pairs.begin(); i!=pin_pairs.end(); ++i )
{ {
@ -3936,7 +3936,7 @@ public:
delete route; delete route;
} }
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
const char* quote = out->GetQuoteChar( session_id.c_str() ); const char* quote = out->GetQuoteChar( session_id.c_str() );
out->Print( nestLevel, "(%s %s%s%s\n", Name(), out->Print( nestLevel, "(%s %s%s%s\n", Name(),
@ -4048,10 +4048,10 @@ class SPECCTRA_DB
/** /**
* Function needLEFT * Function needLEFT
* calls nextTok() and then verifies that the token read in is a T_LEFT. * calls nextTok() and then verifies that the token read in is a T_LEFT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a T_LEFT * @throw IO_ERROR, if the next token is not a T_LEFT
*/ */
void needLEFT() throw( IOError ) void needLEFT() throw( IO_ERROR )
{ {
lexer->NeedLEFT(); lexer->NeedLEFT();
} }
@ -4059,10 +4059,10 @@ class SPECCTRA_DB
/** /**
* Function needRIGHT * Function needRIGHT
* calls nextTok() and then verifies that the token read in is a T_RIGHT. * calls nextTok() and then verifies that the token read in is a T_RIGHT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a T_RIGHT * @throw IO_ERROR, if the next token is not a T_RIGHT
*/ */
void needRIGHT() throw( IOError ) void needRIGHT() throw( IO_ERROR )
{ {
lexer->NeedRIGHT(); lexer->NeedRIGHT();
} }
@ -4071,11 +4071,11 @@ class SPECCTRA_DB
* Function needSYMBOL * Function needSYMBOL
* calls nextTok() and then verifies that the token read in * calls nextTok() and then verifies that the token read in
* satisfies bool isSymbol(). * satisfies bool isSymbol().
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return DSN_T - the actual token read in. * @return DSN_T - the actual token read in.
* @throw IOError, if the next token does not satisfy isSymbol() * @throw IO_ERROR, if the next token does not satisfy isSymbol()
*/ */
DSN_T needSYMBOL() throw( IOError ) DSN_T needSYMBOL() throw( IO_ERROR )
{ {
return (DSN_T) lexer->NeedSYMBOL(); return (DSN_T) lexer->NeedSYMBOL();
} }
@ -4084,11 +4084,11 @@ class SPECCTRA_DB
* Function needSYMBOLorNUMBER * Function needSYMBOLorNUMBER
* calls nextTok() and then verifies that the token read in * calls nextTok() and then verifies that the token read in
* satisfies bool isSymbol() or tok==T_NUMBER. * satisfies bool isSymbol() or tok==T_NUMBER.
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return DSN_T - the actual token read in. * @return DSN_T - the actual token read in.
* @throw IOError, if the next token does not satisfy the above test * @throw IO_ERROR, if the next token does not satisfy the above test
*/ */
DSN_T needSYMBOLorNUMBER() throw( IOError ) DSN_T needSYMBOLorNUMBER() throw( IO_ERROR )
{ {
return (DSN_T) lexer->NeedSYMBOLorNUMBER(); return (DSN_T) lexer->NeedSYMBOLorNUMBER();
} }
@ -4106,10 +4106,10 @@ class SPECCTRA_DB
* *
* @param component_id Where to put the text preceeding the '-' hyphen. * @param component_id Where to put the text preceeding the '-' hyphen.
* @param pin_d Where to put the text which trails the '-'. * @param pin_d Where to put the text which trails the '-'.
* @throw IOError, if the next token or two do no make up a pin_reference, * @throw IO_ERROR, if the next token or two do no make up a pin_reference,
* or there is an error reading from the input stream. * or there is an error reading from the input stream.
*/ */
void readCOMPnPIN( std::string* component_id, std::string* pid_id ) throw( IOError ); void readCOMPnPIN( std::string* component_id, std::string* pid_id ) throw( IO_ERROR );
/** /**
@ -4123,80 +4123,80 @@ class SPECCTRA_DB
* time stamp. * time stamp.
* *
* @param time_stamp Where to put the parsed time value. * @param time_stamp Where to put the parsed time value.
* @throw IOError, if the next token or 8 do no make up a time stamp, * @throw IO_ERROR, if the next token or 8 do no make up a time stamp,
* or there is an error reading from the input stream. * or there is an error reading from the input stream.
*/ */
void readTIME( time_t* time_stamp ) throw( IOError ); void readTIME( time_t* time_stamp ) throw( IO_ERROR );
/** /**
* Function expecting * Function expecting
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param int is the token type which was expected at the current input location. * @param int is the token type which was expected at the current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void expecting( DSN_T aTok ) throw( IOError ) void expecting( DSN_T aTok ) throw( IO_ERROR )
{ {
lexer->Expecting( aTok ); lexer->Expecting( aTok );
} }
void unexpected( DSN_T aTok ) throw( IOError ) void unexpected( DSN_T aTok ) throw( IO_ERROR )
{ {
lexer->Unexpected( aTok ); lexer->Unexpected( aTok );
} }
void expecting( const char* text ) throw( IOError ); void expecting( const char* text ) throw( IO_ERROR );
void unexpected( const char* text ) throw( IOError ); void unexpected( const char* text ) throw( IO_ERROR );
void doPCB( PCB* growth ) throw(IOError); void doPCB( PCB* growth ) throw( IO_ERROR );
void doPARSER( PARSER* growth ) throw(IOError); void doPARSER( PARSER* growth ) throw( IO_ERROR );
void doRESOLUTION( UNIT_RES* growth ) throw(IOError); void doRESOLUTION( UNIT_RES* growth ) throw( IO_ERROR );
void doUNIT( UNIT_RES* growth ) throw( IOError ); void doUNIT( UNIT_RES* growth ) throw( IO_ERROR );
void doSTRUCTURE( STRUCTURE* growth ) throw( IOError ); void doSTRUCTURE( STRUCTURE* growth ) throw( IO_ERROR );
void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IOError ); void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR );
void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IOError ); void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR );
void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IOError ); void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR );
void doBOUNDARY( BOUNDARY* growth ) throw( IOError ); void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR );
void doRECTANGLE( RECTANGLE* growth ) throw( IOError ); void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR );
void doPATH( PATH* growth ) throw( IOError ); void doPATH( PATH* growth ) throw( IO_ERROR );
void doSTRINGPROP( STRINGPROP* growth ) throw( IOError ); void doSTRINGPROP( STRINGPROP* growth ) throw( IO_ERROR );
void doTOKPROP( TOKPROP* growth ) throw( IOError ); void doTOKPROP( TOKPROP* growth ) throw( IO_ERROR );
void doVIA( VIA* growth ) throw( IOError ); void doVIA( VIA* growth ) throw( IO_ERROR );
void doCONTROL( CONTROL* growth ) throw( IOError ); void doCONTROL( CONTROL* growth ) throw( IO_ERROR );
void doLAYER( LAYER* growth ) throw( IOError ); void doLAYER( LAYER* growth ) throw( IO_ERROR );
void doRULE( RULE* growth ) throw( IOError ); void doRULE( RULE* growth ) throw( IO_ERROR );
void doKEEPOUT( KEEPOUT* growth ) throw( IOError ); void doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR );
void doCIRCLE( CIRCLE* growth ) throw( IOError ); void doCIRCLE( CIRCLE* growth ) throw( IO_ERROR );
void doQARC( QARC* growth ) throw( IOError ); void doQARC( QARC* growth ) throw( IO_ERROR );
void doWINDOW( WINDOW* growth ) throw( IOError ); void doWINDOW( WINDOW* growth ) throw( IO_ERROR );
void doREGION( REGION* growth ) throw( IOError ); void doREGION( REGION* growth ) throw( IO_ERROR );
void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IOError ); void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR );
void doLAYER_RULE( LAYER_RULE* growth ) throw( IOError ); void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR );
void doCLASSES( CLASSES* growth ) throw( IOError ); void doCLASSES( CLASSES* growth ) throw( IO_ERROR );
void doGRID( GRID* growth ) throw( IOError ); void doGRID( GRID* growth ) throw( IO_ERROR );
void doPLACE( PLACE* growth ) throw( IOError ); void doPLACE( PLACE* growth ) throw( IO_ERROR );
void doCOMPONENT( COMPONENT* growth ) throw( IOError ); void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR );
void doPLACEMENT( PLACEMENT* growth ) throw( IOError ); void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR );
void doPROPERTIES( PROPERTIES* growth ) throw( IOError ); void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR );
void doPADSTACK( PADSTACK* growth ) throw( IOError ); void doPADSTACK( PADSTACK* growth ) throw( IO_ERROR );
void doSHAPE( SHAPE* growth ) throw( IOError ); void doSHAPE( SHAPE* growth ) throw( IO_ERROR );
void doIMAGE( IMAGE* growth ) throw( IOError ); void doIMAGE( IMAGE* growth ) throw( IO_ERROR );
void doLIBRARY( LIBRARY* growth ) throw( IOError ); void doLIBRARY( LIBRARY* growth ) throw( IO_ERROR );
void doPIN( PIN* growth ) throw( IOError ); void doPIN( PIN* growth ) throw( IO_ERROR );
void doNET( NET* growth ) throw( IOError ); void doNET( NET* growth ) throw( IO_ERROR );
void doNETWORK( NETWORK* growth ) throw( IOError ); void doNETWORK( NETWORK* growth ) throw( IO_ERROR );
void doCLASS( CLASS* growth ) throw( IOError ); void doCLASS( CLASS* growth ) throw( IO_ERROR );
void doTOPOLOGY( TOPOLOGY* growth ) throw( IOError ); void doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR );
void doFROMTO( FROMTO* growth ) throw( IOError ); void doFROMTO( FROMTO* growth ) throw( IO_ERROR );
void doCOMP_ORDER( COMP_ORDER* growth ) throw( IOError ); void doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR );
void doWIRE( WIRE* growth ) throw( IOError ); void doWIRE( WIRE* growth ) throw( IO_ERROR );
void doWIRE_VIA( WIRE_VIA* growth ) throw( IOError ); void doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR );
void doWIRING( WIRING* growth ) throw( IOError ); void doWIRING( WIRING* growth ) throw( IO_ERROR );
void doSESSION( SESSION* growth ) throw( IOError ); void doSESSION( SESSION* growth ) throw( IO_ERROR );
void doANCESTOR( ANCESTOR* growth ) throw( IOError ); void doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR );
void doHISTORY( HISTORY* growth ) throw( IOError ); void doHISTORY( HISTORY* growth ) throw( IO_ERROR );
void doROUTE( ROUTE* growth ) throw( IOError ); void doROUTE( ROUTE* growth ) throw( IO_ERROR );
void doWAS_IS( WAS_IS* growth ) throw( IOError ); void doWAS_IS( WAS_IS* growth ) throw( IO_ERROR );
void doNET_OUT( NET_OUT* growth ) throw( IOError ); void doNET_OUT( NET_OUT* growth ) throw( IO_ERROR );
void doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IOError ); void doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IO_ERROR );
//-----<FromBOARD>------------------------------------------------------- //-----<FromBOARD>-------------------------------------------------------
@ -4206,7 +4206,7 @@ class SPECCTRA_DB
* @param aBoard The BOARD to get information from in order to make the BOUNDARY. * @param aBoard The BOARD to get information from in order to make the BOUNDARY.
* @param aBoundary The empty BOUNDARY to fill in. * @param aBoundary The empty BOUNDARY to fill in.
*/ */
void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IOError ); void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IO_ERROR );
/** /**
@ -4280,7 +4280,7 @@ class SPECCTRA_DB
* Function makeTRACK * Function makeTRACK
* creates a TRACK form the PATH and BOARD info. * creates a TRACK form the PATH and BOARD info.
*/ */
TRACK* makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IOError ); TRACK* makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IO_ERROR );
/** /**
@ -4288,7 +4288,7 @@ class SPECCTRA_DB
* instantiates a Kicad SEGVIA on the heap and initializes it with internal * instantiates a Kicad SEGVIA on the heap and initializes it with internal
* values consistent with the given PADSTACK, POINT, and netcode. * values consistent with the given PADSTACK, POINT, and netcode.
*/ */
SEGVIA* makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IOError ); SEGVIA* makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IO_ERROR );
//-----</FromSESSION>---------------------------------------------------- //-----</FromSESSION>----------------------------------------------------
@ -4357,9 +4357,9 @@ public:
* missing only the silkscreen stuff). * missing only the silkscreen stuff).
* *
* @param filename The name of the dsn file to load. * @param filename The name of the dsn file to load.
* @throw IOError if there is a lexer or parser error. * @throw IO_ERROR if there is a lexer or parser error.
*/ */
void LoadPCB( const wxString& filename ) throw( IOError ); void LoadPCB( const wxString& filename ) throw( IO_ERROR );
/** /**
@ -4370,12 +4370,12 @@ public:
* tracks, vias, and component locations. * tracks, vias, and component locations.
* *
* @param filename The name of the dsn file to load. * @param filename The name of the dsn file to load.
* @throw IOError if there is a lexer or parser error. * @throw IO_ERROR if there is a lexer or parser error.
*/ */
void LoadSESSION( const wxString& filename ) throw( IOError ); void LoadSESSION( const wxString& filename ) throw( IO_ERROR );
void ThrowIOError( const wxChar* fmt, ... ) throw( IOError ); void ThrowIOError( const wxChar* fmt, ... ) throw( IO_ERROR );
/** /**
@ -4385,9 +4385,9 @@ public:
* @param aFilename The file to save to. * @param aFilename The file to save to.
* @param aNameChange If true, causes the pcb's name to change to "aFilename" * @param aNameChange If true, causes the pcb's name to change to "aFilename"
* and also to to be changed in the output file. * and also to to be changed in the output file.
* @throw IOError, if an i/o error occurs saving the file. * @throw IO_ERROR, if an i/o error occurs saving the file.
*/ */
void ExportPCB( wxString aFilename, bool aNameChange=false ) throw( IOError ); void ExportPCB( wxString aFilename, bool aNameChange=false ) throw( IO_ERROR );
/** /**
@ -4401,7 +4401,7 @@ public:
* *
* @param aBoard The BOARD to convert to a PCB. * @param aBoard The BOARD to convert to a PCB.
*/ */
void FromBOARD( BOARD* aBoard ) throw( IOError ); void FromBOARD( BOARD* aBoard ) throw( IO_ERROR );
/** /**
* Function FromSESSION * Function FromSESSION
@ -4411,7 +4411,7 @@ public:
* *
* @param aBoard The BOARD to merge the SESSION information into. * @param aBoard The BOARD to merge the SESSION information into.
*/ */
void FromSESSION( BOARD* aBoard ) throw( IOError ); void FromSESSION( BOARD* aBoard ) throw( IO_ERROR );
/** /**
* Function ExportSESSION * Function ExportSESSION

View File

@ -112,7 +112,7 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
// if an exception is thrown by FromBOARD or ExportPCB(), then // if an exception is thrown by FromBOARD or ExportPCB(), then
// ~SPECCTRA_DB() will close the file. // ~SPECCTRA_DB() will close the file.
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
ok = false; ok = false;
@ -719,7 +719,7 @@ PADSTACK* SPECCTRA_DB::makeVia( const SEGVIA* aVia )
} }
void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IOError ) void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ERROR )
{ {
TYPE_COLLECTOR items; TYPE_COLLECTOR items;
@ -905,7 +905,7 @@ typedef std::set<std::string> STRINGSET;
typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR; typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR;
void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
{ {
TYPE_COLLECTOR items; TYPE_COLLECTOR items;

View File

@ -96,7 +96,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
db.LoadSESSION( fullFileName ); db.LoadSESSION( fullFileName );
db.FromSESSION( GetBoard() ); db.FromSESSION( GetBoard() );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
@ -193,7 +193,7 @@ static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
} }
TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IOError ) TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IO_ERROR )
{ {
int layerNdx = findLayerName( aPath->layer_id ); int layerNdx = findLayerName( aPath->layer_id );
@ -216,7 +216,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro
} }
SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IOError ) SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IO_ERROR )
{ {
SEGVIA* via = 0; SEGVIA* via = 0;
SHAPE* shape; SHAPE* shape;
@ -351,7 +351,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
// no UI code in this function, throw exception to report problems to the // no UI code in this function, throw exception to report problems to the
// UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) // UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError ) void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
{ {
sessionBoard = aBoard; // not owned here sessionBoard = aBoard; // not owned here

View File

@ -63,7 +63,7 @@ int main( int argc, char** argv )
// db.LoadPCB( filename ); // db.LoadPCB( filename );
db.LoadSESSION( filename ); db.LoadSESSION( filename );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
fprintf( stderr, "%s\n", CONV_TO_UTF8(ioe.errorText) ); fprintf( stderr, "%s\n", CONV_TO_UTF8(ioe.errorText) );
failed = true; failed = true;

View File

@ -27,6 +27,7 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "help_common_strings.h" #include "help_common_strings.h"
#include "class_layerchoicebox.h"
#define SEL_LAYER_HELP _( \ #define SEL_LAYER_HELP _( \
"Show active layer selections\nand select layer pair for route and place via" ) "Show active layer selections\nand select layer pair for route and place via" )
@ -267,7 +268,12 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
if(m_SelLayerBox == NULL)
m_SelLayerBox = new WinEDALayerChoiceBox( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER);
ReCreateLayerBox( m_HToolBar ); ReCreateLayerBox( m_HToolBar );
m_HToolBar->AddControl( m_SelLayerBox );
PrepareLayerIndicator(); // Initialize the bitmap with current PrepareLayerIndicator(); // Initialize the bitmap with current
// active layer colors for the next tool // active layer colors for the next tool
m_HToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString, m_HToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString,
@ -434,7 +440,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString,
wxBitmap( add_zone_xpm ), wxBitmap( add_zone_xpm ),
_( "Add zones" ), wxITEM_CHECK ); _( "Add filled zones" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString,
@ -451,7 +457,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString,
wxBitmap( add_text_xpm ), wxBitmap( add_text_xpm ),
_( "Add text" ), wxITEM_CHECK ); _( "Add text on copper layers or graphic text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString,
@ -470,7 +476,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString,
wxBitmap( pcb_offset_xpm ), wxBitmap( pcb_offset_xpm ),
_( "Offset adjust for drill and place files" ), _( "Place the origin point for drill and place files" ),
wxITEM_CHECK ); wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString,
@ -677,7 +683,6 @@ an existing track use its width\notherwise, use current width setting" ),
m_TrackAndViasSizesList_Changed = true; m_TrackAndViasSizesList_Changed = true;
m_AuxiliaryToolBar->AddSeparator(); m_AuxiliaryToolBar->AddSeparator();
ReCreateLayerBox( NULL );
} }
@ -685,97 +690,18 @@ void WinEDA_PcbFrame::syncLayerBox()
{ {
wxASSERT( m_SelLayerBox ); wxASSERT( m_SelLayerBox );
// Enable the display on the correct layer
// To avoid reentrancy ( Bug wxGTK Linux version? ), the selection is
// made only if it needs changing ( corrected on wxGTK 2.6.0 )
int count = m_SelLayerBox->GetCount();
int choice = m_SelLayerBox->GetChoice();
int layer = getActiveLayer(); int layer = getActiveLayer();
m_SelLayerBox->SetLayerSelection(layer);
for( int listNdx=0; listNdx<count; ++listNdx )
{
int clientData = (int) (size_t) m_SelLayerBox->wxItemContainer::GetClientData( listNdx );
if( clientData == layer )
{
if( listNdx != choice )
m_SelLayerBox->SetSelection( listNdx );
break;
}
}
} }
WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent ) WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
{ {
if( m_SelLayerBox == NULL ) if( m_SelLayerBox == NULL )
{ return NULL;
if( parent == NULL )
return NULL;
m_SelLayerBox = new WinEDAChoiceBox( parent,
ID_TOOLBARH_PCB_SELECT_LAYER,
wxPoint( -1, -1 ),
#if defined (__UNIX__)
// Width enough for the longest
// string: "Component (Page Down)"
// Maybe that string is too long?
wxSize( 230, -1 )
#else
wxSize( LISTBOX_WIDTH + 30, -1 )
#endif
);
parent->AddControl( m_SelLayerBox );
}
int layer_mask = GetBoard()->GetEnabledLayers();
unsigned length = 0;
m_SelLayerBox->Clear();
static DECLARE_LAYERS_ORDER_LIST(layerOrder_for_display);
for( int idx=0, listNdx=0; idx <= EDGE_N; idx++ )
{
int layer = layerOrder_for_display[idx];
// List to append hotkeys in layer box selection
static const int HK_SwitchLayer[EDGE_N + 1] = {
HK_SWITCH_LAYER_TO_COPPER,
HK_SWITCH_LAYER_TO_INNER1,
HK_SWITCH_LAYER_TO_INNER2,
HK_SWITCH_LAYER_TO_INNER3,
HK_SWITCH_LAYER_TO_INNER4,
HK_SWITCH_LAYER_TO_INNER5,
HK_SWITCH_LAYER_TO_INNER6,
HK_SWITCH_LAYER_TO_INNER7,
HK_SWITCH_LAYER_TO_INNER8,
HK_SWITCH_LAYER_TO_INNER9,
HK_SWITCH_LAYER_TO_INNER10,
HK_SWITCH_LAYER_TO_INNER11,
HK_SWITCH_LAYER_TO_INNER12,
HK_SWITCH_LAYER_TO_INNER13,
HK_SWITCH_LAYER_TO_INNER14,
HK_SWITCH_LAYER_TO_COMPONENT
};
if( g_TabOneLayerMask[layer] & layer_mask )
{
wxString msg = GetBoard()->GetLayerName( layer );
msg << wxT(" ");
msg = AddHotkeyName( msg, s_Board_Editor_Hokeys_Descr,
HK_SwitchLayer[layer], false );
m_SelLayerBox->Append( msg );
//D(printf("appending layername=%s, ndx=%d, layer=%d\n", CONV_TO_UTF8(msg), listNdx, layer );)
m_SelLayerBox->wxItemContainer::SetClientData( listNdx, (void*) layer );
length = MAX( length, msg.Len() );
listNdx++;
}
}
m_SelLayerBox->m_hotkeys = s_Board_Editor_Hokeys_Descr;
m_SelLayerBox->Resync();
m_SelLayerBox->SetToolTip( _( "+/- to switch" ) ); m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
syncLayerBox(); syncLayerBox();

View File

@ -184,7 +184,9 @@ void WinEDA_PcbFrame::SetToolbars()
state = GetScreen()->GetRedoCommandCount() > 0; state = GetScreen()->GetRedoCommandCount() > 0;
m_HToolBar->EnableTool( wxID_REDO, state ); m_HToolBar->EnableTool( wxID_REDO, state );
m_HToolBar->Refresh(); syncLayerBox();
PrepareLayerIndicator();
m_HToolBar->Refresh(true);
if( m_OptionsToolBar ) if( m_OptionsToolBar )
{ {
@ -276,9 +278,5 @@ void WinEDA_PcbFrame::SetToolbars()
if( m_AuxiliaryToolBar ) if( m_AuxiliaryToolBar )
AuxiliaryToolBar_Update_UI(); AuxiliaryToolBar_Update_UI();
syncLayerBox();
PrepareLayerIndicator();
DisplayUnitsMsg(); DisplayUnitsMsg();
} }

View File

@ -55,9 +55,12 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
DrawPanel->m_overlay.Reset(); if(IsShown())
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC ); {
overlaydc.Clear(); DrawPanel->m_overlay.Reset();
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC );
overlaydc.Clear();
}
#endif #endif
screen->ClrRefreshReq(); screen->ClrRefreshReq();
@ -91,9 +94,12 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawGeneralRatsnest( DC ); DrawGeneralRatsnest( DC );
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
DrawPanel->m_overlay.Reset(); if(IsShown())
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC ); {
overlaydc.Clear(); DrawPanel->m_overlay.Reset();
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC );
overlaydc.Clear();
}
#endif #endif
GetScreen()->ClrRefreshReq(); GetScreen()->ClrRefreshReq();