Commit b8a6c53b authored by charras's avatar charras

Some minor changes and enhancements

parent e8cb60f9
......@@ -8,7 +8,7 @@
#include "appl_wxstruct.h"
#define BUILD_VERSION "(20091021-unstable)"
#define BUILD_VERSION "(20091024-unstable)"
#ifdef HAVE_SVN_VERSION
......
......@@ -97,15 +97,25 @@ WinEDAListBox::WinEDAListBox( WinEDA_DrawFrame* parent, const wxString& title,
{
Centre();
}
else // Ensure the window dialog is on screen :
else // Ensure the window dialog is inside the main window :
{
wxPoint pos;
m_Parent->GetPosition( &pos.x, &pos.y );
if( pos.x < 0 )
pos.x = 0;
if( pos.y < 0 )
pos.y = 0;
pos.x += 20; pos.y += 30;
wxPoint pos = dialog_position;
wxPoint maxpos;
maxpos.x = parent->GetPosition().x + parent->GetSize().x;
maxpos.y = parent->GetPosition().y + parent->GetSize().y;
wxPoint endpoint;
endpoint.x = pos.x + GetSize().x;
endpoint.y = pos.y + GetSize().y;
if( endpoint.x > maxpos.x )
pos.x -= endpoint.x - maxpos.x;
if( endpoint.y > maxpos.y )
pos.y -= endpoint.y - maxpos.y;
if( pos.x < parent->GetPosition().x )
pos.x = parent->GetPosition().x;
if( pos.y < parent->GetPosition().y )
pos.y = parent->GetPosition().y;
Move( pos );
}
}
......
......@@ -88,9 +88,9 @@ void WinEDA_CvpcbFrame::BuildCmpListBox()
BOOST_FOREACH( COMPONENT & component, m_components ) {
msg.Printf( CMP_FORMAT, m_ListCmp->GetCount() + 1,
component.m_Reference.GetData(),
component.m_Value.GetData(),
component.m_Module.GetData() );
GetChars(component.m_Reference),
GetChars(component.m_Value),
GetChars(component.m_Module) );
m_ListCmp->m_ComponentList.Add( msg );
}
......
......@@ -931,13 +931,18 @@ bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
}
/* Test for duplicate pins:
/* Test for duplicate pins and off grid pins:
* Pins are considered off grid when they are not on the 25 mils grid
* A grid smaller than 25 mils must be used only to build graphic shapes.
*/
void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
{
int error;
#define MIN_GRID_SIZE 25
int dup_error;
int offgrid_error;
LIB_PIN* Pin;
wxString msg;
wxString aux_msg;
if( m_component == NULL )
return;
......@@ -962,13 +967,11 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
sort( PinList.begin(), PinList.end(), sort_by_pin_number );
// Test for duplicates:
error = 0;
DIALOG_DISPLAY_HTML_TEXT_BASE
error_display( this, wxID_ANY, _( "Marker Info" ),
dup_error = 0;
DIALOG_DISPLAY_HTML_TEXT_BASE error_display( this, wxID_ANY, _( "Marker Info" ),
wxDefaultPosition, wxSize( 750, 600 ) );
for( unsigned ii = 1; ii < PinList.size(); ii++ )
{
wxString aux_msg;
wxString stringPinNum, stringCurrPinNum;
LIB_PIN* curr_pin = PinList[ii];
......@@ -979,7 +982,7 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
|| Pin->m_Unit != curr_pin->m_Unit )
continue;
error++;
dup_error++;
Pin->ReturnPinStringNum( stringPinNum );
curr_pin->ReturnPinStringNum( stringCurrPinNum );
msg.Printf( _(
......@@ -1007,12 +1010,50 @@ with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>"
}
msg += wxT( ".<br>" );
error_display.m_htmlWindow->AppendToPage( msg );
}
// Test for off grid pins:
offgrid_error = 0;
for( unsigned ii = 0; ii < PinList.size(); ii++ )
{
Pin = PinList[ii];
if( ( (Pin->m_Pos.x % MIN_GRID_SIZE) == 0 ) &&
( (Pin->m_Pos.y % MIN_GRID_SIZE) == 0 ) )
continue;
// A pin is foun here off grid
offgrid_error++;
wxString stringPinNum;
Pin->ReturnPinStringNum( stringPinNum );
msg.Printf( _( "<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>" ),
GetChars( stringPinNum ),
GetChars( Pin->m_PinName ),
(float) Pin->m_Pos.x / 1000.0, (float) -Pin->m_Pos.y / 1000.0
);
if( m_component->GetPartCount() > 1 )
{
aux_msg.Printf( _( " in part %c" ), 'A' + Pin->m_Unit );
msg += aux_msg;
}
if( m_showDeMorgan )
{
if( Pin->m_Convert )
msg += _( " of converted" );
else
msg += _( " of normal" );
}
msg += wxT( ".<br>" );
error_display.m_htmlWindow->AppendToPage( msg );
}
if( error == 0 )
DisplayInfoMessage( this, _( "No duplicate pins were found." ) );
if( !dup_error && !offgrid_error )
DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) );
else
error_display.ShowModal();
}
......@@ -153,7 +153,7 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_CHECK_PART, wxEmptyString,
wxBitmap( erc_xpm ), _( "Test for duplicate pins" ) );
wxBitmap( erc_xpm ), _( "Test for duplicate pins and off grid pins" ) );
m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Libedit_Hokeys_Descr, HK_ZOOM_IN );
......
No preview for this file type
This diff is collapsed.
......@@ -266,16 +266,16 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
if( fillpad )
{
GRFillCSegm( &panel->m_ClipBox, DC,
ux0 + delta_cx + mask_margin, uy0 + delta_cy + mask_margin,
ux0 - delta_cx - mask_margin, uy0 - delta_cy - mask_margin,
rotdx, color );
ux0 + delta_cx, uy0 + delta_cy,
ux0 - delta_cx, uy0 - delta_cy,
rotdx + mask_margin, color );
}
else
{
GRCSegm( &panel->m_ClipBox, DC,
ux0 + delta_cx + mask_margin, uy0 + delta_cy + mask_margin,
ux0 - delta_cx - mask_margin, uy0 - delta_cy - mask_margin,
rotdx, color );
ux0 + delta_cx, uy0 + delta_cy,
ux0 - delta_cx, uy0 - delta_cy,
rotdx + mask_margin, color );
}
/* Trace de la marge d'isolement */
......@@ -293,20 +293,20 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
case PAD_TRAPEZOID:
{
int ddx, ddy;
ddx = (m_DeltaSize.x >> 1) + mask_margin;
ddy = (m_DeltaSize.y >> 1) + mask_margin; /* demi dim dx et dy */
ddx = (m_DeltaSize.x >> 1);
ddy = (m_DeltaSize.y >> 1); /* demi dim dx et dy */
coord[0].x = -dx - ddy;
coord[0].y = +dy + ddx;
coord[0].x = -dx - ddy - mask_margin;
coord[0].y = +dy + ddx + mask_margin;
coord[1].x = -dx + ddy;
coord[1].y = -dy - ddx;
coord[1].x = -dx + ddy - mask_margin;
coord[1].y = -dy - ddx - mask_margin;
coord[2].x = +dx - ddy;
coord[2].y = -dy + ddx;
coord[2].x = +dx - ddy + mask_margin;
coord[2].y = -dy + ddx - mask_margin;
coord[3].x = +dx + ddy;
coord[3].y = +dy - ddx;
coord[3].x = +dx + ddy + mask_margin;
coord[3].y = +dy - ddx + mask_margin;
for( ii = 0; ii < 4; ii++ )
{
......
......@@ -91,6 +91,7 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
Layout();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
Center();
}
......
......@@ -659,6 +659,8 @@ DialogLayerSetup::DialogLayerSetup( WinEDA_PcbFrame* parent, const wxPoint& pos,
m_LayerEnabledCheckBox[i]->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledKillFocus ), NULL, this );
m_LayerEnabledCheckBox[i]->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledSetFocus ), NULL, this );
}
Centre();
}
//==============================================================================
......
......@@ -362,7 +362,8 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List(
WinEDAListBox* ListBox = new WinEDAListBox( active_window, wxEmptyString,
NULL, OldName, DisplayCmpDoc,
wxColour( 200, 200, 255 ),GetScreen()->m_Curseur );
wxColour( 200, 200, 255 ),
GetComponentDialogPosition());
wxBeginBusyCursor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment