merge from testing
This commit is contained in:
commit
50dbd5b762
|
@ -175,7 +175,7 @@ Info_3D_Visu::~Info_3D_Visu()
|
|||
* units */
|
||||
WinEDA_VertexCtrl::WinEDA_VertexCtrl( wxWindow* parent, const wxString& title,
|
||||
wxBoxSizer* BoxSizer,
|
||||
UserUnitType units, int internal_unit )
|
||||
EDA_UNITS_T units, int internal_unit )
|
||||
{
|
||||
wxString text;
|
||||
wxStaticText* msgtitle;
|
||||
|
|
|
@ -92,7 +92,9 @@ void Pcb3D_GLCanvas::Redraw( bool finish )
|
|||
glRotatef( g_Parm_3D_Visu.m_Rot[2], 0.0, 0.0, 1.0 );
|
||||
|
||||
if( m_gllist )
|
||||
{
|
||||
glCallList( m_gllist );
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDrawGL_List();
|
||||
|
@ -146,9 +148,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
|
|||
for( ii = 0; ii < 32; ii++ )
|
||||
{
|
||||
if( ii < g_Parm_3D_Visu.m_Layers )
|
||||
g_Parm_3D_Visu.m_LayerZcoord[ii] =
|
||||
g_Parm_3D_Visu.m_Epoxy_Width
|
||||
* ii / (g_Parm_3D_Visu.m_Layers - 1);
|
||||
g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width
|
||||
* ii / (g_Parm_3D_Visu.m_Layers - 1);
|
||||
else
|
||||
g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width;
|
||||
}
|
||||
|
@ -277,16 +278,20 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
|
|||
for( ii = 0; ii < pcb->GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* zone = pcb->GetArea( ii );
|
||||
|
||||
if( zone->m_FilledPolysList.size() == 0 )
|
||||
continue;
|
||||
|
||||
if( zone->m_ZoneMinThickness <= 1 )
|
||||
continue;
|
||||
|
||||
int imax = zone->m_FilledPolysList.size() - 1;
|
||||
CPolyPt* firstcorner = &zone->m_FilledPolysList[0];
|
||||
CPolyPt* begincorner = firstcorner;
|
||||
SEGZONE dummysegment( pcb );
|
||||
dummysegment.SetLayer( zone->GetLayer() );
|
||||
dummysegment.m_Width = zone->m_ZoneMinThickness;
|
||||
|
||||
for( int ic = 1; ic <= imax; ic++ )
|
||||
{
|
||||
CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
|
||||
|
@ -312,13 +317,16 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
|
|||
|
||||
Draw3D_Track( &dummysegment );
|
||||
}
|
||||
|
||||
ic++;
|
||||
|
||||
if( ic < imax - 1 )
|
||||
begincorner = firstcorner =
|
||||
&zone->m_FilledPolysList[ic];
|
||||
begincorner = firstcorner = &zone->m_FilledPolysList[ic];
|
||||
}
|
||||
else
|
||||
{
|
||||
begincorner = endcorner;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -345,6 +353,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
|
|||
|
||||
/* draw footprints */
|
||||
MODULE* Module = pcb->m_Modules;
|
||||
|
||||
for( ; Module != NULL; Module = Module->Next() )
|
||||
{
|
||||
Module->Draw3D( this );
|
||||
|
@ -373,6 +382,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )
|
|||
|
||||
if( layer == LAST_COPPER_LAYER )
|
||||
layer = g_Parm_3D_Visu.m_Layers - 1;
|
||||
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
|
||||
SetGLColor( color );
|
||||
|
@ -404,6 +414,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
|
|||
|
||||
if( layer == LAST_COPPER_LAYER )
|
||||
layer = g_Parm_3D_Visu.m_Layers - 1;
|
||||
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
g_Parm_3D_Visu.m_ActZpos = zpos;
|
||||
|
||||
|
@ -471,16 +482,16 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
|
|||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
if( layer < g_Parm_3D_Visu.m_Layers - 1 )
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
|
||||
false )
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
|
||||
continue;
|
||||
|
||||
color = g_ColorsSettings.GetLayerColor( layer );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
|
||||
false )
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) == false )
|
||||
continue;
|
||||
|
||||
color = g_ColorsSettings.GetLayerColor( LAYER_N_FRONT );
|
||||
}
|
||||
|
||||
|
@ -488,11 +499,14 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
|
|||
|
||||
// SetGLColor( LIGHTGRAY );
|
||||
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
|
||||
|
||||
if( layer == LAYER_N_BACK )
|
||||
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
else
|
||||
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
|
||||
Draw3D_FilledCircle( x, -y, r, hole, zpos );
|
||||
|
||||
if( layer >= top_layer )
|
||||
break;
|
||||
}
|
||||
|
@ -500,10 +514,8 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
|
|||
// Drawing hole:
|
||||
color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->m_Shape );
|
||||
SetGLColor( color );
|
||||
height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] -
|
||||
g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
|
||||
Draw3D_FilledCylinder( x, -y, hole, height,
|
||||
g_Parm_3D_Visu.m_LayerZcoord[bottom_layer] );
|
||||
height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] - g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
|
||||
Draw3D_FilledCylinder( x, -y, hole, height, g_Parm_3D_Visu.m_LayerZcoord[bottom_layer] );
|
||||
}
|
||||
|
||||
|
||||
|
@ -553,6 +565,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
|
|||
{
|
||||
glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
|
||||
if( Get3DLayerEnable( layer ) )
|
||||
{
|
||||
switch( segment->m_Shape )
|
||||
|
@ -591,8 +604,7 @@ static void Draw3dTextSegm( int x0, int y0, int xf, int yf )
|
|||
double endx = xf * g_Parm_3D_Visu.m_BoardScale;
|
||||
double endy = yf * g_Parm_3D_Visu.m_BoardScale;
|
||||
|
||||
Draw3D_FilledSegment( startx, -starty, endx, -endy,
|
||||
s_Text3DWidth, s_Text3DZPos );
|
||||
Draw3D_FilledSegment( startx, -starty, endx, -endy, s_Text3DWidth, s_Text3DZPos );
|
||||
}
|
||||
|
||||
|
||||
|
@ -605,14 +617,15 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
|
|||
|
||||
int color = g_ColorsSettings.GetLayerColor( layer );
|
||||
|
||||
|
||||
SetGLColor( color );
|
||||
s_Text3DZPos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
s_Text3DWidth = text->m_Thickness * g_Parm_3D_Visu.m_BoardScale;
|
||||
glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
|
||||
wxSize size = text->m_Size;
|
||||
|
||||
if( text->m_Mirror )
|
||||
NEGATE( size.x );
|
||||
|
||||
if( text->m_MultilineAllowed )
|
||||
{
|
||||
wxPoint pos = text->m_Pos;
|
||||
|
@ -622,6 +635,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
|
|||
offset.y = text->GetInterline();
|
||||
|
||||
RotatePoint( &offset, text->m_Orient );
|
||||
|
||||
for( unsigned i = 0; i<list->Count(); i++ )
|
||||
{
|
||||
wxString txt = list->Item( i );
|
||||
|
@ -636,12 +650,14 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
|
|||
delete (list);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawGraphicText( NULL, NULL, text->m_Pos, (EDA_Colors) color,
|
||||
text->m_Text, text->m_Orient, size,
|
||||
text->m_HJustify, text->m_VJustify,
|
||||
text->m_Thickness, text->m_Italic,
|
||||
true,
|
||||
Draw3dTextSegm );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -652,6 +668,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
/* Draw pads */
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
|
||||
|
||||
for( ; pad != NULL; pad = pad->Next() )
|
||||
{
|
||||
pad->Draw3D( glcanvas );
|
||||
|
@ -679,6 +696,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
glRotatef( 180.0, 0.0, 1.0, 0.0 );
|
||||
glRotatef( 180.0, 0.0, 0.0, 1.0 );
|
||||
}
|
||||
|
||||
DataScale3D = g_Parm_3D_Visu.m_BoardScale * UNITS3D_TO_UNITSPCB;
|
||||
|
||||
for( ; Struct3D != NULL; Struct3D = Struct3D->Next() )
|
||||
|
@ -789,7 +807,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
default:
|
||||
s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape );
|
||||
D( printf( "%s", TO_UTF8( s ) ); )
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -837,7 +855,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
default:
|
||||
s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape );
|
||||
D( printf( "%s", TO_UTF8( s ) ); )
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -889,8 +907,8 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
|
||||
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
|
||||
nlmax = g_Parm_3D_Visu.m_Layers - 1;
|
||||
Oncu = (m_Masque_Layer & LAYER_BACK) ? TRUE : FALSE;
|
||||
Oncmp = (m_Masque_Layer & LAYER_FRONT) ? TRUE : FALSE;
|
||||
Oncu = (m_layerMask & LAYER_BACK) ? TRUE : FALSE;
|
||||
Oncmp = (m_layerMask & LAYER_FRONT) ? TRUE : FALSE;
|
||||
Both = Oncu && Oncmp;
|
||||
|
||||
switch( m_PadShape & 0x7F )
|
||||
|
@ -899,29 +917,35 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
x = xc * scale;
|
||||
y = yc * scale;
|
||||
r = (double) dx * scale;
|
||||
|
||||
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
|
||||
{
|
||||
if( layer && (layer == nlmax) )
|
||||
layer = LAYER_N_FRONT;
|
||||
|
||||
if( (layer == LAYER_N_FRONT) && !Oncmp )
|
||||
continue;
|
||||
|
||||
if( (layer == LAYER_N_BACK) && !Oncu )
|
||||
continue;
|
||||
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
|
||||
&& !Both )
|
||||
|
||||
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
|
||||
continue;
|
||||
|
||||
color = g_ColorsSettings.GetLayerColor( layer );
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
|
||||
false )
|
||||
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
|
||||
continue;
|
||||
|
||||
SetGLColor( color );
|
||||
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
|
||||
if( layer == LAYER_N_BACK )
|
||||
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
else
|
||||
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
|
||||
Draw3D_FilledCircle( x, -y, r, hole, zpos );
|
||||
}
|
||||
|
||||
|
@ -940,42 +964,48 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
delta_cy = dy - dx;
|
||||
w = m_Size.x * scale;
|
||||
}
|
||||
|
||||
RotatePoint( &delta_cx, &delta_cy, angle );
|
||||
|
||||
{
|
||||
double ox, oy, fx, fy;
|
||||
ox = (double) ( ux0 + delta_cx ) * scale;
|
||||
oy = (double) ( uy0 + delta_cy ) * scale;
|
||||
fx = (double) ( ux0 - delta_cx ) * scale;
|
||||
fy = (double) ( uy0 - delta_cy ) * scale;
|
||||
for( layer = FIRST_COPPER_LAYER;
|
||||
layer <= LAST_COPPER_LAYER;
|
||||
layer++ )
|
||||
|
||||
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
|
||||
{
|
||||
if( layer && (layer == nlmax) )
|
||||
layer = LAYER_N_FRONT;
|
||||
|
||||
if( (layer == LAYER_N_FRONT) && !Oncmp )
|
||||
continue;
|
||||
|
||||
if( (layer == LAYER_N_BACK) && !Oncu )
|
||||
continue;
|
||||
if( (layer > FIRST_COPPER_LAYER)
|
||||
&& (layer < LAST_COPPER_LAYER) && !Both )
|
||||
|
||||
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
|
||||
continue;
|
||||
|
||||
color = g_ColorsSettings.GetLayerColor( layer );
|
||||
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
|
||||
false )
|
||||
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
|
||||
continue;
|
||||
|
||||
SetGLColor( color );
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
|
||||
if( layer == LAYER_N_BACK )
|
||||
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
else
|
||||
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
Draw3D_FilledSegmentWithHole( ox, -oy, fx, -fy, w, drillx,
|
||||
-drilly, hole, zpos );
|
||||
|
||||
Draw3D_FilledSegmentWithHole( ox, -oy, fx, -fy, w, drillx, -drilly, hole, zpos );
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PAD_RECT:
|
||||
|
@ -984,6 +1014,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
wxPoint coord[5];
|
||||
wxRealPoint fcoord[8], f_hole_coord[8];
|
||||
BuildPadPolygon( coord, wxSize(0,0), angle );
|
||||
|
||||
for( ii = 0; ii < 4; ii++ )
|
||||
{
|
||||
coord[ii].x += ux0;
|
||||
|
@ -996,8 +1027,10 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
for( ii = 0; ii < 7; ii += 2 )
|
||||
{
|
||||
ll = ii + 2;
|
||||
|
||||
if( ll > 7 )
|
||||
ll -= 8;
|
||||
|
||||
fcoord[ii + 1].x = (fcoord[ii].x + fcoord[ll].x) / 2;
|
||||
fcoord[ii + 1].y = (fcoord[ii].y + fcoord[ll].y) / 2;
|
||||
}
|
||||
|
@ -1015,26 +1048,32 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
|
|||
{
|
||||
if( layer && (layer == nlmax) )
|
||||
layer = LAYER_N_FRONT;
|
||||
|
||||
if( (layer == LAYER_N_FRONT) && !Oncmp )
|
||||
continue;
|
||||
|
||||
if( (layer == LAYER_N_BACK) && !Oncu )
|
||||
continue;
|
||||
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
|
||||
&& !Both )
|
||||
|
||||
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
|
||||
continue;
|
||||
|
||||
color = g_ColorsSettings.GetLayerColor( layer );
|
||||
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
|
||||
false )
|
||||
|
||||
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
|
||||
continue;
|
||||
|
||||
SetGLColor( color );
|
||||
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
|
||||
|
||||
if( layer == LAYER_N_BACK )
|
||||
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
else
|
||||
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
|
||||
|
||||
glBegin( GL_QUAD_STRIP );
|
||||
|
||||
for( ii = 0; ii < 8; ii++ )
|
||||
{
|
||||
glVertex3f( f_hole_coord[ii].x, -f_hole_coord[ii].y, zpos );
|
||||
|
@ -1073,6 +1112,7 @@ static void Draw3D_FilledCircle( double posx, double posy,
|
|||
double x, y;
|
||||
|
||||
glBegin( GL_QUAD_STRIP );
|
||||
|
||||
for( ii = 0; ii <= slice; ii++ )
|
||||
{
|
||||
x = hole;
|
||||
|
@ -1151,6 +1191,7 @@ static void Draw3D_FilledSegment( double startx, double starty, double endx,
|
|||
x += dx;
|
||||
RotatePoint( &x, &y, -angle );
|
||||
glVertex3f( startx + x, starty + y, zpos );
|
||||
|
||||
if( ii == 0 )
|
||||
{
|
||||
firstx = startx + x;
|
||||
|
@ -1217,6 +1258,7 @@ static void Draw3D_FilledSegmentWithHole( double startx, double starty,
|
|||
RotatePoint( &xin, &yin, -angle );
|
||||
glVertex3f( startx + xin, starty + yin, zpos );
|
||||
glVertex3f( startx + x, starty + y, zpos );
|
||||
|
||||
if( ii == 0 )
|
||||
{
|
||||
firstx = startx + x;
|
||||
|
@ -1263,8 +1305,10 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
|
|||
|
||||
// Calculate the number of segments to approximate this arc
|
||||
int imax = (int) ( (double) arc_angle * slice / 3600.0 );
|
||||
|
||||
if( imax < 0 )
|
||||
imax = -imax;
|
||||
|
||||
if( imax == 0 )
|
||||
imax = 1;
|
||||
|
||||
|
@ -1273,6 +1317,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
|
|||
double delta_angle = (double) arc_angle / imax;
|
||||
|
||||
glBegin( GL_QUAD_STRIP );
|
||||
|
||||
for( ii = 0; ii <= imax; ii++ )
|
||||
{
|
||||
double angle = (double) ii * delta_angle;
|
||||
|
@ -1301,6 +1346,7 @@ static void Draw3D_CircleSegment( double startx, double starty, double endx,
|
|||
hole = rayon - width;
|
||||
|
||||
glBegin( GL_QUAD_STRIP );
|
||||
|
||||
for( ii = 0; ii <= slice; ii++ )
|
||||
{
|
||||
x = hole; y = 0.0;
|
||||
|
@ -1339,6 +1385,7 @@ void Pcb3D_GLCanvas::Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double
|
|||
// Draw solid polygon
|
||||
gluTessBeginPolygon( tess, NULL );
|
||||
gluTessBeginContour( tess );
|
||||
|
||||
for( unsigned ii = 0; ii < aCornersList.size(); ii++ )
|
||||
{
|
||||
v_data[0] = aCornersList[ii].x * g_Parm_3D_Visu.m_BoardScale;
|
||||
|
@ -1361,12 +1408,16 @@ static int Get3DLayerEnable( int act_layer )
|
|||
bool enablelayer;
|
||||
|
||||
enablelayer = TRUE;
|
||||
|
||||
if( act_layer == DRAW_N && !g_Parm_3D_Visu.m_Draw3DDrawings )
|
||||
enablelayer = FALSE;
|
||||
|
||||
if( act_layer == COMMENT_N && !g_Parm_3D_Visu.m_Draw3DComments )
|
||||
enablelayer = FALSE;
|
||||
|
||||
if( act_layer == ECO1_N && !g_Parm_3D_Visu.m_Draw3DEco1 )
|
||||
enablelayer = FALSE;
|
||||
|
||||
if( act_layer == ECO2_N && !g_Parm_3D_Visu.m_Draw3DEco2 )
|
||||
enablelayer = FALSE;
|
||||
|
||||
|
@ -1379,6 +1430,7 @@ static GLfloat Get3DLayerSide( int act_layer )
|
|||
GLfloat nZ;
|
||||
|
||||
nZ = 1.0;
|
||||
|
||||
if( ( act_layer <= LAST_COPPER_LAYER - 1 )
|
||||
|| ( act_layer == ADHESIVE_N_BACK )
|
||||
|| ( act_layer == SOLDERPASTE_N_BACK )
|
||||
|
|
|
@ -123,7 +123,7 @@ private:
|
|||
|
||||
public:
|
||||
WinEDA_VertexCtrl( wxWindow* parent, const wxString& title,
|
||||
wxBoxSizer* BoxSizer, UserUnitType units, int internal_unit );
|
||||
wxBoxSizer* BoxSizer, EDA_UNITS_T units, int internal_unit );
|
||||
|
||||
~WinEDA_VertexCtrl();
|
||||
|
||||
|
|
|
@ -3,6 +3,22 @@ KiCad ChangeLog 2010
|
|||
|
||||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
2011-Sept-07, UPDATE Andrey Fedorushkov <andrf@mail.ru>
|
||||
================================================================================
|
||||
Pcbnew:
|
||||
Add hotkey "P" - place item
|
||||
Add Roman Bashkov patch for record/play sequence hotkey macros
|
||||
Add record and play macros for sequence hotkey.
|
||||
Macros set to numeric key 0..9:
|
||||
<Ctrl>+<numkey> - start record macros
|
||||
<hotkey> <mouse move> ... <hotkey>|<mouse place>
|
||||
<Ctrl>+<numkey> - end record macros
|
||||
<numkey> - play macros
|
||||
Add menu save/read macros to/from xml-file
|
||||
Add configure rotate angle for rotate module: 45 or 90 deg.
|
||||
Fix segfault when move/drag segment if disconnected to pad
|
||||
|
||||
2011-Sept-01, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Add Fabrizio Tappero <fabrizio-dot-tappero[at]gmail-dot-com> in contribuotors list.
|
||||
|
|
|
@ -12,15 +12,6 @@ endif(WIN32)
|
|||
# Path to local CMake modules.
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
|
||||
|
||||
# Command line option to enable or disable building minizip. Minizip
|
||||
# building is enabled by default. Use -DKICAD_MINIZIP=OFF to disable
|
||||
# building minizip.
|
||||
option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
|
||||
|
||||
|
||||
option(USE_PNG_BITMAPS "use PNG bitmaps instead of XPM (default OFF)" OFF)
|
||||
|
||||
|
||||
# Russian GOST patch
|
||||
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
|
||||
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
Contribute to KiCad (under Linux)
|
||||
--------------------
|
||||
|
||||
1) make sure you have all the dependencies of KiCad:
|
||||
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 libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot
|
||||
sudo apt-get install cmake bzr
|
||||
|
||||
2) initialize Bazaar:
|
||||
bzr whoami "John Doe <john.doe@gmail.com>"
|
||||
|
||||
3) get LATEST KiCad source tree and name it, for instance, "kicad_john":
|
||||
cd ~/
|
||||
bzr branch lp:kicad kicad_john
|
||||
|
||||
4) create a copy of this folder and zip it away (just in case).
|
||||
|
||||
5) Modify/add source code.
|
||||
cd kicad_john
|
||||
gedit .......
|
||||
|
||||
6) Compile:
|
||||
cd kicad_john
|
||||
mkdir build; cd build
|
||||
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug
|
||||
make -j 4 # this is for a 4 core machine
|
||||
|
||||
7) Repeat step 5 and 6 until satisfied.
|
||||
|
||||
8) Delete the "build" folder and create a patch:
|
||||
cd kicad_john
|
||||
rm -R ./build
|
||||
bzr add .
|
||||
bzr status
|
||||
bzr diff > gui_better_zoom.patch
|
||||
|
||||
9) Send the patch file "gui_better_zoom.patch" to the KiCad developers mailing list.
|
||||
in the subject of the e-mail include the keyword "[PATCH]".
|
||||
in the body of the e-mail clearly explain what you have done.
|
||||
|
||||
|
||||
for more info see INSTALL.txt.
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
||||
|
@ -39,7 +38,6 @@
|
|||
|
||||
#include "bitmap2component.xpm"
|
||||
|
||||
#include "bitmaps.h"
|
||||
#include "colors_selection.h"
|
||||
#include "build_version.h"
|
||||
|
||||
|
@ -89,6 +87,7 @@ private:
|
|||
void ExportFile( FILE* aOutfile, int aFormat );
|
||||
};
|
||||
|
||||
|
||||
BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
|
||||
{
|
||||
m_Config = new wxConfig();
|
||||
|
@ -116,6 +115,7 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
|
|||
Centre();
|
||||
}
|
||||
|
||||
|
||||
BM2CMP_FRAME::~BM2CMP_FRAME()
|
||||
{
|
||||
if( ( m_Config == NULL ) || IsIconized() )
|
||||
|
@ -133,7 +133,7 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
|
|||
|
||||
delete m_Config;
|
||||
|
||||
/* This needed for OSX: avoids furter OnDraw processing after this
|
||||
/* This needed for OSX: avoids further OnDraw processing after this
|
||||
* destructor and before the native window is destroyed
|
||||
*/
|
||||
this->Freeze( );
|
||||
|
@ -156,7 +156,7 @@ void BM2CMP_FRAME::OnPaint( wxPaintEvent& event )
|
|||
m_InitialPicturePanel->PrepareDC( pict_dc );
|
||||
m_GreyscalePicturePanel->PrepareDC( greyscale_dc );
|
||||
m_BNPicturePanel->PrepareDC( nb_dc );
|
||||
|
||||
|
||||
// OSX crashes with empty bitmaps (on initial refreshes)
|
||||
if(m_Pict_Bitmap.IsOk() && m_Greyscale_Bitmap.IsOk() && m_BN_Bitmap.IsOk())
|
||||
{
|
||||
|
@ -166,12 +166,14 @@ void BM2CMP_FRAME::OnPaint( wxPaintEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Called to load a bitmap file
|
||||
*/
|
||||
void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn(m_BitmapFileName);
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = wxGetCwd();
|
||||
|
||||
|
@ -182,7 +184,9 @@ void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
|
|||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
wxString fullFilename = FileDlg.GetPath();
|
||||
|
||||
if( ! LoadFile( fullFilename ) )
|
||||
return;
|
||||
|
||||
|
@ -192,6 +196,7 @@ void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
|
|||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
bool BM2CMP_FRAME::LoadFile( wxString& aFullFileName )
|
||||
{
|
||||
m_BitmapFileName = aFullFileName;
|
||||
|
@ -232,6 +237,7 @@ bool BM2CMP_FRAME::LoadFile( wxString& aFullFileName )
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void BM2CMP_FRAME::Binarize( double aThreshold )
|
||||
{
|
||||
unsigned int pixin;
|
||||
|
@ -244,10 +250,12 @@ void BM2CMP_FRAME::Binarize( double aThreshold )
|
|||
for( int x = 1; x < w; x++ )
|
||||
{
|
||||
pixin = m_Greyscale_Image.GetGreen( x, y );
|
||||
|
||||
if( pixin < threshold )
|
||||
pixout = 0;
|
||||
else
|
||||
pixout = 255;
|
||||
|
||||
m_NB_Image.SetRGB( x, y, pixout, pixout, pixout );
|
||||
}
|
||||
|
||||
|
@ -289,8 +297,10 @@ void BM2CMP_FRAME::OnExportEeschema( wxCommandEvent& event )
|
|||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxString msg = _( "Schematic lib file (*.lib)|*.lib" );
|
||||
wxFileDialog FileDlg( this, _( "Create a lib file for Eeschema" ), path, wxEmptyString,
|
||||
msg,
|
||||
|
@ -299,10 +309,12 @@ void BM2CMP_FRAME::OnExportEeschema( wxCommandEvent& event )
|
|||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
m_ConvertedFileName = FileDlg.GetPath();
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == NULL )
|
||||
{
|
||||
wxString msg;
|
||||
|
@ -320,8 +332,10 @@ void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
|
|||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxString msg = _( "Footprint file (*.mod)|*.mod" );
|
||||
wxFileDialog FileDlg( this, _( "Create a footprint file for PcbNew" ),
|
||||
path, wxEmptyString,
|
||||
|
@ -331,10 +345,13 @@ void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
|
|||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
m_ConvertedFileName = FileDlg.GetPath();
|
||||
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == NULL )
|
||||
{
|
||||
wxString msg;
|
||||
|
@ -353,6 +370,7 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
|
|||
int h = m_NB_Image.GetHeight();
|
||||
int w = m_NB_Image.GetWidth();
|
||||
potrace_bitmap_t* potrace_bitmap = bm_new( w, h );
|
||||
|
||||
if( !potrace_bitmap )
|
||||
{
|
||||
wxString msg;
|
||||
|
@ -377,18 +395,18 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
|
|||
|
||||
// BM_TO_CMP_APP
|
||||
|
||||
void WinEDA_App::MacOpenFile(const wxString &fileName)
|
||||
void EDA_APP::MacOpenFile(const wxString &fileName)
|
||||
{
|
||||
}
|
||||
|
||||
IMPLEMENT_APP( WinEDA_App )
|
||||
IMPLEMENT_APP( EDA_APP )
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
// BM_TO_CMP_APP
|
||||
// main program
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool WinEDA_App::OnInit()
|
||||
bool EDA_APP::OnInit()
|
||||
{
|
||||
wxInitAllImageHandlers();
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ set( COMMON_ABOUT_DLG_SRCS
|
|||
dialogs/dialog_get_component_base.cpp
|
||||
dialogs/dialog_hotkeys_editor.cpp
|
||||
dialogs/dialog_hotkeys_editor_base.cpp
|
||||
dialogs/dialog_load_error.cpp
|
||||
dialogs/dialog_page_settings_base.cpp
|
||||
)
|
||||
|
||||
|
@ -58,6 +57,7 @@ set(COMMON_SRCS
|
|||
gr_basic.cpp
|
||||
hotkeys_basic.cpp
|
||||
hotkey_grid_table.cpp
|
||||
html_messagebox.cpp
|
||||
msgpanel.cpp
|
||||
netlist_keywords.cpp
|
||||
newstroke_font.cpp
|
||||
|
|
|
@ -334,7 +334,7 @@ void BASE_SCREEN::AddGrid( const wxRealPoint& size, int id )
|
|||
}
|
||||
|
||||
|
||||
void BASE_SCREEN::AddGrid( const wxRealPoint& size, UserUnitType aUnit, int id )
|
||||
void BASE_SCREEN::AddGrid( const wxRealPoint& size, EDA_UNITS_T aUnit, int id )
|
||||
{
|
||||
double x, y;
|
||||
wxRealPoint new_size;
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
#endif
|
||||
|
||||
#ifndef KICAD_BUILD_VERSION
|
||||
#define KICAD_BUILD_VERSION "(2011-aug-04)"
|
||||
#if defined KICAD_GOST
|
||||
# define KICAD_BUILD_VERSION "(2011-aug-04 GOST)"
|
||||
#else
|
||||
# define KICAD_BUILD_VERSION "(2011-aug-04)"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ void BITMAP_BASE::Mirror( bool aVertically )
|
|||
if( m_image )
|
||||
{
|
||||
*m_image = m_image->Mirror( not aVertically );
|
||||
*m_bitmap = wxBitmap( *m_image );
|
||||
RebuildBitmap();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ void BITMAP_BASE::Rotate( bool aRotateCCW )
|
|||
if( m_image )
|
||||
{
|
||||
*m_image = m_image->Rotate90( aRotateCCW );
|
||||
*m_bitmap = wxBitmap( *m_image );
|
||||
RebuildBitmap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ const wxString NetlistFileExtension( wxT( "net" ) );
|
|||
const wxString GerberFileExtension( wxT( "pho" ) );
|
||||
const wxString PcbFileExtension( wxT( "brd" ) );
|
||||
const wxString PdfFileExtension( wxT( "pdf" ) );
|
||||
const wxString MacrosFileExtension( wxT( "mcr" ) );
|
||||
|
||||
/* Proper wxFileDialog wild card definitions. */
|
||||
const wxString ProjectFileWildcard( _( "Kicad project files (*.pro)|*.pro" ) );
|
||||
|
@ -67,6 +68,7 @@ const wxString NetlistFileWildcard( _( "Kicad netlist files (*.net)|*.net" ) );
|
|||
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
|
||||
const wxString PcbFileWildcard( _( "Kicad printed circuit board files (*.brd)|*.brd" ) );
|
||||
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
|
||||
const wxString MacrosFileWildcard( _( "Kicad recorded macros (*.mcr)|*.mcr" ) );
|
||||
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
|
||||
|
||||
|
||||
|
@ -78,7 +80,7 @@ wxString g_Prj_Default_Config_FullFilename;
|
|||
wxString g_Prj_Config_LocalFilename;
|
||||
|
||||
/* Current user unit of measure */
|
||||
UserUnitType g_UserUnit;
|
||||
EDA_UNITS_T g_UserUnit;
|
||||
|
||||
/* Draw color for moving objects: */
|
||||
int g_GhostColor;
|
||||
|
@ -221,7 +223,7 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size,
|
|||
}
|
||||
|
||||
|
||||
wxString ReturnUnitSymbol( UserUnitType aUnit, const wxString& formatString )
|
||||
wxString ReturnUnitSymbol( EDA_UNITS_T aUnit, const wxString& formatString )
|
||||
{
|
||||
wxString tmp;
|
||||
wxString label;
|
||||
|
@ -249,7 +251,7 @@ wxString ReturnUnitSymbol( UserUnitType aUnit, const wxString& formatString )
|
|||
}
|
||||
|
||||
|
||||
wxString GetUnitsLabel( UserUnitType aUnit )
|
||||
wxString GetUnitsLabel( EDA_UNITS_T aUnit )
|
||||
{
|
||||
wxString label;
|
||||
|
||||
|
@ -272,7 +274,7 @@ wxString GetUnitsLabel( UserUnitType aUnit )
|
|||
}
|
||||
|
||||
|
||||
wxString GetAbbreviatedUnitsLabel( UserUnitType aUnit )
|
||||
wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit )
|
||||
{
|
||||
wxString label;
|
||||
|
||||
|
@ -298,7 +300,7 @@ wxString GetAbbreviatedUnitsLabel( UserUnitType aUnit )
|
|||
* Add string " (mm):" or " ("):" to the static text Stext.
|
||||
* Used in dialog boxes for entering values depending on selected units
|
||||
*/
|
||||
void AddUnitSymbol( wxStaticText& Stext, UserUnitType aUnit )
|
||||
void AddUnitSymbol( wxStaticText& Stext, EDA_UNITS_T aUnit )
|
||||
{
|
||||
wxString msg = Stext.GetLabel();
|
||||
|
||||
|
@ -346,7 +348,7 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit )
|
|||
* @return a wxString what contains value and optionally the symbol unit
|
||||
* (like 2.000 mm)
|
||||
*/
|
||||
wxString ReturnStringFromValue( UserUnitType aUnit, int aValue, int aInternal_Unit,
|
||||
wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, int aInternal_Unit,
|
||||
bool aAdd_unit_symbol )
|
||||
{
|
||||
wxString StringValue;
|
||||
|
@ -384,7 +386,7 @@ wxString ReturnStringFromValue( UserUnitType aUnit, int aValue, int aInternal_Un
|
|||
* Value = text
|
||||
* Internal_Unit = units per inch for computed value
|
||||
*/
|
||||
int ReturnValueFromString( UserUnitType aUnit, const wxString& TextValue,
|
||||
int ReturnValueFromString( EDA_UNITS_T aUnit, const wxString& TextValue,
|
||||
int Internal_Unit )
|
||||
{
|
||||
int Value;
|
||||
|
@ -479,7 +481,7 @@ wxArrayString* wxStringSplit( wxString txt, wxChar splitter )
|
|||
* @param val : double : the given value
|
||||
* @param internal_unit_value = internal units per inch
|
||||
*/
|
||||
double To_User_Unit( UserUnitType aUnit, double val, int internal_unit_value )
|
||||
double To_User_Unit( EDA_UNITS_T aUnit, double val, int internal_unit_value )
|
||||
{
|
||||
switch( aUnit )
|
||||
{
|
||||
|
@ -498,7 +500,7 @@ double To_User_Unit( UserUnitType aUnit, double val, int internal_unit_value )
|
|||
/*
|
||||
* Return in internal units the value "val" given in inch or mm
|
||||
*/
|
||||
int From_User_Unit( UserUnitType aUnit, double val, int internal_unit_value )
|
||||
int From_User_Unit( EDA_UNITS_T aUnit, double val, int internal_unit_value )
|
||||
{
|
||||
double value;
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "wx/wx.h"
|
||||
#include "wx/html/htmlwin.h"
|
||||
#include "html_messagebox.h"
|
||||
|
||||
/* Display an error or warning message.
|
||||
* TODO:
|
||||
|
@ -45,6 +47,18 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text,
|
|||
}
|
||||
|
||||
|
||||
/* Display a simple message window in html format.
|
||||
*/
|
||||
void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title,
|
||||
const wxString& text, const wxSize& size )
|
||||
{
|
||||
HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size );
|
||||
dlg->AddHTML_Text( text );
|
||||
dlg->ShowModal();
|
||||
dlg->Destroy();
|
||||
}
|
||||
|
||||
|
||||
bool IsOK( wxWindow* parent, const wxString& text )
|
||||
{
|
||||
int ii;
|
||||
|
|
|
@ -40,6 +40,8 @@ DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR( wxWindow* aParent, BITMAP_BASE* aItem
|
|||
: DIALOG_IMAGE_EDITOR_BASE( aParent )
|
||||
{
|
||||
m_workingImage = new BITMAP_BASE( * aItem );
|
||||
m_lastImage = NULL;
|
||||
m_buttonUndoLast->Enable( false );
|
||||
wxString msg;
|
||||
msg.Printf( wxT("%f"), m_workingImage->m_Scale );
|
||||
m_textCtrlScale->SetValue( msg );;
|
||||
|
@ -53,28 +55,106 @@ DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR( wxWindow* aParent, BITMAP_BASE* aItem
|
|||
SetFocus();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnUndoLastChange( wxCommandEvent& event )
|
||||
{
|
||||
BITMAP_BASE * tmp = m_workingImage;
|
||||
m_workingImage = m_lastImage;
|
||||
delete tmp;
|
||||
m_buttonUndoLast->Enable( false );
|
||||
m_lastImage = NULL;
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnMirrorX_click( wxCommandEvent& event )
|
||||
{
|
||||
|
||||
delete m_lastImage;
|
||||
m_lastImage = new BITMAP_BASE( * m_workingImage );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
m_workingImage->Mirror( true );
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnMirrorY_click( wxCommandEvent& event )
|
||||
{
|
||||
delete m_lastImage;
|
||||
m_lastImage = new BITMAP_BASE( * m_workingImage );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
m_workingImage->Mirror( false );
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnRotateClick( wxCommandEvent& event )
|
||||
{
|
||||
delete m_lastImage;
|
||||
m_lastImage = new BITMAP_BASE( * m_workingImage );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
m_workingImage->Rotate( false );
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnGreyScaleConvert( wxCommandEvent& event )
|
||||
{
|
||||
delete m_lastImage;
|
||||
m_lastImage = new BITMAP_BASE( * m_workingImage );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
wxImage& image = *m_workingImage->GetImageData();
|
||||
image = image.ConvertToGreyscale();
|
||||
m_workingImage->RebuildBitmap();
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnHalfSize( wxCommandEvent& event )
|
||||
{
|
||||
delete m_lastImage;
|
||||
m_lastImage = new BITMAP_BASE( * m_workingImage );
|
||||
m_buttonUndoLast->Enable( true );
|
||||
wxSize psize = m_workingImage->GetSizePixels();
|
||||
wxImage& image = *m_workingImage->GetImageData();
|
||||
|
||||
image = image.Scale(psize.x/2, psize.y/2, wxIMAGE_QUALITY_HIGH);
|
||||
m_workingImage->RebuildBitmap();
|
||||
m_panelDraw->Refresh();
|
||||
}
|
||||
|
||||
/* Test params values correctness
|
||||
* Currently scale value must give an actual image
|
||||
* > MIN_SIZE pixels and < MAX_SIZE pixels
|
||||
*/
|
||||
bool DIALOG_IMAGE_EDITOR::CheckValues()
|
||||
{
|
||||
#define MIN_SIZE 16
|
||||
#define MAX_SIZE 6000
|
||||
double tmp;
|
||||
wxString msg = m_textCtrlScale->GetValue();
|
||||
// Test number correctness
|
||||
if( ! msg.ToDouble( &tmp ) )
|
||||
{
|
||||
wxMessageBox( _("Incorrect scale number" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test value correctness
|
||||
wxSize psize = m_workingImage->GetSizePixels();
|
||||
if ( (psize.x * tmp) < MIN_SIZE || (psize.y * tmp) < MIN_SIZE )
|
||||
{
|
||||
wxMessageBox( _("Scale is too small for this image" ) );
|
||||
return false;
|
||||
}
|
||||
if ( (psize.x * tmp) > MAX_SIZE || (psize.y * tmp) > MAX_SIZE )
|
||||
{
|
||||
wxMessageBox( _("Scale is too large for this image" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnOK_Button( wxCommandEvent& aEvent )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
if( CheckValues() )
|
||||
EndModal( wxID_OK );
|
||||
return;
|
||||
}
|
||||
|
||||
void DIALOG_IMAGE_EDITOR::OnCancel_Button( wxCommandEvent& aEvent )
|
||||
|
@ -97,7 +177,6 @@ void DIALOG_IMAGE_EDITOR::TransfertToImage(BITMAP_BASE* aItem )
|
|||
{
|
||||
wxString msg = m_textCtrlScale->GetValue();
|
||||
msg.ToDouble( &m_workingImage->m_Scale );
|
||||
m_textCtrlScale->SetValue( msg );
|
||||
aItem->ImportData( m_workingImage );
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<property name="resize">Resizable</property>
|
||||
<property name="row"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size">340,256</property>
|
||||
<property name="size">340,299</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="title">Image Editor</property>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -324,7 +324,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -412,7 +412,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -498,6 +498,270 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Grey</property>
|
||||
<property name="layer"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_buttonGrey</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</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_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnGreyScaleConvert</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Half Size</property>
|
||||
<property name="layer"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_buttonHalfSize</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</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_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnHalfSize</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Undo Last</property>
|
||||
<property name="layer"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_buttonUndoLast</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</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_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnUndoLastChange</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
class DIALOG_IMAGE_EDITOR : public DIALOG_IMAGE_EDITOR_BASE
|
||||
{
|
||||
private:
|
||||
BITMAP_BASE* m_workingImage;
|
||||
BITMAP_BASE* m_workingImage; // The copy of BITMAP_BASE to be edited
|
||||
BITMAP_BASE* m_lastImage; // the saved BITMAP_BASE before a new change.
|
||||
// Used to undo the last change
|
||||
|
||||
public:
|
||||
DIALOG_IMAGE_EDITOR( wxWindow* aParent, BITMAP_BASE* aItem );
|
||||
|
@ -51,12 +53,16 @@ public:
|
|||
void TransfertToImage( BITMAP_BASE* aItem );
|
||||
|
||||
private:
|
||||
void OnUndoLastChange( wxCommandEvent& event );
|
||||
void OnGreyScaleConvert( wxCommandEvent& event );
|
||||
void OnHalfSize( wxCommandEvent& event );
|
||||
void OnMirrorX_click( wxCommandEvent& event );
|
||||
void OnMirrorY_click( wxCommandEvent& event );
|
||||
void OnRotateClick( wxCommandEvent& event );
|
||||
void OnOK_Button( wxCommandEvent& aEvent );
|
||||
void OnCancel_Button( wxCommandEvent& aEvent );
|
||||
void OnRedrawPanel( wxPaintEvent& event );
|
||||
bool CheckValues();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -31,13 +31,23 @@ DIALOG_IMAGE_EDITOR_BASE::DIALOG_IMAGE_EDITOR_BASE( wxWindow* parent, wxWindowID
|
|||
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonMirrorX = new wxButton( this, wxID_ANY, _("Mirror X"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonMirrorX, 0, wxEXPAND|wxALL, 5 );
|
||||
bSizerRight->Add( m_buttonMirrorX, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonMirrorY = new wxButton( this, wxID_ANY, _("Mirror Y"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonMirrorY, 0, wxEXPAND|wxALL, 5 );
|
||||
bSizerRight->Add( m_buttonMirrorY, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonRotate = new wxButton( this, wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonRotate, 0, wxALL|wxEXPAND, 5 );
|
||||
bSizerRight->Add( m_buttonRotate, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonGrey = new wxButton( this, wxID_ANY, _("Grey"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonGrey, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonHalfSize = new wxButton( this, wxID_ANY, _("Half Size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonHalfSize->SetDefault();
|
||||
bSizerRight->Add( m_buttonHalfSize, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonUndoLast = new wxButton( this, wxID_ANY, _("Undo Last"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonUndoLast, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextScale = new wxStaticText( this, wxID_ANY, _("Image Scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextScale->Wrap( -1 );
|
||||
|
@ -70,6 +80,9 @@ DIALOG_IMAGE_EDITOR_BASE::DIALOG_IMAGE_EDITOR_BASE( wxWindow* parent, wxWindowID
|
|||
m_buttonMirrorX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorX_click ), NULL, this );
|
||||
m_buttonMirrorY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorY_click ), NULL, this );
|
||||
m_buttonRotate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRotateClick ), NULL, this );
|
||||
m_buttonGrey->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnGreyScaleConvert ), NULL, this );
|
||||
m_buttonHalfSize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnHalfSize ), NULL, this );
|
||||
m_buttonUndoLast->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnUndoLastChange ), NULL, this );
|
||||
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnCancel_Button ), NULL, this );
|
||||
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnOK_Button ), NULL, this );
|
||||
}
|
||||
|
@ -81,6 +94,9 @@ DIALOG_IMAGE_EDITOR_BASE::~DIALOG_IMAGE_EDITOR_BASE()
|
|||
m_buttonMirrorX->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorX_click ), NULL, this );
|
||||
m_buttonMirrorY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnMirrorY_click ), NULL, this );
|
||||
m_buttonRotate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnRotateClick ), NULL, this );
|
||||
m_buttonGrey->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnGreyScaleConvert ), NULL, this );
|
||||
m_buttonHalfSize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnHalfSize ), NULL, this );
|
||||
m_buttonUndoLast->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnUndoLastChange ), NULL, this );
|
||||
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnCancel_Button ), NULL, this );
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMAGE_EDITOR_BASE::OnOK_Button ), NULL, this );
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@ class DIALOG_IMAGE_EDITOR_BASE : public wxDialog
|
|||
wxButton* m_buttonMirrorX;
|
||||
wxButton* m_buttonMirrorY;
|
||||
wxButton* m_buttonRotate;
|
||||
wxButton* m_buttonGrey;
|
||||
wxButton* m_buttonHalfSize;
|
||||
wxButton* m_buttonUndoLast;
|
||||
wxStaticText* m_staticTextScale;
|
||||
wxTextCtrl* m_textCtrlScale;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
|
@ -49,13 +52,16 @@ class DIALOG_IMAGE_EDITOR_BASE : public wxDialog
|
|||
virtual void OnMirrorX_click( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnMirrorY_click( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnRotateClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnGreyScaleConvert( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnHalfSize( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnUndoLastChange( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancel_Button( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOK_Button( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_IMAGE_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Image Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,256 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_IMAGE_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Image Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,299 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_IMAGE_EDITOR_BASE();
|
||||
|
||||
};
|
||||
|
|
|
@ -16,14 +16,14 @@ enum listbox {
|
|||
};
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE( WinEDAListBox, wxDialog )
|
||||
EVT_BUTTON( wxID_OK, WinEDAListBox::OnOkClick )
|
||||
EVT_BUTTON( wxID_CANCEL, WinEDAListBox::OnCancelClick )
|
||||
EVT_LISTBOX( ID_LISTBOX_LIST, WinEDAListBox::ClickOnList )
|
||||
EVT_LISTBOX_DCLICK( ID_LISTBOX_LIST, WinEDAListBox::D_ClickOnList )
|
||||
EVT_CHAR( WinEDAListBox::OnKeyEvent )
|
||||
EVT_CHAR_HOOK( WinEDAListBox::OnKeyEvent )
|
||||
EVT_CLOSE( WinEDAListBox::OnClose )
|
||||
BEGIN_EVENT_TABLE( EDA_LIST_DIALOG, wxDialog )
|
||||
EVT_BUTTON( wxID_OK, EDA_LIST_DIALOG::OnOkClick )
|
||||
EVT_BUTTON( wxID_CANCEL, EDA_LIST_DIALOG::OnCancelClick )
|
||||
EVT_LISTBOX( ID_LISTBOX_LIST, EDA_LIST_DIALOG::ClickOnList )
|
||||
EVT_LISTBOX_DCLICK( ID_LISTBOX_LIST, EDA_LIST_DIALOG::D_ClickOnList )
|
||||
EVT_CHAR( EDA_LIST_DIALOG::OnKeyEvent )
|
||||
EVT_CHAR_HOOK( EDA_LIST_DIALOG::OnKeyEvent )
|
||||
EVT_CLOSE( EDA_LIST_DIALOG::OnClose )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
@ -37,9 +37,9 @@ END_EVENT_TABLE()
|
|||
* @param aCallBackFunction callback function to display comments
|
||||
* @param aPos = position of the dialog.
|
||||
*/
|
||||
WinEDAListBox::WinEDAListBox( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
|
||||
const wxArrayString& aItemList, const wxString& aRefText,
|
||||
void(* aCallBackFunction)(wxString& Text), wxPoint aPos ) :
|
||||
EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
|
||||
const wxArrayString& aItemList, const wxString& aRefText,
|
||||
void(* aCallBackFunction)(wxString& Text), wxPoint aPos ) :
|
||||
wxDialog( aParent, wxID_ANY, aTitle, aPos, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
|
||||
{
|
||||
|
@ -61,8 +61,8 @@ WinEDAListBox::WinEDAListBox( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
|
|||
if( m_callBackFct )
|
||||
{
|
||||
m_messages = new wxTextCtrl( this, -1, wxEmptyString,
|
||||
wxDefaultPosition, wxSize( -1, 60 ),
|
||||
wxTE_READONLY | wxTE_MULTILINE );
|
||||
wxDefaultPosition, wxSize( -1, 60 ),
|
||||
wxTE_READONLY | wxTE_MULTILINE );
|
||||
|
||||
GeneralBoxSizer->Add( m_messages, 0, wxGROW | wxALL, 5 );
|
||||
}
|
||||
|
@ -78,12 +78,12 @@ WinEDAListBox::WinEDAListBox( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
|
|||
}
|
||||
|
||||
|
||||
WinEDAListBox::~WinEDAListBox()
|
||||
EDA_LIST_DIALOG::~EDA_LIST_DIALOG()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::MoveMouseToOrigin()
|
||||
void EDA_LIST_DIALOG::MoveMouseToOrigin()
|
||||
{
|
||||
int x, y, w, h;
|
||||
wxSize list_size = m_listBox->GetSize();
|
||||
|
@ -96,32 +96,32 @@ void WinEDAListBox::MoveMouseToOrigin()
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDAListBox::GetTextSelection()
|
||||
wxString EDA_LIST_DIALOG::GetTextSelection()
|
||||
{
|
||||
wxString text = m_listBox->GetStringSelection();
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::Append( const wxString& item )
|
||||
void EDA_LIST_DIALOG::Append( const wxString& item )
|
||||
{
|
||||
m_listBox->Append( item );
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::InsertItems( const wxArrayString& itemlist, int position )
|
||||
void EDA_LIST_DIALOG::InsertItems( const wxArrayString& itemlist, int position )
|
||||
{
|
||||
m_listBox->InsertItems( itemlist, position );
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::OnCancelClick( wxCommandEvent& event )
|
||||
void EDA_LIST_DIALOG::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::ClickOnList( wxCommandEvent& event )
|
||||
void EDA_LIST_DIALOG::ClickOnList( wxCommandEvent& event )
|
||||
{
|
||||
wxString text;
|
||||
|
||||
|
@ -135,19 +135,19 @@ void WinEDAListBox::ClickOnList( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDAListBox::D_ClickOnList( wxCommandEvent& event )
|
||||
void EDA_LIST_DIALOG::D_ClickOnList( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::OnOkClick( wxCommandEvent& event )
|
||||
void EDA_LIST_DIALOG::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
void WinEDAListBox::OnClose( wxCloseEvent& event )
|
||||
void EDA_LIST_DIALOG::OnClose( wxCloseEvent& event )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ static int SortItems( const wxString** ptr1, const wxString** ptr2 )
|
|||
}
|
||||
|
||||
|
||||
void WinEDAListBox:: SortList()
|
||||
void EDA_LIST_DIALOG:: SortList()
|
||||
{
|
||||
int ii, NbItems = m_listBox->GetCount();
|
||||
const wxString** BufList;
|
||||
|
@ -170,6 +170,7 @@ void WinEDAListBox:: SortList()
|
|||
return;
|
||||
|
||||
BufList = (const wxString**) MyZMalloc( 100 * NbItems * sizeof(wxString*) );
|
||||
|
||||
for( ii = 0; ii < NbItems; ii++ )
|
||||
{
|
||||
BufList[ii] = new wxString( m_listBox->GetString( ii ) );
|
||||
|
@ -179,6 +180,7 @@ void WinEDAListBox:: SortList()
|
|||
( int( * ) ( const void*, const void* ) )SortItems );
|
||||
|
||||
m_listBox->Clear();
|
||||
|
||||
for( ii = 0; ii < NbItems; ii++ )
|
||||
{
|
||||
m_listBox->Append( *BufList[ii] );
|
||||
|
@ -189,7 +191,7 @@ void WinEDAListBox:: SortList()
|
|||
}
|
||||
|
||||
|
||||
void WinEDAListBox::OnKeyEvent( wxKeyEvent& event )
|
||||
void EDA_LIST_DIALOG::OnKeyEvent( wxKeyEvent& event )
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/* Read from Common config the Pdf browser choice
|
||||
*/
|
||||
void WinEDA_App::ReadPdfBrowserInfos()
|
||||
void EDA_APP::ReadPdfBrowserInfos()
|
||||
{
|
||||
wxASSERT( m_EDA_CommonConfig != NULL );
|
||||
|
||||
|
@ -32,7 +32,7 @@ void WinEDA_App::ReadPdfBrowserInfos()
|
|||
|
||||
/* Write into Common config the Pdf browser choice
|
||||
*/
|
||||
void WinEDA_App::WritePdfBrowserInfos()
|
||||
void EDA_APP::WritePdfBrowserInfos()
|
||||
{
|
||||
wxASSERT( m_EDA_CommonConfig != NULL );
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
|
|||
};
|
||||
|
||||
|
||||
WinEDA_App::WinEDA_App()
|
||||
EDA_APP::EDA_APP()
|
||||
{
|
||||
m_Checker = NULL;
|
||||
m_HtmlCtrl = NULL;
|
||||
|
@ -251,7 +251,7 @@ WinEDA_App::WinEDA_App()
|
|||
}
|
||||
|
||||
|
||||
WinEDA_App::~WinEDA_App()
|
||||
EDA_APP::~EDA_APP()
|
||||
{
|
||||
SaveSettings();
|
||||
|
||||
|
@ -271,7 +271,7 @@ WinEDA_App::~WinEDA_App()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
|
||||
void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
|
||||
{
|
||||
wxString EnvLang;
|
||||
|
||||
|
@ -349,7 +349,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::InitOnLineHelp()
|
||||
void EDA_APP::InitOnLineHelp()
|
||||
{
|
||||
wxString fullfilename = FindKicadHelpPath();
|
||||
|
||||
|
@ -376,7 +376,7 @@ void WinEDA_App::InitOnLineHelp()
|
|||
}
|
||||
|
||||
|
||||
bool WinEDA_App::SetBinDir()
|
||||
bool EDA_APP::SetBinDir()
|
||||
{
|
||||
/* Apple MacOSx */
|
||||
#ifdef __APPLE__
|
||||
|
@ -460,7 +460,7 @@ bool WinEDA_App::SetBinDir()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::SetDefaultSearchPaths( void )
|
||||
void EDA_APP::SetDefaultSearchPaths( void )
|
||||
{
|
||||
size_t i;
|
||||
wxString path = m_BinDir;
|
||||
|
@ -554,7 +554,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
|
|||
/* Add schematic library file path to search path list.
|
||||
* we must add <kicad path>/library and <kicad path>/library/doc
|
||||
*/
|
||||
if( m_Id == APP_TYPE_EESCHEMA )
|
||||
if( m_Id == APP_EESCHEMA_T )
|
||||
{
|
||||
fn.AppendDir( wxT( "library" ) );
|
||||
|
||||
|
@ -576,7 +576,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
|
|||
}
|
||||
|
||||
/* Add PCB library file path to search path list. */
|
||||
if( ( m_Id == APP_TYPE_PCBNEW ) || ( m_Id == APP_TYPE_CVPCB ) )
|
||||
if( ( m_Id == APP_PCBNEW_T ) || ( m_Id == APP_CVPCB_T ) )
|
||||
{
|
||||
fn.AppendDir( wxT( "modules" ) );
|
||||
|
||||
|
@ -611,7 +611,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::GetSettings( bool aReopenLastUsedDirectory )
|
||||
void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
|
||||
{
|
||||
wxASSERT( m_EDA_Config != NULL && m_EDA_CommonConfig != NULL );
|
||||
|
||||
|
@ -669,7 +669,7 @@ void WinEDA_App::GetSettings( bool aReopenLastUsedDirectory )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::SaveSettings()
|
||||
void EDA_APP::SaveSettings()
|
||||
{
|
||||
wxASSERT( m_EDA_Config != NULL );
|
||||
m_EDA_Config->Write( wxT( "ShowPageLimits" ), g_ShowPageLimits );
|
||||
|
@ -681,7 +681,7 @@ void WinEDA_App::SaveSettings()
|
|||
}
|
||||
|
||||
|
||||
bool WinEDA_App::SetLanguage( bool first_time )
|
||||
bool EDA_APP::SetLanguage( bool first_time )
|
||||
{
|
||||
bool retv = true;
|
||||
|
||||
|
@ -757,7 +757,7 @@ bool WinEDA_App::SetLanguage( bool first_time )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::SetLanguageIdentifier( int menu_id )
|
||||
void EDA_APP::SetLanguageIdentifier( int menu_id )
|
||||
{
|
||||
wxLogDebug( wxT( "Select language ID %d from %d possible languages." ),
|
||||
menu_id, LANGUAGE_DESCR_COUNT );
|
||||
|
@ -773,7 +773,7 @@ void WinEDA_App::SetLanguageIdentifier( int menu_id )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::SetLanguagePath( void )
|
||||
void EDA_APP::SetLanguagePath( void )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
@ -811,7 +811,7 @@ void WinEDA_App::SetLanguagePath( void )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
|
||||
void EDA_APP::AddMenuLanguageList( wxMenu* MasterMenu )
|
||||
{
|
||||
wxMenu* menu = NULL;
|
||||
wxMenuItem* item;
|
||||
|
@ -858,7 +858,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
|
||||
wxString EDA_APP::FindFileInSearchPaths( const wxString& filename,
|
||||
const wxArrayString* subdirs )
|
||||
{
|
||||
size_t i, j;
|
||||
|
@ -885,7 +885,7 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::GetHelpFile( void )
|
||||
wxString EDA_APP::GetHelpFile( void )
|
||||
{
|
||||
wxString fn;
|
||||
wxArrayString subdirs, altsubdirs;
|
||||
|
@ -963,7 +963,7 @@ wxString WinEDA_App::GetHelpFile( void )
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::GetLibraryFile( const wxString& filename )
|
||||
wxString EDA_APP::GetLibraryFile( const wxString& filename )
|
||||
{
|
||||
wxArrayString subdirs;
|
||||
|
||||
|
@ -978,7 +978,7 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename )
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString& aSubPathToSearch )
|
||||
wxString EDA_APP::ReturnLastVisitedLibraryPath( const wxString& aSubPathToSearch )
|
||||
{
|
||||
if( !m_LastVisitedLibPath.IsEmpty() )
|
||||
return m_LastVisitedLibPath;
|
||||
|
@ -1021,13 +1021,13 @@ wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString& aSubPathToSea
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::SaveLastVisitedLibraryPath( const wxString& aPath )
|
||||
void EDA_APP::SaveLastVisitedLibraryPath( const wxString& aPath )
|
||||
{
|
||||
m_LastVisitedLibPath = aPath;
|
||||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath( const wxString& aFullFilename )
|
||||
wxString EDA_APP::ReturnFilenameWithRelativePathInLibPath( const wxString& aFullFilename )
|
||||
{
|
||||
/* If the library path is already in the library search paths
|
||||
* list, just add the library name to the list. Otherwise, add
|
||||
|
@ -1065,7 +1065,7 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath( const wxString& aF
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_App::FindLibraryPath( const wxString& aFileName )
|
||||
wxString EDA_APP::FindLibraryPath( const wxString& aFileName )
|
||||
{
|
||||
if( wxFileName::FileExists( aFileName ) )
|
||||
return aFileName;
|
||||
|
@ -1074,7 +1074,7 @@ wxString WinEDA_App::FindLibraryPath( const wxString& aFileName )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::RemoveLibraryPath( const wxString& aPaths )
|
||||
void EDA_APP::RemoveLibraryPath( const wxString& aPaths )
|
||||
{
|
||||
wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) );
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ void WinEDA_App::RemoveLibraryPath( const wxString& aPaths )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::InsertLibraryPath( const wxString& aPaths, size_t aIndex )
|
||||
void EDA_APP::InsertLibraryPath( const wxString& aPaths, size_t aIndex )
|
||||
{
|
||||
wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) );
|
||||
|
||||
|
|
|
@ -520,20 +520,20 @@ wxString ReturnKicadDatasPath()
|
|||
if( PathFound )
|
||||
{
|
||||
data_path.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
|
||||
|
||||
if( data_path.Last() != '/' )
|
||||
data_path += UNIX_STRING_DIR_SEP;
|
||||
}
|
||||
else
|
||||
{
|
||||
data_path.Empty();
|
||||
}
|
||||
|
||||
return data_path;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the preferred editor name
|
||||
*/
|
||||
wxString& WinEDA_App::GetEditorName()
|
||||
wxString& EDA_APP::GetEditorName()
|
||||
{
|
||||
wxString editorname = m_EditorName;
|
||||
|
||||
|
|
|
@ -339,8 +339,9 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame,
|
|||
wxString keyname;
|
||||
Ki_HotkeyInfo** List;
|
||||
|
||||
wxString msg = _( "Current hotkey list:\n\n" );
|
||||
wxString msg = _( "<html><body>" );
|
||||
|
||||
msg += _( "<H3>Hotkeys List</H3> <table cellpadding=\"0\">");
|
||||
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
|
||||
{
|
||||
List = aDescList->m_HK_InfoList;
|
||||
|
@ -348,13 +349,17 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame,
|
|||
for( ; *List != NULL; List++ )
|
||||
{
|
||||
Ki_HotkeyInfo* hk_decr = *List;
|
||||
msg += _( "key " );
|
||||
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
|
||||
msg += keyname + wxT( ": " ) + hk_decr->m_InfoMsg + wxT( "\n" );
|
||||
if( !hk_decr->m_InfoMsg.Contains( wxT( "Macros" ) ) )
|
||||
{
|
||||
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
|
||||
msg += wxT( "<tr><td>" ) + hk_decr->m_InfoMsg + wxT("</td>");
|
||||
msg += wxT("<td><b> ") + keyname + wxT( "</b></td></tr>" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DisplayInfoMessage( aFrame, msg );
|
||||
msg += wxT("</table></html></body>");
|
||||
DisplayHtmlInfoMessage( aFrame, _("Hotkeys List"), msg, wxSize(340, 750));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#include "fctsys.h"
|
||||
#include "dialog_load_error.h"
|
||||
#include "html_messagebox.h"
|
||||
#include "macros.h"
|
||||
|
||||
DIALOG_LOAD_ERROR::DIALOG_LOAD_ERROR( wxWindow* parent )
|
||||
:
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, _("Load Error!"),wxDefaultPosition, wxSize( 450,250 ) )
|
||||
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
|
||||
wxPoint aPos, wxSize aSize)
|
||||
: DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
|
||||
{
|
||||
SetFocus();
|
||||
ListClear();
|
||||
}
|
||||
|
||||
void DIALOG_LOAD_ERROR::OnCloseButtonClick( wxCommandEvent& event )
|
||||
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal(0);
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LOAD_ERROR::ListClear(void)
|
||||
void HTML_MESSAGE_BOX::ListClear(void)
|
||||
{
|
||||
m_htmlWindow->SetPage(wxEmptyString);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ void DIALOG_LOAD_ERROR::ListClear(void)
|
|||
* Add a list of items.
|
||||
* @param aList = a string containing items. Items are separated by '\n'
|
||||
*/
|
||||
void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
|
||||
void HTML_MESSAGE_BOX::ListSet(const wxString &aList)
|
||||
{
|
||||
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
|
||||
|
||||
|
@ -48,7 +48,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
|
|||
* Add a list of items.
|
||||
* @param aList = a wxArrayString containing items
|
||||
*/
|
||||
void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
|
||||
void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
|
||||
{
|
||||
wxString msg = wxT("<ul>");
|
||||
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
|
||||
|
@ -65,10 +65,20 @@ void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
|
|||
* Add a message (in bold) to message list.
|
||||
* @param message = the message
|
||||
*/
|
||||
void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
|
||||
void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
|
||||
{
|
||||
wxString message_value;
|
||||
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
|
||||
m_htmlWindow->AppendToPage( message_value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function AddHTML_Text
|
||||
* Add a text to message list.
|
||||
* @param message = the text to add
|
||||
*/
|
||||
void HTML_MESSAGE_BOX::AddHTML_Text(const wxString &message)
|
||||
{
|
||||
m_htmlWindow->AppendToPage( message );
|
||||
}
|
||||
|
|
@ -83,6 +83,7 @@ const wxString ModuleFileWildcard( _( "Kicad footprint library files (*.mod)|*.m
|
|||
|
||||
int g_CurrentVersionPCB = 1;
|
||||
|
||||
int g_RotationAngle;
|
||||
int g_TimeOut; // Timer for automatic saving
|
||||
int g_SaveTime; // Time for next saving
|
||||
|
||||
|
|
|
@ -22,19 +22,9 @@
|
|||
#define FORCE_LOCAL_CONFIG true
|
||||
|
||||
|
||||
/**
|
||||
* Creates or recreates the kicad project file. (filename.pro)
|
||||
* Initialize:
|
||||
* G_Prj_Config
|
||||
* G_Prj_Config_LocalFilename
|
||||
* G_Prj_Default_Config_FullFilename
|
||||
* Return:
|
||||
* True if local config
|
||||
* False if default config
|
||||
*/
|
||||
bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
bool ForceUseLocalConfig )
|
||||
bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
bool ForceUseLocalConfig )
|
||||
{
|
||||
wxFileName fn = fileName;
|
||||
wxString defaultFileName;
|
||||
|
@ -89,7 +79,9 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
|
|||
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
|
||||
|
||||
if( version > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete m_ProjectConfig; // Version incorrect
|
||||
|
@ -118,15 +110,9 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function WriteProjectConfig
|
||||
* Save the current "projet" parameters
|
||||
* saved parameters are parameters that have the .m_Setup member set to false
|
||||
* saving file is the .pro file project
|
||||
*/
|
||||
void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_BASE** List )
|
||||
void EDA_APP::WriteProjectConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_BASE** List )
|
||||
{
|
||||
PARAM_CFG_BASE* pt_cfg;
|
||||
wxString msg;
|
||||
|
@ -155,6 +141,7 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
|||
for( ; List != NULL && *List != NULL; List++ )
|
||||
{
|
||||
pt_cfg = *List;
|
||||
|
||||
if( pt_cfg->m_Group )
|
||||
m_ProjectConfig->SetPath( pt_cfg->m_Group );
|
||||
else
|
||||
|
@ -169,7 +156,9 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
|||
m_ProjectConfig->DeleteGroup( pt_cfg->m_Ident );
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_cfg->SaveParam( m_ProjectConfig );
|
||||
}
|
||||
}
|
||||
|
||||
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP );
|
||||
|
@ -178,9 +167,9 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_ARRAY& params )
|
||||
void EDA_APP::WriteProjectConfig( const wxString& fileName,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_ARRAY& params )
|
||||
{
|
||||
ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG );
|
||||
|
||||
|
@ -216,7 +205,9 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
|||
m_ProjectConfig->DeleteGroup( param.m_Ident );
|
||||
}
|
||||
else
|
||||
{
|
||||
param.SaveParam( m_ProjectConfig );
|
||||
}
|
||||
}
|
||||
|
||||
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP );
|
||||
|
@ -231,7 +222,7 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
|
|||
* saved parameters are parameters that have the .m_Setup member set to true
|
||||
* @param aList = array of PARAM_CFG_BASE pointers
|
||||
*/
|
||||
void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
|
||||
void EDA_APP::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
|
||||
{
|
||||
PARAM_CFG_BASE* pt_cfg;
|
||||
|
||||
|
@ -250,12 +241,14 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
|
|||
m_EDA_Config->DeleteGroup( pt_cfg->m_Ident );
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_cfg->SaveParam( m_EDA_Config );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List )
|
||||
void EDA_APP::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List )
|
||||
{
|
||||
if( m_EDA_Config == NULL )
|
||||
return;
|
||||
|
@ -276,24 +269,10 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function ReadProjectConfig
|
||||
* Read the current "projet" parameters
|
||||
* Parameters are parameters that have the .m_Setup member set to false
|
||||
* read file is the .pro file project
|
||||
*
|
||||
* if Load_Only_if_New == true, this file is read only if it differs from
|
||||
* the current config (different dates )
|
||||
*
|
||||
* @return true if read.
|
||||
* Also set:
|
||||
* wxGetApp().m_CurrentOptionFileDateAndTime
|
||||
* wxGetApp().m_CurrentOptionFile
|
||||
*/
|
||||
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_BASE** List,
|
||||
bool Load_Only_if_New )
|
||||
bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_BASE** List,
|
||||
bool Load_Only_if_New )
|
||||
{
|
||||
PARAM_CFG_BASE* pt_cfg;
|
||||
wxString timestamp;
|
||||
|
@ -302,6 +281,7 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
|
||||
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
|
||||
timestamp = m_ProjectConfig->Read( wxT( "update" ) );
|
||||
|
||||
if( Load_Only_if_New && ( !timestamp.IsEmpty() )
|
||||
&& (timestamp == m_CurrentOptionFileDateAndTime) )
|
||||
{
|
||||
|
@ -311,12 +291,13 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
m_CurrentOptionFileDateAndTime = timestamp;
|
||||
|
||||
if( !g_Prj_Default_Config_FullFilename.IsEmpty() )
|
||||
{
|
||||
m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() )
|
||||
m_CurrentOptionFile = wxGetCwd() + STRING_DIR_SEP +
|
||||
g_Prj_Config_LocalFilename;
|
||||
m_CurrentOptionFile = wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename;
|
||||
else
|
||||
m_CurrentOptionFile = g_Prj_Config_LocalFilename;
|
||||
}
|
||||
|
@ -324,6 +305,7 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
for( ; List != NULL && *List != NULL; List++ )
|
||||
{
|
||||
pt_cfg = *List;
|
||||
|
||||
if( pt_cfg->m_Group )
|
||||
m_ProjectConfig->SetPath( pt_cfg->m_Group );
|
||||
else
|
||||
|
@ -342,10 +324,10 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
}
|
||||
|
||||
|
||||
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_ARRAY& params,
|
||||
bool Load_Only_if_New )
|
||||
bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
|
||||
const wxString& GroupName,
|
||||
PARAM_CFG_ARRAY& params,
|
||||
bool Load_Only_if_New )
|
||||
{
|
||||
wxString timestamp;
|
||||
|
||||
|
@ -353,6 +335,7 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
|
||||
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
|
||||
timestamp = m_ProjectConfig->Read( wxT( "update" ) );
|
||||
|
||||
if( Load_Only_if_New && ( !timestamp.IsEmpty() )
|
||||
&& (timestamp == m_CurrentOptionFileDateAndTime) )
|
||||
{
|
||||
|
@ -362,12 +345,13 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
m_CurrentOptionFileDateAndTime = timestamp;
|
||||
|
||||
if( !g_Prj_Default_Config_FullFilename.IsEmpty() )
|
||||
{
|
||||
m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() )
|
||||
m_CurrentOptionFile = wxGetCwd() + STRING_DIR_SEP +
|
||||
g_Prj_Config_LocalFilename;
|
||||
m_CurrentOptionFile = wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename;
|
||||
else
|
||||
m_CurrentOptionFile = g_Prj_Config_LocalFilename;
|
||||
}
|
||||
|
@ -392,19 +376,14 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function ReadCurrentSetupValues
|
||||
* Raed the current setup values previously saved, from m_EDA_Config
|
||||
* saved parameters are parameters that have the .m_Setup member set to true
|
||||
* @param aList = array of PARAM_CFG_BASE pointers
|
||||
*/
|
||||
void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
|
||||
void EDA_APP::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
|
||||
{
|
||||
PARAM_CFG_BASE* pt_cfg;
|
||||
|
||||
for( ; *aList != NULL; aList++ )
|
||||
{
|
||||
pt_cfg = *aList;
|
||||
|
||||
if( pt_cfg->m_Setup == false )
|
||||
continue;
|
||||
|
||||
|
@ -413,7 +392,7 @@ void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_ARRAY& List )
|
||||
void EDA_APP::ReadCurrentSetupValues( PARAM_CFG_ARRAY& List )
|
||||
{
|
||||
BOOST_FOREACH( PARAM_CFG_BASE& param, List )
|
||||
{
|
||||
|
@ -468,6 +447,7 @@ void PARAM_CFG_INT::ReadParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
int itmp = aConfig->Read( m_Ident, m_Default );
|
||||
|
||||
if( (itmp < m_Min) || (itmp > m_Max) )
|
||||
|
@ -485,6 +465,7 @@ void PARAM_CFG_INT::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
aConfig->Write( m_Ident, *m_Pt_param );
|
||||
}
|
||||
|
||||
|
@ -536,6 +517,7 @@ void PARAM_CFG_SETCOLOR::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
aConfig->Write( m_Ident, *m_Pt_param );
|
||||
}
|
||||
|
||||
|
@ -577,18 +559,23 @@ void PARAM_CFG_DOUBLE::ReadParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
double ftmp = 0;
|
||||
wxString msg;
|
||||
msg = aConfig->Read( m_Ident, wxT( "" ) );
|
||||
|
||||
if( msg.IsEmpty() )
|
||||
{
|
||||
ftmp = m_Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.ToDouble( &ftmp );
|
||||
|
||||
if( (ftmp < m_Min) || (ftmp > m_Max) )
|
||||
ftmp = m_Default;
|
||||
}
|
||||
|
||||
*m_Pt_param = ftmp;
|
||||
}
|
||||
|
||||
|
@ -601,6 +588,7 @@ void PARAM_CFG_DOUBLE::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
aConfig->Write( m_Ident, *m_Pt_param );
|
||||
}
|
||||
|
||||
|
@ -635,6 +623,7 @@ void PARAM_CFG_BOOL::ReadParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
int itmp = aConfig->Read( m_Ident, (int) m_Default );
|
||||
|
||||
*m_Pt_param = itmp ? true : false;
|
||||
|
@ -649,6 +638,7 @@ void PARAM_CFG_BOOL::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
aConfig->Write( m_Ident, *m_Pt_param );
|
||||
}
|
||||
|
||||
|
@ -694,6 +684,7 @@ void PARAM_CFG_WXSTRING::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
aConfig->Write( m_Ident, *m_Pt_param );
|
||||
}
|
||||
|
||||
|
@ -735,6 +726,7 @@ void PARAM_CFG_FILENAME::SaveParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
wxString prm = *m_Pt_param;
|
||||
// filenames are stored using Unix notation
|
||||
prm.Replace(wxT("\\"), wxT("/") );
|
||||
|
@ -759,10 +751,12 @@ void PARAM_CFG_LIBNAME_LIST::ReadParam( wxConfigBase* aConfig )
|
|||
{
|
||||
if( m_Pt_param == NULL || aConfig == NULL )
|
||||
return;
|
||||
|
||||
int indexlib = 1; // We start indexlib to 1 because first
|
||||
// lib name is LibName1
|
||||
wxString libname, id_lib;
|
||||
wxArrayString* libname_list = m_Pt_param;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
id_lib = m_Ident;
|
||||
|
@ -795,6 +789,7 @@ void PARAM_CFG_LIBNAME_LIST::SaveParam( wxConfigBase* aConfig )
|
|||
unsigned indexlib = 0;
|
||||
wxString configkey;
|
||||
wxString libname;
|
||||
|
||||
for( ; indexlib < libname_list->GetCount(); indexlib++ )
|
||||
{
|
||||
configkey = m_Ident;
|
||||
|
|
|
@ -1,94 +1,23 @@
|
|||
/***************/
|
||||
/* wxwineda.cpp */
|
||||
/****************/
|
||||
/**
|
||||
* @file wxwineda.cpp
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "wxstruct.h"
|
||||
#include "dialog_helpers.h"
|
||||
|
||||
/*
|
||||
* Text entry dialog to enter one or more lines of text.
|
||||
*/
|
||||
WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent,
|
||||
const wxString& Title,
|
||||
const wxString& TextToEdit,
|
||||
wxBoxSizer* BoxSizer,
|
||||
const wxSize& Size, bool Multiline )
|
||||
{
|
||||
m_Modify = FALSE;
|
||||
if( ! TextToEdit.IsEmpty() )
|
||||
m_NewText = TextToEdit;
|
||||
|
||||
m_Title = new wxStaticText( parent, -1, Title );
|
||||
|
||||
BoxSizer->Add( m_Title, 0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
|
||||
|
||||
long style = 0;
|
||||
|
||||
if (Multiline)
|
||||
style = wxTE_MULTILINE;
|
||||
|
||||
m_FrameText = new wxTextCtrl( parent, -1, TextToEdit, wxDefaultPosition,
|
||||
Size,style );
|
||||
|
||||
m_FrameText->SetInsertionPoint( 1 );
|
||||
BoxSizer->Add( m_FrameText,
|
||||
0,
|
||||
wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM,
|
||||
5 );
|
||||
}
|
||||
|
||||
|
||||
wxString WinEDA_EnterText::GetValue()
|
||||
{
|
||||
m_Modify = m_FrameText->IsModified();
|
||||
m_NewText = m_FrameText->GetValue();
|
||||
return m_NewText;
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_EnterText::GetValue( char* buffer, int lenmax )
|
||||
{
|
||||
m_Modify = m_FrameText->IsModified();
|
||||
if( buffer )
|
||||
{
|
||||
m_NewText = m_FrameText->GetValue();
|
||||
int ii, ll = m_NewText.Len();
|
||||
for( ii = 0; ii < ll && ii < (lenmax - 1); ii++ )
|
||||
;
|
||||
|
||||
buffer[ii] = m_NewText.GetChar( ii );
|
||||
buffer[lenmax - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_EnterText::SetValue( const wxString& new_text )
|
||||
{
|
||||
m_FrameText->SetValue( new_text );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_EnterText::Enable( bool enbl )
|
||||
{
|
||||
m_Title->Enable( enbl );
|
||||
m_FrameText->Enable( enbl );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************/
|
||||
/* Class to edit a graphic + text size in INCHES or MM */
|
||||
/*******************************************************/
|
||||
WinEDA_GraphicTextCtrl::WinEDA_GraphicTextCtrl( wxWindow* parent,
|
||||
const wxString& Title,
|
||||
const wxString& TextToEdit,
|
||||
int textsize,
|
||||
UserUnitType user_unit,
|
||||
wxBoxSizer* BoxSizer,
|
||||
int framelen,
|
||||
int internal_unit )
|
||||
EDA_GRAPHIC_TEXT_CTRL::EDA_GRAPHIC_TEXT_CTRL( wxWindow* parent,
|
||||
const wxString& Title,
|
||||
const wxString& TextToEdit,
|
||||
int textsize,
|
||||
EDA_UNITS_T user_unit,
|
||||
wxBoxSizer* BoxSizer,
|
||||
int framelen,
|
||||
int internal_unit )
|
||||
{
|
||||
m_UserUnit = user_unit;
|
||||
m_Internal_Unit = internal_unit;
|
||||
|
@ -121,7 +50,7 @@ WinEDA_GraphicTextCtrl::WinEDA_GraphicTextCtrl( wxWindow* parent,
|
|||
}
|
||||
|
||||
|
||||
WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl()
|
||||
EDA_GRAPHIC_TEXT_CTRL::~EDA_GRAPHIC_TEXT_CTRL()
|
||||
{
|
||||
/* no, these are deleted by the BoxSizer
|
||||
delete m_FrameText;
|
||||
|
@ -130,8 +59,8 @@ WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl()
|
|||
}
|
||||
|
||||
|
||||
wxString WinEDA_GraphicTextCtrl::FormatSize( int internalUnit, UserUnitType aUnit,
|
||||
int textSize )
|
||||
wxString EDA_GRAPHIC_TEXT_CTRL::FormatSize( int internalUnit, EDA_UNITS_T aUnit,
|
||||
int textSize )
|
||||
{
|
||||
wxString value;
|
||||
|
||||
|
@ -143,40 +72,40 @@ wxString WinEDA_GraphicTextCtrl::FormatSize( int internalUnit, UserUnitType aUni
|
|||
textSize = 3000;
|
||||
|
||||
value.Printf( ( internalUnit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ),
|
||||
To_User_Unit( aUnit, textSize, internalUnit ) );
|
||||
To_User_Unit( aUnit, textSize, internalUnit ) );
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_GraphicTextCtrl::SetTitle( const wxString& title )
|
||||
void EDA_GRAPHIC_TEXT_CTRL::SetTitle( const wxString& title )
|
||||
{
|
||||
m_Title->SetLabel( title );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_GraphicTextCtrl::SetValue( const wxString& value )
|
||||
void EDA_GRAPHIC_TEXT_CTRL::SetValue( const wxString& value )
|
||||
{
|
||||
m_FrameText->SetValue( value );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_GraphicTextCtrl::SetValue( int textSize )
|
||||
void EDA_GRAPHIC_TEXT_CTRL::SetValue( int textSize )
|
||||
{
|
||||
wxString value = FormatSize( m_Internal_Unit, m_UserUnit, textSize );
|
||||
m_FrameSize->SetValue( value );
|
||||
}
|
||||
|
||||
|
||||
wxString WinEDA_GraphicTextCtrl::GetText()
|
||||
wxString EDA_GRAPHIC_TEXT_CTRL::GetText()
|
||||
{
|
||||
wxString text = m_FrameText->GetValue();
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
int WinEDA_GraphicTextCtrl::ParseSize( const wxString& sizeText,
|
||||
int internalUnit, UserUnitType aUnit )
|
||||
int EDA_GRAPHIC_TEXT_CTRL::ParseSize( const wxString& sizeText,
|
||||
int internalUnit, EDA_UNITS_T aUnit )
|
||||
{
|
||||
int textsize;
|
||||
|
||||
|
@ -193,13 +122,13 @@ int WinEDA_GraphicTextCtrl::ParseSize( const wxString& sizeText,
|
|||
}
|
||||
|
||||
|
||||
int WinEDA_GraphicTextCtrl::GetTextSize()
|
||||
int EDA_GRAPHIC_TEXT_CTRL::GetTextSize()
|
||||
{
|
||||
return ParseSize( m_FrameSize->GetValue(), m_Internal_Unit, m_UserUnit );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_GraphicTextCtrl::Enable( bool state )
|
||||
void EDA_GRAPHIC_TEXT_CTRL::Enable( bool state )
|
||||
{
|
||||
m_FrameText->Enable( state );
|
||||
}
|
||||
|
@ -208,21 +137,23 @@ void WinEDA_GraphicTextCtrl::Enable( bool state )
|
|||
/********************************************************/
|
||||
/* Class to display and edit a coordinated INCHES or MM */
|
||||
/********************************************************/
|
||||
WinEDA_PositionCtrl::WinEDA_PositionCtrl( wxWindow* parent,
|
||||
const wxString& title,
|
||||
const wxPoint& pos_to_edit,
|
||||
UserUnitType user_unit,
|
||||
wxBoxSizer* BoxSizer,
|
||||
int internal_unit )
|
||||
EDA_POSITION_CTRL::EDA_POSITION_CTRL( wxWindow* parent,
|
||||
const wxString& title,
|
||||
const wxPoint& pos_to_edit,
|
||||
EDA_UNITS_T user_unit,
|
||||
wxBoxSizer* BoxSizer,
|
||||
int internal_unit )
|
||||
{
|
||||
wxString text;
|
||||
|
||||
m_UserUnit = user_unit;
|
||||
m_Internal_Unit = internal_unit;
|
||||
|
||||
if( title.IsEmpty() )
|
||||
text = _( "Pos " );
|
||||
else
|
||||
text = title;
|
||||
|
||||
text += _( "X" ) + ReturnUnitSymbol( m_UserUnit );
|
||||
m_TextX = new wxStaticText( parent, -1, text );
|
||||
|
||||
|
@ -239,6 +170,7 @@ WinEDA_PositionCtrl::WinEDA_PositionCtrl( wxWindow* parent,
|
|||
else
|
||||
text = title;
|
||||
text += _( "Y" ) + ReturnUnitSymbol( m_UserUnit );
|
||||
|
||||
m_TextY = new wxStaticText( parent, -1, text );
|
||||
|
||||
BoxSizer->Add( m_TextY, 0,
|
||||
|
@ -252,7 +184,7 @@ WinEDA_PositionCtrl::WinEDA_PositionCtrl( wxWindow* parent,
|
|||
}
|
||||
|
||||
|
||||
WinEDA_PositionCtrl::~WinEDA_PositionCtrl()
|
||||
EDA_POSITION_CTRL::~EDA_POSITION_CTRL()
|
||||
{
|
||||
delete m_TextX;
|
||||
delete m_TextY;
|
||||
|
@ -263,7 +195,7 @@ WinEDA_PositionCtrl::~WinEDA_PositionCtrl()
|
|||
|
||||
/* Returns (in internal units) to coordinate between (in user units)
|
||||
*/
|
||||
wxPoint WinEDA_PositionCtrl::GetValue()
|
||||
wxPoint EDA_POSITION_CTRL::GetValue()
|
||||
{
|
||||
wxPoint coord;
|
||||
|
||||
|
@ -274,14 +206,14 @@ wxPoint WinEDA_PositionCtrl::GetValue()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_PositionCtrl::Enable( bool x_win_on, bool y_win_on )
|
||||
void EDA_POSITION_CTRL::Enable( bool x_win_on, bool y_win_on )
|
||||
{
|
||||
m_FramePosX->Enable( x_win_on );
|
||||
m_FramePosY->Enable( y_win_on );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_PositionCtrl::SetValue( int x_value, int y_value )
|
||||
void EDA_POSITION_CTRL::SetValue( int x_value, int y_value )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -299,22 +231,22 @@ void WinEDA_PositionCtrl::SetValue( int x_value, int y_value )
|
|||
|
||||
|
||||
/*******************/
|
||||
/* WinEDA_SizeCtrl */
|
||||
/* EDA_SIZE_CTRL */
|
||||
/*******************/
|
||||
WinEDA_SizeCtrl::WinEDA_SizeCtrl( wxWindow* parent, const wxString& title,
|
||||
const wxSize& size_to_edit,
|
||||
UserUnitType aUnit, wxBoxSizer* BoxSizer,
|
||||
int internal_unit ) :
|
||||
WinEDA_PositionCtrl( parent, title,
|
||||
wxPoint( size_to_edit.x, size_to_edit.y ),
|
||||
aUnit, BoxSizer, internal_unit )
|
||||
EDA_SIZE_CTRL::EDA_SIZE_CTRL( wxWindow* parent, const wxString& title,
|
||||
const wxSize& size_to_edit,
|
||||
EDA_UNITS_T aUnit, wxBoxSizer* aBoxSizer,
|
||||
int internal_unit ) :
|
||||
EDA_POSITION_CTRL( parent, title,
|
||||
wxPoint( size_to_edit.x, size_to_edit.y ),
|
||||
aUnit, aBoxSizer, internal_unit )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxSize WinEDA_SizeCtrl::GetValue()
|
||||
wxSize EDA_SIZE_CTRL::GetValue()
|
||||
{
|
||||
wxPoint pos = WinEDA_PositionCtrl::GetValue();
|
||||
wxPoint pos = EDA_POSITION_CTRL::GetValue();
|
||||
wxSize size;
|
||||
|
||||
size.x = pos.x;
|
||||
|
@ -326,9 +258,9 @@ wxSize WinEDA_SizeCtrl::GetValue()
|
|||
/**************************************************************/
|
||||
/* Class to display and edit a dimension INCHES, MM, or other */
|
||||
/**************************************************************/
|
||||
WinEDA_ValueCtrl::WinEDA_ValueCtrl( wxWindow* parent, const wxString& title,
|
||||
int value, UserUnitType user_unit, wxBoxSizer* BoxSizer,
|
||||
int internal_unit )
|
||||
EDA_VALUE_CTRL::EDA_VALUE_CTRL( wxWindow* parent, const wxString& title,
|
||||
int value, EDA_UNITS_T user_unit, wxBoxSizer* BoxSizer,
|
||||
int internal_unit )
|
||||
{
|
||||
wxString label = title;
|
||||
|
||||
|
@ -353,14 +285,14 @@ WinEDA_ValueCtrl::WinEDA_ValueCtrl( wxWindow* parent, const wxString& title,
|
|||
}
|
||||
|
||||
|
||||
WinEDA_ValueCtrl::~WinEDA_ValueCtrl()
|
||||
EDA_VALUE_CTRL::~EDA_VALUE_CTRL()
|
||||
{
|
||||
delete m_ValueCtrl;
|
||||
delete m_Text;
|
||||
}
|
||||
|
||||
|
||||
int WinEDA_ValueCtrl::GetValue()
|
||||
int EDA_VALUE_CTRL::GetValue()
|
||||
{
|
||||
int coord;
|
||||
wxString txtvalue = m_ValueCtrl->GetValue();
|
||||
|
@ -370,7 +302,7 @@ int WinEDA_ValueCtrl::GetValue()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_ValueCtrl::SetValue( int new_value )
|
||||
void EDA_VALUE_CTRL::SetValue( int new_value )
|
||||
{
|
||||
wxString buffer;
|
||||
|
||||
|
@ -381,7 +313,7 @@ void WinEDA_ValueCtrl::SetValue( int new_value )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_ValueCtrl::Enable( bool enbl )
|
||||
void EDA_VALUE_CTRL::Enable( bool enbl )
|
||||
{
|
||||
m_ValueCtrl->Enable( enbl );
|
||||
m_Text->Enable( enbl );
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "cvpcb.h"
|
||||
#include "cvpcb_mainframe.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "cvpcb.h"
|
||||
#include "cvpcb_mainframe.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "dialog_cvpcb_config.h"
|
||||
#include "class_DisplayFootprintsFrame.h"
|
||||
#include "cvpcb_id.h"
|
||||
#include "dialog_load_error.h"
|
||||
#include "html_messagebox.h"
|
||||
|
||||
|
||||
#include "build_version.h"
|
||||
|
@ -578,7 +578,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
|
|||
/* Display error messages, if any */
|
||||
if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
|
||||
{
|
||||
DIALOG_LOAD_ERROR dialog( NULL );
|
||||
HTML_MESSAGE_BOX dialog( this, _("Load Error") );
|
||||
|
||||
if( !m_footprints.m_filesNotFound.IsEmpty() )
|
||||
{
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
||||
#include "cvpcb.h"
|
||||
#include "zones.h"
|
||||
#include "bitmaps.h"
|
||||
#include "cvpcb_mainframe.h"
|
||||
#include "colors_selection.h"
|
||||
#include "cvpcb_id.h"
|
||||
|
@ -39,7 +37,7 @@ const wxString titleLibLoadError( _( "Library Load Error" ) );
|
|||
* MacOSX: Needed for file association
|
||||
* http://wiki.wxwidgets.org/WxMac-specific_topics
|
||||
*/
|
||||
void WinEDA_App::MacOpenFile(const wxString &fileName)
|
||||
void EDA_APP::MacOpenFile(const wxString &fileName)
|
||||
{
|
||||
wxFileName filename = fileName;
|
||||
wxString oldPath;
|
||||
|
@ -62,20 +60,20 @@ void WinEDA_App::MacOpenFile(const wxString &fileName)
|
|||
}
|
||||
|
||||
// Create a new application object
|
||||
IMPLEMENT_APP( WinEDA_App )
|
||||
IMPLEMENT_APP( EDA_APP )
|
||||
|
||||
|
||||
/************************************/
|
||||
/* Called to initialize the program */
|
||||
/************************************/
|
||||
|
||||
bool WinEDA_App::OnInit()
|
||||
bool EDA_APP::OnInit()
|
||||
{
|
||||
wxFileName filename;
|
||||
wxString message;
|
||||
CVPCB_MAINFRAME* frame = NULL;
|
||||
|
||||
InitEDA_Appl( wxT( "CvPcb" ), APP_TYPE_CVPCB );
|
||||
InitEDA_Appl( wxT( "CvPcb" ), APP_CVPCB_T );
|
||||
|
||||
if( m_Checker && m_Checker->IsAnotherRunning() )
|
||||
{
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "wxstruct.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include "macros.h"
|
||||
|
||||
#include "cvpcb.h"
|
||||
#include "cvpcb_mainframe.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "cvpcb.h"
|
||||
#include "cvpcb_mainframe.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
#include "macros.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -136,12 +136,12 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
|
|||
* but they must exist because they appear in some classes.
|
||||
* Do nothing in CvPcb.
|
||||
*/
|
||||
TRACK* Marque_Une_Piste( BOARD* aPcb,
|
||||
TRACK* aStartSegm,
|
||||
int* aSegmCount,
|
||||
int* aTrackLen,
|
||||
int* aLenDie,
|
||||
bool aReorder )
|
||||
TRACK* MarkTrace( BOARD* aPcb,
|
||||
TRACK* aStartSegm,
|
||||
int* aSegmCount,
|
||||
int* aTrackLen,
|
||||
int* aLenDie,
|
||||
bool aReorder )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "wxstruct.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
****************************************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "block_commande.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "kicad_string.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "eeschema_id.h"
|
||||
#include "confirm.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/*************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "kicad_string.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "kicad_string.h"
|
||||
#include "confirm.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
|
|
|
@ -33,10 +33,8 @@
|
|||
#include <vector>
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "kicad_string.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
#include "wxstruct.h"
|
||||
#include "netlist.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "sch_component.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "eda_dde.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "confirm.h"
|
||||
#include "eda_doc.h"
|
||||
|
@ -50,9 +49,11 @@ wxString DataBaseGetName( EDA_DRAW_FRAME* frame, wxString& Keys, wxString& BufNa
|
|||
if( nameList.IsEmpty() )
|
||||
{
|
||||
msg = _( "No components found matching " );
|
||||
|
||||
if( !BufName.IsEmpty() )
|
||||
{
|
||||
msg += _( "name search criteria <" ) + BufName + wxT( "> " );
|
||||
|
||||
if( !Keys.IsEmpty() )
|
||||
msg += _( "and " );
|
||||
}
|
||||
|
@ -67,8 +68,8 @@ wxString DataBaseGetName( EDA_DRAW_FRAME* frame, wxString& Keys, wxString& BufNa
|
|||
|
||||
// Show candidate list:
|
||||
wxString cmpname;
|
||||
WinEDAListBox dlg( frame, _( "Select Component" ),
|
||||
nameList, cmpname, DisplayCmpDoc );
|
||||
EDA_LIST_DIALOG dlg( frame, _( "Select Component" ), nameList, cmpname, DisplayCmpDoc );
|
||||
|
||||
if( dlg.ShowModal() != wxID_OK )
|
||||
return wxEmptyString;
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "bitmaps.h"
|
||||
#include "common.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include "kicad_string.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "wxstruct.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
@ -633,9 +632,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
|||
else
|
||||
fieldValueTextCtrl->Enable( true );
|
||||
|
||||
textSizeTextCtrl->SetValue(
|
||||
WinEDA_GraphicTextCtrl::FormatSize( EESCHEMA_INTERNAL_UNIT,
|
||||
g_UserUnit, field.m_Size.x ) );
|
||||
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( EESCHEMA_INTERNAL_UNIT,
|
||||
g_UserUnit, field.m_Size.x ) );
|
||||
|
||||
wxPoint coord = field.m_Pos;
|
||||
wxPoint zero = -m_Cmp->m_Pos; // relative zero
|
||||
|
@ -714,8 +712,8 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
|
|||
|
||||
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
||||
|
||||
field.m_Size.x = WinEDA_GraphicTextCtrl::ParseSize(
|
||||
textSizeTextCtrl->GetValue(), EESCHEMA_INTERNAL_UNIT, g_UserUnit );
|
||||
field.m_Size.x = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(),
|
||||
EESCHEMA_INTERNAL_UNIT, g_UserUnit );
|
||||
field.m_Size.y = field.m_Size.x;
|
||||
|
||||
int style = m_StyleRadioBox->GetSelection();
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "wx/valgen.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "general.h"
|
||||
#include "drawtxt.h"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
@ -658,8 +657,8 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
|
|||
|
||||
fieldValueTextCtrl->SetValue( field.m_Text );
|
||||
|
||||
textSizeTextCtrl->SetValue(
|
||||
WinEDA_GraphicTextCtrl::FormatSize( EESCHEMA_INTERNAL_UNIT, g_UserUnit, field.m_Size.x ) );
|
||||
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( EESCHEMA_INTERNAL_UNIT,
|
||||
g_UserUnit, field.m_Size.x ) );
|
||||
|
||||
wxPoint coord = field.m_Pos;
|
||||
wxPoint zero;
|
||||
|
@ -745,8 +744,8 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
|
|||
|
||||
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
||||
|
||||
field.m_Size.x = WinEDA_GraphicTextCtrl::ParseSize(
|
||||
textSizeTextCtrl->GetValue(), EESCHEMA_INTERNAL_UNIT, g_UserUnit );
|
||||
field.m_Size.x = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(),
|
||||
EESCHEMA_INTERNAL_UNIT, g_UserUnit );
|
||||
|
||||
field.m_Size.y = field.m_Size.x;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
// License: GPL
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
#include "bitmaps.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Handles the dialog so set current texts and pins sizes in LibEdit
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
#include "general.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "plot_common.h"
|
||||
#include "confirm.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "plot_common.h"
|
||||
#include "worksheet.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "worksheet.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "trigo.h"
|
||||
#include "common.h"
|
||||
#include "richio.h"
|
||||
#include "plot_common.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "base_struct.h"
|
||||
#include "drawtxt.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "general.h"
|
||||
#include "class_library.h"
|
||||
|
||||
#include "dialog_load_error.h"
|
||||
#include "html_messagebox.h"
|
||||
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,7 @@ void SCH_EDIT_FRAME::LoadLibraries( void )
|
|||
/* Print the libraries not found */
|
||||
if( !libraries_not_found.IsEmpty() )
|
||||
{
|
||||
DIALOG_LOAD_ERROR dialog( this );
|
||||
HTML_MESSAGE_BOX dialog( this, _("Files not found") );
|
||||
dialog.MessageSet( _( "The following libraries could not be found:" ) );
|
||||
dialog.ListSet( libraries_not_found );
|
||||
libraries_not_found.empty();
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include "bitmaps.h"
|
||||
#include "eda_dde.h"
|
||||
#include "id.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
@ -80,12 +78,12 @@ TRANSFORM DefaultTransform = TRANSFORM( 1, 0, 0, -1 );
|
|||
// static object for many reasons) and also declares the accessor function
|
||||
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
|
||||
// not wxApp)
|
||||
IMPLEMENT_APP( WinEDA_App )
|
||||
IMPLEMENT_APP( EDA_APP )
|
||||
|
||||
/* MacOSX: Needed for file association
|
||||
* http://wiki.wxwidgets.org/WxMac-specific_topics
|
||||
*/
|
||||
void WinEDA_App::MacOpenFile( const wxString &fileName )
|
||||
void EDA_APP::MacOpenFile( const wxString &fileName )
|
||||
{
|
||||
wxFileName filename = fileName;
|
||||
SCH_EDIT_FRAME* frame = ((SCH_EDIT_FRAME*) GetTopWindow());
|
||||
|
@ -100,12 +98,12 @@ void WinEDA_App::MacOpenFile( const wxString &fileName )
|
|||
}
|
||||
|
||||
|
||||
bool WinEDA_App::OnInit()
|
||||
bool EDA_APP::OnInit()
|
||||
{
|
||||
wxFileName filename;
|
||||
SCH_EDIT_FRAME* frame = NULL;
|
||||
|
||||
InitEDA_Appl( wxT( "EESchema" ), APP_TYPE_EESCHEMA );
|
||||
InitEDA_Appl( wxT( "EESchema" ), APP_EESCHEMA_T );
|
||||
|
||||
if( m_Checker && m_Checker->IsAnotherRunning() )
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
@ -211,7 +210,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
|||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
g_UserUnit = (UserUnitType)dlg.GetUnitsSelection();
|
||||
g_UserUnit = (EDA_UNITS_T)dlg.GetUnitsSelection();
|
||||
|
||||
GetScreen()->SetGrid( grid_list[ (size_t) dlg.GetGridSelection() ].m_Size );
|
||||
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
/**************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "kicad_string.h"
|
||||
#include "bitmaps.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "general.h"
|
||||
#include "kicad_device_context.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/****************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
*/
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
|
|
@ -57,3 +57,4 @@
|
|||
#define HELP_ADD_BODYCIRCLE _( "Add circles to the component body" )
|
||||
#define HELP_ADD_BODYARC _( "Add arcs to the component body" )
|
||||
#define HELP_ADD_BODYPOLYGON _( "Add lines and polygons to the component body" )
|
||||
#define HELP_PLACE_GRAPHICIMAGES _("Add a bitmap image")
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
/******************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "bitmaps.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/***************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "eeschema_id.h"
|
||||
#include "hotkeys.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
@ -87,8 +86,8 @@ static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
|
|||
static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' );
|
||||
#endif
|
||||
|
||||
static Ki_HotkeyInfo HkHelp( wxT( "Help: this message" ), HK_HELP, '?' );
|
||||
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ),
|
||||
static Ki_HotkeyInfo HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' );
|
||||
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset Local Coordinates" ),
|
||||
HK_RESET_LOCAL_COORD, ' ' );
|
||||
|
||||
/* Undo */
|
||||
|
@ -104,11 +103,11 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL +
|
|||
|
||||
// Schematic editor
|
||||
static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' );
|
||||
static Ki_HotkeyInfo HkAddHierarchicalLabel( wxT( "add Hierarchical Label" ), HK_ADD_HLABEL, 'H' );
|
||||
static Ki_HotkeyInfo HkAddGlobalLabel( wxT( "add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + '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 HkBeginBus( wxT( "begin Bus" ), HK_BEGIN_BUS, 'B' );
|
||||
static Ki_HotkeyInfo HkAddHierarchicalLabel( wxT( "Add Hierarchical Label" ), HK_ADD_HLABEL, 'H' );
|
||||
static Ki_HotkeyInfo HkAddGlobalLabel( wxT( "Add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'L' );
|
||||
static Ki_HotkeyInfo HkAddJunction( wxT( "Add Junction" ), HK_ADD_JUNCTION, 'J' );
|
||||
static Ki_HotkeyInfo HkBeginWire( wxT( "Draw Wire" ), HK_BEGIN_WIRE, 'W' );
|
||||
static Ki_HotkeyInfo HkBeginBus( wxT( "Draw Bus" ), HK_BEGIN_BUS, 'B' );
|
||||
static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A' );
|
||||
static Ki_HotkeyInfo HkAddPower( wxT( "Add Power" ), HK_ADD_NEW_POWER, 'P' );
|
||||
static Ki_HotkeyInfo HkAddNoConn( wxT( "Add NoConnected Flag" ), HK_ADD_NOCONN_FLAG, 'Q' );
|
||||
|
@ -139,20 +138,20 @@ static Ki_HotkeyInfo HkCopyComponentOrText( wxT( "Copy Component or Label" ),
|
|||
|
||||
static Ki_HotkeyInfo HkDrag( wxT( "Drag Schematic Item" ), HK_DRAG, 'G',
|
||||
ID_POPUP_SCH_DRAG_CMP_REQUEST );
|
||||
static Ki_HotkeyInfo HkMove2Drag( wxT( "Switch move block to drag block" ),
|
||||
static Ki_HotkeyInfo HkMove2Drag( wxT( "Move Block -> Drag Block" ),
|
||||
HK_MOVEBLOCK_TO_DRAGBLOCK, '\t' );
|
||||
static Ki_HotkeyInfo HkInsert( wxT( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT );
|
||||
static Ki_HotkeyInfo HkDelete( wxT( "Delete Item" ), HK_DELETE, WXK_DELETE );
|
||||
|
||||
static Ki_HotkeyInfo HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL );
|
||||
static Ki_HotkeyInfo HkFindNextItem( wxT( "Find Next Item" ), HK_FIND_NEXT_ITEM, WXK_F5 );
|
||||
static Ki_HotkeyInfo HkFindNextDrcMarker( wxT( "Find next DRC marker" ), HK_FIND_NEXT_DRC_MARKER,
|
||||
static Ki_HotkeyInfo HkFindNextDrcMarker( wxT( "Find Next DRC Marker" ), HK_FIND_NEXT_DRC_MARKER,
|
||||
WXK_F5 + GR_KB_SHIFT );
|
||||
|
||||
// Special keys for library editor:
|
||||
static Ki_HotkeyInfo HkCreatePin( wxT( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
|
||||
static Ki_HotkeyInfo HkInsertPin( wxT( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT );
|
||||
static Ki_HotkeyInfo HkMoveLibItem( wxT( "Move Lib Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
|
||||
static Ki_HotkeyInfo HkMoveLibItem( wxT( "Move Library Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
|
||||
|
||||
|
||||
// List of common hotkey descriptors
|
||||
|
@ -977,7 +976,7 @@ void LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
|||
break;
|
||||
|
||||
case HK_LIBEDIT_CREATE_PIN:
|
||||
SetToolID( ID_LIBEDIT_PIN_BUTT, wxCURSOR_PENCIL, _( "Add pin" ) );
|
||||
SetToolID( ID_LIBEDIT_PIN_BUTT, wxCURSOR_PENCIL, _( "Add Pin" ) );
|
||||
OnLeftClick( aDC, aPosition );
|
||||
break;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "base_struct.h"
|
||||
#include "drawtxt.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "drawtxt.h"
|
||||
#include "plot_common.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
#include "bitmaps.h"
|
||||
|
||||
#include "general.h"
|
||||
#include "protos.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "plot_common.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/* Module for generation of component archive files. */
|
||||
/*****************************************************/
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "wxstruct.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "eeschema_id.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "fctsys.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "general.h"
|
||||
#include "protos.h"
|
||||
#include "libeditframe.h"
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "class_drawpanel.h"
|
||||
#include "confirm.h"
|
||||
#include "class_sch_screen.h"
|
||||
|
||||
#include "general.h"
|
||||
//#include "protos.h"
|
||||
#include "sch_component.h"
|
||||
#include "libeditframe.h"
|
||||
#include "class_library.h"
|
||||
|
|
|
@ -196,8 +196,13 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
AddMenuItem( editMenu,
|
||||
ID_BACKANNO_ITEMS,
|
||||
_( "&Backannotate" ),
|
||||
<<<<<<< TREE
|
||||
_( "Back annotate the footprint fields" ),
|
||||
KiBitmap( import_footprint_names_xpm ) );
|
||||
=======
|
||||
_( "Back Annotate Footprint Fields" ),
|
||||
import_footprint_names_xpm );
|
||||
>>>>>>> MERGE-SOURCE
|
||||
|
||||
// Menu View:
|
||||
wxMenu* viewMenu = new wxMenu;
|
||||
|
@ -258,7 +263,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
KiBitmap( add_component_xpm ) );
|
||||
|
||||
// Power port
|
||||
text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Power Port" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_NEW_POWER, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text,
|
||||
HELP_PLACE_POWERPORT,
|
||||
|
@ -279,21 +284,21 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
KiBitmap( add_bus_xpm ) );
|
||||
|
||||
// Wire to Bus entry
|
||||
text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Wire to Bus Entry" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
|
||||
HELP_PLACE_WIRE2BUS_ENTRY,
|
||||
KiBitmap( add_line2bus_xpm ) );
|
||||
|
||||
// Bus to Bus entry
|
||||
text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Bus to Bus Entry" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
|
||||
HELP_PLACE_BUS2BUS_ENTRY,
|
||||
KiBitmap( add_bus2bus_xpm ) );
|
||||
|
||||
// No connect flag
|
||||
text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr,
|
||||
// No Connect Flag
|
||||
text = AddHotkeyName( _( "No Connect Flag" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
|
||||
|
||||
|
@ -305,7 +310,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
KiBitmap( add_line_label_xpm ) );
|
||||
|
||||
// Global label
|
||||
text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Global Label" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_GLABEL, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_GLABEL_BUTT, text,
|
||||
HELP_PLACE_GLOBALLABEL,
|
||||
|
@ -322,9 +327,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AppendSeparator();
|
||||
|
||||
// Hierarchical label
|
||||
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_HLABEL, false ); // add comment, not a shortcut
|
||||
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_HLABEL, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_HIERLABEL_BUTT,
|
||||
text, HELP_PLACE_HIER_LABEL,
|
||||
|
@ -332,7 +337,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
|
||||
|
||||
// Hierarchical sheet
|
||||
text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Hierarchical Sheet" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text,
|
||||
HELP_PLACE_SHEET,
|
||||
|
@ -348,7 +353,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Add hierarchical Pin to Sheet
|
||||
AddMenuItem( placeMenu,
|
||||
ID_SHEET_PIN_BUTT,
|
||||
_( "Add Hierarchical Pin to Sheet" ),
|
||||
_( "Hierarchical Pin to Sheet" ),
|
||||
HELP_PLACE_SHEETPIN,
|
||||
KiBitmap( add_hierar_pin_xpm ) );
|
||||
|
||||
|
@ -356,19 +361,23 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AppendSeparator();
|
||||
|
||||
// Graphic line or polygon
|
||||
text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Graphic Polyline" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text,
|
||||
HELP_PLACE_GRAPHICLINES,
|
||||
KiBitmap( add_dashed_line_xpm ) );
|
||||
|
||||
// Graphic text
|
||||
text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr,
|
||||
text = AddHotkeyName( _( "Graphic Text" ), s_Schematic_Hokeys_Descr,
|
||||
HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut
|
||||
AddMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text,
|
||||
HELP_PLACE_GRAPHICTEXTS,
|
||||
KiBitmap( add_text_xpm ) );
|
||||
|
||||
// Graphic image
|
||||
AddMenuItem( placeMenu, ID_ADD_IMAGE_BUTT, _("Image"),
|
||||
HELP_PLACE_GRAPHICIMAGES,
|
||||
image_xpm );
|
||||
|
||||
// Menu Preferences:
|
||||
wxMenu* preferencesMenu = new wxMenu;
|
||||
|
@ -412,14 +421,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Save preferences
|
||||
AddMenuItem( preferencesMenu,
|
||||
ID_CONFIG_SAVE,
|
||||
_( "&Save preferences" ),
|
||||
_( "&Save Preferences" ),
|
||||
_( "Save application preferences" ),
|
||||
KiBitmap( save_setup_xpm ) );
|
||||
|
||||
// Read preferences
|
||||
AddMenuItem( preferencesMenu,
|
||||
ID_CONFIG_READ,
|
||||
_( "&Read preferences" ),
|
||||
_( "&Read Preferences" ),
|
||||
_( "Read application preferences" ),
|
||||
KiBitmap( read_setup_xpm ) );
|
||||
|
||||
|
@ -478,14 +487,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
//Run CVPcb
|
||||
AddMenuItem( toolsMenu,
|
||||
ID_TO_CVPCB,
|
||||
_( "A&ssign component footprints" ),
|
||||
_( "A&ssign Component Footprints" ),
|
||||
_( "Run CVPcb" ),
|
||||
KiBitmap( cvpcb_xpm ) );
|
||||
|
||||
// Run PCBNew
|
||||
AddMenuItem( toolsMenu,
|
||||
ID_TO_PCB,
|
||||
_( "&Layout printed circuit board" ),
|
||||
_( "&Layout Printed Circuit Board" ),
|
||||
_( "Run PCBNew" ),
|
||||
KiBitmap( pcbnew_xpm ) );
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "fctsys.h"
|
||||
|
||||
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/*****************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "class_sch_screen.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include "wxEeschemaStruct.h"
|
||||
|
@ -255,16 +254,23 @@ void NETLIST_DIALOG::InstallPageSpice()
|
|||
wxDefaultPosition, wxDefaultSize,
|
||||
2, netlist_opt, 1,
|
||||
wxRA_SPECIFY_COLS );
|
||||
|
||||
if( !g_OptNetListUseNames )
|
||||
m_UseNetNamesInNetlist->SetSelection( 1 );
|
||||
|
||||
page->m_LeftBoxSizer->Add( m_UseNetNamesInNetlist, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
page->m_CommandStringCtrl = new WinEDA_EnterText( page,
|
||||
_( "Simulator command:" ),
|
||||
m_Parent->GetSimulatorCommand(),
|
||||
page->m_LowBoxSizer,
|
||||
wxDefaultSize );
|
||||
page->m_LowBoxSizer->Add( new wxStaticText( page, -1, _( "Simulator command:" ) ), 0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
|
||||
|
||||
page->m_CommandStringCtrl = new wxTextCtrl( page, -1, m_Parent->GetSimulatorCommand(),
|
||||
wxDefaultPosition, wxDefaultSize );
|
||||
|
||||
page->m_CommandStringCtrl->SetInsertionPoint( 1 );
|
||||
page->m_LowBoxSizer->Add( page->m_CommandStringCtrl,
|
||||
0,
|
||||
wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM,
|
||||
5 );
|
||||
|
||||
// Add buttons
|
||||
Button = new wxButton( page, ID_CREATE_NETLIST, _( "Netlist" ) );
|
||||
|
@ -302,6 +308,7 @@ void NETLIST_DIALOG::InstallCustomPages()
|
|||
|
||||
/* Install the panel "Add Plugin" after
|
||||
* the last initialized panel */
|
||||
|
||||
previoustitle = title;
|
||||
if( title.IsEmpty() )
|
||||
CurrPage =
|
||||
|
@ -325,17 +332,32 @@ void NETLIST_DIALOG::InstallCustomPages()
|
|||
msg = CUSTOM_NETLIST_COMMAND;
|
||||
msg << ii + 1;
|
||||
wxString Command = wxGetApp().m_EDA_Config->Read( msg );
|
||||
CurrPage->m_CommandStringCtrl =
|
||||
new WinEDA_EnterText( CurrPage,
|
||||
_( "Netlist command:" ), Command,
|
||||
CurrPage->m_LowBoxSizer,
|
||||
wxDefaultSize );
|
||||
|
||||
CurrPage->m_TitleStringCtrl =
|
||||
new WinEDA_EnterText( CurrPage,
|
||||
_( "Title:" ), title,
|
||||
CurrPage->m_LowBoxSizer,
|
||||
wxDefaultSize );
|
||||
CurrPage->m_LowBoxSizer->Add( new wxStaticText( CurrPage,
|
||||
-1, _( "Netlist command:" ) ), 0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
|
||||
|
||||
CurrPage->m_CommandStringCtrl = new wxTextCtrl( CurrPage, -1, Command,
|
||||
wxDefaultPosition, wxDefaultSize );
|
||||
|
||||
CurrPage->m_CommandStringCtrl->SetInsertionPoint( 1 );
|
||||
CurrPage->m_LowBoxSizer->Add( CurrPage->m_CommandStringCtrl,
|
||||
0,
|
||||
wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM,
|
||||
5 );
|
||||
|
||||
CurrPage->m_LowBoxSizer->Add( new wxStaticText( CurrPage,
|
||||
-1, _( "Title:" ) ), 0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
|
||||
|
||||
CurrPage->m_TitleStringCtrl = new wxTextCtrl( CurrPage, -1, title,
|
||||
wxDefaultPosition, wxDefaultSize );
|
||||
|
||||
CurrPage->m_TitleStringCtrl->SetInsertionPoint( 1 );
|
||||
CurrPage->m_LowBoxSizer->Add( CurrPage->m_TitleStringCtrl,
|
||||
0,
|
||||
wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM,
|
||||
5 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,6 +407,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
|
|||
|
||||
/* Get a title for this page */
|
||||
wxString title = CurrPage->m_TitleStringCtrl->GetValue();
|
||||
|
||||
if( title.IsEmpty() )
|
||||
DisplayInfoMessage( this,
|
||||
_( "Do not forget to choose a title for this netlist control page" ) );
|
||||
|
|
|
@ -48,8 +48,8 @@ public:
|
|||
int m_IdNetType;
|
||||
wxCheckBox* m_IsCurrentFormat;
|
||||
wxCheckBox* m_AddSubPrefix;
|
||||
WinEDA_EnterText* m_CommandStringCtrl;
|
||||
WinEDA_EnterText* m_TitleStringCtrl;
|
||||
wxTextCtrl* m_CommandStringCtrl;
|
||||
wxTextCtrl* m_TitleStringCtrl;
|
||||
wxButton* m_ButtonCancel;
|
||||
wxBoxSizer* m_LeftBoxSizer;
|
||||
wxBoxSizer* m_RightBoxSizer;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue