Pcbnew: code cleaning, dialogs converted from Dialogblocks to wxFormBuilder, file housekeeping. Add patch from Manveru.

This commit is contained in:
jean-pierre charras 2010-11-27 14:09:18 +01:00
commit 8e0937e6a2
104 changed files with 16917 additions and 16528 deletions

View File

@ -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 );
}

View File

@ -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;

View File

@ -5,7 +5,6 @@
#include "colors_selection.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "hotkeys.h"
#include "help_common_strings.h"

View File

@ -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();

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<FileVersion major="1" minor="10" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="class_decoration" />
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
@ -12,66 +12,66 @@
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_edit_label_base</property>
<property name="namespace"></property>
<property name="namespace" />
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="precompiled_header" />
<property name="relative_path">1</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="center" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="extra_style" />
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">DialogLabelEditor_Base</property>
<property name="pos"></property>
<property name="pos" />
<property name="size">359,347</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="subclass" />
<property name="title">Text Editor</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></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>
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnActivate" />
<event name="OnActivateApp" />
<event name="OnChar" />
<event name="OnClose" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnHibernate" />
<event name="OnIconize" />
<event name="OnIdle" />
<event name="OnInitDialog" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
@ -85,7 +85,7 @@
<property name="growablecols">1</property>
<property name="growablerows">0</property>
<property name="hgap">3</property>
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">m_textControlSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">protected</property>
@ -96,50 +96,50 @@
<property name="flag">wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Text:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_staticText1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip">Enter the text to be used within the schematic</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<property name="wrap">-1</property>
<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>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -147,7 +147,7 @@
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">bSizeText</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
@ -156,54 +156,54 @@
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_VALUESINGLE</property>
<property name="maximum_size"></property>
<property name="maximum_size" />
<property name="maxlength">0</property>
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">m_textLabelSingleLine</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="pos" />
<property name="size" />
<property name="style">wxTE_PROCESS_ENTER</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnText"></event>
<property name="subclass" />
<property name="tooltip" />
<property name="value" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnText" />
<event name="OnTextEnter">OnEnterKey</event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
<event name="OnTextMaxLen" />
<event name="OnTextURL" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -211,54 +211,54 @@
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_VALUEMULTI</property>
<property name="maximum_size"></property>
<property name="maximum_size" />
<property name="maxlength">0</property>
<property name="minimum_size">-1,60</property>
<property name="name">m_textLabelMultiLine</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="pos" />
<property name="size" />
<property name="style">wxTE_MULTILINE|wxTE_PROCESS_ENTER</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnText"></event>
<property name="subclass" />
<property name="tooltip" />
<property name="value" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnText" />
<event name="OnTextEnter">OnEnterKey</event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
<event name="OnTextMaxLen" />
<event name="OnTextURL" />
<event name="OnUpdateUI" />
</object>
</object>
</object>
@ -268,50 +268,50 @@
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Size:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_SizeTitle</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<property name="wrap">-1</property>
<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>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -319,7 +319,7 @@
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">bSizeCtrlSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
@ -328,54 +328,54 @@
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_SIZE</property>
<property name="maximum_size"></property>
<property name="maximum_size" />
<property name="maxlength">0</property>
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">m_TextSize</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="value" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnText" />
<event name="OnTextEnter" />
<event name="OnTextMaxLen" />
<event name="OnTextURL" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -383,50 +383,50 @@
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="bg" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">units</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_staticSizeUnits</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<property name="wrap">-1</property>
<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>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
</object>
@ -438,7 +438,7 @@
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">m_OptionsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
@ -447,53 +447,53 @@
<property name="flag">wxRIGHT|wxTOP</property>
<property name="proportion">1</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="bg" />
<property name="choices">&quot;Right&quot; &quot;Up&quot; &quot;Left&quot; &quot;Down&quot;</property>
<property name="context_help"></property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">O&amp;rientation</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_TextOrient</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="pos" />
<property name="selection">0</property>
<property name="size"></property>
<property name="size" />
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnRadioBox"></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>
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRadioBox" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -501,53 +501,53 @@
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">1</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="bg" />
<property name="choices">&quot;Normal&quot; &quot;Italic&quot; &quot;Bold&quot; &quot;Bold Italic&quot;</property>
<property name="context_help"></property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">St&amp;yle</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_TextStyle</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="pos" />
<property name="selection">0</property>
<property name="size"></property>
<property name="size" />
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnRadioBox"></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>
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRadioBox" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
@ -555,53 +555,53 @@
<property name="flag">wxALL|wxLEFT|wxTOP</property>
<property name="proportion">1</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="bg" />
<property name="choices">&quot;Input&quot; &quot;Output&quot; &quot;Bidirectional&quot; &quot;Tri-State&quot; &quot;Passive&quot;</property>
<property name="context_help"></property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">S&amp;hape</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_TextShape</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="pos" />
<property name="selection">0</property>
<property name="size"></property>
<property name="size" />
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnRadioBox"></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>
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRadioBox" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
</object>
@ -619,17 +619,17 @@
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="minimum_size" />
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnApplyButtonClick" />
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnContextHelpButtonClick" />
<event name="OnHelpButtonClick" />
<event name="OnNoButtonClick" />
<event name="OnOKButtonClick">OnOkClick</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
<event name="OnSaveButtonClick" />
<event name="OnYesButtonClick" />
</object>
</object>
</object>

View File

@ -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;

View File

@ -1,385 +1,385 @@
/**********************/
/** class LIB_BEZIER **/
/**********************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "bezier_curves.h"
#include "general.h"
#include "protos.h"
#include "lib_bezier.h"
#include "transform.h"
LIB_BEZIER::LIB_BEZIER( LIB_COMPONENT* aParent ) :
LIB_DRAW_ITEM( COMPONENT_BEZIER_DRAW_TYPE, aParent )
{
m_Fill = NO_FILL;
m_Width = 0;
m_isFillable = true;
m_typeName = _( "Bezier" );
}
LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& aBezier ) : LIB_DRAW_ITEM( aBezier )
{
m_PolyPoints = aBezier.m_PolyPoints;
m_BezierPoints = aBezier.m_BezierPoints; // Vector copy
m_Width = aBezier.m_Width;
m_Fill = aBezier.m_Fill;
}
bool LIB_BEZIER::Save( FILE* aFile )
{
int ccount = GetCornerCount();
if( fprintf( aFile, "B %d %d %d %d", ccount, m_Unit, m_Convert, m_Width ) < 0 )
return false;
for( unsigned i = 0; i < GetCornerCount(); i++ )
{
if( fprintf( aFile, " %d %d", m_BezierPoints[i].x, m_BezierPoints[i].y ) < 0 )
return false;
}
if( fprintf( aFile, " %c\n", fill_tab[m_Fill] ) < 0 )
return false;
return true;
}
bool LIB_BEZIER::Load( char* aLine, wxString& aErrorMsg )
{
char* p;
int i, ccount = 0;
wxPoint pt;
i = sscanf( &aLine[2], "%d %d %d %d", &ccount, &m_Unit, &m_Convert, &m_Width );
if( i !=4 )
{
aErrorMsg.Printf( _( "Bezier only had %d parameters of the required 4" ), i );
return false;
}
if( ccount <= 0 )
{
aErrorMsg.Printf( _( "Bezier count parameter %d is invalid" ), ccount );
return false;
}
p = strtok( &aLine[2], " \t\n" );
p = strtok( NULL, " \t\n" );
p = strtok( NULL, " \t\n" );
p = strtok( NULL, " \t\n" );
for( i = 0; i < ccount; i++ )
{
wxPoint point;
p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.x ) != 1 )
{
aErrorMsg.Printf( _( "Bezier point %d X position not defined" ), i );
return false;
}
p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.y ) != 1 )
{
aErrorMsg.Printf( _( "Bezier point %d Y position not defined" ), i );
return false;
}
m_BezierPoints.push_back( pt );
}
m_Fill = NO_FILL;
if( ( p = strtok( NULL, " \t\n" ) ) != NULL )
{
if( p[0] == 'F' )
m_Fill = FILLED_SHAPE;
if( p[0] == 'f' )
m_Fill = FILLED_WITH_BG_BODYCOLOR;
}
return true;
}
LIB_DRAW_ITEM* LIB_BEZIER::DoGenCopy()
{
LIB_BEZIER* newitem = new LIB_BEZIER(GetParent());
newitem->m_BezierPoints = m_BezierPoints; // Vector copy
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return (LIB_DRAW_ITEM*) newitem;
}
int LIB_BEZIER::DoCompare( const LIB_DRAW_ITEM& aOther ) const
{
wxASSERT( aOther.Type() == COMPONENT_BEZIER_DRAW_TYPE );
const LIB_BEZIER* tmp = ( LIB_BEZIER* ) &aOther;
if( m_BezierPoints.size() != tmp->m_BezierPoints.size() )
return m_BezierPoints.size() - tmp->m_BezierPoints.size();
for( size_t i = 0; i < m_BezierPoints.size(); i++ )
{
if( m_BezierPoints[i].x != tmp->m_BezierPoints[i].x )
return m_BezierPoints[i].x - tmp->m_BezierPoints[i].x;
if( m_BezierPoints[i].y != tmp->m_BezierPoints[i].y )
return m_BezierPoints[i].y - tmp->m_BezierPoints[i].y;
}
return 0;
}
void LIB_BEZIER::DoOffset( const wxPoint& aOffset )
{
size_t i;
for( i = 0; i < m_BezierPoints.size(); i++ )
m_BezierPoints[i] += aOffset;
for( i = 0; i < m_PolyPoints.size(); i++ )
m_PolyPoints[i] += aOffset;
}
bool LIB_BEZIER::DoTestInside( EDA_Rect& aRect ) const
{
for( size_t i = 0; i < m_PolyPoints.size(); i++ )
{
if( aRect.Inside( m_PolyPoints[i].x, -m_PolyPoints[i].y ) )
return true;
}
return false;
}
void LIB_BEZIER::DoMove( const wxPoint& aPosition )
{
DoOffset( aPosition - m_PolyPoints[0] );
}
void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter )
{
size_t i, imax = m_PolyPoints.size();
for( i = 0; i < imax; i++ )
{
m_PolyPoints[i].x -= aCenter.x;
m_PolyPoints[i].x *= -1;
m_PolyPoints[i].x += aCenter.x;
}
imax = m_BezierPoints.size();
for( i = 0; i < imax; i++ )
{
m_BezierPoints[i].x -= aCenter.x;
m_BezierPoints[i].x *= -1;
m_BezierPoints[i].x += aCenter.x;
}
}
void LIB_BEZIER::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
const TRANSFORM& aTransform )
{
wxASSERT( aPlotter != NULL );
size_t i;
int* Poly = (int*) MyMalloc( sizeof(int) * 2 * GetCornerCount() );
if( Poly == NULL )
return;
for( i = 0; i < m_PolyPoints.size(); i++ )
{
wxPoint pos = m_PolyPoints[i];
pos = aTransform.TransformCoordinate( pos ) + aOffset;
Poly[i * 2] = pos.x;
Poly[i * 2 + 1] = pos.y;
}
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->poly( i, Poly, FILLED_WITH_BG_BODYCOLOR, 0 );
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->poly( i, Poly, already_filled ? NO_FILL : m_Fill, GetPenSize() );
MyFree( Poly );
}
/**
* Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
int LIB_BEZIER::GetPenSize()
{
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
}
void LIB_BEZIER::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1;
std::vector<wxPoint> PolyPointsTraslated;
int color = ReturnLayerColor( LAYER_DEVICE );
m_PolyPoints = Bezier2Poly( m_BezierPoints[0],
m_BezierPoints[1],
m_BezierPoints[2],
m_BezierPoints[3] );
PolyPointsTraslated.clear();
for( unsigned int i = 0; i < m_PolyPoints.size() ; i++ )
PolyPointsTraslated.push_back( aTransform.TransformCoordinate( m_PolyPoints[i] ) +
aOffset );
if( aColor < 0 ) // Used normal color or selected color
{
if( m_Selected & IS_SELECTED )
color = g_ItemSelectetColor;
}
else
color = aColor;
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(), color, color );
else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 0, GetPenSize(), color, color );
/* Set to one (1) to draw bounding box around bezier curve to validate
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 1, m_Width + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return true if a hit, else false
*/
bool LIB_BEZIER::HitTest( const wxPoint& aRefPos )
{
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPos, mindist, DefaultTransform );
}
/**
* Function HitTest
* @return if the point aPosRef is near a segment
* @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix
*/
bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{
wxPoint ref, start, end;
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
start = aTransform.TransformCoordinate( m_PolyPoints[ii - 1] );
end = aTransform.TransformCoordinate( m_PolyPoints[ii] );
if ( TestSegmentHit( aPosRef, start, end, aThreshold ) )
return true;
}
return false;
}
/**
* Function GetBoundingBox
* @return the boundary box for this, in library coordinates
*/
EDA_Rect LIB_BEZIER::GetBoundingBox()
{
EDA_Rect rect;
int xmin, xmax, ymin, ymax;
if( !GetCornerCount() )
return rect;
xmin = xmax = m_PolyPoints[0].x;
ymin = ymax = m_PolyPoints[0].y;
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
xmin = MIN( xmin, m_PolyPoints[ii].x );
xmax = MAX( xmax, m_PolyPoints[ii].x );
ymin = MIN( ymin, m_PolyPoints[ii].y );
ymax = MAX( ymax, m_PolyPoints[ii].y );
}
rect.SetOrigin( xmin, ymin * -1 );
rect.SetEnd( xmax, ymax * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
void LIB_BEZIER::DisplayInfo( WinEDA_DrawFrame* aFrame )
{
wxString msg;
EDA_Rect bBox = GetBoundingBox();
LIB_DRAW_ITEM::DisplayInfo( aFrame );
msg = ReturnStringFromValue( g_UserUnit, m_Width, EESCHEMA_INTERNAL_UNIT, true );
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
aFrame->AppendMsgPanel( _( "Bounding box" ), msg, BROWN );
}
/**********************/
/** class LIB_BEZIER **/
/**********************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "bezier_curves.h"
#include "general.h"
#include "protos.h"
#include "lib_bezier.h"
#include "transform.h"
LIB_BEZIER::LIB_BEZIER( LIB_COMPONENT* aParent ) :
LIB_DRAW_ITEM( COMPONENT_BEZIER_DRAW_TYPE, aParent )
{
m_Fill = NO_FILL;
m_Width = 0;
m_isFillable = true;
m_typeName = _( "Bezier" );
}
LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& aBezier ) : LIB_DRAW_ITEM( aBezier )
{
m_PolyPoints = aBezier.m_PolyPoints;
m_BezierPoints = aBezier.m_BezierPoints; // Vector copy
m_Width = aBezier.m_Width;
m_Fill = aBezier.m_Fill;
}
bool LIB_BEZIER::Save( FILE* aFile )
{
int ccount = GetCornerCount();
if( fprintf( aFile, "B %d %d %d %d", ccount, m_Unit, m_Convert, m_Width ) < 0 )
return false;
for( unsigned i = 0; i < GetCornerCount(); i++ )
{
if( fprintf( aFile, " %d %d", m_BezierPoints[i].x, m_BezierPoints[i].y ) < 0 )
return false;
}
if( fprintf( aFile, " %c\n", fill_tab[m_Fill] ) < 0 )
return false;
return true;
}
bool LIB_BEZIER::Load( char* aLine, wxString& aErrorMsg )
{
char* p;
int i, ccount = 0;
wxPoint pt;
i = sscanf( &aLine[2], "%d %d %d %d", &ccount, &m_Unit, &m_Convert, &m_Width );
if( i !=4 )
{
aErrorMsg.Printf( _( "Bezier only had %d parameters of the required 4" ), i );
return false;
}
if( ccount <= 0 )
{
aErrorMsg.Printf( _( "Bezier count parameter %d is invalid" ), ccount );
return false;
}
p = strtok( &aLine[2], " \t\n" );
p = strtok( NULL, " \t\n" );
p = strtok( NULL, " \t\n" );
p = strtok( NULL, " \t\n" );
for( i = 0; i < ccount; i++ )
{
wxPoint point;
p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.x ) != 1 )
{
aErrorMsg.Printf( _( "Bezier point %d X position not defined" ), i );
return false;
}
p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.y ) != 1 )
{
aErrorMsg.Printf( _( "Bezier point %d Y position not defined" ), i );
return false;
}
m_BezierPoints.push_back( pt );
}
m_Fill = NO_FILL;
if( ( p = strtok( NULL, " \t\n" ) ) != NULL )
{
if( p[0] == 'F' )
m_Fill = FILLED_SHAPE;
if( p[0] == 'f' )
m_Fill = FILLED_WITH_BG_BODYCOLOR;
}
return true;
}
LIB_DRAW_ITEM* LIB_BEZIER::DoGenCopy()
{
LIB_BEZIER* newitem = new LIB_BEZIER(GetParent());
newitem->m_BezierPoints = m_BezierPoints; // Vector copy
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return (LIB_DRAW_ITEM*) newitem;
}
int LIB_BEZIER::DoCompare( const LIB_DRAW_ITEM& aOther ) const
{
wxASSERT( aOther.Type() == COMPONENT_BEZIER_DRAW_TYPE );
const LIB_BEZIER* tmp = ( LIB_BEZIER* ) &aOther;
if( m_BezierPoints.size() != tmp->m_BezierPoints.size() )
return m_BezierPoints.size() - tmp->m_BezierPoints.size();
for( size_t i = 0; i < m_BezierPoints.size(); i++ )
{
if( m_BezierPoints[i].x != tmp->m_BezierPoints[i].x )
return m_BezierPoints[i].x - tmp->m_BezierPoints[i].x;
if( m_BezierPoints[i].y != tmp->m_BezierPoints[i].y )
return m_BezierPoints[i].y - tmp->m_BezierPoints[i].y;
}
return 0;
}
void LIB_BEZIER::DoOffset( const wxPoint& aOffset )
{
size_t i;
for( i = 0; i < m_BezierPoints.size(); i++ )
m_BezierPoints[i] += aOffset;
for( i = 0; i < m_PolyPoints.size(); i++ )
m_PolyPoints[i] += aOffset;
}
bool LIB_BEZIER::DoTestInside( EDA_Rect& aRect ) const
{
for( size_t i = 0; i < m_PolyPoints.size(); i++ )
{
if( aRect.Inside( m_PolyPoints[i].x, -m_PolyPoints[i].y ) )
return true;
}
return false;
}
void LIB_BEZIER::DoMove( const wxPoint& aPosition )
{
DoOffset( aPosition - m_PolyPoints[0] );
}
void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter )
{
size_t i, imax = m_PolyPoints.size();
for( i = 0; i < imax; i++ )
{
m_PolyPoints[i].x -= aCenter.x;
m_PolyPoints[i].x *= -1;
m_PolyPoints[i].x += aCenter.x;
}
imax = m_BezierPoints.size();
for( i = 0; i < imax; i++ )
{
m_BezierPoints[i].x -= aCenter.x;
m_BezierPoints[i].x *= -1;
m_BezierPoints[i].x += aCenter.x;
}
}
void LIB_BEZIER::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
const TRANSFORM& aTransform )
{
wxASSERT( aPlotter != NULL );
size_t i;
int* Poly = (int*) MyMalloc( sizeof(int) * 2 * GetCornerCount() );
if( Poly == NULL )
return;
for( i = 0; i < m_PolyPoints.size(); i++ )
{
wxPoint pos = m_PolyPoints[i];
pos = aTransform.TransformCoordinate( pos ) + aOffset;
Poly[i * 2] = pos.x;
Poly[i * 2 + 1] = pos.y;
}
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->poly( i, Poly, FILLED_WITH_BG_BODYCOLOR, 0 );
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->poly( i, Poly, already_filled ? NO_FILL : m_Fill, GetPenSize() );
MyFree( Poly );
}
/**
* Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
int LIB_BEZIER::GetPenSize()
{
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
}
void LIB_BEZIER::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1;
std::vector<wxPoint> PolyPointsTraslated;
int color = ReturnLayerColor( LAYER_DEVICE );
m_PolyPoints = Bezier2Poly( m_BezierPoints[0],
m_BezierPoints[1],
m_BezierPoints[2],
m_BezierPoints[3] );
PolyPointsTraslated.clear();
for( unsigned int i = 0; i < m_PolyPoints.size() ; i++ )
PolyPointsTraslated.push_back( aTransform.TransformCoordinate( m_PolyPoints[i] ) +
aOffset );
if( aColor < 0 ) // Used normal color or selected color
{
if( m_Selected & IS_SELECTED )
color = g_ItemSelectetColor;
}
else
color = aColor;
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(), color, color );
else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 0, GetPenSize(), color, color );
/* Set to one (1) to draw bounding box around bezier curve to validate
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
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
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return true if a hit, else false
*/
bool LIB_BEZIER::HitTest( const wxPoint& aRefPos )
{
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPos, mindist, DefaultTransform );
}
/**
* Function HitTest
* @return if the point aPosRef is near a segment
* @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix
*/
bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{
wxPoint ref, start, end;
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
start = aTransform.TransformCoordinate( m_PolyPoints[ii - 1] );
end = aTransform.TransformCoordinate( m_PolyPoints[ii] );
if ( TestSegmentHit( aPosRef, start, end, aThreshold ) )
return true;
}
return false;
}
/**
* Function GetBoundingBox
* @return the boundary box for this, in library coordinates
*/
EDA_Rect LIB_BEZIER::GetBoundingBox()
{
EDA_Rect rect;
int xmin, xmax, ymin, ymax;
if( !GetCornerCount() )
return rect;
xmin = xmax = m_PolyPoints[0].x;
ymin = ymax = m_PolyPoints[0].y;
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
xmin = MIN( xmin, m_PolyPoints[ii].x );
xmax = MAX( xmax, m_PolyPoints[ii].x );
ymin = MIN( ymin, m_PolyPoints[ii].y );
ymax = MAX( ymax, m_PolyPoints[ii].y );
}
rect.SetOrigin( xmin, ymin * -1 );
rect.SetEnd( xmax, ymax * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
void LIB_BEZIER::DisplayInfo( WinEDA_DrawFrame* aFrame )
{
wxString msg;
EDA_Rect bBox = GetBoundingBox();
LIB_DRAW_ITEM::DisplayInfo( aFrame );
msg = ReturnStringFromValue( g_UserUnit, m_Width, EESCHEMA_INTERNAL_UNIT, true );
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
aFrame->AppendMsgPanel( _( "Bounding box" ), msg, BROWN );
}

View File

@ -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;

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -1,400 +1,400 @@
/*************************/
/** class LIB_RECTANGLE **/
/*************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
#include "lib_rectangle.h"
#include "transform.h"
LIB_RECTANGLE::LIB_RECTANGLE( LIB_COMPONENT* aParent ) :
LIB_DRAW_ITEM( COMPONENT_RECT_DRAW_TYPE, aParent )
{
m_Width = 0;
m_Fill = NO_FILL;
m_isFillable = true;
m_typeName = _( "Rectangle" );
m_isHeightLocked = false;
m_isWidthLocked = false;
m_isStartPointSelected = false;
}
LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& aRect ) :
LIB_DRAW_ITEM( aRect )
{
m_Pos = aRect.m_Pos;
m_End = aRect.m_End;
m_Width = aRect.m_Width;
m_Fill = aRect.m_Fill;
}
bool LIB_RECTANGLE::Save( FILE* aFile )
{
if( fprintf( aFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
m_End.x, m_End.y, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 )
return false;
return true;
}
bool LIB_RECTANGLE::Load( char* aLine, wxString& aErrorMsg )
{
int cnt;
char tmp[256];
cnt = sscanf( &aLine[2], "%d %d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
&m_End.x, &m_End.y, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 7 )
{
aErrorMsg.Printf( _( "rectangle only had %d parameters of the required 7" ), cnt );
return false;
}
if( tmp[0] == 'F' )
m_Fill = FILLED_SHAPE;
if( tmp[0] == 'f' )
m_Fill = FILLED_WITH_BG_BODYCOLOR;
return true;
}
LIB_DRAW_ITEM* LIB_RECTANGLE::DoGenCopy()
{
LIB_RECTANGLE* newitem = new LIB_RECTANGLE( GetParent() );
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return (LIB_DRAW_ITEM*) newitem;
}
int LIB_RECTANGLE::DoCompare( const LIB_DRAW_ITEM& aOther ) const
{
wxASSERT( aOther.Type() == COMPONENT_RECT_DRAW_TYPE );
const LIB_RECTANGLE* tmp = ( LIB_RECTANGLE* ) &aOther;
if( m_Pos.x != tmp->m_Pos.x )
return m_Pos.x - tmp->m_Pos.x;
if( m_Pos.y != tmp->m_Pos.y )
return m_Pos.y - tmp->m_Pos.y;
if( m_End.x != tmp->m_End.x )
return m_End.x - tmp->m_End.x;
if( m_End.y != tmp->m_End.y )
return m_End.y - tmp->m_End.y;
return 0;
}
void LIB_RECTANGLE::DoOffset( const wxPoint& aOffset )
{
m_Pos += aOffset;
m_End += aOffset;
}
bool LIB_RECTANGLE::DoTestInside( EDA_Rect& aRect ) const
{
return aRect.Inside( m_Pos.x, -m_Pos.y ) || aRect.Inside( m_End.x, -m_End.y );
}
void LIB_RECTANGLE::DoMove( const wxPoint& aPosition )
{
wxPoint size = m_End - m_Pos;
m_Pos = aPosition;
m_End = aPosition + size;
}
void LIB_RECTANGLE::DoMirrorHorizontal( const wxPoint& aCenter )
{
m_Pos.x -= aCenter.x;
m_Pos.x *= -1;
m_Pos.x += aCenter.x;
m_End.x -= aCenter.x;
m_End.x *= -1;
m_End.x += aCenter.x;
}
void LIB_RECTANGLE::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
const TRANSFORM& aTransform )
{
wxASSERT( aPlotter != NULL );
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
wxPoint end = aTransform.TransformCoordinate( m_End ) + aOffset;
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->rect( pos, end, FILLED_WITH_BG_BODYCOLOR, 0 );
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
/**
* Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
int LIB_RECTANGLE::GetPenSize()
{
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
}
void LIB_RECTANGLE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aColor, int aDrawMode,
void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
if( aColor < 0 ) // Used normal color or selected color
{
if( m_Selected & IS_SELECTED )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
pos2 = aTransform.TransformCoordinate( m_End ) + aOffset;
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GetPenSize(), color, color );
else
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color );
/* Set to one (1) to draw bounding box around rectangle to validate
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 1, m_Width + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}
void LIB_RECTANGLE::DisplayInfo( WinEDA_DrawFrame* aFrame )
{
wxString msg;
LIB_DRAW_ITEM::DisplayInfo( aFrame );
msg = ReturnStringFromValue( g_UserUnit, m_Width, EESCHEMA_INTERNAL_UNIT, true );
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
}
EDA_Rect LIB_RECTANGLE::GetBoundingBox()
{
EDA_Rect rect;
rect.SetOrigin( m_Pos.x, m_Pos.y * -1 );
rect.SetEnd( m_End.x, m_End.y * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPoint A wxPoint to test in eeschema space
* @return true if a hit, else false
*/
bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint )
{
int mindist = ( m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2 ) + 1;
// Have a minimal tolerance for hit test
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPoint, mindist, DefaultTransform );
}
/**
* Function HitTest
* @return true if the point aPosRef is near this object
* @param aRefPoint = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half thickness
* of a line)
* @param aTransMat = the transform matrix
*/
bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const TRANSFORM& aTransform )
{
wxPoint actualStart = aTransform.TransformCoordinate( m_Pos );
wxPoint actualEnd = aTransform.TransformCoordinate( m_End );
// locate lower segment
wxPoint start, end;
start = actualStart;
end.x = actualEnd.x;
end.y = actualStart.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate right segment
start.x = actualEnd.x;
end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate upper segment
start.y = actualEnd.y;
end.x = actualStart.x;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate left segment
start = actualStart;
end.x = actualStart.x;
end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
return false;
}
void LIB_RECTANGLE::BeginEdit( int aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
wxT( "Invalid edit mode for LIB_RECTANGLE object." ) );
if( aEditMode == IS_NEW )
{
m_Pos = m_End = aPosition;
}
else if( aEditMode == IS_RESIZED )
{
m_isStartPointSelected = abs( m_Pos.x - aPosition.x ) < MINIMUM_SELECTION_DISTANCE
|| abs( m_Pos.y - aPosition.y ) < MINIMUM_SELECTION_DISTANCE;
if( m_isStartPointSelected )
{
m_isWidthLocked = abs( m_Pos.x - aPosition.x ) >= MINIMUM_SELECTION_DISTANCE;
m_isHeightLocked = abs( m_Pos.y - aPosition.y ) >= MINIMUM_SELECTION_DISTANCE;
}
else
{
m_isWidthLocked = abs( m_End.x - aPosition.x ) >= MINIMUM_SELECTION_DISTANCE;
m_isHeightLocked = abs( m_End.y - aPosition.y ) >= MINIMUM_SELECTION_DISTANCE;
}
SetEraseLastDrawItem();
}
else if( aEditMode == IS_MOVED )
{
m_initialPos = m_Pos;
m_initialCursorPos = aPosition;
SetEraseLastDrawItem();
}
m_Flags = aEditMode;
}
bool LIB_RECTANGLE::ContinueEdit( const wxPoint aPosition )
{
wxCHECK_MSG( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0, false,
wxT( "Bad call to ContinueEdit(). LIB_RECTANGLE is not being edited." ) );
return false;
}
void LIB_RECTANGLE::EndEdit( const wxPoint& aPosition, bool aAbort )
{
wxCHECK_RET( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
wxT( "Bad call to EndEdit(). LIB_RECTANGLE is not being edited." ) );
m_Flags = 0;
m_isHeightLocked = false;
m_isWidthLocked = false;
SetEraseLastDrawItem( false );
}
void LIB_RECTANGLE::calcEdit( const wxPoint& aPosition )
{
if( m_Flags == IS_NEW )
{
m_End = aPosition;
SetEraseLastDrawItem();
}
else if( m_Flags == IS_RESIZED )
{
if( m_isHeightLocked )
{
if( m_isStartPointSelected )
m_Pos.x = aPosition.x;
else
m_End.x = aPosition.x;
}
else if( m_isWidthLocked )
{
if( m_isStartPointSelected )
m_Pos.y = aPosition.y;
else
m_End.y = aPosition.y;
}
else
{
if( m_isStartPointSelected )
m_Pos = aPosition;
else
m_End = aPosition;
}
}
else if( m_Flags == IS_MOVED )
{
Move( m_initialPos + aPosition - m_initialCursorPos );
}
}
/*************************/
/** class LIB_RECTANGLE **/
/*************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
#include "lib_rectangle.h"
#include "transform.h"
LIB_RECTANGLE::LIB_RECTANGLE( LIB_COMPONENT* aParent ) :
LIB_DRAW_ITEM( COMPONENT_RECT_DRAW_TYPE, aParent )
{
m_Width = 0;
m_Fill = NO_FILL;
m_isFillable = true;
m_typeName = _( "Rectangle" );
m_isHeightLocked = false;
m_isWidthLocked = false;
m_isStartPointSelected = false;
}
LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& aRect ) :
LIB_DRAW_ITEM( aRect )
{
m_Pos = aRect.m_Pos;
m_End = aRect.m_End;
m_Width = aRect.m_Width;
m_Fill = aRect.m_Fill;
}
bool LIB_RECTANGLE::Save( FILE* aFile )
{
if( fprintf( aFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
m_End.x, m_End.y, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 )
return false;
return true;
}
bool LIB_RECTANGLE::Load( char* aLine, wxString& aErrorMsg )
{
int cnt;
char tmp[256];
cnt = sscanf( &aLine[2], "%d %d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
&m_End.x, &m_End.y, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 7 )
{
aErrorMsg.Printf( _( "rectangle only had %d parameters of the required 7" ), cnt );
return false;
}
if( tmp[0] == 'F' )
m_Fill = FILLED_SHAPE;
if( tmp[0] == 'f' )
m_Fill = FILLED_WITH_BG_BODYCOLOR;
return true;
}
LIB_DRAW_ITEM* LIB_RECTANGLE::DoGenCopy()
{
LIB_RECTANGLE* newitem = new LIB_RECTANGLE( GetParent() );
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return (LIB_DRAW_ITEM*) newitem;
}
int LIB_RECTANGLE::DoCompare( const LIB_DRAW_ITEM& aOther ) const
{
wxASSERT( aOther.Type() == COMPONENT_RECT_DRAW_TYPE );
const LIB_RECTANGLE* tmp = ( LIB_RECTANGLE* ) &aOther;
if( m_Pos.x != tmp->m_Pos.x )
return m_Pos.x - tmp->m_Pos.x;
if( m_Pos.y != tmp->m_Pos.y )
return m_Pos.y - tmp->m_Pos.y;
if( m_End.x != tmp->m_End.x )
return m_End.x - tmp->m_End.x;
if( m_End.y != tmp->m_End.y )
return m_End.y - tmp->m_End.y;
return 0;
}
void LIB_RECTANGLE::DoOffset( const wxPoint& aOffset )
{
m_Pos += aOffset;
m_End += aOffset;
}
bool LIB_RECTANGLE::DoTestInside( EDA_Rect& aRect ) const
{
return aRect.Inside( m_Pos.x, -m_Pos.y ) || aRect.Inside( m_End.x, -m_End.y );
}
void LIB_RECTANGLE::DoMove( const wxPoint& aPosition )
{
wxPoint size = m_End - m_Pos;
m_Pos = aPosition;
m_End = aPosition + size;
}
void LIB_RECTANGLE::DoMirrorHorizontal( const wxPoint& aCenter )
{
m_Pos.x -= aCenter.x;
m_Pos.x *= -1;
m_Pos.x += aCenter.x;
m_End.x -= aCenter.x;
m_End.x *= -1;
m_End.x += aCenter.x;
}
void LIB_RECTANGLE::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
const TRANSFORM& aTransform )
{
wxASSERT( aPlotter != NULL );
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
wxPoint end = aTransform.TransformCoordinate( m_End ) + aOffset;
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->rect( pos, end, FILLED_WITH_BG_BODYCOLOR, 0 );
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
/**
* Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
int LIB_RECTANGLE::GetPenSize()
{
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
}
void LIB_RECTANGLE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aColor, int aDrawMode,
void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
if( aColor < 0 ) // Used normal color or selected color
{
if( m_Selected & IS_SELECTED )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
pos2 = aTransform.TransformCoordinate( m_End ) + aOffset;
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GetPenSize(), color, color );
else
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color );
/* Set to one (1) to draw bounding box around rectangle to validate
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
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
}
void LIB_RECTANGLE::DisplayInfo( WinEDA_DrawFrame* aFrame )
{
wxString msg;
LIB_DRAW_ITEM::DisplayInfo( aFrame );
msg = ReturnStringFromValue( g_UserUnit, m_Width, EESCHEMA_INTERNAL_UNIT, true );
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
}
EDA_Rect LIB_RECTANGLE::GetBoundingBox()
{
EDA_Rect rect;
rect.SetOrigin( m_Pos.x, m_Pos.y * -1 );
rect.SetEnd( m_End.x, m_End.y * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPoint A wxPoint to test in eeschema space
* @return true if a hit, else false
*/
bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint )
{
int mindist = ( m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2 ) + 1;
// Have a minimal tolerance for hit test
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPoint, mindist, DefaultTransform );
}
/**
* Function HitTest
* @return true if the point aPosRef is near this object
* @param aRefPoint = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half thickness
* of a line)
* @param aTransMat = the transform matrix
*/
bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const TRANSFORM& aTransform )
{
wxPoint actualStart = aTransform.TransformCoordinate( m_Pos );
wxPoint actualEnd = aTransform.TransformCoordinate( m_End );
// locate lower segment
wxPoint start, end;
start = actualStart;
end.x = actualEnd.x;
end.y = actualStart.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate right segment
start.x = actualEnd.x;
end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate upper segment
start.y = actualEnd.y;
end.x = actualStart.x;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
// locate left segment
start = actualStart;
end.x = actualStart.x;
end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
return false;
}
void LIB_RECTANGLE::BeginEdit( int aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
wxT( "Invalid edit mode for LIB_RECTANGLE object." ) );
if( aEditMode == IS_NEW )
{
m_Pos = m_End = aPosition;
}
else if( aEditMode == IS_RESIZED )
{
m_isStartPointSelected = abs( m_Pos.x - aPosition.x ) < MINIMUM_SELECTION_DISTANCE
|| abs( m_Pos.y - aPosition.y ) < MINIMUM_SELECTION_DISTANCE;
if( m_isStartPointSelected )
{
m_isWidthLocked = abs( m_Pos.x - aPosition.x ) >= MINIMUM_SELECTION_DISTANCE;
m_isHeightLocked = abs( m_Pos.y - aPosition.y ) >= MINIMUM_SELECTION_DISTANCE;
}
else
{
m_isWidthLocked = abs( m_End.x - aPosition.x ) >= MINIMUM_SELECTION_DISTANCE;
m_isHeightLocked = abs( m_End.y - aPosition.y ) >= MINIMUM_SELECTION_DISTANCE;
}
SetEraseLastDrawItem();
}
else if( aEditMode == IS_MOVED )
{
m_initialPos = m_Pos;
m_initialCursorPos = aPosition;
SetEraseLastDrawItem();
}
m_Flags = aEditMode;
}
bool LIB_RECTANGLE::ContinueEdit( const wxPoint aPosition )
{
wxCHECK_MSG( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0, false,
wxT( "Bad call to ContinueEdit(). LIB_RECTANGLE is not being edited." ) );
return false;
}
void LIB_RECTANGLE::EndEdit( const wxPoint& aPosition, bool aAbort )
{
wxCHECK_RET( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
wxT( "Bad call to EndEdit(). LIB_RECTANGLE is not being edited." ) );
m_Flags = 0;
m_isHeightLocked = false;
m_isWidthLocked = false;
SetEraseLastDrawItem( false );
}
void LIB_RECTANGLE::calcEdit( const wxPoint& aPosition )
{
if( m_Flags == IS_NEW )
{
m_End = aPosition;
SetEraseLastDrawItem();
}
else if( m_Flags == IS_RESIZED )
{
if( m_isHeightLocked )
{
if( m_isStartPointSelected )
m_Pos.x = aPosition.x;
else
m_End.x = aPosition.x;
}
else if( m_isWidthLocked )
{
if( m_isStartPointSelected )
m_Pos.y = aPosition.y;
else
m_End.y = aPosition.y;
}
else
{
if( m_isStartPointSelected )
m_Pos = aPosition;
else
m_End = aPosition;
}
}
else if( m_Flags == IS_MOVED )
{
Move( m_initialPos + aPosition - m_initialCursorPos );
}
}

View File

@ -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 );
}

View File

@ -1,147 +1,147 @@
#ifndef _LIB_TEXT_H_
#define _LIB_TEXT_H_
#include "lib_draw_item.h"
/*********************************************/
/* Graphic Body Item: Text */
/* This is only a graphic text. */
/* Fields like Ref , value... are not Text, */
/* they are a separate class */
/*********************************************/
class LIB_TEXT : public LIB_DRAW_ITEM, public EDA_TextStruct
{
wxString m_savedText; ///< Temporary storage for the string when edition.
bool m_rotate; ///< Flag to indicate a rotation occurred while editing.
bool m_updateText; ///< Flag to indicate text change occurred while editing.
/**
* Draw the polyline.
*/
void drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
/**
* Calculate the text attributes ralative to \a aPosition while editing.
*
* @param aPosition - Edit position in drawing units.
*/
void calcEdit( const wxPoint& aPosition );
public:
LIB_TEXT( LIB_COMPONENT * aParent );
LIB_TEXT( const LIB_TEXT& aText );
~LIB_TEXT() { }
virtual wxString GetClass() const
{
return wxT( "LIB_TEXT" );
}
/**
* Sets the text item string to \a aText.
*
* This method does more than juat set the set the text string. There are special
* cases when changing the text string alone is not enough. If the text item is
* being moved, the name change must be delayed until the next redraw to prevent
* drawing artifacts.
*
* @param aText - New text value.
*/
void SetText( const wxString& aText );
/**
* Write text object out to a FILE in "*.lib" format.
*
* @param aFile - The FILE to write to.
* @return - true if success writing else false.
*/
virtual bool Save( FILE* aFile );
virtual bool Load( char* aLine, wxString& aErrorMsg );
/**
* Test if the given point is within the bounds of this object.
*
* @param refPos - A wxPoint to test
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& refPos );
/**
* @param aPosRef = a wxPoint to test, in eeschema coordinates
* @param aThreshold = max distance to a segment
* @param aTransform = the transform matrix
* @return true if the point aPosRef is near a segment
*/
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform );
/**
* Test if the given rectangle intersects this object.
*
* For now, an ending point must be inside this rect.
*
* @param aRect - the given EDA_Rect
* @return - true if a hit, else false
*/
virtual bool HitTest( EDA_Rect& aRect )
{
return TextHitTest( aRect );
}
/**
* @return the size of the "pen" that be used to draw or plot this item
*/
virtual int GetPenSize( );
virtual void DisplayInfo( WinEDA_DrawFrame* aFrame );
virtual EDA_Rect GetBoundingBox();
void Rotate();
/**
* See LIB_DRAW_ITEM::BeginEdit().
*/
void BeginEdit( int aEditMode, const wxPoint aStartPoint = wxPoint( 0, 0 ) );
/**
* See LIB_DRAW_ITEM::ContinueEdit().
*/
bool ContinueEdit( const wxPoint aNextPoint );
/**
* See LIB_DRAW_ITEM::AbortEdit().
*/
void EndEdit( const wxPoint& aPosition, bool aAbort = false );
protected:
virtual LIB_DRAW_ITEM* DoGenCopy();
/**
* Provide the text draw object specific comparison.
*
* The sort order is as follows:
* - Text string, case insensitive compare.
* - Text horizontal (X) position.
* - Text vertical (Y) position.
* - Text width.
* - Text height.
*/
virtual int DoCompare( const LIB_DRAW_ITEM& aOther ) const;
virtual void DoOffset( const wxPoint& aOffset );
virtual bool DoTestInside( EDA_Rect& aRect ) const;
virtual void DoMove( const wxPoint& aPosition );
virtual wxPoint DoGetPosition() const { return m_Pos; }
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; }
};
#endif // _LIB_TEXT_H_
#ifndef _LIB_TEXT_H_
#define _LIB_TEXT_H_
#include "lib_draw_item.h"
/*********************************************/
/* Graphic Body Item: Text */
/* This is only a graphic text. */
/* Fields like Ref , value... are not Text, */
/* they are a separate class */
/*********************************************/
class LIB_TEXT : public LIB_DRAW_ITEM, public EDA_TextStruct
{
wxString m_savedText; ///< Temporary storage for the string when edition.
bool m_rotate; ///< Flag to indicate a rotation occurred while editing.
bool m_updateText; ///< Flag to indicate text change occurred while editing.
/**
* Draw the polyline.
*/
void drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
/**
* Calculate the text attributes ralative to \a aPosition while editing.
*
* @param aPosition - Edit position in drawing units.
*/
void calcEdit( const wxPoint& aPosition );
public:
LIB_TEXT( LIB_COMPONENT * aParent );
LIB_TEXT( const LIB_TEXT& aText );
~LIB_TEXT() { }
virtual wxString GetClass() const
{
return wxT( "LIB_TEXT" );
}
/**
* Sets the text item string to \a aText.
*
* This method does more than juat set the set the text string. There are special
* cases when changing the text string alone is not enough. If the text item is
* being moved, the name change must be delayed until the next redraw to prevent
* drawing artifacts.
*
* @param aText - New text value.
*/
void SetText( const wxString& aText );
/**
* Write text object out to a FILE in "*.lib" format.
*
* @param aFile - The FILE to write to.
* @return - true if success writing else false.
*/
virtual bool Save( FILE* aFile );
virtual bool Load( char* aLine, wxString& aErrorMsg );
/**
* Test if the given point is within the bounds of this object.
*
* @param refPos - A wxPoint to test
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& refPos );
/**
* @param aPosRef = a wxPoint to test, in eeschema coordinates
* @param aThreshold = max distance to a segment
* @param aTransform = the transform matrix
* @return true if the point aPosRef is near a segment
*/
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform );
/**
* Test if the given rectangle intersects this object.
*
* For now, an ending point must be inside this rect.
*
* @param aRect - the given EDA_Rect
* @return - true if a hit, else false
*/
virtual bool HitTest( EDA_Rect& aRect )
{
return TextHitTest( aRect );
}
/**
* @return the size of the "pen" that be used to draw or plot this item
*/
virtual int GetPenSize( );
virtual void DisplayInfo( WinEDA_DrawFrame* aFrame );
virtual EDA_Rect GetBoundingBox();
void Rotate();
/**
* See LIB_DRAW_ITEM::BeginEdit().
*/
void BeginEdit( int aEditMode, const wxPoint aStartPoint = wxPoint( 0, 0 ) );
/**
* See LIB_DRAW_ITEM::ContinueEdit().
*/
bool ContinueEdit( const wxPoint aNextPoint );
/**
* See LIB_DRAW_ITEM::AbortEdit().
*/
void EndEdit( const wxPoint& aPosition, bool aAbort = false );
protected:
virtual LIB_DRAW_ITEM* DoGenCopy();
/**
* Provide the text draw object specific comparison.
*
* The sort order is as follows:
* - Text string, case insensitive compare.
* - Text horizontal (X) position.
* - Text vertical (Y) position.
* - Text width.
* - Text height.
*/
virtual int DoCompare( const LIB_DRAW_ITEM& aOther ) const;
virtual void DoOffset( const wxPoint& aOffset );
virtual bool DoTestInside( EDA_Rect& aRect ) const;
virtual void DoMove( const wxPoint& aPosition );
virtual wxPoint DoGetPosition() const { return m_Pos; }
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_Thickness; }
virtual void DoSetWidth( int aWidth ) { m_Thickness = aWidth; }
};
#endif // _LIB_TEXT_H_

View File

@ -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;

View File

@ -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;

View File

@ -16,7 +16,6 @@
#include "gerbview.h"
#include "wxGerberFrame.h"
#include "wxPcbStruct.h"
#include "pcbplot.h"
#include "class_board_design_settings.h"

View File

@ -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;
}
/**

View File

@ -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 );

View File

@ -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

View File

@ -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();

View File

@ -8,7 +8,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "autorout.h"
#include "protos.h"

View File

@ -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;
}

View File

@ -51,7 +51,6 @@ static bool AutoPlaceShowAll = TRUE;
float MinCout;
static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide );
static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare );
static void TracePenaliteRectangle( BOARD* Pcb,
int ux0,
@ -74,7 +73,6 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module,
{
int ii, activ;
MODULE* ThisModule = NULL;
MODULE** BaseListeModules;
wxPoint PosOK;
wxPoint memopos;
int error;
@ -125,19 +123,17 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module,
/* Compute module parmeters used in auto place */
Module = GetBoard()->m_Modules;
NbTotalModules = 0;
for( ; Module != NULL; Module = Module->Next() )
{
Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit();
NbTotalModules ++;
}
if( GenPlaceBoard() == 0 )
return;
/* Updating the parameters useful for module placement. */
BaseListeModules = GenListeModules( GetBoard(), &NbTotalModules );
MyFree( BaseListeModules );
Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
@ -1003,37 +999,23 @@ static void TracePenaliteRectangle( BOARD* Pcb,
}
/************************************/
/* Sort routines for use with qsort */
/************************************/
static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare )
/* Sort routines */
static bool Tri_PlaceModules( MODULE* ref, MODULE* compare )
{
float ff, ff1, ff2;
double ff1, ff2;
ff1 = (*pt_ref)->m_Surface * (*pt_ref)->m_PadNum;
ff2 = (*pt_compare)->m_Surface * (*pt_compare)->m_PadNum;
ff = ff1 - ff2;
if( ff < 0 )
return 1;
if( ff > 0 )
return -1;
return 0;
ff1 = ref->m_Surface * ref->m_PadNum;
ff2 = compare->m_Surface * compare->m_PadNum;
return ff2 < ff1;
}
static int Tri_RatsModules( MODULE** pt_ref, MODULE** pt_compare )
static bool Tri_RatsModules( MODULE* ref, MODULE* compare )
{
float ff, ff1, ff2;
double ff1, ff2;
ff1 = (*pt_ref)->m_Surface * (*pt_ref)->flag;
ff2 = (*pt_compare)->m_Surface * (*pt_compare)->flag;
ff = ff1 - ff2;
if( ff < 0 )
return 1;
if( ff > 0 )
return -1;
return 0;
ff1 = ref->m_Surface * ref->flag;
ff2 = compare->m_Surface * compare->flag;
return ff2 < ff1;
}
@ -1044,28 +1026,28 @@ static int Tri_RatsModules( MODULE** pt_ref, MODULE** pt_compare )
*/
static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
{
MODULE** BaseListeModules, ** pt_Dmod;
MODULE* Module = NULL, * AltModule = NULL;
int NbModules;
MODULE* Module;
std::vector <MODULE*> moduleList;
BaseListeModules = GenListeModules( pcbframe->GetBoard(), &NbModules );
if( BaseListeModules == NULL )
return NULL;
/* Sort surface area of modules from greatest to least. Surface area
* weighted by the number of pads
*/
qsort( BaseListeModules, NbModules, sizeof(MODULE * *),
( int (*)( const void*, const void* ) )Tri_PlaceModules );
for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ )
// Build sorted footprints list (sort by decreasing size )
Module = pcbframe->GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
(*pt_Dmod)->flag = 0;
if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) )
Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit();
moduleList.push_back(Module);
}
sort( moduleList.begin(), moduleList.end(), Tri_PlaceModules );
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = moduleList[ii];
Module->flag = 0;
if( !( Module->m_ModuleStatus & MODULE_to_PLACE ) )
continue;
pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
(*pt_Dmod)->DisplayInfo( pcbframe );
pcbframe->build_ratsnest_module( DC, *pt_Dmod );
Module->DisplayInfo( pcbframe );
pcbframe->build_ratsnest_module( DC, Module );
/* Calculate external ratsnet. */
for( unsigned ii = 0;
@ -1074,33 +1056,33 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
{
if( ( pcbframe->GetBoard()->m_LocalRatsnest[ii].m_Status &
LOCAL_RATSNEST_ITEM ) == 0 )
(*pt_Dmod)->flag++;
Module->flag++;
}
}
pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
qsort( BaseListeModules, NbModules, sizeof(MODULE * *),
( int (*)( const void*, const void* ) )Tri_RatsModules );
sort( moduleList.begin(), moduleList.end(), Tri_RatsModules );
/* Search for "best" module. */
Module = NULL;
for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ )
MODULE* bestModule = NULL;
MODULE* altModule = NULL;
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) )
Module = moduleList[ii];
if( !( Module->m_ModuleStatus & MODULE_to_PLACE ) )
continue;
AltModule = *pt_Dmod;
if( (*pt_Dmod)->flag == 0 )
altModule = Module;
if( Module->flag == 0 )
continue;
Module = *pt_Dmod; break;
bestModule = Module;
break;
}
MyFree( BaseListeModules );
if( Module )
return Module;
if( bestModule )
return bestModule;
else
return AltModule;
return altModule;
}
@ -1169,3 +1151,145 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
ymax - GetBoard()->m_BoundaryBox.m_Pos.y );
return succes;
}
/********************************************/
int Propagation( WinEDA_PcbFrame* frame )
/********************************************/
/**
* Function Propagation
* Used now only in autoplace calculations
* Uses the routing matrix to fill the cells within the zone
* Search and mark cells within the zone, and agree with DRC options.
* Requirements:
* Start from an initial point, to fill zone
* The zone must have no "copper island"
* Algorithm:
* If the current cell has a neightbour flagged as "cell in the zone", it
* become a cell in the zone
* The first point in the zone is the starting point
* 4 searches within the matrix are made:
* 1 - Left to right and top to bottom
* 2 - Right to left and top to bottom
* 3 - bottom to top and Right to left
* 4 - bottom to top and Left to right
* Given the current cell, for each search, we consider the 2 neightbour cells
* the previous cell on the same line and the previous cell on the same column.
*
* This funtion can request some iterations
* Iterations are made until no cell is added to the zone.
* @return: added cells count (i.e. which the attribute CELL_is_ZONE is set)
*/
{
int row, col, nn;
long current_cell, old_cell_H;
int long* pt_cell_V;
int nbpoints = 0;
#define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE)
wxString msg;
Affiche_1_Parametre( frame, 57, wxT( "Detect" ), msg, CYAN );
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "1" ), CYAN );
// Alloc memory to handle 1 line or 1 colunmn on the routing matrix
nn = MAX( Nrows, Ncols ) * sizeof(*pt_cell_V);
pt_cell_V = (long*) MyMalloc( nn );
/* search 1 : from left to right and top to bottom */
memset( pt_cell_V, 0, nn );
for( row = 0; row < Nrows; row++ )
{
old_cell_H = 0;
for( col = 0; col < Ncols; col++ )
{
current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE;
if( current_cell == 0 ) /* a free cell is found */
{
if( (old_cell_H & CELL_is_ZONE)
|| (pt_cell_V[col] & CELL_is_ZONE) )
{
OrCell( row, col, BOTTOM, CELL_is_ZONE );
current_cell = CELL_is_ZONE;
nbpoints++;
}
}
pt_cell_V[col] = old_cell_H = current_cell;
}
}
/* search 2 : from right to left and top to bottom */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "2" ), CYAN );
memset( pt_cell_V, 0, nn );
for( row = 0; row < Nrows; row++ )
{
old_cell_H = 0;
for( col = Ncols - 1; col >= 0; col-- )
{
current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE;
if( current_cell == 0 ) /* a free cell is found */
{
if( (old_cell_H & CELL_is_ZONE)
|| (pt_cell_V[col] & CELL_is_ZONE) )
{
OrCell( row, col, BOTTOM, CELL_is_ZONE );
current_cell = CELL_is_ZONE;
nbpoints++;
}
}
pt_cell_V[col] = old_cell_H = current_cell;
}
}
/* search 3 : from bottom to top and right to left balayage */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "3" ), CYAN );
memset( pt_cell_V, 0, nn );
for( col = Ncols - 1; col >= 0; col-- )
{
old_cell_H = 0;
for( row = Nrows - 1; row >= 0; row-- )
{
current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE;
if( current_cell == 0 ) /* a free cell is found */
{
if( (old_cell_H & CELL_is_ZONE)
|| (pt_cell_V[row] & CELL_is_ZONE) )
{
OrCell( row, col, BOTTOM, CELL_is_ZONE );
current_cell = CELL_is_ZONE;
nbpoints++;
}
}
pt_cell_V[row] = old_cell_H = current_cell;
}
}
/* search 4 : from bottom to top and left to right */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "4" ), CYAN );
memset( pt_cell_V, 0, nn );
for( col = 0; col < Ncols; col++ )
{
old_cell_H = 0;
for( row = Nrows - 1; row >= 0; row-- )
{
current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE;
if( current_cell == 0 ) /* a free cell is found */
{
if( (old_cell_H & CELL_is_ZONE)
|| (pt_cell_V[row] & CELL_is_ZONE) )
{
OrCell( row, col, BOTTOM, CELL_is_ZONE );
current_cell = CELL_is_ZONE;
nbpoints++;
}
}
pt_cell_V[row] = old_cell_H = current_cell;
}
}
MyFree( pt_cell_V );
return nbpoints;
}

View File

@ -12,7 +12,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "autorout.h"
#include "pcbplot.h"
#include "trigo.h"

View File

@ -14,7 +14,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "autorout.h"
#include "pcbplot.h"
#include "trigo.h"

View File

@ -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;

View File

@ -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;

View File

@ -17,7 +17,6 @@
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "autorout.h"
#include "drag.h"
#include "3d_struct.h"

View File

@ -7,7 +7,6 @@
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "autorout.h"
// Constructor and destructor

View File

@ -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 );

View File

@ -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 );

View File

@ -1,223 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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.
}

View File

@ -1,123 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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_

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"

View File

@ -1,314 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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);
}

View File

@ -1,116 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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_

View File

@ -1,911 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<anthemion-project version="1.0.0.0" xmlns="http://www.anthemion.co.uk">
<header>
<long name="name_counter">0</long>
<string name="html_path">""</string>
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
<bool name="generate_cpp_for_xrc">0</bool>
<long name="working_mode">1</long>
<bool name="use_help_text_for_tooltips">1</bool>
<bool name="translate_strings">1</bool>
<bool name="make_unicode_strings">1</bool>
<bool name="extract_strings">0</bool>
<string name="user_name">""</string>
<string name="copyright_string">""</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"2.6.4"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %HEADER-FILENAME%
// Purpose:
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_implementation_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %SOURCE-FILENAME%
// Purpose:
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_symbols_file_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %SYMBOLS-FILENAME%
// Purpose: Symbols file
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_header_preamble">""</string>
<string name="cpp_implementation_preamble">"// For compilers that support precompilation, includes &quot;wx/wx.h&quot;.
#include &quot;wx/wxprec.h&quot;
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include &quot;wx/wx.h&quot;
#endif
"</string>
<string name="cpp_function_declaration_comment">" /// %BODY%
"</string>
<string name="cpp_function_implementation_comment">"
/*!
* %BODY%
*/
"</string>
<string name="resource_file_header">"app_resources.h"</string>
<string name="resource_file_implementation">"app_resources.cpp"</string>
<string name="resource_class_name">"AppResources"</string>
<string name="app_file_header">"app.h"</string>
<string name="app_file_implementation">"app.cpp"</string>
<string name="app_class_name">"Application"</string>
<bool name="generate_app_class">0</bool>
<string name="external_symbol_filenames">""</string>
<string name="configuration">"&lt;None&gt;"</string>
<string name="source_encoding">"iso-8859-1"</string>
<string name="xrc_encoding">"utf-8"</string>
<string name="project_encoding">"utf-8"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="use_id_name_for_name">0</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="archive_all_image_files">0</bool>
<bool name="xrc_retain_relative_paths">1</bool>
<bool name="xrc_generate_id_tags">0</bool>
</header>
<data>
<document>
<string name="title">""</string>
<string name="type">"data-document"</string>
<string name="filename">""</string>
<string name="icon-name">""</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<document>
<string name="title">"Configurations"</string>
<string name="type">"config-data-document"</string>
<string name="filename">""</string>
<string name="icon-name">""</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="template-name">""</string>
<bool name="dirty">1</bool>
<long name="makefile-last-written">-8519680</long>
<string name="Compiler name">""</string>
<string name="Build mode">"Debug"</string>
<string name="Unicode mode">"ANSI"</string>
<string name="Shared mode">"Static"</string>
<string name="Modularity">"Modular"</string>
<string name="GUI mode">"GUI"</string>
<string name="Toolkit">"wxMSW"</string>
<string name="Runtime linking">"Dynamic"</string>
<string name="Use exceptions">"Yes"</string>
<string name="Use ODBC">"No"</string>
<string name="Use OpenGL">"No"</string>
<string name="wxWidgets version">"%WXVERSION%"</string>
<string name="Executable name">"%EXECUTABLE%"</string>
<string name="Program arguments">""</string>
<string name="Working path">"%AUTO%"</string>
<string name="Output path">"%AUTO%"</string>
<string name="Objects path">"%AUTO%"</string>
<string name="Compiler location">"%AUTO%"</string>
<string name="wxWidgets location">"%AUTO%"</string>
<string name="C++ command">"%AUTO%"</string>
<string name="Resource compiler">"%AUTO%"</string>
<string name="Make command">"%AUTO%"</string>
<string name="Project makefile">"%AUTO%"</string>
<string name="wxWidgets makefile">"%AUTO%"</string>
<string name="Compiler bin path">"%AUTO%"</string>
<string name="Compiler include path">"%AUTO%"</string>
<string name="Compiler lib path">"%AUTO%"</string>
<string name="Preprocessor flags">"%AUTO%"</string>
<string name="Optimizations">"%AUTO%"</string>
<string name="Warnings">"%AUTO%"</string>
<string name="Debug flags">"%AUTO%"</string>
<string name="Libraries">"%AUTO%"</string>
<string name="Library path">"%AUTO%"</string>
<string name="Linker flags">"%AUTO%"</string>
<string name="Include path">"%AUTO%"</string>
<string name="Resource flags">"%AUTO%"</string>
<string name="Resource path">"%AUTO%"</string>
<string name="wxWidgets build path">"%AUTO%"</string>
<string name="wxWidgets build command">"%AUTO%"</string>
<string name="wxWidgets clean command">"%AUTO%"</string>
<string name="PATH variable">"%AUTO%"</string>
<bool name="Suppress source rules">0</bool>
<bool name="Enable makefile generation">1</bool>
</document>
</document>
</data>
<documents>
<document>
<string name="title">"Projects"</string>
<string name="type">"root-document"</string>
<string name="filename">""</string>
<string name="icon-name">"project"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"Windows"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogsfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"dialog_orient_footprints"</string>
<string name="type">"dialog-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialog"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbDialogProxy"</string>
<long name="base-id">10000</long>
<bool name="use-id-prefix">0</bool>
<string name="id-prefix">""</string>
<bool name="use-id-suffix">0</bool>
<string name="id-suffix">""</string>
<long name="use-xrc">0</long>
<long name="working-mode">0</long>
<string name="event-handler-0">"wxEVT_CLOSE_WINDOW|OnCloseWindow|NONE||"</string>
<string name="proxy-Id name">"ID_DIALOG_ORIENT_FOOTPRINTS"</string>
<long name="proxy-Id value">10000</long>
<string name="proxy-Class">"dialog_orient_footprints"</string>
<string name="proxy-Base class">"wxDialog"</string>
<string name="proxy-Window kind">"wxDialog"</string>
<string name="proxy-Implementation filename">"dialog_orient_footprints.cpp"</string>
<string name="proxy-Header filename">"dialog_orient_footprints.h"</string>
<string name="proxy-XRC filename">""</string>
<string name="proxy-Title">"Footprints Orientation"</string>
<bool name="proxy-Centre">1</bool>
<string name="proxy-Icon">""</string>
<bool name="proxy-Dialog units">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Texture">""</string>
<string name="proxy-Texture style">"Tiled"</string>
<bool name="proxy-wxDEFAULT_DIALOG_STYLE">1</bool>
<bool name="proxy-wxCAPTION">1</bool>
<bool name="proxy-wxRESIZE_BORDER">1</bool>
<bool name="proxy-wxSYSTEM_MENU">1</bool>
<bool name="proxy-wxSTAY_ON_TOP">0</bool>
<bool name="proxy-wxDIALOG_NO_PARENT">0</bool>
<bool name="proxy-wxCLOSE_BOX">1</bool>
<bool name="proxy-wxMAXIMIZE_BOX">0</bool>
<bool name="proxy-wxMINIMIZE_BOX">0</bool>
<bool name="proxy-wxDIALOG_MODAL">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">1</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
<bool name="proxy-wxWS_EX_TRANSIENT">0</bool>
<string name="proxy-Custom styles">""</string>
<bool name="proxy-wxDIALOG_EX_CONTEXTHELP">0</bool>
<bool name="proxy-Fit to content">1</bool>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">400</long>
<long name="proxy-Height">300</long>
<bool name="proxy-AUI manager">0</bool>
<string name="proxy-Event sources">""</string>
<document>
<string name="title">"wxBoxSizer H"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Horizontal"</string>
<string name="proxy-Member variable name">""</string>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">1</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxStaticText: wxID_STATIC"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"statictext"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbStaticTextProxy"</string>
<string name="proxy-Id name">"wxID_STATIC"</string>
<long name="proxy-Id value">5105</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Base class">"wxStaticText"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Orientation:"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<bool name="proxy-wxALIGN_LEFT">0</bool>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxALIGN_CENTRE">0</bool>
<bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">0</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxTextCtrl: ID_TEXTCTRLROT_VALUE"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"textctrl"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbTextCtrlProxy"</string>
<string name="proxy-Id name">"ID_TEXTCTRLROT_VALUE"</string>
<long name="proxy-Id value">10003</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxTextCtrl"</string>
<string name="proxy-Base class">"wxTextCtrl"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_OrientationCtrl"</string>
<string name="proxy-Initial value">""</string>
<long name="proxy-Max length">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">"New orientation (0.1 degree resolution)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<bool name="proxy-wxTE_MULTILINE">0</bool>
<bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
<bool name="proxy-wxTE_PROCESS_TAB">0</bool>
<bool name="proxy-wxTE_PASSWORD">0</bool>
<bool name="proxy-wxTE_READONLY">0</bool>
<bool name="proxy-wxTE_RICH">0</bool>
<bool name="proxy-wxTE_RICH2">0</bool>
<bool name="proxy-wxTE_AUTO_URL">0</bool>
<bool name="proxy-wxTE_NOHIDESEL">0</bool>
<bool name="proxy-wxTE_LEFT">0</bool>
<bool name="proxy-wxTE_CENTRE">0</bool>
<bool name="proxy-wxTE_RIGHT">0</bool>
<bool name="proxy-wxHSCROLL">0</bool>
<bool name="proxy-wxTE_CHARWRAP">0</bool>
<bool name="proxy-wxTE_WORDWRAP">0</bool>
<bool name="proxy-wxTE_CAPITALIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">0</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxStaticText: wxID_STATIC"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"statictext"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbStaticTextProxy"</string>
<string name="proxy-Id name">"wxID_STATIC"</string>
<long name="proxy-Id value">5105</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Base class">"wxStaticText"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Filter:"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<bool name="proxy-wxALIGN_LEFT">0</bool>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxALIGN_CENTRE">0</bool>
<bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">0</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxTextCtrl: ID_TEXTCTRL_FOOTPRINTS_FILTER"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"textctrl"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbTextCtrlProxy"</string>
<string name="proxy-Id name">"ID_TEXTCTRL_FOOTPRINTS_FILTER"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxTextCtrl"</string>
<string name="proxy-Base class">"wxTextCtrl"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_FilterPattern"</string>
<string name="proxy-Initial value">"*"</string>
<long name="proxy-Max length">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">"Filter to select footprints by reference"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<bool name="proxy-wxTE_MULTILINE">0</bool>
<bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
<bool name="proxy-wxTE_PROCESS_TAB">0</bool>
<bool name="proxy-wxTE_PASSWORD">0</bool>
<bool name="proxy-wxTE_READONLY">0</bool>
<bool name="proxy-wxTE_RICH">0</bool>
<bool name="proxy-wxTE_RICH2">0</bool>
<bool name="proxy-wxTE_AUTO_URL">0</bool>
<bool name="proxy-wxTE_NOHIDESEL">0</bool>
<bool name="proxy-wxTE_LEFT">0</bool>
<bool name="proxy-wxTE_CENTRE">0</bool>
<bool name="proxy-wxTE_RIGHT">0</bool>
<bool name="proxy-wxHSCROLL">0</bool>
<bool name="proxy-wxTE_CHARWRAP">0</bool>
<bool name="proxy-wxTE_WORDWRAP">0</bool>
<bool name="proxy-wxTE_CAPITALIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">1</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">0</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"Spacer"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"spacer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbSpacerProxy"</string>
<long name="proxy-Width">5</long>
<long name="proxy-Height">5</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX_APPLY_TO_LOCKED"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX_APPLY_TO_LOCKED"</string>
<long name="proxy-Id value">10002</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_ApplyToLocked"</string>
<string name="proxy-Label">"Include Locked Footprints"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">"Force locked footprints to be modified"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxButton: wxID_OK"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||dialog_orient_footprints"</string>
<string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"OK"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxBU_LEFT">0</bool>
<bool name="proxy-wxBU_RIGHT">0</bool>
<bool name="proxy-wxBU_TOP">0</bool>
<bool name="proxy-wxBU_BOTTOM">0</bool>
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxButton: wxID_CANCEL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||dialog_orient_footprints"</string>
<string name="proxy-Id name">"wxID_CANCEL"</string>
<long name="proxy-Id value">5101</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_CloseButton"</string>
<string name="proxy-Label">"Cancel"</string>
<bool name="proxy-Default">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxBU_LEFT">0</bool>
<bool name="proxy-wxBU_RIGHT">0</bool>
<bool name="proxy-wxBU_TOP">0</bool>
<bool name="proxy-wxBU_BOTTOM">0</bool>
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
</document>
</document>
</document>
<document>
<string name="title">"Sources"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sourcesfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"dialog_orient_footprints.rc"</string>
<string name="type">"source-editor-document"</string>
<string name="filename">"dialog_orient_footprints.rc"</string>
<string name="icon-name">"source-editor"</string>
<long name="is-transient">0</long>
<long name="owns-file">0</long>
<long name="title-mode">1</long>
<long name="locked">0</long>
<string name="created">"11/7/2008"</string>
<string name="language">""</string>
</document>
</document>
<document>
<string name="title">"Images"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"bitmapsfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
</document>
</document>
</documents>
</anthemion-project>

View File

@ -1,258 +0,0 @@
/***************************************************************************/
/* Dialog editor for text on copper and technical layers (TEXTE_PCB class) */
/***************************************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "drawtxt.h"
#include "confirm.h"
#include "dialog_helpers.h"
enum id_TextPCB_properties {
ID_TEXTPCB_SELECT_LAYER = 1900
};
/************************************/
/* class WinEDA_TextPCBPropertiesFrame */
/************************************/
class WinEDA_TextPCBPropertiesFrame : public wxDialog
{
private:
WinEDA_PcbFrame* m_Parent;
wxDC* m_DC;
TEXTE_PCB* CurrentTextPCB;
WinEDA_EnterText* m_Name;
WinEDA_PositionCtrl* m_TxtPosCtrl;
WinEDA_SizeCtrl* m_TxtSizeCtrl;
WinEDA_ValueCtrl* m_TxtWidthCtlr;
wxRadioBox* m_Orient;
wxRadioBox* m_Mirror;
wxRadioBox* m_Style;
WinEDAChoiceBox* m_SelLayerBox;
public:
// Constructor and destructor
WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* parent,
TEXTE_PCB* TextPCB, wxDC* DC );
~WinEDA_TextPCBPropertiesFrame()
{
}
private:
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE( WinEDA_TextPCBPropertiesFrame, wxDialog )
EVT_BUTTON( wxID_OK, WinEDA_TextPCBPropertiesFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_TextPCBPropertiesFrame::OnCancelClick )
END_EVENT_TABLE()
void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC )
{
DrawPanel->m_IgnoreMouseEvents = TRUE;
WinEDA_TextPCBPropertiesFrame* frame =
new WinEDA_TextPCBPropertiesFrame( this, TextPCB, DC );
frame->ShowModal();
frame->Destroy();
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
}
WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* parent,
TEXTE_PCB* TextPCB,
wxDC* DC ) :
wxDialog( parent, -1, _( "PCB Text properties" ), wxDefaultPosition,
wxSize( 390, 340 ) )
{
wxButton* Button;
BOARD* board = parent->GetBoard();
m_Parent = parent;
m_DC = DC;
Centre();
CurrentTextPCB = TextPCB;
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( MainBoxSizer );
wxBoxSizer* LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* MiddleBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* RightBoxSizer = new wxBoxSizer( wxVERTICAL );
MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 );
MainBoxSizer->Add( MiddleBoxSizer, 0, wxGROW | wxALL, 5 );
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
/* Creation des boutons de commande */
Button = new wxButton( this, wxID_OK, _( "OK" ) );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button->SetDefault();
Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
m_Name = new WinEDA_EnterText( this, _( "Text:" ),
TextPCB->m_Text,
LeftBoxSizer, wxSize( 200, 60 ), true );
m_Name->SetFocus();
m_Name->SetSelection( -1, -1 );
m_TxtSizeCtrl = new WinEDA_SizeCtrl( this, _( "Size" ),
TextPCB->m_Size,
g_UserUnit, LeftBoxSizer,
m_Parent->m_InternalUnits );
m_TxtWidthCtlr = new WinEDA_ValueCtrl( this, _( "Width" ),
TextPCB->m_Width,
g_UserUnit, LeftBoxSizer,
m_Parent->m_InternalUnits );
m_TxtPosCtrl = new WinEDA_PositionCtrl( this, _( "Position" ),
TextPCB->m_Pos,
g_UserUnit, LeftBoxSizer,
m_Parent->m_InternalUnits );
m_SelLayerBox = new WinEDAChoiceBox( this, ID_TEXTPCB_SELECT_LAYER,
wxDefaultPosition, wxDefaultSize );
MiddleBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxALL, 5 );
for( int layer = 0; layer<NB_LAYERS; ++layer )
{
m_SelLayerBox->Append( board->GetLayerName( layer ) );
}
m_SelLayerBox->SetSelection( TextPCB->GetLayer() );
static const wxString orient_msg[4] =
{
wxT( "0" ), wxT( "90" ), wxT( "180" ), wxT( "-90" )
};
m_Orient = new wxRadioBox( this, -1, _( "Orientation" ), wxDefaultPosition,
wxSize( -1, -1 ), 4, orient_msg,
1, wxRA_SPECIFY_COLS );
MiddleBoxSizer->Add( m_Orient, 0, wxGROW | wxALL, 5 );
switch( TextPCB->m_Orient )
{
default:
m_Orient->SetSelection( 0 );
break;
case 900:
m_Orient->SetSelection( 1 );
break;
case 1800:
m_Orient->SetSelection( 2 );
break;
case 2700:
m_Orient->SetSelection( 3 );
break;
}
wxString display_msg[2] = { _( "Normal" ), _( "Mirror" ) };
m_Mirror = new wxRadioBox( this, -1, _( "Display" ), wxDefaultPosition,
wxSize( -1, -1 ), 2, display_msg,
1, wxRA_SPECIFY_COLS );
if( TextPCB->m_Mirror )
m_Mirror->SetSelection( 1 );
MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 );
int style = 0;
if( CurrentTextPCB->m_Italic )
style = 1;
wxString style_msg[] = { _( "Normal" ), _( "Italic" ) };
m_Style = new wxRadioBox( this, -1, _( "Style" ), wxDefaultPosition,
wxSize( -1, -1 ), 2, style_msg,
1, wxRA_SPECIFY_COLS );
m_Style->SetSelection( style );
MiddleBoxSizer->Add( m_Style, 0, wxGROW | wxALL, 5 );
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
}
void WinEDA_TextPCBPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) )
{
EndModal( wxID_CANCEL );
}
void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
{
// If no other command in progress, prepare undo command
// (for a command in progress, will be made later, at the completion of command)
if( CurrentTextPCB->m_Flags == 0 )
m_Parent->SaveCopyInUndoList( CurrentTextPCB, UR_CHANGED );
/* set flag in edit to force undo/redo/abort proper operation,
* and avoid new calls to SaveCopyInUndoList for the same text
* this can occurs when a text is moved, and then rotated, edited ..
*/
if( CurrentTextPCB->m_Flags != 0 )
CurrentTextPCB->m_Flags |= IN_EDIT;
// test for acceptable values for parameters:
wxSize newsize = m_TxtSizeCtrl->GetValue();
if( newsize.x < TEXTS_MIN_SIZE )
newsize.x = TEXTS_MIN_SIZE;
if( newsize.y < TEXTS_MIN_SIZE )
newsize.y = TEXTS_MIN_SIZE;
if( newsize.x > TEXTS_MAX_WIDTH )
newsize.x = TEXTS_MAX_WIDTH;
if( newsize.y > TEXTS_MAX_WIDTH )
newsize.y = TEXTS_MAX_WIDTH;
if( m_DC ) // Erase old text on screen
{
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
}
if( !m_Name->GetValue().IsEmpty() )
{
CurrentTextPCB->m_Text = m_Name->GetValue();
}
CurrentTextPCB->m_Pos = m_TxtPosCtrl->GetValue();
CurrentTextPCB->m_Size = newsize;
CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue();
// test for acceptable values for parameters:
int maxthickness = Clamp_Text_PenSize( CurrentTextPCB->m_Width, CurrentTextPCB->m_Size );
if( CurrentTextPCB->m_Width > maxthickness )
{
DisplayError(this, _("The text thickness is too large for the text size. It will be clamped"));
CurrentTextPCB->m_Width = maxthickness;
}
CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false;
CurrentTextPCB->m_Orient = m_Orient->GetSelection() * 900;
CurrentTextPCB->SetLayer( m_SelLayerBox->GetChoice() );
CurrentTextPCB->m_Italic = m_Style->GetSelection() ? 1 : 0;
if( m_DC ) // Display new text
{
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->OnModify();
EndModal( 1 );
}

View File

@ -14,7 +14,6 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "trigo.h"
#include "autorout.h"
#include "zones.h"
#include "dialog_copper_zones.h"

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
/**
* @file dialog_global_deletion.cpp
*/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "dialog_global_deletion.h"
DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( WinEDA_PcbFrame* parent )
: DIALOG_GLOBAL_DELETION_BASE( parent )
{
m_Parent = parent;
SetFocus();
GetSizer()->SetSizeHints(this);
Centre();
}
/********************************************************************/
void WinEDA_PcbFrame::InstallPcbGlobalDeleteFrame( const wxPoint& pos )
/********************************************************************/
{
DIALOG_GLOBAL_DELETION dlg( this );
dlg.ShowModal();
}
/***********************************************************************/
void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
/***********************************************************************/
{
bool gen_rastnest = false;
m_Parent->SetCurItem( NULL );
if( m_DelAlls->GetValue() )
{
m_Parent->Clear_Pcb( true );
}
else
{
if( !IsOK( this, _( "Ok to delete selected items ?" ) ) )
return;
BOARD * pcb = m_Parent->GetBoard();
PICKED_ITEMS_LIST pickersList;
ITEM_PICKER itemPicker( NULL, UR_DELETED );
BOARD_ITEM* item, * nextitem;
if( m_DelZones->GetValue() )
{
gen_rastnest = true;
/* ZEG_ZONE items used in Zone filling selection are now deprecated :
* and are deleted but not put in undo buffer if exist
*/
pcb->m_Zone.DeleteAll();
while( pcb->GetAreaCount() )
{
item = pcb->GetArea( 0 );
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
pcb->Remove( item );
}
}
int masque_layer = 0;
if( m_DelDrawings->GetValue() )
masque_layer = (~EDGE_LAYER) & 0x1FFF0000;
if( m_DelBoardEdges->GetValue() )
masque_layer |= EDGE_LAYER;
for( item = pcb->m_Drawings; item != NULL; item = nextitem )
{
nextitem = item->Next();
bool removeme = (g_TabOneLayerMask[ item->GetLayer()] & masque_layer) != 0;
if( ( item->Type() == TYPE_TEXTE ) && m_DelTexts->GetValue() )
removeme = true;
if( removeme )
{
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
if( m_DelModules->GetValue() )
{
gen_rastnest = true;
for( item = pcb->m_Modules; item; item = nextitem )
{
nextitem = item->Next();
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
if( m_DelTracks->GetValue() )
{
int track_mask_filter = 0;
if( !m_TrackFilterLocked->GetValue() )
track_mask_filter |= SEGM_FIXE;
if( !m_TrackFilterAR->GetValue() )
track_mask_filter |= SEGM_AR;
for( item = pcb->m_Track; item != NULL; item = nextitem )
{
nextitem = item->Next();
if( (item->GetState( SEGM_FIXE | SEGM_AR ) & track_mask_filter) != 0 )
continue;
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
gen_rastnest = true;
}
}
if( pickersList.GetCount() )
m_Parent->SaveCopyInUndoList( pickersList, UR_DELETED );
if( m_DelMarkers->GetValue() )
pcb->DeleteMARKERs();
if( gen_rastnest )
m_Parent->Compile_Ratsnest( NULL, true );
}
m_Parent->DrawPanel->Refresh();
m_Parent->OnModify();
EndModal( 1 );
}

View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_global_deletion.h
/////////////////////////////////////////////////////////////////////////////
#ifndef _DIALOG_GLOBAL_DELETION_H_
#define _DIALOG_GLOBAL_DELETION_H_
#include "dialog_global_deletion_base.h"
class DIALOG_GLOBAL_DELETION: public DIALOG_GLOBAL_DELETION_BASE
{
private:
WinEDA_PcbFrame * m_Parent;
public:
DIALOG_GLOBAL_DELETION( WinEDA_PcbFrame* parent );
private:
void OnOkClick( wxCommandEvent& event )
{
AcceptPcbDelete();
EndModal(wxID_OK);
}
void OnCancelClick( wxCommandEvent& event )
{
EndModal(wxID_CANCEL);
}
void AcceptPcbDelete();
};
#endif
// _DIALOG_GLOBAL_DELETION_H_

View File

@ -0,0 +1,90 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_global_deletion_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizerLeft;
sbSizerLeft = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Items to delete") ), wxVERTICAL );
m_DelZones = new wxCheckBox( this, wxID_ANY, _("Delete Zones"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelZones, 0, wxALL, 5 );
m_DelTexts = new wxCheckBox( this, wxID_ANY, _("Delete Texts"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelTexts, 0, wxALL, 5 );
m_DelBoardEdges = new wxCheckBox( this, wxID_ANY, _("Delete Board Outlines"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelBoardEdges, 0, wxALL, 5 );
m_DelDrawings = new wxCheckBox( this, wxID_ANY, _("Delete Drawings"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelDrawings, 0, wxALL, 5 );
m_DelModules = new wxCheckBox( this, wxID_ANY, _("Delete Modules"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelModules, 0, wxALL, 5 );
m_DelTracks = new wxCheckBox( this, wxID_ANY, _("Delete Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelTracks, 0, wxALL, 5 );
m_DelMarkers = new wxCheckBox( this, wxID_ANY, _("Delete Markers"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelMarkers, 0, wxALL, 5 );
m_DelAlls = new wxCheckBox( this, wxID_ANY, _("Clear Board"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_DelAlls, 0, wxALL, 5 );
bSizerMain->Add( sbSizerLeft, 1, wxEXPAND|wxALL, 5 );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerTrackFilter;
sbSizerTrackFilter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Track Filter") ), wxVERTICAL );
m_TrackFilterAR = new wxCheckBox( this, wxID_ANY, _("Include AutoRouted Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerTrackFilter->Add( m_TrackFilterAR, 0, wxALL, 5 );
m_TrackFilterLocked = new wxCheckBox( this, wxID_ANY, _("Include Locked Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerTrackFilter->Add( m_TrackFilterLocked, 0, wxALL, 5 );
bSizer2->Add( sbSizerTrackFilter, 0, wxALL|wxEXPAND, 5 );
bSizer2->Add( 0, 10, 0, 0, 5 );
m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
bSizer2->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( bSizer2, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this );
}
DIALOG_GLOBAL_DELETION_BASE::~DIALOG_GLOBAL_DELETION_BASE()
{
// Disconnect Events
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this );
}

View File

@ -0,0 +1,61 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_global_deletion_base__
#define __dialog_global_deletion_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GLOBAL_DELETION_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GLOBAL_DELETION_BASE : public wxDialog
{
private:
protected:
wxCheckBox* m_DelZones;
wxCheckBox* m_DelTexts;
wxCheckBox* m_DelBoardEdges;
wxCheckBox* m_DelDrawings;
wxCheckBox* m_DelModules;
wxCheckBox* m_DelTracks;
wxCheckBox* m_DelMarkers;
wxCheckBox* m_DelAlls;
wxCheckBox* m_TrackFilterAR;
wxCheckBox* m_TrackFilterLocked;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 365,242 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_DELETION_BASE();
};
#endif //__dialog_global_deletion_base__

View File

@ -0,0 +1,491 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="10" />
<object class="Project" expanded="1">
<property name="class_decoration" />
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_global_pads_edition_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">0</property>
<property name="name">dialog_global_pads_edition</property>
<property name="namespace" />
<property name="path">.</property>
<property name="precompiled_header" />
<property name="relative_path">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg" />
<property name="center" />
<property name="context_help" />
<property name="enabled">1</property>
<property name="extra_style" />
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">DIALOG_GLOBAL_PADS_EDITION_BASE</property>
<property name="pos" />
<property name="size">482,165</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass" />
<property name="title">Global Pads Edition</property>
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnActivate" />
<event name="OnActivateApp" />
<event name="OnChar" />
<event name="OnClose" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnHibernate" />
<event name="OnIconize" />
<event name="OnIdle" />
<event name="OnInitDialog" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size" />
<property name="name">bMainSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size" />
<property name="name">bLeftSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Pad Filter :</property>
<property name="minimum_size" />
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI" />
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg" />
<property name="checked">0</property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different shape</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_Pad_Shape_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnCheckBox" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg" />
<property name="checked">0</property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having different layers</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_Pad_Layer_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnCheckBox" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg" />
<property name="checked">0</property>
<property name="context_help" />
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different orientation</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_Pad_Orient_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnChar" />
<event name="OnCheckBox" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size" />
<property name="name">bRightSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<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="bg" />
<property name="context_help" />
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">ID_CHANGE_GET_PAD_SETTINGS</property>
<property name="label">Pad Editor</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_buttonPadEditor</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnButtonClick">InstallPadEditor</event>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag" />
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">10</property>
<property name="permission">protected</property>
<property name="width">10</property>
</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="bg" />
<property name="context_help" />
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">ID_CHANGE_CURRENT_MODULE</property>
<property name="label">Change Pads on Module</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_button2</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnButtonClick">PadPropertiesAccept</event>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</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="bg" />
<property name="context_help" />
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">ID_CHANGE_ID_MODULES</property>
<property name="label">Change Pads on Same Modules</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_button3</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnButtonClick">PadPropertiesAccept</event>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</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="bg" />
<property name="context_help" />
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg" />
<property name="font" />
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property>
<property name="maximum_size" />
<property name="minimum_size" />
<property name="name">m_button4</property>
<property name="permission">protected</property>
<property name="pos" />
<property name="size" />
<property name="style" />
<property name="subclass" />
<property name="tooltip" />
<property name="window_extra_style" />
<property name="window_name" />
<property name="window_style" />
<event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar" />
<event name="OnEnterWindow" />
<event name="OnEraseBackground" />
<event name="OnKeyDown" />
<event name="OnKeyUp" />
<event name="OnKillFocus" />
<event name="OnLeaveWindow" />
<event name="OnLeftDClick" />
<event name="OnLeftDown" />
<event name="OnLeftUp" />
<event name="OnMiddleDClick" />
<event name="OnMiddleDown" />
<event name="OnMiddleUp" />
<event name="OnMotion" />
<event name="OnMouseEvents" />
<event name="OnMouseWheel" />
<event name="OnPaint" />
<event name="OnRightDClick" />
<event name="OnRightDown" />
<event name="OnRightUp" />
<event name="OnSetFocus" />
<event name="OnSize" />
<event name="OnUpdateUI" />
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,168 @@
/**
* @file DIALOG_ORIENT_FOOTPRINTS.cpp
*/
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Jean_Pierre Charras <jp.charras@ujf-grenoble.fr>
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "fctsys.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "macros.h"
#include "dialog_orient_footprints_base.h"
/* DIALOG_ORIENT_FOOTPRINTS class declaration
*/
class DIALOG_ORIENT_FOOTPRINTS: public DIALOG_ORIENT_FOOTPRINTS_BASE
{
private:
WinEDA_PcbFrame * m_Parent;
static int newOrientation;
public:
DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent );
~DIALOG_ORIENT_FOOTPRINTS() {}
bool ApplyToLockedModules()
{
return m_ApplyToLocked->IsChecked();
}
int GetOrientation()
{
return newOrientation;
}
wxString GetFilter()
{
return m_FilterPattern->GetValue();
}
private:
void init();
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
int DIALOG_ORIENT_FOOTPRINTS::newOrientation = 0;
DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent )
: DIALOG_ORIENT_FOOTPRINTS_BASE( parent )
{
m_Parent = parent;
wxString txt;
txt.Printf(wxT("%g"), (double) newOrientation/10);
m_OrientationCtrl->SetValue(txt);
SetFocus( );
GetSizer()->SetSizeHints(this);
Centre();
}
/****************************************************************/
void WinEDA_PcbFrame::OnOrientFootprints( wxCommandEvent& event )
/****************************************************************/
/**
* Function OnOrientFootprints
* install the dialog box for the comman Orient Footprints
*/
{
DIALOG_ORIENT_FOOTPRINTS dlg(this);
if( dlg.ShowModal() != wxID_OK )
return;
wxString text = dlg.GetFilter();
if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) )
{
DrawPanel->Refresh();
Compile_Ratsnest( NULL, true );
}
}
/*******************************************************************/
bool 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
* @return true if some footprints modified, false if no change
*/
{
wxString line;
bool modified = false;
line.Printf( _( "Ok to set footprints orientation to %.1f degrees ?" ), (double)Orient / 10 );
if( !IsOK( this, line ) )
return false;
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 ) )
{
modified = true;
Rotate_Module( NULL, module, Orient, FALSE );
}
}
if ( modified )
OnModify();
return modified;
}
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;
}
newOrientation = wxRound(d_orient * 10);
NORMALIZE_ANGLE_180( newOrientation );
EndModal( wxID_OK );
}
void DIALOG_ORIENT_FOOTPRINTS::OnCancelClick( wxCommandEvent& event )
{
EndModal( wxID_CANCEL );
}

View File

@ -0,0 +1,78 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_orient_footprints_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_ORIENT_FOOTPRINTS_BASE::DIALOG_ORIENT_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerLeft;
bSizerLeft = new wxBoxSizer( wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bSizerLeft->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OrientationCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_OrientationCtrl->SetToolTip( _("New orientation (0.1 degree resolution)") );
bSizerLeft->Add( m_OrientationCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
bSizerLeft->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_FilterPattern = new wxTextCtrl( this, wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 );
m_FilterPattern->SetToolTip( _("Filter to select footprints by reference") );
bSizerLeft->Add( m_FilterPattern, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerLeft->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 );
m_ApplyToLocked = new wxCheckBox( this, wxID_ANY, _("Include Locked Footprints"), wxDefaultPosition, wxDefaultSize, 0 );
m_ApplyToLocked->SetToolTip( _("Force locked footprints to be modified") );
bSizerLeft->Add( m_ApplyToLocked, 0, wxALL, 5 );
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
bSizerRight->Add( m_buttonOK, 0, wxALL, 5 );
m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_buttonClose, 0, wxALL, 5 );
bSizerMain->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this );
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this );
}
DIALOG_ORIENT_FOOTPRINTS_BASE::~DIALOG_ORIENT_FOOTPRINTS_BASE()
{
// Disconnect Events
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this );
}

View File

@ -0,0 +1,57 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_orient_footprints_base__
#define __dialog_orient_footprints_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ORIENT_FOOTPRINTS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_ORIENT_FOOTPRINTS_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_staticText1;
wxTextCtrl* m_OrientationCtrl;
wxStaticText* m_staticText2;
wxTextCtrl* m_FilterPattern;
wxCheckBox* m_ApplyToLocked;
wxButton* m_buttonOK;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_ORIENT_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprints Orientation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 403,160 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ORIENT_FOOTPRINTS_BASE();
};
#endif //__dialog_orient_footprints_base__

View File

@ -0,0 +1,215 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2004-2010 Jean-Pierre Charras <jean-pierre.charras@gpisa-lab.inpg.fr>
* Copyright (C) 2010 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/***************************************************************************/
/* Dialog editor for text on copper and technical layers (TEXTE_PCB class) */
/***************************************************************************/
#include "dialog_pcb_text_properties.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "drawtxt.h"
#include "confirm.h"
#include "dialog_helpers.h"
/**
* DIALOG_PCB_TEXT_PROPERTIES, derived from DIALOG_PCB_TEXT_PROPERTIES_BASE
* @see dialog_dialog_pcb_text_properties_base.h and
* dialog_dialog_pcb_text_properties_base.cpp, automatically created by
* wxFormBuilder.
*/
DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( WinEDA_PcbFrame* parent, TEXTE_PCB* passedTextPCB, wxDC* DC )
: DIALOG_PCB_TEXT_PROPERTIES_BASE( parent )
{
m_Parent = parent;
m_DC = DC;
m_SelectedPCBText = passedTextPCB;
MyInit();
GetSizer()->SetSizeHints( this );
Centre();
}
/**
* Routine for main window class to launch text properties dialog.
*/
void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC )
{
DrawPanel->m_IgnoreMouseEvents = TRUE;
DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC );
dlg.ShowModal();
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
}
void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
{
SetFocus();
// Put units symbols to text labels where appropriate
AddUnitSymbol( *m_SizeXLabel );
AddUnitSymbol( *m_SizeYLabel );
AddUnitSymbol( *m_ThicknessLabel );
AddUnitSymbol( *m_PositionXLabel );
AddUnitSymbol( *m_PositionYLabel );
// Fill fields with current values
*m_TextContentCtrl << m_SelectedPCBText->m_Text;
PutValueInLocalUnits( *m_SizeXCtrl, m_SelectedPCBText->m_Size.x,
m_Parent->m_InternalUnits );
PutValueInLocalUnits( *m_SizeYCtrl, m_SelectedPCBText->m_Size.y,
m_Parent->m_InternalUnits );
PutValueInLocalUnits( *m_ThicknessCtrl, m_SelectedPCBText->m_Thickness,
m_Parent->m_InternalUnits );
PutValueInLocalUnits( *m_PositionXCtrl, m_SelectedPCBText->m_Pos.x,
m_Parent->m_InternalUnits );
PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->m_Pos.y,
m_Parent->m_InternalUnits );
for( int layer = 0; layer < NB_LAYERS; ++layer )
{
m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) );
}
m_LayerSelectionCtrl->SetSelection( m_SelectedPCBText->GetLayer() );
switch( m_SelectedPCBText->m_Orient )
{
default:
m_OrientationCtrl->SetSelection( 0 );
break;
case 900:
m_OrientationCtrl->SetSelection( 1 );
break;
case 1800:
m_OrientationCtrl->SetSelection( 2 );
break;
case 2700:
m_OrientationCtrl->SetSelection( 3 );
break;
}
if( m_SelectedPCBText->m_Mirror )
m_DisplayCtrl->SetSelection( 1 );
else
m_DisplayCtrl->SetSelection( 0 );
if( m_SelectedPCBText->m_Italic )
m_StyleCtrl->SetSelection( 1 );
else
m_StyleCtrl->SetSelection( 0 );
// Set focus on most important control
m_TextContentCtrl->SetFocus();
m_TextContentCtrl->SetSelection( -1, -1 );
}
void DIALOG_PCB_TEXT_PROPERTIES::OnCancelClick( wxCommandEvent& event )
{
EndModal( wxID_CANCEL );
}
void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
{
wxPoint newPosition;
wxSize newSize;
// If no other command in progress, prepare undo command
// (for a command in progress, will be made later, at the completion of command)
if( m_SelectedPCBText->m_Flags == 0 )
m_Parent->SaveCopyInUndoList( m_SelectedPCBText, UR_CHANGED );
/* set flag in edit to force undo/redo/abort proper operation,
* and avoid new calls to SaveCopyInUndoList for the same text
* this can occurs when a text is moved, and then rotated, edited ..
*/
if( m_SelectedPCBText->m_Flags != 0 )
m_SelectedPCBText->m_Flags |= IN_EDIT;
// Erase old text on screen if context is available
if( m_DC )
{
m_SelectedPCBText->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
}
// Set the new text content
if( !m_TextContentCtrl->GetValue().IsEmpty() )
{
m_SelectedPCBText->m_Text = m_TextContentCtrl->GetValue();
}
// Set PCB Text position
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(), m_Parent->m_InternalUnits );
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(), m_Parent->m_InternalUnits );
m_SelectedPCBText->m_Pos = newPosition;
// Check constraints and set PCB Text size
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->m_InternalUnits );
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->m_InternalUnits );
if( newSize.x < TEXTS_MIN_SIZE )
newSize.x = TEXTS_MIN_SIZE;
if( newSize.y < TEXTS_MIN_SIZE )
newSize.y = TEXTS_MIN_SIZE;
if( newSize.x > TEXTS_MAX_WIDTH )
newSize.x = TEXTS_MAX_WIDTH;
if( newSize.y > TEXTS_MAX_WIDTH )
newSize.y = TEXTS_MAX_WIDTH;
m_SelectedPCBText->m_Size = newSize;
// Set the new thickness
m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue(), m_Parent->m_InternalUnits );
// Test for acceptable values for thickness and size and clamp if fails
int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->m_Thickness, m_SelectedPCBText->m_Size );
if( m_SelectedPCBText->m_Thickness > maxthickness )
{
DisplayError(this, _("The text thickness is too large for the text size. It will be clamped"));
m_SelectedPCBText->m_Thickness = maxthickness;
}
// Set the layer on which the PCB text is laying
m_SelectedPCBText->SetLayer( m_LayerSelectionCtrl->GetSelection() );
// Set whether the PCB text is mirrored (faced down from layer face perspective)
m_SelectedPCBText->m_Mirror = (m_DisplayCtrl->GetSelection() == 1) ? true : false;
// Set the text orientation
m_SelectedPCBText->m_Orient = m_OrientationCtrl->GetSelection() * 900;
// Set whether the PCB text is slanted (it is not italics, as italics has additional curves in style)
m_SelectedPCBText->m_Italic = m_StyleCtrl->GetSelection() ? 1 : 0;
// Finally, display new text if there is a context to do so
if( m_DC )
{
m_SelectedPCBText->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->OnModify();
EndModal( 1 );
}

View File

@ -0,0 +1,38 @@
#ifndef __dialog_pcb_text_properties__
#define __dialog_pcb_text_properties__
/**
@file
Subclass of DIALOG_PCB_TEXT_PROPERTIES_BASE, which is generated by wxFormBuilder.
*/
#include "dialog_pcb_text_properties_base.h"
//// end generated include
class WinEDA_PcbFrame;
class wxDC;
class TEXTE_PCB;
/** Implementing DIALOG_PCB_TEXT_PROPERTIES_BASE */
class DIALOG_PCB_TEXT_PROPERTIES : public DIALOG_PCB_TEXT_PROPERTIES_BASE
{
private:
WinEDA_PcbFrame* m_Parent;
wxDC* m_DC;
TEXTE_PCB* m_SelectedPCBText;
void MyInit();
protected:
// Handlers for DIALOG_PCB_TEXT_PROPERTIES_BASE events.
void OnCancelClick( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
public:
DIALOG_PCB_TEXT_PROPERTIES( WinEDA_PcbFrame* parent, TEXTE_PCB* passedTextPCB, wxDC* DC );
//// end generated class members
};
#endif // __dialog_pcb_text_properties__

View File

@ -0,0 +1,132 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_pcb_text_properties_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_TextLabel = new wxStaticText( this, wxID_ANY, _("Text content:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextLabel->Wrap( -1 );
bMainSizer->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_TextContentCtrl->SetToolTip( _("Enter the text placed on selected layer.") );
m_TextContentCtrl->SetMinSize( wxSize( 400,60 ) );
bMainSizer->Add( m_TextContentCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxBoxSizer* bSizerLower;
bSizerLower = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerLeft;
bSizerLeft = new wxBoxSizer( wxVERTICAL );
m_SizeXLabel = new wxStaticText( this, wxID_ANY, _("Size X"), wxDefaultPosition, wxDefaultSize, 0 );
m_SizeXLabel->Wrap( -1 );
bSizerLeft->Add( m_SizeXLabel, 0, wxRIGHT|wxLEFT, 5 );
m_SizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_SizeXCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_SizeYLabel = new wxStaticText( this, wxID_ANY, _("Size Y"), wxDefaultPosition, wxDefaultSize, 0 );
m_SizeYLabel->Wrap( -1 );
bSizerLeft->Add( m_SizeYLabel, 0, wxRIGHT|wxLEFT, 5 );
m_SizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_SizeYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ThicknessLabel = new wxStaticText( this, wxID_ANY, _("Thickness"), wxDefaultPosition, wxDefaultSize, 0 );
m_ThicknessLabel->Wrap( -1 );
bSizerLeft->Add( m_ThicknessLabel, 0, wxRIGHT|wxLEFT, 5 );
m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_ThicknessCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_PositionXLabel = new wxStaticText( this, wxID_ANY, _("Position X"), wxDefaultPosition, wxDefaultSize, 0 );
m_PositionXLabel->Wrap( -1 );
bSizerLeft->Add( m_PositionXLabel, 0, wxRIGHT|wxLEFT, 5 );
m_PositionXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_PositionXCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_PositionYLabel = new wxStaticText( this, wxID_ANY, _("Position Y"), wxDefaultPosition, wxDefaultSize, 0 );
m_PositionYLabel->Wrap( -1 );
bSizerLeft->Add( m_PositionYLabel, 0, wxRIGHT|wxLEFT, 5 );
m_PositionYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_PositionYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerLabel->Wrap( -1 );
bSizerLeft->Add( m_LayerLabel, 0, wxRIGHT|wxLEFT, 5 );
wxArrayString m_LayerSelectionCtrlChoices;
m_LayerSelectionCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlChoices, 0 );
m_LayerSelectionCtrl->SetSelection( 0 );
m_LayerSelectionCtrl->SetToolTip( _("Select the layer on which text should lay.") );
bSizerLeft->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerLower->Add( bSizerLeft, 1, 0, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
wxString m_OrientationCtrlChoices[] = { _("0"), _("90"), _("180"), _("-90") };
int m_OrientationCtrlNChoices = sizeof( m_OrientationCtrlChoices ) / sizeof( wxString );
m_OrientationCtrl = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientationCtrlNChoices, m_OrientationCtrlChoices, 2, wxRA_SPECIFY_COLS );
m_OrientationCtrl->SetSelection( 0 );
bSizerRight->Add( m_OrientationCtrl, 0, wxALL|wxEXPAND, 3 );
wxString m_StyleCtrlChoices[] = { _("Normal"), _("Italic") };
int m_StyleCtrlNChoices = sizeof( m_StyleCtrlChoices ) / sizeof( wxString );
m_StyleCtrl = new wxRadioBox( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, m_StyleCtrlNChoices, m_StyleCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_StyleCtrl->SetSelection( 0 );
bSizerRight->Add( m_StyleCtrl, 0, wxALL|wxEXPAND, 3 );
wxString m_DisplayCtrlChoices[] = { _("Normal"), _("Mirror") };
int m_DisplayCtrlNChoices = sizeof( m_DisplayCtrlChoices ) / sizeof( wxString );
m_DisplayCtrl = new wxRadioBox( this, wxID_ANY, _("Display"), wxDefaultPosition, wxDefaultSize, m_DisplayCtrlNChoices, m_DisplayCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_DisplayCtrl->SetSelection( 0 );
bSizerRight->Add( m_DisplayCtrl, 0, wxALL|wxEXPAND, 3 );
bSizerLower->Add( bSizerRight, 0, 0, 5 );
bMainSizer->Add( bSizerLower, 0, wxEXPAND, 5 );
m_StandardSizer = new wxStdDialogButtonSizer();
m_StandardSizerOK = new wxButton( this, wxID_OK );
m_StandardSizer->AddButton( m_StandardSizerOK );
m_StandardSizerCancel = new wxButton( this, wxID_CANCEL );
m_StandardSizer->AddButton( m_StandardSizerCancel );
m_StandardSizer->Realize();
bMainSizer->Add( m_StandardSizer, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_StandardSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this );
m_StandardSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this );
}
DIALOG_PCB_TEXT_PROPERTIES_BASE::~DIALOG_PCB_TEXT_PROPERTIES_BASE()
{
// Disconnect Events
m_StandardSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this );
m_StandardSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_pcb_text_properties_base__
#define __dialog_pcb_text_properties_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PCB_TEXT_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PCB_TEXT_PROPERTIES_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_TextLabel;
wxTextCtrl* m_TextContentCtrl;
wxStaticText* m_SizeXLabel;
wxTextCtrl* m_SizeXCtrl;
wxStaticText* m_SizeYLabel;
wxTextCtrl* m_SizeYCtrl;
wxStaticText* m_ThicknessLabel;
wxTextCtrl* m_ThicknessCtrl;
wxStaticText* m_PositionXLabel;
wxTextCtrl* m_PositionXCtrl;
wxStaticText* m_PositionYLabel;
wxTextCtrl* m_PositionYCtrl;
wxStaticText* m_LayerLabel;
wxChoice* m_LayerSelectionCtrl;
wxRadioBox* m_OrientationCtrl;
wxRadioBox* m_StyleCtrl;
wxRadioBox* m_DisplayCtrl;
wxStdDialogButtonSizer* m_StandardSizer;
wxButton* m_StandardSizerOK;
wxButton* m_StandardSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text item properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 433,465 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_PCB_TEXT_PROPERTIES_BASE();
};
#endif //__dialog_pcb_text_properties_base__

View File

@ -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( );

View File

@ -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"

View File

@ -165,7 +165,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
TextePcb->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize;
TextePcb->m_Pos = GetScreen()->m_Curseur;
TextePcb->m_Width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth;
TextePcb->m_Thickness = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth;
InstallTextPCBOptionsFrame( TextePcb, DC );
if( TextePcb->m_Text.IsEmpty() )

View File

@ -49,7 +49,7 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
MIN( g_ModuleTextSize.x,
g_ModuleTextSize.y ), true );
Text->m_Size = g_ModuleTextSize;
Text->m_Width = g_ModuleTextWidth;
Text->m_Thickness = g_ModuleTextWidth;
Text->m_Pos = GetScreen()->m_Curseur;
Text->SetLocalCoord();

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"

View File

@ -58,10 +58,10 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
* displayed on the screen.
* Name The name of the element, usually the reference designator.
* Value The value of the element.
* MX MY The location of the elements mark. This is the reference point for placing the element and its pins and pads.
* MX MY The location of the element<EFBFBD>s mark. This is the reference point for placing the element and its pins and pads.
* TX TY The upper left corner of the text (one of the three strings).
* TDir The relative direction of the text. 0 means left to right for an unrotated element, 1 means up, 2 left, 3 down.
* TScale Size of the text, as a percentage of the default size of of the font (the default font is about 40 mils high). Default is 100 (40 mils).
* TScale Size of the text, as a percentage of the <EFBFBD>default<EFBFBD> size of of the font (the default font is about 40 mils high). Default is 100 (40 mils).
* TSFlags Symbolic or numeric flags, for the text.
* TNFlags Numeric flags, for the text.
*
@ -227,10 +227,10 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
// real size is: default * ibuf[5] / 100 (size in gpcb is given in percent of defalut size
ibuf[5] *= TEXT_DEFAULT_SIZE; ibuf[5] /= 100;
m_Reference->m_Size.x = m_Reference->m_Size.y = MAX( 20, ibuf[5] );
m_Reference->m_Width = m_Reference->m_Size.x / 10;
m_Reference->m_Thickness = m_Reference->m_Size.x / 10;
m_Value->m_Orient = m_Reference->m_Orient;
m_Value->m_Size = m_Reference->m_Size;
m_Value->m_Width = m_Reference->m_Width;
m_Value->m_Thickness = m_Reference->m_Thickness;
while( GetLine( cmpfile, Line, &NbLine, sizeof(Line) - 1 ) != NULL )
{

View File

@ -12,132 +12,7 @@
#include "module_editor_frame.h"
#include "class_board_design_settings.h"
#include "protos.h"
/**************************************/
/* dialog WinEDA_PcbGlobalDeleteFrame */
/**************************************/
#include "dialog_initpcb.cpp"
/********************************************************************/
void WinEDA_PcbFrame::InstallPcbGlobalDeleteFrame( const wxPoint& pos )
/********************************************************************/
{
WinEDA_PcbGlobalDeleteFrame* frame =
new WinEDA_PcbGlobalDeleteFrame( this );
frame->ShowModal(); frame->Destroy();
}
/***********************************************************************/
void WinEDA_PcbGlobalDeleteFrame::AcceptPcbDelete( wxCommandEvent& event )
/***********************************************************************/
{
bool gen_rastnest = false;
m_Parent->SetCurItem( NULL );
if( m_DelAlls->GetValue() )
{
m_Parent->Clear_Pcb( true );
}
else
{
if( !IsOK( this, _( "Ok to delete selected items ?" ) ) )
return;
BOARD * pcb = m_Parent->GetBoard();
PICKED_ITEMS_LIST pickersList;
ITEM_PICKER itemPicker( NULL, UR_DELETED );
BOARD_ITEM* item, * nextitem;
if( m_DelZones->GetValue() )
{
gen_rastnest = true;
/* ZEG_ZONE items used in Zone filling selection are now deprecated :
* and are deleted but not put in undo buffer if exist
*/
pcb->m_Zone.DeleteAll();
while( pcb->GetAreaCount() )
{
item = pcb->GetArea( 0 );
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
pcb->Remove( item );
}
}
int masque_layer = 0;
if( m_DelDrawings->GetValue() )
masque_layer = (~EDGE_LAYER) & 0x1FFF0000;
if( m_DelEdges->GetValue() )
masque_layer |= EDGE_LAYER;
for( item = pcb->m_Drawings; item != NULL; item = nextitem )
{
nextitem = item->Next();
bool removeme = (g_TabOneLayerMask[ item->GetLayer()] & masque_layer) != 0;
if( ( item->Type() == TYPE_TEXTE ) && m_DelTexts->GetValue() )
removeme = true;
if( removeme )
{
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
if( m_DelModules->GetValue() )
{
gen_rastnest = true;
for( item = pcb->m_Modules; item; item = nextitem )
{
nextitem = item->Next();
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
if( m_DelTracks->GetValue() )
{
int track_mask_filter = 0;
if( !m_TrackFilterLocked->GetValue() )
track_mask_filter |= SEGM_FIXE;
if( !m_TrackFilterAR->GetValue() )
track_mask_filter |= SEGM_AR;
for( item = pcb->m_Track; item != NULL; item = nextitem )
{
nextitem = item->Next();
if( (item->GetState( SEGM_FIXE | SEGM_AR ) & track_mask_filter) != 0 )
continue;
itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker );
item->UnLink();
gen_rastnest = true;
}
}
if( pickersList.GetCount() )
m_Parent->SaveCopyInUndoList( pickersList, UR_DELETED );
if( m_DelMarkers->GetValue() )
pcb->DeleteMARKERs();
if( gen_rastnest )
m_Parent->Compile_Ratsnest( NULL, true );
}
m_Parent->DrawPanel->Refresh();
m_Parent->OnModify();
EndModal( 1 );
}
//#include "protos.h"
/**

View File

@ -13,7 +13,6 @@
#include "class_board_design_settings.h"
#ifdef PCBNEW
#include "autorout.h"
#include "zones.h"
#endif

View File

@ -532,11 +532,11 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( const wxString& name,
Module->m_Value->m_Size = wxSize( DEFAULT_SIZE, DEFAULT_SIZE );
Module->m_Value->m_Pos0.y = -DEFAULT_SIZE;
Module->m_Value->m_Pos.y += Module->m_Value->m_Pos0.y;
Module->m_Value->m_Width = DEFAULT_SIZE / 4;
Module->m_Value->m_Thickness = DEFAULT_SIZE / 4;
Module->m_Reference->m_Size = wxSize( DEFAULT_SIZE, DEFAULT_SIZE );
Module->m_Reference->m_Pos0.y = DEFAULT_SIZE;
Module->m_Reference->m_Pos.y += Module->m_Reference->m_Pos0.y;
Module->m_Reference->m_Width = DEFAULT_SIZE / 4;
Module->m_Reference->m_Thickness = DEFAULT_SIZE / 4;
/* Create 2 pads used in gaps and stubs.
* The gap is between these 2 pads

View File

@ -233,6 +233,9 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
ID_POPUP_PCB_AUTOPLACE_END_RANGE,
WinEDA_PcbFrame::AutoPlace )
EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES,
WinEDA_PcbFrame::OnOrientFootprints )
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions )
@ -253,11 +256,11 @@ END_EVENT_TABLE()
///////****************************///////////:
WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* parent,
const wxString& title,
const wxPoint& pos, const wxSize& size,
long style ) :
WinEDA_BasePcbFrame( father, PCB_FRAME, title, pos, size, style )
WinEDA_BasePcbFrame( parent, PCB_FRAME, title, pos, size, style )
{
m_FrameName = wxT( "PcbFrame" );
m_Draw_Sheet_Ref = true; // true to display sheet references

View File

@ -187,9 +187,6 @@ enum pcbnew_ids
ID_POPUP_PCB_AUTOMOVE_ALL_MODULES,
ID_POPUP_PCB_AUTOMOVE_NEW_MODULES,
ID_POPUP_PCB_AUTOPLACE_COMMANDS,
ID_POPUP_PCB_REORIENT_ALL_MODULES,
ID_POPUP_PCB_AUTOPLACE_ALL_MODULES,
ID_POPUP_PCB_AUTOPLACE_NEW_MODULES,
ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE,
@ -204,6 +201,8 @@ enum pcbnew_ids
ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS,
ID_POPUP_PCB_AUTOPLACE_END_RANGE,
ID_POPUP_PCB_REORIENT_ALL_MODULES,
ID_MENU_RECOVER_BOARD,
ID_MENU_READ_LAST_SAVED_VERSION_BOARD,
ID_MENU_ARCHIVE_MODULES,

Some files were not shown because too many files have changed in this diff Show More