Commit 8e0937e6 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: code cleaning, dialogs converted from Dialogblocks to wxFormBuilder,...

Pcbnew: code cleaning, dialogs converted from Dialogblocks to wxFormBuilder, file housekeeping. Add patch from Manveru.
parents 6963001a 8a0b632a
......@@ -605,7 +605,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
SetGLColor( color );
s_Text3DZPos = g_Parm_3D_Visu.m_LayerZcoord[layer];
s_Text3DWidth = text->m_Width * g_Parm_3D_Visu.m_BoardScale;
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 )
......@@ -625,7 +625,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
DrawGraphicText( NULL, NULL, pos, (EDA_Colors) color,
txt, text->m_Orient, size,
text->m_HJustify, text->m_VJustify,
text->m_Width, text->m_Italic,
text->m_Thickness, text->m_Italic,
true, Draw3dTextSegm );
pos += offset;
}
......@@ -636,7 +636,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
DrawGraphicText( NULL, NULL, text->m_Pos, (EDA_Colors) color,
text->m_Text, text->m_Orient, size,
text->m_HJustify, text->m_VJustify,
text->m_Width, text->m_Italic,
text->m_Thickness, text->m_Italic,
true,
Draw3dTextSegm );
}
......
......@@ -182,7 +182,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text )
m_Mirror = false; // display mirror if true
m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; /* Justifications Horiz et Vert du texte */
m_Width = 0; /* thickness */
m_Thickness = 0; /* thickness */
m_Italic = false; /* true = italic shape */
m_Bold = false;
m_MultilineAllowed = false; // Set to true only for texts that can use multiline.
......@@ -203,7 +203,7 @@ EDA_TextStruct::~EDA_TextStruct()
*/
int EDA_TextStruct::LenSize( const wxString& aLine ) const
{
return ReturnGraphicTextWidth(aLine, m_Size.x, m_Italic, m_Bold ) + m_Width;
return ReturnGraphicTextWidth(aLine, m_Size.x, m_Italic, m_Bold ) + m_Thickness;
}
......@@ -262,7 +262,7 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
delete list;
rect.SetSize( textsize );
rect.Inflate( m_Width/2 ); // ensure a small margin
rect.Inflate( m_Thickness/2 ); // ensure a small margin
/* Now, calculate the rect origin, according to text justification
* At this point the rectangle origin is the text origin (m_Pos).
......@@ -284,7 +284,7 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
break;
}
dy = m_Size.y + m_Width;
dy = m_Size.y + m_Thickness;
switch( m_VJustify )
{
case GR_TEXT_VJUSTIFY_TOP:
......@@ -419,7 +419,7 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
GRTraceMode aFillMode, EDA_Colors aAnchor_color,
wxString& aText, wxPoint aPos )
{
int width = m_Width;
int width = m_Thickness;
if( aFillMode == FILAIRE )
width = 0;
......
......@@ -5,7 +5,6 @@
#include "colors_selection.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "hotkeys.h"
#include "help_common_strings.h"
......
......@@ -224,12 +224,12 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
if( ( style & 2 ) )
{
m_CurrentText->m_Bold = true;
m_CurrentText->m_Width = GetPenSizeForBold( m_CurrentText->m_Size.x );
m_CurrentText->m_Thickness = GetPenSizeForBold( m_CurrentText->m_Size.x );
}
else
{
m_CurrentText->m_Bold = false;
m_CurrentText->m_Width = 0;
m_CurrentText->m_Thickness = 0;
}
m_Parent->OnModify();
......
This diff is collapsed.
......@@ -304,7 +304,7 @@ void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newty
newtext->m_Shape = Text->m_Shape;
newtext->SetSchematicTextOrientation( Text->GetSchematicTextOrientation() );
newtext->m_Size = Text->m_Size;
newtext->m_Width = Text->m_Width;
newtext->m_Thickness = Text->m_Thickness;
newtext->m_Italic = Text->m_Italic;
newtext->m_Bold = Text->m_Bold;
......
......@@ -290,7 +290,7 @@ void LIB_BEZIER::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 1, m_Width + 1 );
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
......
......@@ -59,7 +59,7 @@ LIB_FIELD::LIB_FIELD( const LIB_FIELD& field ) : LIB_DRAW_ITEM( field )
m_FieldId = field.m_FieldId;
m_Pos = field.m_Pos;
m_Size = field.m_Size;
m_Width = field.m_Width;
m_Thickness = field.m_Thickness;
m_Orient = field.m_Orient;
m_Attributs = field.m_Attributs;
m_Text = field.m_Text;
......@@ -283,7 +283,7 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg )
*/
int LIB_FIELD::GetPenSize()
{
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
return ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
}
......@@ -425,7 +425,7 @@ void LIB_FIELD::Copy( LIB_FIELD* Target ) const
Target->SetParent( m_Parent );
Target->m_Pos = m_Pos;
Target->m_Size = m_Size;
Target->m_Width = m_Width;
Target->m_Thickness = m_Thickness;
Target->m_Orient = m_Orient;
Target->m_Attributs = m_Attributs;
Target->m_Text = m_Text;
......
......@@ -138,7 +138,7 @@ public:
m_Name = field.m_Name;
m_Pos = field.m_Pos;
m_Size = field.m_Size;
m_Width = field.m_Width;
m_Thickness = field.m_Thickness;
m_Orient = field.m_Orient;
m_Mirror = field.m_Mirror;
m_Attributs = field.m_Attributs;
......@@ -217,8 +217,8 @@ protected:
virtual void DoMirrorHorizontal( const wxPoint& center );
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const TRANSFORM& aTransform );
virtual int DoGetWidth( void ) const { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
virtual int DoGetWidth( void ) const { return m_Thickness; }
virtual void DoSetWidth( int width ) { m_Thickness = width; }
};
typedef std::vector< LIB_FIELD > LIB_FIELD_LIST;
......
......@@ -306,7 +306,7 @@ void LIB_POLYLINE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoi
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 1, m_Width + 1 );
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
......
......@@ -210,7 +210,7 @@ void LIB_RECTANGLE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC,
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 1, m_Width + 1 );
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
......
......@@ -187,7 +187,7 @@ LIB_DRAW_ITEM* LIB_TEXT::DoGenCopy()
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Text = m_Text;
newitem->m_Width = m_Width;
newitem->m_Thickness = m_Thickness;
newitem->m_Italic = m_Italic;
newitem->m_Bold = m_Bold;
newitem->m_HJustify = m_HJustify;
......@@ -276,7 +276,7 @@ void LIB_TEXT::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
*/
int LIB_TEXT::GetPenSize( )
{
int pensize = m_Width;
int pensize = m_Thickness;
if( pensize == 0 ) // Use default values for pen size
{
......@@ -369,7 +369,7 @@ void LIB_TEXT::DisplayInfo( WinEDA_DrawFrame* frame )
LIB_DRAW_ITEM::DisplayInfo( frame );
msg = ReturnStringFromValue( g_UserUnit, m_Width, EESCHEMA_INTERNAL_UNIT, true );
msg = ReturnStringFromValue( g_UserUnit, m_Thickness, EESCHEMA_INTERNAL_UNIT, true );
frame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
}
......
......@@ -139,8 +139,8 @@ protected:
virtual void DoMirrorHorizontal( const wxPoint& aCenter );
virtual void DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
const TRANSFORM& aTransform );
virtual int DoGetWidth() const { return m_Width; }
virtual void DoSetWidth( int aWidth ) { m_Width = aWidth; }
virtual int DoGetWidth() const { return m_Thickness; }
virtual void DoSetWidth( int aWidth ) { m_Thickness = aWidth; }
};
......
......@@ -55,7 +55,7 @@ SCH_FIELD::~SCH_FIELD()
*/
int SCH_FIELD::GetPenSize()
{
int pensize = m_Width;
int pensize = m_Thickness;
if( pensize == 0 ) // Use default values for pen size
{
......@@ -81,7 +81,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_Colors color;
wxPoint textpos;
SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) m_Parent;
int LineWidth = m_Width;
int LineWidth = m_Thickness;
if( LineWidth == 0 ) // Use default values for pen size
{
......@@ -197,7 +197,7 @@ void SCH_FIELD::ImportValues( const LIB_FIELD& aSource )
m_VJustify = aSource.m_VJustify;
m_Italic = aSource.m_Italic;
m_Bold = aSource.m_Bold;
m_Width = aSource.m_Width;
m_Thickness = aSource.m_Thickness;
m_Attributs = aSource.m_Attributs;
m_Mirror = aSource.m_Mirror;
}
......@@ -213,7 +213,7 @@ void SCH_FIELD::SwapData( SCH_FIELD* copyitem )
EXCHG( m_Layer, copyitem->m_Layer );
EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Size, copyitem->m_Size );
EXCHG( m_Width, copyitem->m_Width );
EXCHG( m_Thickness, copyitem->m_Thickness );
EXCHG( m_Orient, copyitem->m_Orient );
EXCHG( m_Mirror, copyitem->m_Mirror );
EXCHG( m_Attributs, copyitem->m_Attributs );
......@@ -317,7 +317,7 @@ EDA_Rect SCH_FIELD::GetBoundaryBox() const
BoundaryBox.SetSize( size );
// Take thickness in account:
int linewidth = ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
BoundaryBox.Inflate( linewidth, linewidth );
return BoundaryBox;
......
......@@ -126,7 +126,7 @@ SCH_TEXT* SCH_TEXT::GenCopy()
newitem->m_Shape = m_Shape;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Width = m_Width;
newitem->m_Thickness = m_Thickness;
newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify;
newitem->m_IsDangling = m_IsDangling;
......@@ -366,7 +366,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
EXCHG( m_Text, copyitem->m_Text );
EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Size, copyitem->m_Size );
EXCHG( m_Width, copyitem->m_Width );
EXCHG( m_Thickness, copyitem->m_Thickness );
EXCHG( m_Shape, copyitem->m_Shape );
EXCHG( m_Orient, copyitem->m_Orient );
......@@ -405,7 +405,7 @@ void SCH_TEXT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
*/
int SCH_TEXT::GetPenSize()
{
int pensize = m_Width;
int pensize = m_Thickness;
if( pensize == 0 ) // Use default values for pen size
{
......@@ -428,7 +428,7 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& aOffset,
int DrawMode, int Color )
{
EDA_Colors color;
int linewidth = ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
......@@ -440,9 +440,9 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& aOffset,
wxPoint text_offset = aOffset + GetSchematicTextOffset();
EXCHG( linewidth, m_Width ); // Set the minimum width
EXCHG( linewidth, m_Thickness ); // Set the minimum width
EDA_TextStruct::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );
EXCHG( linewidth, m_Width ); // set initial value
EXCHG( linewidth, m_Thickness ); // set initial value
if( m_IsDangling )
DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color );
......@@ -484,7 +484,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_SchematicOrientation, m_Size.x,
shape, m_Width, CONV_TO_UTF8( text ) ) == EOF )
shape, m_Thickness, CONV_TO_UTF8( text ) ) == EOF )
{
success = false;
}
......@@ -557,7 +557,7 @@ bool SCH_TEXT::Load( LINE_READER& aLine, wxString& aErrorMsg )
{
thickness = atol( Name3 );
m_Bold = ( thickness != 0 );
m_Width = m_Bold ? GetPenSizeForBold( size ) : 0;
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
}
if( strnicmp( Name2, "Italic", 6 ) == 0 )
......@@ -658,12 +658,12 @@ EDA_Rect SCH_TEXT::GetBoundingBox()
{
// We must pass the effective text thickness to GetTextBox
// when calculating the bounding box
int linewidth = ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
EXCHG( linewidth, m_Width ); // Set the real width
EXCHG( linewidth, m_Thickness ); // Set the real width
EDA_Rect rect = GetTextBox( -1 );
EXCHG( linewidth, m_Width ); // set initial value
EXCHG( linewidth, m_Thickness ); // set initial value
if( m_Orient ) // Rotate rect
{
......@@ -785,7 +785,7 @@ bool SCH_LABEL::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Label %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_SchematicOrientation, m_Size.x, shape,
m_Width, CONV_TO_UTF8( m_Text ) ) == EOF )
m_Thickness, CONV_TO_UTF8( m_Text ) ) == EOF )
{
success = false;
}
......@@ -846,7 +846,7 @@ bool SCH_LABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
{
thickness = atol( Name3 );
m_Bold = ( thickness != 0 );
m_Width = m_Bold ? GetPenSizeForBold( size ) : 0;
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
}
if( stricmp( Name2, "Italic" ) == 0 )
......@@ -873,7 +873,7 @@ EDA_Rect SCH_LABEL::GetBoundingBox()
x = m_Pos.x;
y = m_Pos.y;
int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int width = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
length = LenSize( m_Text );
height = m_Size.y + width;
dx = dy = 0;
......@@ -940,7 +940,7 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const
shape = "Italic";
if( fprintf( aFile, "Text GLabel %-4d %-4d %-4d %-4d %s %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], shape, m_Width, CONV_TO_UTF8( m_Text ) ) == EOF )
SheetLabelType[m_Shape], shape, m_Thickness, CONV_TO_UTF8( m_Text ) ) == EOF )
{
success = false;
}
......@@ -997,7 +997,7 @@ bool SCH_GLOBALLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
SetSchematicTextOrientation( orient );
m_Shape = NET_INPUT;
m_Bold = ( thickness != 0 );
m_Width = m_Bold ? GetPenSizeForBold( size ) : 0;
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
m_Shape = NET_OUTPUT;
......@@ -1092,7 +1092,7 @@ void SCH_GLOBALLABEL::Rotate( wxPoint rotationPoint )
wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset()
{
wxPoint text_offset;
int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int width = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
width = Clamp_Text_PenSize( width, m_Size, m_Bold );
int HalfSize = m_Size.x / 2;
......@@ -1205,11 +1205,11 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel,
GRSetDrawMode( DC, DrawMode );
int linewidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
EXCHG( linewidth, m_Width ); // Set the minimum width
EXCHG( linewidth, m_Thickness ); // Set the minimum width
EDA_TextStruct::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );
EXCHG( linewidth, m_Width ); // set initial value
EXCHG( linewidth, m_Thickness ); // set initial value
CreateGraphicShape( Poly, m_Pos + aOffset );
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
......@@ -1237,7 +1237,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
const wxPoint& Pos )
{
int HalfSize = m_Size.y / 2;
int linewidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
......@@ -1325,7 +1325,7 @@ EDA_Rect SCH_GLOBALLABEL::GetBoundingBox()
y = m_Pos.y;
dx = dy = 0;
int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int width = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
height = ( (m_Size.y * 15) / 10 ) + width + 2 * TXTMARGE;
// text X size add height for triangular shapes(bidirectional)
......@@ -1393,7 +1393,7 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const
shape = "Italic";
if( fprintf( aFile, "Text HLabel %-4d %-4d %-4d %-4d %s %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], shape, m_Width, CONV_TO_UTF8( m_Text ) ) == EOF )
SheetLabelType[m_Shape], shape, m_Thickness, CONV_TO_UTF8( m_Text ) ) == EOF )
{
success = false;
}
......@@ -1450,7 +1450,7 @@ bool SCH_HIERLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
SetSchematicTextOrientation( orient );
m_Shape = NET_INPUT;
m_Bold = ( thickness != 0 );
m_Width = m_Bold ? GetPenSizeForBold( size ) : 0;
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
m_Shape = NET_OUTPUT;
......@@ -1538,7 +1538,7 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel,
{
static std::vector <wxPoint> Poly;
EDA_Colors color;
int linewidth = ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
......@@ -1549,10 +1549,10 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel,
GRSetDrawMode( DC, DrawMode );
EXCHG( linewidth, m_Width ); // Set the minimum width
EXCHG( linewidth, m_Thickness ); // Set the minimum width
wxPoint text_offset = offset + GetSchematicTextOffset();
EDA_TextStruct::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );
EXCHG( linewidth, m_Width ); // set initial value
EXCHG( linewidth, m_Thickness ); // set initial value
CreateGraphicShape( Poly, m_Pos + offset );
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
......@@ -1606,7 +1606,7 @@ EDA_Rect SCH_HIERLABEL::GetBoundingBox()
y = m_Pos.y;
dx = dy = 0;
int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int width = (m_Thickness == 0) ? g_DrawDefaultLineThickness : m_Thickness;
height = m_Size.y + width + 2 * TXTMARGE;
length = LenSize( m_Text )
+ height // add height for triangular shapes
......@@ -1661,7 +1661,7 @@ wxPoint SCH_HIERLABEL::GetSchematicTextOffset()
{
wxPoint text_offset;
int width = MAX( m_Width, g_DrawDefaultLineThickness );
int width = MAX( m_Thickness, g_DrawDefaultLineThickness );
int ii = m_Size.x + TXTMARGE + width;
......
......@@ -16,7 +16,6 @@
#include "gerbview.h"
#include "wxGerberFrame.h"
#include "wxPcbStruct.h"
#include "pcbplot.h"
#include "class_board_design_settings.h"
......
......@@ -575,7 +575,7 @@ public:
wxString m_Text; /* text! */
wxPoint m_Pos; /* XY position of anchor text. */
wxSize m_Size; /* XY size of text */
int m_Width; /* pen size used to draw this text */
int m_Thickness; /* pen size used to draw this text */
int m_Orient; /* Orient in 0.1 degrees */
bool m_Mirror; /* Display Normal / mirror */
int m_Attributs; /* flags (visible...) */
......@@ -682,7 +682,7 @@ public:
*/
int GetInterline()
{
return (( m_Size.y * 14 ) / 10) + m_Width;
return (( m_Size.y * 14 ) / 10) + m_Thickness;
}
/**
......
......@@ -1100,7 +1100,7 @@ public:
* Function OnOrientFootprints
* install the dialog box for the common Orient Footprints
*/
void OnOrientFootprints( void );
void OnOrientFootprints( wxCommandEvent& event );
/**
* Function ReOrientModules
......@@ -1108,8 +1108,9 @@ public:
* @param ModuleMask = mask (wildcard allowed) selection
* @param Orient = new orientation
* @param include_fixe = true to orient locked footprints
* @return true if some footprints modified, false if no change
*/
void ReOrientModules( const wxString& ModuleMask, int Orient,
bool ReOrientModules( const wxString& ModuleMask, int Orient,
bool include_fixe );
void FixeModule( MODULE* Module, bool Fixe );
void AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb );
......
......@@ -27,12 +27,12 @@ set(PCBNEW_DIALOGS
dialogs/dialog_cleaning_options.cpp
dialogs/dialog_copper_zones.cpp
dialogs/dialog_copper_zones_base.cpp
dialog_design_rules.cpp
dialog_design_rules_base.cpp
dialogs/dialog_design_rules.cpp
dialogs/dialog_design_rules_base.cpp
dialogs/dialog_display_options.cpp
dialogs/dialog_display_options_base.cpp
dialog_drc_base.cpp
dialog_drc.cpp
dialogs/dialog_drc_base.cpp
dialogs/dialog_drc.cpp
dialogs/dialog_edit_module_for_BoardEditor.cpp
dialogs/dialog_edit_module_for_BoardEditor_base.cpp
dialogs/dialog_edit_module_for_Modedit_base.cpp
......@@ -45,20 +45,23 @@ set(PCBNEW_DIALOGS
dialog_freeroute_exchange_base.cpp
dialogs/dialog_gendrill.cpp
dialogs/dialog_gendrill_base.cpp
dialog_general_options.cpp
dialog_general_options_BoardEditor_base.cpp
dialog_global_edit_tracks_and_vias.cpp
dialog_global_edit_tracks_and_vias_base.cpp
dialog_global_pads_edition_base.cpp
dialogs/dialog_general_options.cpp
dialogs/dialog_general_options_BoardEditor_base.cpp
dialogs/dialog_global_edit_tracks_and_vias.cpp
dialogs/dialog_global_edit_tracks_and_vias_base.cpp
dialogs/dialog_global_pads_edition_base.cpp
dialogs/dialog_graphic_items_options.cpp
dialogs/dialog_graphic_items_options_base.cpp
dialogs/dialog_graphic_item_properties.cpp
dialogs/dialog_graphic_item_properties_base.cpp
dialog_layers_setup.cpp
dialog_layers_setup_base.cpp
dialog_netlist.cpp
dialog_netlist_fbp.cpp
dialog_pcb_text_properties.cpp
dialogs/dialog_global_deletion.cpp
dialogs/dialog_global_deletion_base.cpp
dialogs/dialog_layers_setup.cpp
dialogs/dialog_layers_setup_base.cpp
dialogs/dialog_netlist.cpp
dialogs/dialog_netlist_fbp.cpp
dialogs/dialog_pcb_text_properties.cpp
dialogs/dialog_pcb_text_properties_base.cpp
dialogs/dialog_non_copper_zones_properties_base.cpp
dialogs/dialog_pad_properties.cpp
dialogs/dialog_pad_properties_base.cpp
......@@ -69,7 +72,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_print_for_modedit_base.cpp
dialogs/dialog_print_using_printer.cpp
dialogs/dialog_print_using_printer_base.cpp
dialog_orient_footprints.cpp
dialogs/dialog_orient_footprints.cpp
dialogs/dialog_orient_footprints_base.cpp
dialogs/dialog_mask_clearance.cpp
dialogs/dialog_mask_clearance_base.cpp
dialogs/dialog_SVG_print.cpp
......
......@@ -2,13 +2,6 @@
/* ar-proto.h */
/**************/
MODULE ** GenListeModules( BOARD * Pcb, int * NbModules );
/****************/
/* GRAPHPCB.CPP */
/****************/
/* Initialize a value type, the cells included in the board surface of the
* pad edge by pt_pad, with the margin reserved for isolation. */
void Place_1_Pad_Board( BOARD * Pcb, D_PAD * pt_pad, int type, int marge,
......@@ -44,8 +37,6 @@ void TraceFilledRectangle( BOARD * Pcb, int ux0, int uy0, int ux1, int uy1,
void TraceArc( int ux0,int uy0, int ux1, int uy1, int ArcAngle, int lg,
int layer, int color, int op_logique);
/* SOLVE.CPP */
/* QUEUE.CPP */
void FreeQueue();
void InitQueue();
......@@ -53,7 +44,6 @@ void GetQueue( int *, int *, int *, int *, int * );
int SetQueue( int, int, int, int, int, int, int );
void ReSetQueue( int, int, int, int, int, int, int );
/* WORK.CPP */
void InitWork();
void ReInitWork();
......
......@@ -8,7 +8,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "autorout.h"
#include "protos.h"
......
......@@ -2,6 +2,8 @@
/* Routines for automatic displacement and rotation of modules. */
/****************************************************************/
#include <algorithm>
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
......@@ -25,7 +27,7 @@ typedef enum {
} SelectFixeFct;
static int tri_modules( MODULE** pt_ref, MODULE** pt_compare );
static bool sortModulesbySize( MODULE* ref, MODULE* compare );
wxString ModulesMaskSelection = wxT( "*" );
......@@ -132,10 +134,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
AutoMoveModulesOnPcb( TRUE );
break;
case ID_POPUP_PCB_REORIENT_ALL_MODULES:
OnOrientFootprints();
break;
case ID_POPUP_PCB_AUTOROUTE_ALL_MODULES:
Autoroute( &dc, ROUTE_ALL );
break;
......@@ -172,13 +170,12 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
*/
void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
{
MODULE** pt_Dmod, ** BaseListeModules;
MODULE* Module;
std::vector <MODULE*> moduleList;
wxPoint start, current;
int Ymax_size, Xsize_allowed;
int pas_grille = (int) GetScreen()->GetGridSize().x;
bool EdgeExists;
float surface;
bool edgesExists;
double surface;
if( GetBoard()->m_Modules == NULL )
{
......@@ -190,28 +187,29 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
if( !IsOK( this, _( "Move modules?" ) ) )
return;
EdgeExists = SetBoardBoundaryBoxFromEdgesOnly();
edgesExists = SetBoardBoundaryBoxFromEdgesOnly();
if( PlaceModulesHorsPcb && !EdgeExists )
if( PlaceModulesHorsPcb && !edgesExists )
{
DisplayError( this,
_( "Could not automatically place modules. No board outlines detected." ) );
return;
}
Module = GetBoard()->m_Modules;
// Build sorted footprints list (sort by decreasing size )
MODULE* Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit();
moduleList.push_back(Module);
}
sort( moduleList.begin(), moduleList.end(), sortModulesbySize );
BaseListeModules = GenListeModules( GetBoard(), NULL );
/* If allocation of modules not PCBs, the cursor is placed below
* PCB, to avoid placing components in PCB area.
/* to move modules outside the board, the cursor is placed below
* the current board, to avoid placing components in board area.
*/
if( PlaceModulesHorsPcb && EdgeExists )
if( PlaceModulesHorsPcb && edgesExists )
{
if( GetScreen()->m_Curseur.y <
(GetBoard()->m_BoundaryBox.GetBottom() + 2000) )
......@@ -219,12 +217,12 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
2000;
}
/* calculating the area occupied by the circuits */
/* calculate the area needed by footprints */
surface = 0.0;
for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ )
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = *pt_Dmod;
if( PlaceModulesHorsPcb && EdgeExists )
Module = moduleList[ii];
if( PlaceModulesHorsPcb && edgesExists )
{
if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) )
continue;
......@@ -237,13 +235,13 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
start = current = GetScreen()->m_Curseur;
Ymax_size = 0;
for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ )
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = *pt_Dmod;
Module = moduleList[ii];
if( Module->IsLocked() )
continue;
if( PlaceModulesHorsPcb && EdgeExists )
if( PlaceModulesHorsPcb && edgesExists )
{
if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) )
continue;
......@@ -269,7 +267,6 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille;
}
MyFree( BaseListeModules );
DrawPanel->Refresh();
}
......@@ -302,58 +299,8 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe )
}
/* Create memory allocation by the ordered list of structures D_MODULES
* Describing the module to move
* The end of the list is indicated by NULL
* Also returns the number of modules per NbModules *
* Deallocates memory after use
*/
MODULE** GenListeModules( BOARD* Pcb, int* NbModules )
static bool sortModulesbySize( MODULE* ref, MODULE* compare )
{
MODULE* Module;
MODULE** ListeMod, ** PtList;
int NbMod;
/* Reserve memory for descriptions of modules that are to be moved. */
Module = Pcb->m_Modules;
NbMod = 0;
for( ; Module != NULL; Module = Module->Next() )
NbMod++;
ListeMod = (MODULE**) MyZMalloc( (NbMod + 1) * sizeof(MODULE*) );
if( ListeMod == NULL )
{
if( NbModules != NULL )
*NbModules = 0;
return NULL;
}
PtList = ListeMod;
Module = Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
*PtList = Module; PtList++;
Module->SetRectangleExinscrit();
}
/* Sort by surface area module largest to smallest */
qsort( ListeMod, NbMod, sizeof(MODULE * *),
( int ( * )( const void*, const void* ) )tri_modules );
if( NbModules != NULL )
*NbModules = NbMod;
return ListeMod;
return compare->m_Surface < ref->m_Surface;
}
static int tri_modules( MODULE** pt_ref, MODULE** pt_compare )
{
float ff;
ff = (*pt_ref)->m_Surface - (*pt_compare)->m_Surface;
if( ff < 0 )
return 1;
if( ff > 0 )
return -1;
return 0;
}
This diff is collapsed.
......@@ -12,7 +12,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "autorout.h"
#include "pcbplot.h"
#include "trigo.h"
......
......@@ -14,7 +14,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "autorout.h"
#include "pcbplot.h"
#include "trigo.h"
......
......@@ -195,7 +195,7 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
EXCHG( ( (TEXTE_PCB*) aItem )->m_Mirror, ( (TEXTE_PCB*) aImage )->m_Mirror );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Size, ( (TEXTE_PCB*) aImage )->m_Size );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Pos, ( (TEXTE_PCB*) aImage )->m_Pos );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Width, ( (TEXTE_PCB*) aImage )->m_Width );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Thickness, ( (TEXTE_PCB*) aImage )->m_Thickness );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Orient, ( (TEXTE_PCB*) aImage )->m_Orient );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Text, ( (TEXTE_PCB*) aImage )->m_Text );
EXCHG( ( (TEXTE_PCB*) aItem )->m_Italic, ( (TEXTE_PCB*) aImage )->m_Italic );
......@@ -218,7 +218,7 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
( (DIMENSION*) aImage )->SetText( txt );
EXCHG( ( (DIMENSION*) aItem )->m_Width, ( (DIMENSION*) aImage )->m_Width );
EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Size, ( (DIMENSION*) aImage )->m_Text->m_Size );
EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Width, ( (DIMENSION*) aImage )->m_Text->m_Width );
EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Thickness, ( (DIMENSION*) aImage )->m_Text->m_Thickness );
EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Mirror, ( (DIMENSION*) aImage )->m_Text->m_Mirror );
}
break;
......
......@@ -144,7 +144,7 @@ bool DIMENSION::ReadDimensionDescr( FILE* File, int* LineNum )
sscanf( Line + 2, " %d %d %d %d %d %d %d",
&m_Text->m_Pos.x, &m_Text->m_Pos.y,
&m_Text->m_Size.x, &m_Text->m_Size.y,
&m_Text->m_Width, &m_Text->m_Orient,
&m_Text->m_Thickness, &m_Text->m_Orient,
&normal_display );
m_Text->m_Mirror = normal_display ? false : true;
......@@ -369,7 +369,7 @@ bool DIMENSION::Save( FILE* aFile ) const
fprintf( aFile, "Po %d %d %d %d %d %d %d\n",
m_Text->m_Pos.x, m_Text->m_Pos.y,
m_Text->m_Size.x, m_Text->m_Size.y,
m_Text->m_Width, m_Text->m_Orient,
m_Text->m_Thickness, m_Text->m_Orient,
m_Text->m_Mirror ? 0 : 1 );
fprintf( aFile, "Sb %d %d %d %d %d %d\n", S_SEGMENT,
......@@ -433,7 +433,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
/* calculate the size of the cdimension
* (text + line above the text) */
ii = m_Text->m_Size.y +
m_Text->m_Width + (m_Width * 3);
m_Text->m_Thickness + (m_Width * 3);
deltax = TraitD_ox - TraitG_ox;
deltay = TraitD_oy - TraitG_oy;
......
......@@ -17,7 +17,6 @@
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "autorout.h"
#include "drag.h"
#include "3d_struct.h"
......
......@@ -7,7 +7,6 @@
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "autorout.h"
// Constructor and destructor
......
......@@ -43,7 +43,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
m_Orient = source->m_Orient;
m_Pos = source->m_Pos;
m_Layer = source->m_Layer;
m_Width = source->m_Width;
m_Thickness = source->m_Thickness;
m_Attributs = source->m_Attributs;
m_Italic = source->m_Italic;
m_Bold = source->m_Bold;
......@@ -103,7 +103,7 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
{
sscanf( Line + 2, " %d %d %d %d %d %d",
&m_Pos.x, &m_Pos.y, &m_Size.x, &m_Size.y,
&m_Width, &m_Orient );
&m_Thickness, &m_Orient );
// Ensure the text has minimal size to see this text on screen:
if( m_Size.x < 5 )
......@@ -135,9 +135,9 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
}
// Set a reasonable width:
if( m_Width < 1 )
m_Width = 1;
m_Width = Clamp_Text_PenSize( m_Width, m_Size );
if( m_Thickness < 1 )
m_Thickness = 1;
m_Thickness = Clamp_Text_PenSize( m_Thickness, m_Size );
return 1;
}
......@@ -168,7 +168,7 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
delete (list);
fprintf( aFile, "Po %d %d %d %d %d %d\n",
m_Pos.x, m_Pos.y, m_Size.x, m_Size.y, m_Width, m_Orient );
m_Pos.x, m_Pos.y, m_Size.x, m_Size.y, m_Thickness, m_Orient );
fprintf( aFile, "De %d %d %lX %s\n", m_Layer,
m_Mirror ? 0 : 1,
m_TimeStamp, style );
......@@ -244,8 +244,8 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
frame->AppendMsgPanel( _( "Orient" ), msg, DARKGREEN );
valeur_param( m_Width, msg );
frame->AppendMsgPanel( _( "Width" ), msg, MAGENTA );
valeur_param( m_Thickness, msg );
frame->AppendMsgPanel( _( "Thickness" ), msg, MAGENTA );
valeur_param( m_Size.x, msg );
frame->AppendMsgPanel( _( "H Size" ), msg, RED );
......
......@@ -30,7 +30,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
m_NoShow = false;
m_Size.x = m_Size.y = 400;
m_Width = 120; /* Set default dimension to a reasonable value. */
m_Thickness = 120; /* Set default dimension to a reasonable value. */
SetLayer( SILKSCREEN_N_FRONT );
if( Module && ( Module->Type() == TYPE_MODULE ) )
......@@ -82,7 +82,7 @@ bool TEXTE_MODULE::Save( FILE* aFile ) const
m_Pos0.x, m_Pos0.y,
m_Size.y, m_Size.x,
orient,
m_Width,
m_Thickness,
m_Mirror ? 'M' : 'N', m_NoShow ? 'I' : 'V',
GetLayer(),
m_Italic ? 'I' : 'N',
......@@ -115,7 +115,7 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum )
&type,
&m_Pos0.x, &m_Pos0.y,
&m_Size.y, &m_Size.x,
&m_Orient, &m_Width,
&m_Orient, &m_Thickness,
BufCar1, BufCar2, &layer, BufCar3 ) >= 10 )
success = true;
......@@ -165,9 +165,9 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum )
m_Size.y = TEXTS_MIN_SIZE;
// Set a reasonable width:
if( m_Width < 1 )
m_Width = 1;
m_Width = Clamp_Text_PenSize( m_Width, m_Size );
if( m_Thickness < 1 )
m_Thickness = 1;
m_Thickness = Clamp_Text_PenSize( m_Thickness, m_Size );
return success;
}
......@@ -187,7 +187,7 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source )
m_Orient = source->m_Orient;
m_Pos0 = source->m_Pos0;
m_Size = source->m_Size;
m_Width = source->m_Width;
m_Thickness = source->m_Thickness;
m_Italic = source->m_Italic;
m_Bold = source->m_Bold;
m_Text = source->m_Text;
......@@ -202,7 +202,7 @@ int TEXTE_MODULE:: GetLength()
void TEXTE_MODULE:: SetWidth( int new_width )
{
m_Width = new_width;
m_Thickness = new_width;
}
......@@ -258,8 +258,8 @@ EDA_Rect TEXTE_MODULE::GetTextRect( void )
dx = ( m_Size.x * GetLength() ) / 2;
dx = (dx * 10) / 9; /* letter size = 10/9 */
dx += m_Width / 2;
dy = ( m_Size.y + m_Width ) / 2;
dx += m_Thickness / 2;
dy = ( m_Size.y + m_Thickness ) / 2;
wxPoint Org = m_Pos; // This is the position of the center of the area
Org.x -= dx;
......@@ -355,7 +355,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
size = m_Size;
orient = GetDrawRotation();
width = m_Width;
width = m_Thickness;
if( ( frame->m_DisplayModText == FILAIRE )
......@@ -509,8 +509,8 @@ void TEXTE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
frame->AppendMsgPanel( _( "Orient" ), msg, DARKGREEN );
valeur_param( m_Width, msg );
frame->AppendMsgPanel( _( "Width" ), msg, DARKGREEN );
valeur_param( m_Thickness, msg );
frame->AppendMsgPanel( _( "Thickness" ), msg, DARKGREEN );
valeur_param( m_Size.x, msg );
frame->AppendMsgPanel( _( "H Size" ), msg, RED );
......
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_initpcb.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 15/02/2006 21:42:41
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 15/02/2006 21:42:41
////@begin includes
////@end includes
#include "dialog_initpcb.h"
////@begin XPM images
////@end XPM images
/*!
* WinEDA_PcbGlobalDeleteFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbGlobalDeleteFrame, wxDialog )
/*!
* WinEDA_PcbGlobalDeleteFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_PcbGlobalDeleteFrame, wxDialog )
////@begin WinEDA_PcbGlobalDeleteFrame event table entries
EVT_BUTTON( wxID_OK, WinEDA_PcbGlobalDeleteFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_PcbGlobalDeleteFrame::OnCancelClick )
////@end WinEDA_PcbGlobalDeleteFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_PcbGlobalDeleteFrame constructors
*/
WinEDA_PcbGlobalDeleteFrame::WinEDA_PcbGlobalDeleteFrame( )
{
}
WinEDA_PcbGlobalDeleteFrame::WinEDA_PcbGlobalDeleteFrame( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
m_Parent = parent;
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_PcbGlobalDeleteFrame creator
*/
bool WinEDA_PcbGlobalDeleteFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_PcbGlobalDeleteFrame member initialisation
m_DelZones = NULL;
m_DelTexts = NULL;
m_DelEdges = NULL;
m_DelDrawings = NULL;
m_DelModules = NULL;
m_DelTracks = NULL;
m_DelMarkers = NULL;
m_DelAlls = NULL;
m_TrackFilterAR = NULL;
m_TrackFilterLocked = NULL;
////@end WinEDA_PcbGlobalDeleteFrame member initialisation
////@begin WinEDA_PcbGlobalDeleteFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end WinEDA_PcbGlobalDeleteFrame creation
return true;
}
/*!
* Control creation for WinEDA_PcbGlobalDeleteFrame
*/
void WinEDA_PcbGlobalDeleteFrame::CreateControls()
{
////@begin WinEDA_PcbGlobalDeleteFrame content construction
// Generated by DialogBlocks, 15/02/2006 22:10:20 (unregistered)
WinEDA_PcbGlobalDeleteFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Items to delete"));
wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_DelZones = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Delete Zones"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelZones->SetValue(false);
itemStaticBoxSizer3->Add(m_DelZones, 0, wxALIGN_LEFT|wxALL, 5);
m_DelTexts = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete Texts"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelTexts->SetValue(false);
itemStaticBoxSizer3->Add(m_DelTexts, 0, wxALIGN_LEFT|wxALL, 5);
m_DelEdges = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Delete Edges"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelEdges->SetValue(false);
itemStaticBoxSizer3->Add(m_DelEdges, 0, wxALIGN_LEFT|wxALL, 5);
m_DelDrawings = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Delete Drawings"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelDrawings->SetValue(false);
itemStaticBoxSizer3->Add(m_DelDrawings, 0, wxALIGN_LEFT|wxALL, 5);
m_DelModules = new wxCheckBox( itemDialog1, ID_CHECKBOX4, _("Delete Modules"), wxDefaultPosition, wxDefaultSize, 0 );
m_DelModules->SetValue(false);
itemStaticBoxSizer3->Add(m_DelModules, 0, wxALIGN_LEFT|wxALL, 5);
m_DelTracks = new wxCheckBox( itemDialog1, ID_CHECKBOX5, _("Delete Tracks"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelTracks->SetValue(false);
itemStaticBoxSizer3->Add(m_DelTracks, 0, wxALIGN_LEFT|wxALL, 5);
m_DelMarkers = new wxCheckBox( itemDialog1, ID_CHECKBOX6, _("Delete Markers"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelMarkers->SetValue(false);
itemStaticBoxSizer3->Add(m_DelMarkers, 0, wxALIGN_LEFT|wxALL, 5);
m_DelAlls = new wxCheckBox( itemDialog1, ID_CHECKBOX7, _("Clear Board"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_DelAlls->SetValue(false);
itemStaticBoxSizer3->Add(m_DelAlls, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer13Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Track Filter"));
wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(itemStaticBoxSizer13Static, wxVERTICAL);
itemBoxSizer12->Add(itemStaticBoxSizer13, 0, wxGROW|wxALL, 5);
m_TrackFilterAR = new wxCheckBox( itemDialog1, ID_CHECKBOX8, _("Include AutoRouted Tracks"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_TrackFilterAR->SetValue(false);
itemStaticBoxSizer13->Add(m_TrackFilterAR, 0, wxALIGN_LEFT|wxALL, 5);
m_TrackFilterLocked = new wxCheckBox( itemDialog1, ID_CHECKBOX9, _("Include Locked Tracks"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_TrackFilterLocked->SetValue(false);
itemStaticBoxSizer13->Add(m_TrackFilterLocked, 0, wxALIGN_LEFT|wxALL, 5);
itemBoxSizer12->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer12->Add(itemBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton18 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer17->Add(itemButton18, 0, wxGROW|wxALL, 5);
wxButton* itemButton19 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer17->Add(itemButton19, 0, wxGROW|wxALL, 5);
////@end WinEDA_PcbGlobalDeleteFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_PcbGlobalDeleteFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_PcbGlobalDeleteFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_PcbGlobalDeleteFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_PcbGlobalDeleteFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_PcbGlobalDeleteFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_PcbGlobalDeleteFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_PcbGlobalDeleteFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void WinEDA_PcbGlobalDeleteFrame::OnOkClick( wxCommandEvent& event )
{
AcceptPcbDelete(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_PcbGlobalDeleteFrame::OnCancelClick( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbGlobalDeleteFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbGlobalDeleteFrame.
}
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_initpcb.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 15/02/2006 21:42:41
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 15/02/2006 21:42:41
#ifndef _DIALOG_INITPCB_H_
#define _DIALOG_INITPCB_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_TITLE _("Global Delete")
#define SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_POSITION wxDefaultPosition
#define ID_CHECKBOX 10001
#define ID_CHECKBOX1 10002
#define ID_CHECKBOX2 10003
#define ID_CHECKBOX3 10004
#define ID_CHECKBOX4 10005
#define ID_CHECKBOX5 10006
#define ID_CHECKBOX6 10007
#define ID_CHECKBOX7 10008
#define ID_CHECKBOX8 10009
#define ID_CHECKBOX9 10010
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PcbGlobalDeleteFrame class declaration
*/
class WinEDA_PcbGlobalDeleteFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PcbGlobalDeleteFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PcbGlobalDeleteFrame( );
WinEDA_PcbGlobalDeleteFrame( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_SIZE, long style = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_SIZE, long style = SYMBOL_WINEDA_PCBGLOBALDELETEFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PcbGlobalDeleteFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_PcbGlobalDeleteFrame event handler declarations
////@begin WinEDA_PcbGlobalDeleteFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PcbGlobalDeleteFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void AcceptPcbDelete(wxCommandEvent& event);
////@begin WinEDA_PcbGlobalDeleteFrame member variables
wxCheckBox* m_DelZones;
wxCheckBox* m_DelTexts;
wxCheckBox* m_DelEdges;
wxCheckBox* m_DelDrawings;
wxCheckBox* m_DelModules;
wxCheckBox* m_DelTracks;
wxCheckBox* m_DelMarkers;
wxCheckBox* m_DelAlls;
wxCheckBox* m_TrackFilterAR;
wxCheckBox* m_TrackFilterLocked;
////@end WinEDA_PcbGlobalDeleteFrame member variables
WinEDA_PcbFrame * m_Parent;
};
#endif
// _DIALOG_INITPCB_H_
This diff is collapsed.
#include "wx/msw/wx.rc"
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_orient_footprints.cpp
// Purpose:
// Author: j-p Charras
// Modified by:
// Created: 11/07/2008 13:32:12
// RCS-ID:
// Copyright: j-p Charras
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 11/07/2008 13:32:12
////@begin includes
////@end includes
#include "fctsys.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "dialog_orient_footprints.h"
////@begin XPM images
////@end XPM images
int s_NewOrientation = 0;
/*!
* dialog_orient_footprints type definition
*/
IMPLEMENT_DYNAMIC_CLASS( dialog_orient_footprints, wxDialog )
/*!
* dialog_orient_footprints event table definition
*/
BEGIN_EVENT_TABLE( dialog_orient_footprints, wxDialog )
////@begin dialog_orient_footprints event table entries
EVT_CLOSE( dialog_orient_footprints::OnCloseWindow )
EVT_BUTTON( wxID_OK, dialog_orient_footprints::OnOkClick )
EVT_BUTTON( wxID_CANCEL, dialog_orient_footprints::OnCancelClick )
////@end dialog_orient_footprints event table entries
END_EVENT_TABLE()
/*!
* dialog_orient_footprints constructors
*/
dialog_orient_footprints::dialog_orient_footprints()
{
Init();
}
dialog_orient_footprints::dialog_orient_footprints( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
m_Parent = parent;
Init();
Create(parent, id, caption, pos, size, style);
}
/*!
* dialog_orient_footprints creator
*/
bool dialog_orient_footprints::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin dialog_orient_footprints creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end dialog_orient_footprints creation
return true;
}
/*!
* dialog_orient_footprints destructor
*/
dialog_orient_footprints::~dialog_orient_footprints()
{
////@begin dialog_orient_footprints destruction
////@end dialog_orient_footprints destruction
}
/*!
* Member initialisation
*/
void dialog_orient_footprints::Init()
{
////@begin dialog_orient_footprints member initialisation
m_OrientationCtrl = NULL;
m_FilterPattern = NULL;
m_ApplyToLocked = NULL;
m_CloseButton = NULL;
////@end dialog_orient_footprints member initialisation
}
/*!
* Control creation for dialog_orient_footprints
*/
void dialog_orient_footprints::CreateControls()
{
////@begin dialog_orient_footprints content construction
// Generated by DialogBlocks, 11/07/2008 16:49:18 (unregistered)
dialog_orient_footprints* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add(itemStaticText4, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
m_OrientationCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRLROT_VALUE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
if (dialog_orient_footprints::ShowToolTips())
m_OrientationCtrl->SetToolTip(_("New orientation (0.1 degree resolution)"));
itemBoxSizer3->Add(m_OrientationCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add(itemStaticText6, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
m_FilterPattern = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_FOOTPRINTS_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, 0 );
if (dialog_orient_footprints::ShowToolTips())
m_FilterPattern->SetToolTip(_("Filter to select footprints by reference"));
itemBoxSizer3->Add(m_FilterPattern, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5);
m_ApplyToLocked = new wxCheckBox( itemDialog1, ID_CHECKBOX_APPLY_TO_LOCKED, _("Include Locked Footprints"), wxDefaultPosition, wxDefaultSize, 0 );
m_ApplyToLocked->SetValue(false);
if (dialog_orient_footprints::ShowToolTips())
m_ApplyToLocked->SetToolTip(_("Force locked footprints to be modified"));
itemBoxSizer3->Add(m_ApplyToLocked, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_CloseButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_CloseButton->SetDefault();
itemBoxSizer10->Add(m_CloseButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
////@end dialog_orient_footprints content construction
wxString txt;
txt.Printf(wxT("%g"), (double) s_NewOrientation/10);
m_OrientationCtrl->SetValue(txt);
m_CloseButton->SetFocus( );
}
/*!
* Should we show tooltips?
*/
bool dialog_orient_footprints::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap dialog_orient_footprints::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin dialog_orient_footprints bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end dialog_orient_footprints bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon dialog_orient_footprints::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin dialog_orient_footprints icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end dialog_orient_footprints icon retrieval
}
/***********************************************/
void WinEDA_PcbFrame::OnOrientFootprints( void )
/***********************************************/
/**
* Function OnOrientFootprints
* install the dialog box for the comman Orient Footprints
*/
{
dialog_orient_footprints dialogbox(this);
dialogbox.ShowModal();
dialogbox.Destroy();
}
/*******************************************************************/
void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
int Orient, bool include_fixe )
/*******************************************************************/
/**
* Function ReOrientModules
* Set the orientation of footprints
* @param ModuleMask = mask (wildcard allowed) selection
* @param Orient = new orientation
* @param include_fixe = true to orient locked footprints
*/
{
wxString line;
bool redraw = false;
line.Printf( _( "Ok to set footprints orientation to %g degrees ?" ), (double)Orient / 10 );
if( !IsOK( this, line ) )
return;
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{
if( module->IsLocked() && !include_fixe )
continue;
if( WildCompareString( ModuleMask, module->m_Reference->m_Text, FALSE ) )
{
OnModify();
redraw = true;
Rotate_Module( NULL, module, Orient, FALSE );
}
}
if ( redraw )
DrawPanel->Refresh();
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void dialog_orient_footprints::OnOkClick( wxCommandEvent& event )
{
double d_orient;
wxString text = m_OrientationCtrl->GetValue();
if ( ! text.ToDouble(&d_orient) )
{
DisplayError(this, _("Bad value for footprints orientation"));
return;
}
s_NewOrientation = wxRound(d_orient * 10);
if ( s_NewOrientation > 3600 )
s_NewOrientation = 3600;
if ( s_NewOrientation < -3600 )
s_NewOrientation = -3600;
text = m_FilterPattern->GetValue();
m_Parent->ReOrientModules( text, s_NewOrientation, m_ApplyToLocked->IsChecked() );
Close();
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void dialog_orient_footprints::OnCancelClick( wxCommandEvent& event )
{
Close();
}
/*!
* wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_ORIENT_FOOTPRINTS
*/
void dialog_orient_footprints::OnCloseWindow( wxCloseEvent& event )
{
EndModal(1);
}
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_orient_footprints.h
// Purpose:
// Author:
// Modified by:
// Created: 11/07/2008 13:32:12
// RCS-ID:
// Copyright:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 11/07/2008 13:32:12
#ifndef _DIALOG_ORIENT_FOOTPRINTS_H_
#define _DIALOG_ORIENT_FOOTPRINTS_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG_ORIENT_FOOTPRINTS 10000
#define ID_TEXTCTRLROT_VALUE 10003
#define ID_TEXTCTRL_FOOTPRINTS_FILTER 10001
#define ID_CHECKBOX_APPLY_TO_LOCKED 10002
#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE wxDEFAULT_DIALOG_STYLE
#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE _("Footprints Orientation")
#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME ID_DIALOG_ORIENT_FOOTPRINTS
#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE wxSize(400, 300)
#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION wxDefaultPosition
////@end control identifiers
/*!
* dialog_orient_footprints class declaration
*/
class dialog_orient_footprints: public wxDialog
{
DECLARE_DYNAMIC_CLASS( dialog_orient_footprints )
DECLARE_EVENT_TABLE()
public:
/// Constructors
dialog_orient_footprints();
dialog_orient_footprints( WinEDA_PcbFrame* parent,
wxWindowID id = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME,
const wxString& caption = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE,
const wxPoint& pos = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION,
const wxSize& size = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE,
long style = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME, const wxString& caption = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE, const wxPoint& pos = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION, const wxSize& size = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE, long style = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE );
/// Destructor
~dialog_orient_footprints();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin dialog_orient_footprints event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_ORIENT_FOOTPRINTS
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end dialog_orient_footprints event handler declarations
////@begin dialog_orient_footprints member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end dialog_orient_footprints member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin dialog_orient_footprints member variables
wxTextCtrl* m_OrientationCtrl;
wxTextCtrl* m_FilterPattern;
wxCheckBox* m_ApplyToLocked;
wxButton* m_CloseButton;
////@end dialog_orient_footprints member variables
WinEDA_PcbFrame * m_Parent;
};
#endif
// _DIALOG_ORIENT_FOOTPRINTS_H_
This diff is collapsed.
This diff is collapsed.
......@@ -14,7 +14,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "trigo.h"
#include "autorout.h"
#include "zones.h"
#include "dialog_copper_zones.h"
......
......@@ -123,7 +123,7 @@ void DialogEditModuleText::Init( )
m_Parent->m_InternalUnits );
AddUnitSymbol( *m_WidthTitle );
PutValueInLocalUnits( *m_TxtWidthCtlr, m_CurrentTextMod->m_Width,
PutValueInLocalUnits( *m_TxtWidthCtlr, m_CurrentTextMod->m_Thickness,
m_Parent->m_InternalUnits );
int text_orient = m_CurrentTextMod->m_Orient;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -171,7 +171,7 @@ void DIMENSION_EDITOR_DIALOG::OnOkClick( wxCommandEvent& event )
_( "The text thickness is too large for the text size. It will be clamped") );
width = maxthickness;
}
CurrentDimension->m_Text->m_Width = CurrentDimension->m_Width = width ;
CurrentDimension->m_Text->m_Thickness = CurrentDimension->m_Width = width ;
CurrentDimension->m_Text->m_Mirror = ( m_Mirror->GetSelection() == 1 ) ? true : false;
......@@ -260,7 +260,7 @@ DIMENSION* WinEDA_PcbFrame::Begin_Dimension( DIMENSION* Dimension, wxDC* DC )
{
width = maxthickness;
}
Dimension->m_Text->m_Width = Dimension->m_Width = width ;
Dimension->m_Text->m_Thickness = Dimension->m_Width = width ;
Dimension->AdjustDimensionDetails( );
......
......@@ -14,7 +14,6 @@
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "class_board_design_settings.h"
#include "autorout.h"
#include "protos.h"
#include "dialog_drc.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment