Commit 07cd3bcb authored by Maciej Suminski's avatar Maciej Suminski

Upstream merged

parents 80999ba0 0d41a7a5
...@@ -49,21 +49,21 @@ ...@@ -49,21 +49,21 @@
#include <3d_draw_basic_functions.h> #include <3d_draw_basic_functions.h>
// Imported function: // Imported function:
extern void SetGLColor( int color ); extern void SetGLColor( EDA_COLOR_T color );
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ); extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
extern void CheckGLError(); extern void CheckGLError();
/* returns true if aLayer should be displayed, false otherwise /* returns true if aLayer should be displayed, false otherwise
*/ */
static bool Is3DLayerEnabled( int aLayer ); static bool Is3DLayerEnabled( LAYER_NUM aLayer );
/* returns the Z orientation parameter 1.0 or -1.0 for aLayer /* returns the Z orientation parameter 1.0 or -1.0 for aLayer
* Z orientation is 1.0 for all layers but "back" layers: * Z orientation is 1.0 for all layers but "back" layers:
* LAYER_N_BACK , ADHESIVE_N_BACK, SOLDERPASTE_N_BACK ), SILKSCREEN_N_BACK * LAYER_N_BACK , ADHESIVE_N_BACK, SOLDERPASTE_N_BACK ), SILKSCREEN_N_BACK
* used to calculate the Z orientation parameter for glNormal3f * used to calculate the Z orientation parameter for glNormal3f
*/ */
static GLfloat Get3DLayer_Z_Orientation( int aLayer ); static GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer );
void EDA_3D_CANVAS::Redraw( bool finish ) void EDA_3D_CANVAS::Redraw( bool finish )
{ {
...@@ -163,7 +163,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -163,7 +163,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
Draw3D_Via( (SEGVIA*) track ); Draw3D_Via( (SEGVIA*) track );
else else
{ {
int layer = track->GetLayer(); LAYER_NUM layer = track->GetLayer();
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) )
Draw3D_Track( track ); Draw3D_Track( track );
...@@ -174,7 +174,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -174,7 +174,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
{ {
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{ {
int layer = pcb->GetArea( ii )->GetLayer(); LAYER_NUM layer = pcb->GetArea( ii )->GetLayer();
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) )
Draw3D_Zone( pcb->GetArea( ii ) ); Draw3D_Zone( pcb->GetArea( ii ) );
...@@ -236,8 +236,8 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -236,8 +236,8 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
*/ */
void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone ) void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
{ {
int layer = aZone->GetLayer(); LAYER_NUM layer = aZone->GetLayer();
int color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
if( layer == LAST_COPPER_LAYER ) if( layer == LAST_COPPER_LAYER )
...@@ -326,8 +326,8 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone ) ...@@ -326,8 +326,8 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
{ {
double zpos = 0.0; double zpos = 0.0;
int gridcolor = DARKGRAY; // Color of grid lines EDA_COLOR_T gridcolor = DARKGRAY; // Color of grid lines
int gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines EDA_COLOR_T gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines
double scale = g_Parm_3D_Visu.m_BiuTo3Dunits; double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;
glNormal3f( 0.0, 0.0, 1.0 ); glNormal3f( 0.0, 0.0, 1.0 );
...@@ -456,8 +456,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) ...@@ -456,8 +456,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
void EDA_3D_CANVAS::Draw3D_Track( TRACK* aTrack ) void EDA_3D_CANVAS::Draw3D_Track( TRACK* aTrack )
{ {
int layer = aTrack->GetLayer(); LAYER_NUM layer = aTrack->GetLayer();
int color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU();
if( layer == LAST_COPPER_LAYER ) if( layer == LAST_COPPER_LAYER )
...@@ -475,8 +475,8 @@ void EDA_3D_CANVAS::Draw3D_Track( TRACK* aTrack ) ...@@ -475,8 +475,8 @@ void EDA_3D_CANVAS::Draw3D_Track( TRACK* aTrack )
void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via ) void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via )
{ {
int layer, top_layer, bottom_layer; LAYER_NUM layer, top_layer, bottom_layer;
int color; EDA_COLOR_T color;
double biu_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits ; double biu_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits ;
int outer_radius = via->GetWidth() / 2; int outer_radius = via->GetWidth() / 2;
...@@ -486,7 +486,7 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via ) ...@@ -486,7 +486,7 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via )
via->ReturnLayerPair( &top_layer, &bottom_layer ); via->ReturnLayerPair( &top_layer, &bottom_layer );
// Drawing horizontal thick rings: // Drawing horizontal thick rings:
for( layer = bottom_layer; layer < g_Parm_3D_Visu.m_CopperLayersCount; layer++ ) for( layer = bottom_layer; layer < g_Parm_3D_Visu.m_CopperLayersCount; ++layer )
{ {
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
...@@ -530,15 +530,15 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via ) ...@@ -530,15 +530,15 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via )
void EDA_3D_CANVAS::Draw3D_DrawSegment( DRAWSEGMENT* segment ) void EDA_3D_CANVAS::Draw3D_DrawSegment( DRAWSEGMENT* segment )
{ {
int layer = segment->GetLayer(); LAYER_NUM layer = segment->GetLayer();
int color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
SetGLColor( color ); SetGLColor( color );
if( layer == EDGE_N ) if( layer == EDGE_N )
{ {
for( layer = 0; layer < g_Parm_3D_Visu.m_CopperLayersCount; layer++ ) for( layer = FIRST_LAYER; layer < g_Parm_3D_Visu.m_CopperLayersCount; ++layer )
{ {
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) ); glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU(layer); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU(layer);
...@@ -552,7 +552,7 @@ void EDA_3D_CANVAS::Draw3D_DrawSegment( DRAWSEGMENT* segment ) ...@@ -552,7 +552,7 @@ void EDA_3D_CANVAS::Draw3D_DrawSegment( DRAWSEGMENT* segment )
break; break;
case S_CIRCLE: case S_CIRCLE:
{ {
int radius = KiROUND( hypot( double(segment->GetStart().x - segment->GetEnd().x), int radius = KiROUND( hypot( double(segment->GetStart().x - segment->GetEnd().x),
double(segment->GetStart().y - segment->GetEnd().y) ) double(segment->GetStart().y - segment->GetEnd().y) )
); );
...@@ -624,8 +624,8 @@ static void Draw3dTextSegm( int x0, int y0, int xf, int yf ) ...@@ -624,8 +624,8 @@ static void Draw3dTextSegm( int x0, int y0, int xf, int yf )
void EDA_3D_CANVAS::Draw3D_DrawText( TEXTE_PCB* text ) void EDA_3D_CANVAS::Draw3D_DrawText( TEXTE_PCB* text )
{ {
int layer = text->GetLayer(); LAYER_NUM layer = text->GetLayer();
int color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
SetGLColor( color ); SetGLColor( color );
s_Text3DZPos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); s_Text3DZPos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
...@@ -754,7 +754,7 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -754,7 +754,7 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas )
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false )
return; return;
int color = g_ColorsSettings.GetLayerColor( m_Layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( m_Layer );
SetGLColor( color ); SetGLColor( color );
// for outline shape = S_POLYGON: // for outline shape = S_POLYGON:
...@@ -790,7 +790,7 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -790,7 +790,7 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas )
if( m_Layer == EDGE_N ) if( m_Layer == EDGE_N )
{ {
for( int layer = 0; layer < g_Parm_3D_Visu.m_CopperLayersCount; layer++ ) for( LAYER_NUM layer = FIRST_LAYER; layer < g_Parm_3D_Visu.m_CopperLayersCount; ++layer )
{ {
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) ); glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
...@@ -948,7 +948,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -948,7 +948,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
switch( GetShape() ) switch( GetShape() )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer )
{ {
if( layer && (layer == nlmax) ) if( layer && (layer == nlmax) )
layer = LAYER_N_FRONT; layer = LAYER_N_FRONT;
...@@ -998,16 +998,14 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -998,16 +998,14 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
polyPadShape.insert( polyPadShape.end(), holecornersBuffer.begin(), polyPadShape.insert( polyPadShape.end(), holecornersBuffer.begin(),
holecornersBuffer.end() ); holecornersBuffer.end() );
} }
break; break;
case PAD_RECT: case PAD_RECT:
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
{ {
wxPoint coord[5]; wxPoint coord[5];
BuildPadPolygon( coord, wxSize(0,0), m_Orient ); BuildPadPolygon( coord, wxSize(0,0), m_Orient );
for( int ii = 0; ii < 4; ii ++ ) for( int ii = 0; ii < 4; ii ++ )
{ {
CPolyPt pt( coord[ii].x + shape_pos.x, coord[ii].y+ shape_pos.y ); CPolyPt pt( coord[ii].x + shape_pos.x, coord[ii].y+ shape_pos.y );
polyPadShape.push_back( pt ); polyPadShape.push_back( pt );
...@@ -1019,7 +1017,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -1019,7 +1017,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
polyPadShape.insert( polyPadShape.end(), holecornersBuffer.begin(), polyPadShape.insert( polyPadShape.end(), holecornersBuffer.begin(),
holecornersBuffer.end() ); holecornersBuffer.end() );
} }
break; break;
default: default:
break; break;
...@@ -1027,7 +1025,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -1027,7 +1025,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
if( polyPadShape.size() ) if( polyPadShape.size() )
{ {
for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer )
{ {
if( layer && (layer == nlmax) ) if( layer && (layer == nlmax) )
layer = LAYER_N_FRONT; layer = LAYER_N_FRONT;
...@@ -1061,41 +1059,41 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) ...@@ -1061,41 +1059,41 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
} }
bool Is3DLayerEnabled( int aLayer ) bool Is3DLayerEnabled( LAYER_NUM aLayer )
{ {
int flg = -1; int flg;
// see if layer needs to be shown // see if layer needs to be shown
// check the flags // check the flags
switch (aLayer) switch (aLayer)
{ {
case DRAW_N: case DRAW_N:
flg=g_Parm_3D_Visu.FL_DRAWINGS; flg = g_Parm_3D_Visu.FL_DRAWINGS;
break; break;
case COMMENT_N: case COMMENT_N:
flg=g_Parm_3D_Visu.FL_COMMENTS; flg = g_Parm_3D_Visu.FL_COMMENTS;
break; break;
case ECO1_N: case ECO1_N:
flg=g_Parm_3D_Visu.FL_ECO1; flg = g_Parm_3D_Visu.FL_ECO1;
break; break;
case ECO2_N: case ECO2_N:
flg=g_Parm_3D_Visu.FL_ECO2; flg = g_Parm_3D_Visu.FL_ECO2;
break; break;
}
// the layer was not a layer with a flag, so show it default:
if( flg < 0 ) // the layer was not a layer with a flag, so show it
return true; return true;
}
// if the layer has a flag, return the flag // if the layer has a flag, return the flag
return g_Parm_3D_Visu.m_DrawFlags[flg]; return g_Parm_3D_Visu.m_DrawFlags[flg];
} }
GLfloat Get3DLayer_Z_Orientation( int aLayer ) GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer )
{ {
double nZ; double nZ;
......
...@@ -122,10 +122,10 @@ static void Draw3D_VerticalPolygonalCylinder( const std::vector<CPolyPt>& aPolys ...@@ -122,10 +122,10 @@ static void Draw3D_VerticalPolygonalCylinder( const std::vector<CPolyPt>& aPolys
} }
void SetGLColor( int color ) void SetGLColor( EDA_COLOR_T color )
{ {
double red, green, blue; double red, green, blue;
StructColors colordata = ColorRefs[color & MASKCOLOR]; const StructColors &colordata = g_ColorRefs[ColorGetBase( color )];
red = colordata.m_Red / 255.0; red = colordata.m_Red / 255.0;
blue = colordata.m_Blue / 255.0; blue = colordata.m_Blue / 255.0;
......
This diff is collapsed.
...@@ -115,26 +115,6 @@ public: ...@@ -115,26 +115,6 @@ public:
void Copy( S3D_MASTER* pattern ); void Copy( S3D_MASTER* pattern );
int ReadData(); int ReadData();
/**
* Function ReadMaterial
* read the description of a 3D material definition in the form:
* DEF yellow material Material (
* DiffuseColor 1.00000 1.00000 0.00000e 0
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
* SpecularColor 1.00000 1.00000 1.00000
* AmbientIntensity 1.00000
* Transparency 0.00000e 0
* Shininess 1.00000
*)
* Or type:
* USE yellow material
*/
int ReadMaterial( FILE* file, int* LineNum );
int ReadChildren( FILE* file, int* LineNum );
int ReadShape( FILE* file, int* LineNum );
int ReadAppearance( FILE* file, int* LineNum );
int ReadGeometry( FILE* file, int* LineNum );
void Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ); void Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices );
#if defined(DEBUG) #if defined(DEBUG)
......
...@@ -105,16 +105,16 @@ void EDA_3D_FRAME::ReCreateHToolbar() ...@@ -105,16 +105,16 @@ void EDA_3D_FRAME::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ), m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ),
_( "Move left <-" ) ); _( "Move left" ) );
m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ), m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ),
_( "Move right ->" ) ); _( "Move right" ) );
m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ), m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ),
_( "Move up ^" ) ); _( "Move up" ) );
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ), m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ),
_( "Move down v" ) ); _( "Move down" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ), m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ),
......
...@@ -19,6 +19,8 @@ set(3D-VIEWER_SRCS ...@@ -19,6 +19,8 @@ set(3D-VIEWER_SRCS
3d_toolbar.cpp 3d_toolbar.cpp
info3d_visu.cpp info3d_visu.cpp
trackball.cpp trackball.cpp
x3dmodelparser.cpp
vrmlmodelparser.cpp
) )
add_library(3d-viewer STATIC ${3D-VIEWER_SRCS}) add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
...@@ -135,7 +135,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard ) ...@@ -135,7 +135,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
} }
// calculate z position for each non copper layer // calculate z position for each non copper layer
for( int layer_id = FIRST_NO_COPPER_LAYER; layer_id < NB_LAYERS; layer_id++ ) for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
{ {
double zpos; double zpos;
#define NonCopperLayerThicknessMargin 1.1 #define NonCopperLayerThicknessMargin 1.1
...@@ -184,7 +184,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard ) ...@@ -184,7 +184,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
default: default:
zpos = zpos_copper_front + zpos = zpos_copper_front +
(layer_id - FIRST_NO_COPPER_LAYER + 5) * (layer_id - FIRST_NON_COPPER_LAYER + 5) *
m_NonCopperLayerThickness * NonCopperLayerThicknessMargin; m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
break; break;
} }
......
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
double m_CurrentZpos; // temporary storage of current value of Z position, double m_CurrentZpos; // temporary storage of current value of Z position,
// used in some calculation // used in some calculation
private: private:
double m_LayerZcoord[LAYER_COUNT]; // Z position of each layer (normalized) double m_LayerZcoord[NB_LAYERS]; // Z position of each layer (normalized)
double m_CopperThickness; // Copper thickness (normalized) double m_CopperThickness; // Copper thickness (normalized)
double m_EpoxyThickness; // Epoxy thickness (normalized) double m_EpoxyThickness; // Epoxy thickness (normalized)
double m_NonCopperLayerThickness; // Non copper layers thickness double m_NonCopperLayerThickness; // Non copper layers thickness
...@@ -173,7 +173,7 @@ public: INFO3D_VISU(); ...@@ -173,7 +173,7 @@ public: INFO3D_VISU();
*/ */
int GetLayerObjectThicknessBIU( int aLayerId) const int GetLayerObjectThicknessBIU( int aLayerId) const
{ {
return aLayerId >= FIRST_NO_COPPER_LAYER ? return aLayerId >= FIRST_NON_COPPER_LAYER ?
GetNonCopperLayerThicknessBIU() : GetNonCopperLayerThicknessBIU() :
GetCopperThicknessBIU(); GetCopperThicknessBIU();
} }
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file modelparsers.h
*/
#ifndef MODELPARSERS_H
#define MODELPARSERS_H
#include <map>
#include <vector>
#include <wx/string.h>
class S3D_MASTER;
class S3D_VERTEX;
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
class S3D_MODEL_PARSER;
class X3D_MODEL_PARSER;
/**
* abstract class S3D_MODEL_PARSER
* Base class for 3D model parsers.
*/
class S3D_MODEL_PARSER
{
public:
S3D_MODEL_PARSER(S3D_MASTER* aMaster) :
master( aMaster )
{}
virtual ~S3D_MODEL_PARSER()
{}
S3D_MASTER* GetMaster()
{
return master;
}
/**
* Function Create
* Factory method for creating concrete 3D model parsers
* Notice that the caller is responsible to delete created parser.
*
* @param aMaster is master object that the parser will fill.
* @param aExtension is file extension of the file you are going to parse.
*/
static S3D_MODEL_PARSER* Create( S3D_MASTER* aMaster, const wxString aExtension );
/**
* Function Load
*
* Concrete parsers should implement this function
*/
virtual void Load( const wxString aFilename ) = 0;
private:
S3D_MASTER* master;
};
class wxXmlNode;
/**
* class X3D_MODEL_PARSER
* Implements parser for X3D file format (VRML2.0 successor)
* X3D files can be exported from eg. Blender */
class X3D_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
X3D_MODEL_PARSER( S3D_MASTER* aMaster );
~X3D_MODEL_PARSER();
void Load( const wxString aFilename );
typedef std::map< wxString, wxString > PROPERTY_MAP;
typedef std::vector< wxXmlNode* > NODE_LIST;
/**
* Function GetChildsByName
* Searches all child nodes with aName.
*
* @param aParent is node to search from
* @param aName is the name of node you try to find
* @param aResult contains found nodes
*/
static void GetChildsByName( wxXmlNode* aParent, const wxString aName, NODE_LIST& aResult );
/**
* Function GetNodeProperties
* Collects all node properties to map.
*
* @param aProps contains map of found properties
*/
static void GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps );
/**
* Return string representing x3d file in vrml format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
wxString VRML_representation();
private:
std::vector< wxString > vrml_materials;
std::vector< wxString > vrml_points;
std::vector< wxString > vrml_coord_indexes;
void readTransform( wxXmlNode* aTransformNode );
void readMaterial( wxXmlNode* aMatNode );
void readIndexedFaceSet( wxXmlNode* aFaceNode, PROPERTY_MAP& aTransfromProps );
bool parseDoubleTriplet( const wxString& aData, S3D_VERTEX& aResult );
void rotate( S3D_VERTEX& aCoordinate, S3D_VERTEX& aRotAxis, double angle );
};
/**
* class WRL_MODEL_PARSER
* Parses
*/
class VRML_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
VRML_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML_MODEL_PARSER();
void Load( const wxString aFilename );
private:
/**
* Function ReadMaterial
* read the description of a 3D material definition in the form:
* DEF yellow material Material (
* DiffuseColor 1.00000 1.00000 0.00000e 0
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
* SpecularColor 1.00000 1.00000 1.00000
* AmbientIntensity 1.00000
* Transparency 0.00000e 0
* Shininess 1.00000
*)
* Or type:
* USE yellow material
*/
int readMaterial( FILE* file, int* LineNum );
int readChildren( FILE* file, int* LineNum );
int readShape( FILE* file, int* LineNum );
int readAppearance( FILE* file, int* LineNum );
int readGeometry( FILE* file, int* LineNum );
/**
* Function ReadCoordList
* reads 3D coordinate lists like:
* coord Coordinate { point [
* -5.24489 6.57640e-3 -9.42129e-2,
* -5.11821 6.57421e-3 0.542654,
* -3.45868 0.256565 1.32000 ] }
* or:
* normal Normal { vector [
* 0.995171 -6.08102e-6 9.81541e-2,
* 0.923880 -4.09802e-6 0.382683,
* 0.707107 -9.38186e-7 0.707107]
* }
*
* text_buffer contains the first line of this node :
* "coord Coordinate { point ["
*/
void readCoordsList( FILE* file, char* text_buffer, std::vector< double >& aList,
int* LineNum );
};
#endif // MODELPARSERS_H
This diff is collapsed.
This diff is collapsed.
...@@ -42,7 +42,7 @@ option(KICAD_STABLE_VERSION ...@@ -42,7 +42,7 @@ option(KICAD_STABLE_VERSION
) )
option(KICAD_TESTING_VERSION option(KICAD_TESTING_VERSION
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)" "set this option to ON to build the testing version of KICAD. mainly used to set version ID (default OFF)"
) )
option(KICAD_SCRIPTING option(KICAD_SCRIPTING
......
...@@ -2,9 +2,9 @@ Contribute to KiCad (under Linux) ...@@ -2,9 +2,9 @@ Contribute to KiCad (under Linux)
-------------------- --------------------
1) make sure you have all the dependencies of KiCad: 1) make sure you have all the dependencies of KiCad:
sudo apt-get install debhelper dpatch libx11-dev sudo apt-get install debhelper dpatch libx11-dev
sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev
sudo apt-get install libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot sudo apt-get install libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot
sudo apt-get install cmake bzr sudo apt-get install cmake bzr
2) initialize Bazaar: 2) initialize Bazaar:
...@@ -24,18 +24,20 @@ Contribute to KiCad (under Linux) ...@@ -24,18 +24,20 @@ Contribute to KiCad (under Linux)
cd kicad_john cd kicad_john
mkdir build; cd build mkdir build; cd build
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug
to build a debug version
or
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Release
to build a release version
make -j 4 # this is for a 4 core machine make -j 4 # this is for a 4 core machine
7) Repeat step 5 and 6 until satisfied. 7) Repeat step 5 and 6 until satisfied.
8) Delete the "build" folder and create a patch: 8) Create a patch:
cd kicad_john in kicad_john:
rm -R ./build if some files are added: bzr add [FILE...]
bzr add . bzr diff > my_changes.patch
bzr status
bzr diff > gui_better_zoom.patch
9) Send the patch file "gui_better_zoom.patch" to the KiCad developers mailing list. 9) Send the patch file "my_changes.patch" to the KiCad developers mailing list.
in the subject of the e-mail include the keyword "[PATCH]". in the subject of the e-mail include the keyword "[PATCH]".
in the body of the e-mail clearly explain what you have done. in the body of the e-mail clearly explain what you have done.
......
...@@ -5,16 +5,15 @@ Documentation subfolder. ...@@ -5,16 +5,15 @@ Documentation subfolder.
Files Files
----- -----
AUTHORS.txt - The authors, contributors, document writers and translators list AUTHORS.txt - The authors, contributors, document writers and translators list
CHANGELOG.txt - This years changelog (see for previous years Documentation/changelogs) CHANGELOG.txt - This years changelog (see for previous years Documentation/changelogs)
CMakeList.txt - CMAKE build tool script CMakeList.txt - CMAKE build tool script
COPYRIGHT.txt - A copy of the GNU General Public License Version 2 COPYRIGHT.txt - A copy of the GNU General Public License Version 2
CTestConfig.txt - Support for CTest and CDash testing tools CTestConfig.cmake - Support for CTest and CDash testing tools
Doxyfile - Doxygen preferences Doxyfile - Doxygen config file for Kicad
INSTALL.txt - The release (binairy) installation instructions INSTALL.txt - The release (binairy) installation instructions
TODO.txt - Todo list TODO.txt - Todo list
uncrustify.cfg - Uncrustify code formatting tool preferences uncrustify.cfg - Uncrustify config file for uncrustify sorces formatting tool
version.txt - The current stable released version
Subdirectories Subdirectories
-------------- --------------
...@@ -37,6 +36,6 @@ packaging - Files for packaging on Windows and Mac OSX ...@@ -37,6 +36,6 @@ packaging - Files for packaging on Windows and Mac OSX
pcbnew - Sourcecode of the printed circuit board editor pcbnew - Sourcecode of the printed circuit board editor
polygon - Sourcecode of the polygon library polygon - Sourcecode of the polygon library
resources - Resources for installation, freedesktop mime-types for linux resources - Resources for installation, freedesktop mime-types for linux
scripts - Helper scripts. For building, sourcecode packaging, font setting, pcb adjusting. scripts - Helper scripts. For building, sourcecode packaging.
template - Project template(s) template - Project template(s)
...@@ -26,13 +26,14 @@ ...@@ -26,13 +26,14 @@
// For some unknown reasons, polygon.hpp shoul be included first // For some unknown reasons, polygon.hpp shoul be included first
#include <boost/polygon/polygon.hpp> #include <boost/polygon/polygon.hpp>
#include <wx/wx.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <layers_id_colors_and_visibility.h>
#include <potracelib.h> #include <potracelib.h>
#include <auxiliary.h> #include <auxiliary.h>
...@@ -310,8 +311,7 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon ) ...@@ -310,8 +311,7 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )
case PCBNEW_FMT: case PCBNEW_FMT:
{ {
#define SILKSCREEN_N_FRONT 21 LAYER_NUM layer = SILKSCREEN_N_FRONT;
int layer = SILKSCREEN_N_FRONT;
int width = 1; int width = 1;
fprintf( m_Outfile, "DP %d %d %d %d %d %d %d\n", fprintf( m_Outfile, "DP %d %d %d %d %d %d %d\n",
0, 0, 0, 0, 0, 0, 0, 0,
......
...@@ -92,6 +92,7 @@ set(COMMON_SRCS ...@@ -92,6 +92,7 @@ set(COMMON_SRCS
netlist_keywords.cpp netlist_keywords.cpp
newstroke_font.cpp newstroke_font.cpp
projet_config.cpp projet_config.cpp
ptree.cpp
richio.cpp richio.cpp
selcolor.cpp selcolor.cpp
string.cpp string.cpp
...@@ -135,7 +136,6 @@ set(PCB_COMMON_SRCS ...@@ -135,7 +136,6 @@ set(PCB_COMMON_SRCS
../pcbnew/class_marker_pcb.cpp ../pcbnew/class_marker_pcb.cpp
../pcbnew/class_mire.cpp ../pcbnew/class_mire.cpp
../pcbnew/class_module.cpp ../pcbnew/class_module.cpp
../pcbnew/class_module_transform_functions.cpp
../pcbnew/class_pad.cpp ../pcbnew/class_pad.cpp
../pcbnew/class_pad_draw_functions.cpp ../pcbnew/class_pad_draw_functions.cpp
../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.cpp
......
...@@ -90,7 +90,7 @@ void EDA_ITEM::InitVars() ...@@ -90,7 +90,7 @@ void EDA_ITEM::InitVars()
void EDA_ITEM::SetModified() void EDA_ITEM::SetModified()
{ {
m_Flags |= IS_CHANGED; SetFlags( IS_CHANGED );
// If this a child object, then the parent modification state also needs to be set. // If this a child object, then the parent modification state also needs to be set.
if( m_Parent ) if( m_Parent )
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -289,7 +289,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type, ...@@ -289,7 +289,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
if( !wxFileName::FileExists( fn ) ) if( !wxFileName::FileExists( fn ) )
{ {
msg = type + _( " file <" ) + fn + _( "> was not found." ); msg.Printf( wxT( "file <%s> was not found." ), GetChars( fn ) );
wxMessageBox( msg ); wxMessageBox( msg );
fileHistory->RemoveFileFromHistory( i ); fileHistory->RemoveFileFromHistory( i );
fn = wxEmptyString; fn = wxEmptyString;
...@@ -388,7 +388,8 @@ void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event ) ...@@ -388,7 +388,8 @@ void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event )
wildcard += wxT( ".exe" ); wildcard += wxT( ".exe" );
#endif #endif
wildcard = _( "Executable file (" ) + wildcard + wxT( ")|" ) + wildcard; wildcard.Printf( _( "Executable file (%s)|%s" ),
GetChars( wildcard ), GetChars( wildcard ) );
wxFileDialog dlg( this, _( "Select Preferred Editor" ), fn.GetPath(), wxFileDialog dlg( this, _( "Select Preferred Editor" ), fn.GetPath(),
fn.GetFullName(), wildcard, fn.GetFullName(), wildcard,
...@@ -644,7 +645,8 @@ edits you made?" ), ...@@ -644,7 +645,8 @@ edits you made?" ),
// Rename the old file to the backup file name. // Rename the old file to the backup file name.
if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
{ {
msg = _( "Could not create backup file " ) + backupFileName.GetFullPath(); msg.Printf( _( "Could not create backup file <%s>" ),
GetChars( backupFileName.GetFullPath() ) );
wxMessageBox( msg ); wxMessageBox( msg );
} }
} }
......
...@@ -108,7 +108,7 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame ) ...@@ -108,7 +108,7 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
break; break;
default: default:
msg = wxT( "????" ); msg = wxT( "???" );
break; break;
} }
......
...@@ -36,34 +36,27 @@ static const EDA_COLOR_T default_layer_color[LAYERSCOLORSBUFFERSIZE] = ...@@ -36,34 +36,27 @@ static const EDA_COLOR_T default_layer_color[LAYERSCOLORSBUFFERSIZE] =
static const EDA_COLOR_T default_items_color[LAYERSCOLORSBUFFERSIZE] = static const EDA_COLOR_T default_items_color[LAYERSCOLORSBUFFERSIZE] =
{ {
LIGHTGRAY, // unused LIGHTGRAY, // unused
CYAN, // VIA_MICROVIA_VISIBLE CYAN, // VIA_MICROVIA_VISIBLE
BROWN, // VIA_BBLIND_VISIBLE BROWN, // VIA_BBLIND_VISIBLE
LIGHTGRAY, // VIA_THROUGH_VISIBLE LIGHTGRAY, // VIA_THROUGH_VISIBLE
LIGHTGRAY, // MOD_TEXT_FR_VISIBLE YELLOW, // NON_PLATED_VISIBLE
LIGHTGRAY, // MOD_TEXT_FR_VISIBLE
BLUE, // MOD_TEXT_BK_VISIBLE BLUE, // MOD_TEXT_BK_VISIBLE
DARKGRAY, // MOD_TEXT_INVISIBLE DARKGRAY, // MOD_TEXT_INVISIBLE
BLUE, // ANCHOR_VISIBLE BLUE, // ANCHOR_VISIBLE
RED, // PAD_FR_VISIBLE RED, // PAD_FR_VISIBLE
GREEN, // PAD_BK_VISIBLE GREEN, // PAD_BK_VISIBLE
LIGHTGRAY, // RATSNEST_VISIBLE LIGHTGRAY, // RATSNEST_VISIBLE
DARKGRAY, //GRID_VISIBLE DARKGRAY, // GRID_VISIBLE
LIGHTRED, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTRED, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY,
LIGHTGRAY
}; };
COLORS_DESIGN_SETTINGS:: COLORS_DESIGN_SETTINGS() COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS()
{ {
for( unsigned ii = 0; ii < DIM(m_LayersColors); ii++ ) for( unsigned ii = 0; ii < DIM(m_LayersColors); ii++ )
m_LayersColors[ii] = default_layer_color[ii]; m_LayersColors[ii] = default_layer_color[ii];
...@@ -78,7 +71,7 @@ COLORS_DESIGN_SETTINGS:: COLORS_DESIGN_SETTINGS() ...@@ -78,7 +71,7 @@ COLORS_DESIGN_SETTINGS:: COLORS_DESIGN_SETTINGS()
* @return the color for aLayer which is one of the layer indices given * @return the color for aLayer which is one of the layer indices given
* in pcbstruct.h or in schematic * in pcbstruct.h or in schematic
*/ */
EDA_COLOR_T COLORS_DESIGN_SETTINGS::GetLayerColor( int aLayer ) const EDA_COLOR_T COLORS_DESIGN_SETTINGS::GetLayerColor( LAYER_NUM aLayer ) const
{ {
if( (unsigned) aLayer < DIM(m_LayersColors) ) if( (unsigned) aLayer < DIM(m_LayersColors) )
{ {
...@@ -93,7 +86,7 @@ EDA_COLOR_T COLORS_DESIGN_SETTINGS::GetLayerColor( int aLayer ) const ...@@ -93,7 +86,7 @@ EDA_COLOR_T COLORS_DESIGN_SETTINGS::GetLayerColor( int aLayer ) const
* sets the color for aLayer which is one of the layer indices given * sets the color for aLayer which is one of the layer indices given
* in pcbstruct.h or in schematic * in pcbstruct.h or in schematic
*/ */
void COLORS_DESIGN_SETTINGS::SetLayerColor( int aLayer, EDA_COLOR_T aColor ) void COLORS_DESIGN_SETTINGS::SetLayerColor( LAYER_NUM aLayer, EDA_COLOR_T aColor )
{ {
if( (unsigned) aLayer < DIM(m_LayersColors) ) if( (unsigned) aLayer < DIM(m_LayersColors) )
{ {
......
...@@ -65,14 +65,14 @@ int LAYER_BOX_SELECTOR::GetChoice() ...@@ -65,14 +65,14 @@ int LAYER_BOX_SELECTOR::GetChoice()
// Get Current Layer // Get Current Layer
int LAYER_BOX_SELECTOR::GetLayerSelection() LAYER_NUM LAYER_BOX_SELECTOR::GetLayerSelection() const
{ {
return (long) GetClientData( GetSelection() ); return (LAYER_NUM)((unsigned long) GetClientData( GetSelection() ) );
} }
// Set Layer # // Set Layer #
int LAYER_BOX_SELECTOR::SetLayerSelection( int layer ) int LAYER_BOX_SELECTOR::SetLayerSelection( LAYER_NUM layer )
{ {
int elements = GetCount(); int elements = GetCount();
...@@ -97,8 +97,8 @@ int LAYER_BOX_SELECTOR::SetLayerSelection( int layer ) ...@@ -97,8 +97,8 @@ int LAYER_BOX_SELECTOR::SetLayerSelection( int layer )
void LAYER_BOX_SELECTOR::ResyncBitmapOnly() void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
{ {
int elements = GetCount(); LAYER_NUM elements = GetCount();
for( int i = 0; i < elements; i++ ) for( LAYER_NUM i = FIRST_LAYER; i < elements; ++i )
{ {
wxBitmap layerbmp( 14, 14 ); wxBitmap layerbmp( 14, 14 );
SetBitmapLayer( layerbmp, i ); SetBitmapLayer( layerbmp, i );
...@@ -106,14 +106,14 @@ void LAYER_BOX_SELECTOR::ResyncBitmapOnly() ...@@ -106,14 +106,14 @@ void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
} }
void LAYER_BOX_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, int aLayerIndex ) void LAYER_BOX_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, LAYER_NUM aLayer )
{ {
wxMemoryDC bmpDC; wxMemoryDC bmpDC;
wxBrush brush; wxBrush brush;
// Prepare Bitmap // Prepare Bitmap
bmpDC.SelectObject( aLayerbmp ); bmpDC.SelectObject( aLayerbmp );
brush.SetColour( MakeColour( GetLayerColor( aLayerIndex ) ) ); brush.SetColour( MakeColour( GetLayerColor( aLayer ) ) );
brush.SetStyle( wxSOLID ); brush.SetStyle( wxSOLID );
bmpDC.SetBrush( brush ); bmpDC.SetBrush( brush );
......
...@@ -330,7 +330,7 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro ...@@ -330,7 +330,7 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro
GetCustomWidthMils() * 25.4 / 1000.0, GetCustomWidthMils() * 25.4 / 1000.0,
GetCustomHeightMils() * 25.4 / 1000.0 ); GetCustomHeightMils() * 25.4 / 1000.0 );
if( IsCustom() && IsPortrait() ) if( !IsCustom() && IsPortrait() )
aFormatter->Print( 0, " portrait" ); aFormatter->Print( 0, " portrait" );
aFormatter->Print( 0, ")\n" ); aFormatter->Print( 0, ")\n" );
......
...@@ -195,7 +195,7 @@ UNDO_REDO_T PICKED_ITEMS_LIST::GetPickedItemStatus( unsigned int aIdx ) ...@@ -195,7 +195,7 @@ UNDO_REDO_T PICKED_ITEMS_LIST::GetPickedItemStatus( unsigned int aIdx )
} }
int PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx ) STATUS_FLAGS PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].GetFlags(); return m_ItemsList[aIdx].GetFlags();
...@@ -253,7 +253,7 @@ bool PICKED_ITEMS_LIST::SetPickedItemStatus( UNDO_REDO_T aStatus, unsigned aIdx ...@@ -253,7 +253,7 @@ bool PICKED_ITEMS_LIST::SetPickedItemStatus( UNDO_REDO_T aStatus, unsigned aIdx
} }
bool PICKED_ITEMS_LIST::SetPickerFlags( int aFlags, unsigned aIdx ) bool PICKED_ITEMS_LIST::SetPickerFlags( STATUS_FLAGS aFlags, unsigned aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
{ {
......
...@@ -52,14 +52,9 @@ wxString g_ProductName = wxT( "KiCad E.D.A. " ); ...@@ -52,14 +52,9 @@ wxString g_ProductName = wxT( "KiCad E.D.A. " );
bool g_ShowPageLimits = true; bool g_ShowPageLimits = true;
wxString g_UserLibDirBuffer; wxString g_UserLibDirBuffer;
wxString g_Prj_Default_Config_FullFilename;
wxString g_Prj_Config_LocalFilename;
EDA_UNITS_T g_UserUnit; EDA_UNITS_T g_UserUnit;
EDA_COLOR_T g_GhostColor; EDA_COLOR_T g_GhostColor;
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
static const bool s_gost = true; static const bool s_gost = true;
#else #else
...@@ -77,34 +72,40 @@ bool IsGOST() ...@@ -77,34 +72,40 @@ bool IsGOST()
* Please: if you change a value, remember these values are carefully chosen * Please: if you change a value, remember these values are carefully chosen
* to have good results in Pcbnew, that uses the ORed value of basic colors * to have good results in Pcbnew, that uses the ORed value of basic colors
* when displaying superimposed objects * when displaying superimposed objects
* This list must have exactly NBCOLOR items * This list must have exactly NBCOLORS items
*/ */
StructColors ColorRefs[NBCOLOR] = const StructColors g_ColorRefs[NBCOLORS] =
{ {
{ 0, 0, 0, BLACK, wxT( "BLACK" ), DARKDARKGRAY }, { 0, 0, 0, BLACK, wxT( "Black" ), DARKDARKGRAY },
{ 192, 0, 0, BLUE, wxT( "BLUE" ), LIGHTBLUE }, { 72, 72, 72, DARKDARKGRAY, wxT( "Gray 1" ), DARKGRAY },
{ 0, 160, 0, GREEN, wxT( "GREEN" ), LIGHTGREEN }, { 132, 132, 132, DARKGRAY, wxT( "Gray 2" ), LIGHTGRAY },
{ 160, 160, 0, CYAN, wxT( "CYAN" ), LIGHTCYAN }, { 194, 194, 194, LIGHTGRAY, wxT( "Gray 3" ), WHITE },
{ 0, 0, 160, RED, wxT( "RED" ), LIGHTRED }, { 255, 255, 255, WHITE, wxT( "White" ), WHITE },
{ 160, 0, 160, MAGENTA, wxT( "MAGENTA" ), LIGHTMAGENTA }, { 194, 255, 255, LIGHTYELLOW, wxT( "L.Yellow" ), WHITE },
{ 0, 128, 128, BROWN, wxT( "BROWN" ), YELLOW }, { 72, 0, 0, DARKBLUE, wxT( "Blue 1" ), BLUE },
{ 192, 192, 192, LIGHTGRAY, wxT( "GRAY" ), WHITE }, { 0, 72, 0, DARKGREEN, wxT( "Green 1" ), GREEN },
{ 128, 128, 128, DARKGRAY, wxT( "DARKGRAY" ), LIGHTGRAY }, { 72, 72, 0, DARKCYAN, wxT( "Cyan 1" ), CYAN },
{ 255, 0, 0, LIGHTBLUE, wxT( "LIGHTBLUE" ), LIGHTBLUE }, { 0, 0, 72, DARKRED, wxT( "Red 1" ), RED },
{ 0, 255, 0, LIGHTGREEN, wxT( "LIGHTGREEN" ), LIGHTGREEN }, { 72, 0, 72, DARKMAGENTA, wxT( "Magenta 1" ), MAGENTA },
{ 255, 255, 0, LIGHTCYAN, wxT( "LIGHTCYAN" ), LIGHTCYAN }, { 0, 72, 72, DARKBROWN, wxT( "Brown 1" ), BROWN },
{ 0, 0, 255, LIGHTRED, wxT( "LIGHTRED" ), LIGHTRED }, { 132, 0, 0, BLUE, wxT( "Blue 2" ), LIGHTBLUE },
{ 255, 0, 255, LIGHTMAGENTA, wxT( "LIGHTMAGENTA" ), LIGHTMAGENTA }, { 0, 132, 0, GREEN, wxT( "Green 2" ), LIGHTGREEN },
{ 0, 255, 255, YELLOW, wxT( "YELLOW" ), YELLOW }, { 132, 132, 0, CYAN, wxT( "Cyan 2" ), LIGHTCYAN },
{ 255, 255, 255, WHITE, wxT( "WHITE" ), WHITE }, { 0, 0, 132, RED, wxT( "Red 2" ), LIGHTRED },
{ 64, 64, 64, DARKDARKGRAY, wxT( "DARKDARKGRAY" ), DARKGRAY }, { 132, 0, 132, MAGENTA, wxT( "Magenta 2" ), LIGHTMAGENTA },
{ 64, 0, 0, DARKBLUE, wxT( "DARKBLUE" ), BLUE }, { 0, 132, 132, BROWN, wxT( "Brown 2" ), YELLOW },
{ 0, 64, 0, DARKGREEN, wxT( "DARKGREEN" ), GREEN }, { 194, 0, 0, LIGHTBLUE, wxT( "Blue 3" ), PUREBLUE, },
{ 64, 64, 0, DARKCYAN, wxT( "DARKCYAN" ), CYAN }, { 0, 194, 0, LIGHTGREEN, wxT( "Green 3" ), PUREGREEN },
{ 0, 0, 80, DARKRED, wxT( "DARKRED" ), RED }, { 194, 194, 0, LIGHTCYAN, wxT( "Cyan 3" ), PURECYAN },
{ 64, 0, 64, DARKMAGENTA, wxT( "DARKMAGENTA" ), MAGENTA }, { 0, 0, 194, LIGHTRED, wxT( "Red 3" ), PURERED },
{ 0, 64, 64, DARKBROWN, wxT( "DARKBROWN" ), BROWN }, { 194, 0, 194, LIGHTMAGENTA, wxT( "Magenta 3" ), PUREMAGENTA },
{ 128, 255, 255, LIGHTYELLOW, wxT( "LIGHTYELLOW" ), LIGHTYELLOW } { 0, 194, 194, YELLOW, wxT( "Yellow 3" ), PUREYELLOW },
{ 255, 0, 0, PUREBLUE, wxT( "Blue 4" ), WHITE },
{ 0, 255, 0, PUREGREEN, wxT( "Green 4" ), WHITE },
{ 255, 255, 0, PURECYAN, wxT( "Cyan 4" ), WHITE },
{ 0, 0, 255, PURERED, wxT( "Red 4" ), WHITE },
{ 255, 0, 255, PUREMAGENTA, wxT( "Magenta 4" ), WHITE },
{ 0, 255, 255, PUREYELLOW, wxT( "Yellow 4" ), WHITE },
}; };
......
...@@ -45,7 +45,7 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil, ...@@ -45,7 +45,7 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
SetDefaultLineWidth( 0 ); // No line width on DXF SetDefaultLineWidth( 0 ); // No line width on DXF
plotMirror = false; // No mirroring on DXF plotMirror = false; // No mirroring on DXF
currentColor = BLACK; m_currentColor = BLACK;
} }
/** /**
...@@ -151,7 +151,7 @@ bool DXF_PLOTTER::StartPlot() ...@@ -151,7 +151,7 @@ bool DXF_PLOTTER::StartPlot()
" 2\n" " 2\n"
"LAYER\n" "LAYER\n"
" 70\n" " 70\n"
"%d\n", NBCOLOR ); "%d\n", NBCOLORS );
/* The layer/colors palette. The acad/DXF palette is divided in 3 zones: /* The layer/colors palette. The acad/DXF palette is divided in 3 zones:
...@@ -159,7 +159,7 @@ bool DXF_PLOTTER::StartPlot() ...@@ -159,7 +159,7 @@ bool DXF_PLOTTER::StartPlot()
- An HSV zone (10-250, 5 values x 2 saturations x 10 hues - An HSV zone (10-250, 5 values x 2 saturations x 10 hues
- Greys (251 - 255) - Greys (251 - 255)
The is *no* black... the white does it on paper, usually, and There is *no* black... the white does it on paper, usually, and
anyway it depends on the plotter configuration, since DXF colors anyway it depends on the plotter configuration, since DXF colors
are meant to be logical only (they represent *both* line color and are meant to be logical only (they represent *both* line color and
width); later version with plot styles only complicate the matter! width); later version with plot styles only complicate the matter!
...@@ -170,36 +170,41 @@ bool DXF_PLOTTER::StartPlot() ...@@ -170,36 +170,41 @@ bool DXF_PLOTTER::StartPlot()
static const struct { static const struct {
const char *name; const char *name;
int color; int color;
} dxf_layer[NBCOLOR] = { } dxf_layer[NBCOLORS] = {
{ "BLACK", 250 }, { "BLACK", 7 }, // In DXF, color 7 is *both* white and black!
{ "BLUE", 5 }, { "GRAY1", 251 },
{ "GREEN", 3 }, { "GRAY2", 8 },
{ "CYAN", 4 }, { "GRAY3", 9 },
{ "RED", 1 }, { "WHITE", 7 },
{ "MAGENTA", 6 }, { "LYELLOW", 51 },
{ "BROWN", 54 }, { "BLUE1", 178 },
{ "LIGHTGRAY", 9 }, { "GREEN1", 98 },
{ "DARKGRAY", 8 }, { "CYAN1", 138 },
{ "LIGHTBLUE", 171 }, { "RED1", 18 },
{ "LIGHTGREEN", 91 }, { "MAGENTA1", 228 },
{ "LIGHTCYAN", 131 }, { "BROWN1", 58 },
{ "LIGHTRED", 11 }, { "BLUE2", 5 },
{ "LIGHTMAGENTA", 221 }, { "GREEN2", 3 },
{ "YELLOW", 2 }, { "CYAN2", 4 },
{ "WHITE", 7 }, { "RED2", 1 },
{ "DARKDARKGRAY", 251 }, { "MAGENTA2", 6 },
{ "DARKBLUE", 178 }, { "BROWN2", 54 },
{ "DARKGREEN", 98 }, { "BLUE3", 171 },
{ "DARKCYAN", 138 }, { "GREEN3", 91 },
{ "DARKRED", 18 }, { "CYAN3", 131 },
{ "DARKMAGENTA", 228 }, { "RED3", 11 },
{ "DARKBROWN", 58 }, { "MAGENTA3", 221 },
{ "LIGHTYELLOW", 51 }, { "YELLOW3", 2 },
{ "BLUE4", 5 },
{ "GREEN4", 3 },
{ "CYAN4", 4 },
{ "RED4", 1 },
{ "MAGENTA4", 6 },
{ "YELLOW4", 2 }
}; };
for( int i = 0; i < NBCOLOR; i++ ) for( EDA_COLOR_T i = BLACK; i < NBCOLORS; i = NextColor(i) )
{ {
wxString cname = ColorRefs[i].m_Name;
fprintf( outputFile, fprintf( outputFile,
" 0\n" " 0\n"
"LAYER\n" "LAYER\n"
...@@ -254,10 +259,10 @@ void DXF_PLOTTER::SetColor( EDA_COLOR_T color ) ...@@ -254,10 +259,10 @@ void DXF_PLOTTER::SetColor( EDA_COLOR_T color )
|| ( color == BLACK ) || ( color == BLACK )
|| ( color == WHITE ) ) || ( color == WHITE ) )
{ {
currentColor = color; m_currentColor = color;
} }
else else
currentColor = BLACK; m_currentColor = BLACK;
} }
/** /**
...@@ -287,7 +292,7 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int ...@@ -287,7 +292,7 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int
DPOINT centre_dev = userToDeviceCoordinates( centre ); DPOINT centre_dev = userToDeviceCoordinates( centre );
if( radius > 0 ) if( radius > 0 )
{ {
wxString cname = ColorRefs[currentColor].m_Name; wxString cname( ColorGetName( m_currentColor ) );
if (!fill) if (!fill)
{ {
fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n", fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n",
...@@ -349,7 +354,7 @@ void DXF_PLOTTER::PenTo( const wxPoint& pos, char plume ) ...@@ -349,7 +354,7 @@ void DXF_PLOTTER::PenTo( const wxPoint& pos, char plume )
if( penLastpos != pos && plume == 'D' ) if( penLastpos != pos && plume == 'D' )
{ {
// DXF LINE // DXF LINE
wxString cname = ColorRefs[currentColor].m_Name; wxString cname( ColorGetName( m_currentColor ) );
fprintf( outputFile, "0\nLINE\n8\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n", fprintf( outputFile, "0\nLINE\n8\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
TO_UTF8( cname ), TO_UTF8( cname ),
pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y ); pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
...@@ -396,7 +401,7 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad ...@@ -396,7 +401,7 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad
double radius_dev = userToDeviceSize( radius ); double radius_dev = userToDeviceSize( radius );
// Emit a DXF ARC entity // Emit a DXF ARC entity
wxString cname = ColorRefs[currentColor].m_Name; wxString cname( ColorGetName( m_currentColor ) );
fprintf( outputFile, fprintf( outputFile,
"0\nARC\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n50\n%g\n51\n%g\n", "0\nARC\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n50\n%g\n51\n%g\n",
TO_UTF8( cname ), TO_UTF8( cname ),
...@@ -570,7 +575,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos, ...@@ -570,7 +575,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
more useful as a CAD object */ more useful as a CAD object */
DPOINT origin_dev = userToDeviceCoordinates( aPos ); DPOINT origin_dev = userToDeviceCoordinates( aPos );
SetColor( aColor ); SetColor( aColor );
wxString cname = ColorRefs[currentColor].m_Name; wxString cname( ColorGetName( m_currentColor ) );
DPOINT size_dev = userToDeviceSize( aSize ); DPOINT size_dev = userToDeviceSize( aSize );
int h_code = 0, v_code = 0; int h_code = 0, v_code = 0;
switch( aH_justify ) switch( aH_justify )
......
...@@ -39,9 +39,9 @@ void PSLIKE_PLOTTER::SetColor( EDA_COLOR_T color ) ...@@ -39,9 +39,9 @@ void PSLIKE_PLOTTER::SetColor( EDA_COLOR_T color )
if( colorMode ) if( colorMode )
{ {
double r = ColorRefs[color].m_Red / 255.0; double r = g_ColorRefs[color].m_Red / 255.0;
double g = ColorRefs[color].m_Green / 255.0; double g = g_ColorRefs[color].m_Green / 255.0;
double b = ColorRefs[color].m_Blue / 255.0; double b = g_ColorRefs[color].m_Blue / 255.0;
if( negativeMode ) if( negativeMode )
emitSetRGBColor( 1 - r, 1 - g, 1 - b ); emitSetRGBColor( 1 - r, 1 - g, 1 - b );
else else
......
This diff is collapsed.
/* /**
* @file confirm.cpp * @file confirm.cpp
* utilities to display some error, warning and info short messges * @brief utilities to display some error, warning and info short messges
*/ */
#include <fctsys.h> #include <fctsys.h>
......
...@@ -109,8 +109,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -109,8 +109,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
dc.SetClippingRegion( DrawArea ); dc.SetClippingRegion( DrawArea );
} }
const int maskLayer = 0xFFFFFFFF; aFrame->PrintPage( &dc, FULL_LAYERS, false );
aFrame->PrintPage( &dc, maskLayer, false );
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
aFrame->GetCanvas()->SetClipBox( tmp ); aFrame->GetCanvas()->SetClipBox( tmp );
wxMetafile* mf = dc.Close(); wxMetafile* mf = dc.Close();
......
...@@ -63,9 +63,9 @@ const wxString pageFmts[] = ...@@ -63,9 +63,9 @@ const wxString pageFmts[] =
_("C 17x22in"), _("C 17x22in"),
_("D 22x34in"), _("D 22x34in"),
_("E 34x44in"), _("E 34x44in"),
_("USLetter 8.5x11in"), _("US Letter 8.5x11in"),
_("USLegal 8.5x14in"), _("US Legal 8.5x14in"),
_("USLedger 11x17in"), _("US Ledger 11x17in"),
_("User (Custom)"), _("User (Custom)"),
wxT("") // end of list wxT("") // end of list
}; };
...@@ -609,12 +609,20 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -609,12 +609,20 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() ); wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() );
wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() ); wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() );
// Get page type
int idx = m_paperSizeComboBox->GetSelection();
if( idx < 0 )
idx = 0;
wxString paperType = m_pageFmt[idx].Left( m_pageFmt[idx].Index( wxT( " " ) ) );
// Draw layout preview. // Draw layout preview.
wxString emptyString; wxString emptyString;
GRResetPenAndBrush( ( wxDC* ) &memDC ); GRResetPenAndBrush( ( wxDC* ) &memDC );
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom, m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom,
emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreens, paperType, emptyString, m_tb, m_Screen->m_NumberOfScreens,
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED ); m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED );
memDC.SelectObject( wxNullBitmap ); memDC.SelectObject( wxNullBitmap );
......
...@@ -166,9 +166,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* aParent, ...@@ -166,9 +166,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* aParent,
m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ), m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
m_messagePanel->SetBackgroundColour( wxColour( ColorRefs[LIGHTGRAY].m_Red, m_messagePanel->SetBackgroundColour( MakeColour( LIGHTGRAY ) );
ColorRefs[LIGHTGRAY].m_Green,
ColorRefs[LIGHTGRAY].m_Blue ) );
} }
...@@ -324,7 +322,7 @@ void EDA_DRAW_FRAME::ToolOnRightClick( wxCommandEvent& event ) ...@@ -324,7 +322,7 @@ void EDA_DRAW_FRAME::ToolOnRightClick( wxCommandEvent& event )
} }
void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,int aPrintMask, bool aPrintMirrorMode, void* aData ) void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,LAYER_MSK aPrintMask, bool aPrintMirrorMode, void* aData )
{ {
wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") ); wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") );
} }
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <cstdlib> // bsearch() #include <cstdlib> // bsearch()
#include <cctype> #include <cctype>
#include <macros.h>
#include <dsnlexer.h> #include <dsnlexer.h>
//#include "fctsys.h" //#include "fctsys.h"
...@@ -280,24 +280,25 @@ bool DSNLEXER::IsSymbol( int aTok ) ...@@ -280,24 +280,25 @@ bool DSNLEXER::IsSymbol( int aTok )
void DSNLEXER::Expecting( int aTok ) throw( IO_ERROR ) void DSNLEXER::Expecting( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText;
errText << wxT(" ") << GetTokenString( aTok ); errText.Printf( _("Expecting '%s'"), GetChars( GetTokenString( aTok ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
} }
void DSNLEXER::Expecting( const char* text ) throw( IO_ERROR ) void DSNLEXER::Expecting( const char* text ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText;
errText << wxT(" '") << wxString::FromUTF8( text ) << wxT("'"); errText.Printf( _("Expecting '%s'"),
GetChars( wxString::FromUTF8( text ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
} }
void DSNLEXER::Unexpected( int aTok ) throw( IO_ERROR ) void DSNLEXER::Unexpected( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText;
errText << wxT(" ") << GetTokenString( aTok ); errText.Printf( _("Unexpected '%s'"), GetChars( GetTokenString( aTok ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
} }
...@@ -312,8 +313,9 @@ void DSNLEXER::Duplicate( int aTok ) throw( IO_ERROR ) ...@@ -312,8 +313,9 @@ void DSNLEXER::Duplicate( int aTok ) throw( IO_ERROR )
void DSNLEXER::Unexpected( const char* text ) throw( IO_ERROR ) void DSNLEXER::Unexpected( const char* text ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText;
errText << wxT(" '") << wxString::FromUTF8( text ) << wxT("'"); errText.Printf( _("Unexpected '%s'"),
GetChars( wxString::FromUTF8( text ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
} }
......
...@@ -122,8 +122,7 @@ bool GetAssociatedDocument( wxFrame* aFrame, ...@@ -122,8 +122,7 @@ bool GetAssociatedDocument( wxFrame* aFrame,
if( !wxFileExists( fullfilename ) ) if( !wxFileExists( fullfilename ) )
{ {
msg = _( "Doc File " ); msg.Printf( _( "Doc File <%s> not found" ), GetChars( aDocName ) );
msg << wxT("\"") << aDocName << wxT("\"") << _( " not found" );
DisplayError( aFrame, msg ); DisplayError( aFrame, msg );
return false; return false;
} }
......
...@@ -269,22 +269,12 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, ...@@ -269,22 +269,12 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
if( aDrawMode != -1 ) if( aDrawMode != -1 )
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
/* Draw text anchor, if allowed */ // Draw text anchor, if requested
if( aAnchor_color != UNSPECIFIED_COLOR ) if( aAnchor_color != UNSPECIFIED_COLOR )
{ {
GRDrawAnchor( aPanel->GetClipBox(), aDC,
int anchor_size = aDC->DeviceToLogicalXRel( 2 ); aPos.x + aOffset.x, aPos.y + aOffset.y,
DIM_ANCRE_TEXTE, aAnchor_color );
aAnchor_color = (EDA_COLOR_T) ( aAnchor_color & MASKCOLOR );
int cX = aPos.x + aOffset.x;
int cY = aPos.y + aOffset.y;
GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY,
cX + anchor_size, cY, 0, aAnchor_color );
GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
cX, cY + anchor_size, 0, aAnchor_color );
} }
if( aFillMode == SKETCH ) if( aFillMode == SKETCH )
......
...@@ -652,15 +652,16 @@ bool OpenPDF( const wxString& file ) ...@@ -652,15 +652,16 @@ bool OpenPDF( const wxString& file )
if( !success ) if( !success )
{ {
wxString msg = _( "Problem while running the PDF viewer" ); wxString msg;
msg << _( "\n command is " ) << command; msg.Printf( _( "Problem while running the PDF viewer\nCommand is '%s'" ),
GetChars( command ) );
DisplayError( NULL, msg ); DisplayError( NULL, msg );
} }
} }
else else
{ {
wxString msg = _( "Unable to find a PDF viewer for" ); wxString msg;
msg << wxT( " " ) << filename; msg.Printf( _( "Unable to find a PDF viewer for <%s>" ), GetChars( filename ) );
DisplayError( NULL, msg ); DisplayError( NULL, msg );
success = false; success = false;
} }
......
...@@ -1451,3 +1451,124 @@ void GRBezier( EDA_RECT* ClipBox, ...@@ -1451,3 +1451,124 @@ void GRBezier( EDA_RECT* ClipBox,
std::vector<wxPoint> Points = Bezier2Poly( x1, y1, x2, y2, x3, y3, x4, y4 ); std::vector<wxPoint> Points = Bezier2Poly( x1, y1, x2, y2, x3, y3, x4, y4 );
GRPoly( ClipBox, DC, Points.size(), &Points[0], false, width, Color, Color ); GRPoly( ClipBox, DC, Points.size(), &Points[0], false, width, Color, Color );
} }
EDA_COLOR_T ColorMix( EDA_COLOR_T aColor1, EDA_COLOR_T aColor2 )
{
/* Memoization storage. This could be potentially called for each
* color merge so a cache is useful (there are few colours anyway) */
static EDA_COLOR_T mix_cache[NBCOLORS][NBCOLORS];
// TODO how is alpha used? it's a mac only thing, I have no idea
aColor1 = ColorGetBase( aColor1 );
aColor2 = ColorGetBase( aColor2 );
// First easy thing: a black gives always the other colour
if( aColor1 == BLACK )
return aColor2;
if( aColor2 == BLACK)
return aColor1;
/* Now we are sure that black can't occur, so the rule is:
* BLACK means not computed yet. If we're lucky we already have
* an answer */
EDA_COLOR_T candidate = mix_cache[aColor1][aColor2];
if( candidate != BLACK )
return candidate;
// Blend the two colors (i.e. OR the RGB values)
const StructColors &c1 = g_ColorRefs[aColor1];
const StructColors &c2 = g_ColorRefs[aColor2];
// Ask the palette for the nearest color to the mix
wxColour mixed( c1.m_Red | c2.m_Red,
c1.m_Green | c2.m_Green,
c1.m_Blue | c2.m_Blue );
candidate = ColorFindNearest( mixed );
/* Here, BLACK is *not* a good answer, since it would recompute the next time.
* Even theorically its not possible (with the current rules), but
* maybe the metric will change in the future */
if( candidate == BLACK)
candidate = DARKDARKGRAY;
// Store the result in the cache. The operation is commutative, too
mix_cache[aColor1][aColor2] = candidate;
mix_cache[aColor2][aColor1] = candidate;
return candidate;
}
EDA_COLOR_T ColorByName( const wxChar *aName )
{
// look for a match in the palette itself
for( EDA_COLOR_T trying = BLACK; trying < NBCOLORS; trying = NextColor(trying) )
{
if( 0 == wxStricmp( aName, g_ColorRefs[trying].m_Name ) )
return trying;
}
// Not found, no idea...
return UNSPECIFIED_COLOR;
}
bool ColorIsLight( EDA_COLOR_T aColor )
{
const StructColors &c = g_ColorRefs[ColorGetBase( aColor )];
int r = c.m_Red;
int g = c.m_Green;
int b = c.m_Blue;
return ((r * r) + (g * g) + (b * b)) > (128 * 128 * 3);
}
EDA_COLOR_T ColorFindNearest( const wxColour &aColor )
{
EDA_COLOR_T candidate = BLACK;
// These are ints because we will subtract them later
int r = aColor.Red();
int g = aColor.Green();
int b = aColor.Blue();
/* Find the 'nearest' color in the palette. This is fun. There is
a gazilion of metrics for the color space and no one of the
useful one is in the RGB color space. Who cares, this is a CAD,
not a photosomething...
I hereby declare that the distance is the sum of the square of the
component difference. Think about the RGB color cube. Now get the
euclidean distance, but without the square root... for ordering
purposes it's the same, obviously. Also each component can't be
less of the target one, since I found this currently work better...
*/
int nearest_distance = 255 * 255 * 3 + 1; // Can't beat this
for( EDA_COLOR_T trying = BLACK; trying < NBCOLORS; trying = NextColor(trying) )
{
const StructColors &c = g_ColorRefs[trying];
int distance = (r - c.m_Red) * (r - c.m_Red) +
(g - c.m_Green) * (g - c.m_Green) +
(b - c.m_Blue) * (b - c.m_Blue);
if( distance < nearest_distance && c.m_Red >= r &&
c.m_Green >= g && c.m_Blue >= b )
{
nearest_distance = distance;
candidate = trying;
}
}
return candidate;
}
void GRDrawAnchor( EDA_RECT *aClipBox, wxDC *aDC, int x, int y,
int aSize, EDA_COLOR_T aColor )
{
int anchor_size = aDC->DeviceToLogicalXRel( aSize );
GRLine( aClipBox, aDC,
x - anchor_size, y,
x + anchor_size, y, 0, aColor );
GRLine( aClipBox, aDC,
x, y - anchor_size,
x, y + anchor_size, 0, aColor );
}
...@@ -205,9 +205,7 @@ void EDA_MSG_PANEL::showItem( wxDC& aDC, const MSG_PANEL_ITEM& aItem ) ...@@ -205,9 +205,7 @@ void EDA_MSG_PANEL::showItem( wxDC& aDC, const MSG_PANEL_ITEM& aItem )
if( color >= 0 ) if( color >= 0 )
{ {
color = ColorGetBase( color ); color = ColorGetBase( color );
aDC.SetTextForeground( wxColour( ColorRefs[color].m_Red, aDC.SetTextForeground( MakeColour( color ) );
ColorRefs[color].m_Green,
ColorRefs[color].m_Blue ) );
} }
if( !aItem.m_UpperText.IsEmpty() ) if( !aItem.m_UpperText.IsEmpty() )
......
...@@ -123,7 +123,7 @@ const char* const newstroke_font[] = ...@@ -123,7 +123,7 @@ const char* const newstroke_font[] =
"KYVcUcSbR`RVQTOSQRRPRFSDUCVC", "KYVcUcSbR`RVQTOSQRRPRFSDUCVC",
"H\\RbRD", "H\\RbRD",
"KYNcOcQbR`RVSTUSSRRPRFQDOCNC", "KYNcOcQbR`RVSTUSSRRPRFQDOCNC",
"KZMHNGPFTHVGWF", "KZMSNRPQTSVRWQ",
"F^K[KFYFY[K[", "F^K[KFYFY[K[",
/* // LATIN-1 SUPPLEMENT (0080-00FF) */ /* // LATIN-1 SUPPLEMENT (0080-00FF) */
"F^K[KFYFY[K[", /* U+80 */ "F^K[KFYFY[K[", /* U+80 */
......
...@@ -46,12 +46,12 @@ RENDER_SETTINGS::RENDER_SETTINGS() ...@@ -46,12 +46,12 @@ RENDER_SETTINGS::RENDER_SETTINGS()
m_outlineWidth = 60000; m_outlineWidth = 60000;
// Store the predefined colors used in KiCad in format used by GAL // Store the predefined colors used in KiCad in format used by GAL
for( int i = 0; i < NBCOLOR; i++ ) for( int i = 0; i < NBCOLORS; i++ )
{ {
m_legacyColorMap[ColorRefs[i].m_Numcolor] = COLOR4D( (double) ColorRefs[i].m_Red / 255.0, m_legacyColorMap[g_ColorRefs[i].m_Numcolor] = COLOR4D( (double) g_ColorRefs[i].m_Red / 255.0,
(double) ColorRefs[i].m_Green / 255.0, (double) g_ColorRefs[i].m_Green / 255.0,
(double) ColorRefs[i].m_Blue / 255.0, (double) g_ColorRefs[i].m_Blue / 255.0,
m_layerOpacity ); m_layerOpacity );
} }
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <pcbcommon.h> #include <pcbcommon.h>
#include <plot_common.h> #include <plot_common.h>
#include <class_board.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_zone_settings.h> #include <class_zone_settings.h>
#include <class_board_design_settings.h> #include <class_board_design_settings.h>
...@@ -42,36 +43,9 @@ ...@@ -42,36 +43,9 @@
class MODULE; class MODULE;
/* return a one bit layer mask from a layer number
* aLayerNumber = the layer number to convert (0 .. LAYER_COUNT-1)
*/
int GetLayerMask( int aLayerNumber )
{
wxASSERT( aLayerNumber < LAYER_COUNT && aLayerNumber >= 0 );
#if 0
// Look up Table for conversion one layer number -> one bit layer mask:
static int tabOneLayerMask[LAYER_COUNT] =
{
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x00000100, 0x00000200, 0x00000400, 0x00000800,
0x00001000, 0x00002000, 0x00004000, 0x00008000,
0x00010000, 0x00020000, 0x00040000, 0x00080000,
0x00100000, 0x00200000, 0x00400000, 0x00800000,
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000
};
return( tabOneLayerMask[aLayerNumber] );
#else
return 1 << aLayerNumber;
#endif
}
/* Look up Table for conversion copper layer count -> general copper layer /* Look up Table for conversion copper layer count -> general copper layer
* mask: */ * mask: */
int g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = { LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
0x0001, 0x8001, 0x8003, 0x8007, 0x0001, 0x8001, 0x8003, 0x8007,
0x800F, 0x801F, 0x803F, 0x807F, 0x800F, 0x801F, 0x803F, 0x807F,
0x80FF, 0x81FF, 0x83FF, 0x87FF, 0x80FF, 0x81FF, 0x83FF, 0x87FF,
...@@ -79,7 +53,7 @@ int g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = { ...@@ -79,7 +53,7 @@ int g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
}; };
DISPLAY_OPTIONS DisplayOpt; /* Display options for board items */ DISPLAY_OPTIONS DisplayOpt; // Display options for board items
int g_RotationAngle; int g_RotationAngle;
...@@ -99,3 +73,156 @@ int g_PadCMPColor = RED; ...@@ -99,3 +73,156 @@ int g_PadCMPColor = RED;
*/ */
DLIST<TRACK> g_CurrentTrackList; DLIST<TRACK> g_CurrentTrackList;
LAYER_NUM FlipLayer( LAYER_NUM oldlayer )
{
switch( oldlayer )
{
case LAYER_N_BACK:
return LAYER_N_FRONT;
case LAYER_N_FRONT:
return LAYER_N_BACK;
case SILKSCREEN_N_BACK:
return SILKSCREEN_N_FRONT;
case SILKSCREEN_N_FRONT:
return SILKSCREEN_N_BACK;
case ADHESIVE_N_BACK:
return ADHESIVE_N_FRONT;
case ADHESIVE_N_FRONT:
return ADHESIVE_N_BACK;
case SOLDERMASK_N_BACK:
return SOLDERMASK_N_FRONT;
case SOLDERMASK_N_FRONT:
return SOLDERMASK_N_BACK;
case SOLDERPASTE_N_BACK:
return SOLDERPASTE_N_FRONT;
case SOLDERPASTE_N_FRONT:
return SOLDERPASTE_N_BACK;
// No change for the other layers
default:
return oldlayer;
}
}
LAYER_MSK FlipLayerMask( LAYER_MSK aMask )
{
LAYER_MSK newMask;
newMask = aMask & ~(LAYER_BACK | LAYER_FRONT |
SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT |
ADHESIVE_LAYER_BACK | ADHESIVE_LAYER_FRONT |
SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT |
SOLDERPASTE_LAYER_BACK | SOLDERPASTE_LAYER_FRONT |
ADHESIVE_LAYER_BACK | ADHESIVE_LAYER_FRONT);
if( aMask & LAYER_BACK )
newMask |= LAYER_FRONT;
if( aMask & LAYER_FRONT )
newMask |= LAYER_BACK;
if( aMask & SILKSCREEN_LAYER_BACK )
newMask |= SILKSCREEN_LAYER_FRONT;
if( aMask & SILKSCREEN_LAYER_FRONT )
newMask |= SILKSCREEN_LAYER_BACK;
if( aMask & ADHESIVE_LAYER_BACK )
newMask |= ADHESIVE_LAYER_FRONT;
if( aMask & ADHESIVE_LAYER_FRONT )
newMask |= ADHESIVE_LAYER_BACK;
if( aMask & SOLDERMASK_LAYER_BACK )
newMask |= SOLDERMASK_LAYER_FRONT;
if( aMask & SOLDERMASK_LAYER_FRONT )
newMask |= SOLDERMASK_LAYER_BACK;
if( aMask & SOLDERPASTE_LAYER_BACK )
newMask |= SOLDERPASTE_LAYER_FRONT;
if( aMask & SOLDERPASTE_LAYER_FRONT )
newMask |= SOLDERPASTE_LAYER_BACK;
if( aMask & ADHESIVE_LAYER_BACK )
newMask |= ADHESIVE_LAYER_FRONT;
if( aMask & ADHESIVE_LAYER_FRONT )
newMask |= ADHESIVE_LAYER_BACK;
return newMask;
}
LAYER_NUM ExtractLayer( LAYER_MSK aMask )
{
if( aMask == NO_LAYERS )
return UNSELECTED_LAYER;
LAYER_NUM candidate = UNDEFINED_LAYER;
// Scan all the layers and take note of the first set; if other are
// then found return UNDEFINED_LAYER
for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i )
{
if( aMask & GetLayerMask( i ) )
{
if( candidate == UNDEFINED_LAYER )
candidate = i;
else
return UNDEFINED_LAYER;
}
}
return candidate;
}
wxString LayerMaskDescribe( const BOARD *aBoard, LAYER_MSK aMask )
{
// Try the single or no- layer case (easy)
LAYER_NUM layer = ExtractLayer( aMask );
switch( layer )
{
case UNSELECTED_LAYER:
return _( "No layers" );
case UNDEFINED_LAYER:
break;
default:
return aBoard->GetLayerName( layer );
}
// Try to be smart and useful, starting with outer copper
// (which are more important than internal ones)
wxString layerInfo;
if( aMask & LAYER_FRONT )
AccumulateDescription( layerInfo, aBoard->GetLayerName( LAYER_N_FRONT ) );
if( aMask & LAYER_BACK )
AccumulateDescription( layerInfo, aBoard->GetLayerName( LAYER_N_BACK ) );
if( aMask & INTERNAL_CU_LAYERS )
AccumulateDescription( layerInfo, _("Internal" ) );
if( aMask & ALL_NO_CU_LAYERS )
AccumulateDescription( layerInfo, _("Non-copper" ) );
return layerInfo;
}
void AccumulateDescription( wxString &aDesc, const wxString &aItem )
{
if( !aDesc.IsEmpty() )
aDesc << wxT(", ");
aDesc << aItem;
}
This diff is collapsed.
This diff is collapsed.
...@@ -58,7 +58,7 @@ bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 ) ...@@ -58,7 +58,7 @@ bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 )
SCH_ITEM::SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType ) : SCH_ITEM::SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType ) :
EDA_ITEM( aParent, aType ) EDA_ITEM( aParent, aType )
{ {
m_Layer = 0; m_Layer = LAYER_WIRE; // It's only a default, in fact
} }
......
...@@ -54,7 +54,7 @@ EDA_COLOR_T DisplayColorFrame( wxWindow* parent, int OldColor ) ...@@ -54,7 +54,7 @@ EDA_COLOR_T DisplayColorFrame( wxWindow* parent, int OldColor )
framepos, OldColor ); framepos, OldColor );
color = static_cast<EDA_COLOR_T>( frame->ShowModal() ); color = static_cast<EDA_COLOR_T>( frame->ShowModal() );
frame->Destroy(); frame->Destroy();
if( color > NBCOLOR ) if( color > NBCOLORS )
color = UNSPECIFIED_COLOR; color = UNSPECIFIED_COLOR;
return color; return color;
} }
...@@ -125,7 +125,7 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor ) ...@@ -125,7 +125,7 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
wxStdDialogButtonSizer* StdDialogButtonSizer = NULL; wxStdDialogButtonSizer* StdDialogButtonSizer = NULL;
wxButton* Button = NULL; wxButton* Button = NULL;
int ii, butt_ID, buttcolor; int ii, butt_ID;
int w = 20, h = 20; int w = 20, h = 20;
bool ColorFound = false; bool ColorFound = false;
...@@ -137,17 +137,17 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor ) ...@@ -137,17 +137,17 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
MainBoxSizer = new wxBoxSizer( wxHORIZONTAL ); MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
for( ii = 0; ColorRefs[ii].m_Name != NULL && ii < NBCOLOR; ii++ ) for( ii = 0; ii < NBCOLORS; ++ii )
{ {
// Provide a separate column for every eight buttons (and their // Provide a separate column for every six buttons (and their
// associated text strings), so provide a FlexGrid Sizer with // associated text strings), so provide a FlexGrid Sizer with
// eight rows and two columns. // eight rows and two columns.
if( ii % 8 == 0 ) if( ii % 6 == 0 )
{ {
FlexColumnBoxSizer = new wxFlexGridSizer( 8, 2, 0, 0 ); FlexColumnBoxSizer = new wxFlexGridSizer( 6, 2, 0, 0 );
// Specify that all of the rows can be expanded. // Specify that all of the rows can be expanded.
for( int ii = 0; ii < 8; ii++ ) for( int ii = 0; ii < 6; ii++ )
{ {
FlexColumnBoxSizer->AddGrowableRow( ii ); FlexColumnBoxSizer->AddGrowableRow( ii );
} }
...@@ -163,11 +163,9 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor ) ...@@ -163,11 +163,9 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
wxBitmap ButtBitmap( w, h ); wxBitmap ButtBitmap( w, h );
wxBrush Brush; wxBrush Brush;
iconDC.SelectObject( ButtBitmap ); iconDC.SelectObject( ButtBitmap );
buttcolor = ColorRefs[ii].m_Numcolor; EDA_COLOR_T buttcolor = g_ColorRefs[ii].m_Numcolor;
iconDC.SetPen( *wxBLACK_PEN ); iconDC.SetPen( *wxBLACK_PEN );
Brush.SetColour( ColorRefs[buttcolor].m_Red, ColorSetBrush( &Brush, buttcolor );
ColorRefs[buttcolor].m_Green,
ColorRefs[buttcolor].m_Blue );
Brush.SetStyle( wxSOLID ); Brush.SetStyle( wxSOLID );
iconDC.SetBrush( Brush ); iconDC.SetBrush( Brush );
...@@ -190,7 +188,7 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor ) ...@@ -190,7 +188,7 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
BitmapButton->SetFocus(); BitmapButton->SetFocus();
} }
Label = new wxStaticText( this, -1, ColorRefs[ii].m_Name, Label = new wxStaticText( this, -1, ColorGetName( buttcolor ),
wxDefaultPosition, wxDefaultSize, 0 ); wxDefaultPosition, wxDefaultSize, 0 );
FlexColumnBoxSizer->Add( Label, 1, FlexColumnBoxSizer->Add( Label, 1,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL |
......
...@@ -95,4 +95,4 @@ const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf ...@@ -95,4 +95,4 @@ const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf
const wxString PSFileWildcard( _( "PostScript files (.ps)|*.ps" ) ); const wxString PSFileWildcard( _( "PostScript files (.ps)|*.ps" ) );
const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" ); const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" );
const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" ); const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" );
const wxString VrmlFileWildcard( _( "Vrml files (*.wrl)|*.wrl" ) ); const wxString Shapes3DFileWildcard( _( "Vrml and x3d files (*.wrl *.x3d)|*.wrl;*.x3d" ) );
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <wxstruct.h> #include <wxstruct.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <base_units.h> #include <base_units.h>
#include <macros.h>
/*******************************************************/ /*******************************************************/
...@@ -56,7 +57,8 @@ EDA_GRAPHIC_TEXT_CTRL::EDA_GRAPHIC_TEXT_CTRL( wxWindow* parent, ...@@ -56,7 +57,8 @@ EDA_GRAPHIC_TEXT_CTRL::EDA_GRAPHIC_TEXT_CTRL( wxWindow* parent,
if( !Title.IsEmpty() ) if( !Title.IsEmpty() )
{ {
wxString msg = _( "Size" ) + ReturnUnitSymbol( m_UserUnit ); wxString msg;
msg.Printf( _( "Size%s" ), GetChars( ReturnUnitSymbol( m_UserUnit ) ) );
wxStaticText* text = new wxStaticText( parent, -1, msg ); wxStaticText* text = new wxStaticText( parent, -1, msg );
BoxSizer->Add( text, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); BoxSizer->Add( text, 0, wxGROW | wxLEFT | wxRIGHT, 5 );
......
...@@ -27,7 +27,6 @@ const wxString RetroFileExtension( wxT( "stf" ) ); ...@@ -27,7 +27,6 @@ const wxString RetroFileExtension( wxT( "stf" ) );
const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic): // Wildcard for schematic retroannotation (import footprint names in schematic):
const wxString RetroFileWildcard( _( "KiCad retroannotation files (*.stf)|*.stf" ) );
const wxString FootprintAliasFileWildcard( _( "KiCad footprint alias files (*.equ)|*.equ" ) ); const wxString FootprintAliasFileWildcard( _( "KiCad footprint alias files (*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment