Commit 0c0b2a40 authored by charras's avatar charras

Pcbnew: allows autopan when editin or creating a zone

parent 31e3e985
......@@ -113,7 +113,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
if( !GetBoard() )
return;
bool erase;
bool erase = false;
int Color;
bool filled;
......
This diff is collapsed.
......@@ -96,8 +96,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
if( aTrack == NULL ) /* Starting a new track */
{
D(printf("Begin_Route NULL\n");)
/* erase old highlight */
OldNetCodeSurbrillance = g_HightLigth_NetCode;
OldEtatSurbrillance = g_HightLigt_Status;
......@@ -148,10 +146,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
Hight_Light( DC );
/* done above
g_CurrentTrackSegment->m_Flags = IS_NEW;
*/
g_CurrentTrackSegment->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
......@@ -205,8 +199,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
}
else /* Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor*/
{
D(printf("Begin_Route in progress\n");)
/* Tst for a D.R.C. error: */
if( Drc_On )
{
......
......@@ -30,7 +30,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( (m_ID_current_state == 0) || ( DrawStruct && DrawStruct->m_Flags ) )
{
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress
{
DrawPanel->m_IgnoreMouseEvents = TRUE;
......@@ -40,7 +40,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{
case TYPE_ZONE_CONTAINER:
if ( (DrawStruct->m_Flags & IS_NEW) )
{
DrawPanel->m_AutoPAN_Request = true;
Begin_Zone( DC );
}
else
End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct );
exit = true;
......@@ -98,7 +101,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break;
}
DrawPanel->m_IgnoreMouseEvents = FALSE;
DrawPanel->m_IgnoreMouseEvents = false;
DrawPanel->CursorOn( DC );
if ( exit ) return;
}
......@@ -225,6 +228,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{
if ( Begin_Zone( DC ) )
{
DrawPanel->m_AutoPAN_Request = true;
DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct );
}
......@@ -233,6 +237,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&& (DrawStruct->Type() == TYPE_ZONE_CONTAINER)
&& (DrawStruct->m_Flags & IS_NEW) )
{
DrawPanel->m_AutoPAN_Request = true;
Begin_Zone( DC );
DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct );
......@@ -251,7 +256,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else if( DrawStruct->Type() == TYPE_TEXTE )
{
Place_Texte_Pcb( (TEXTE_PCB*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
}
else
DisplayError( this, wxT( "Internal err: Struct not TYPE_TEXTE" ) );
......@@ -269,7 +274,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else if( DrawStruct->Type() == TYPE_MODULE )
{
Place_Module( (MODULE*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
}
else
DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) );
......@@ -363,7 +368,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct->m_Flags & IS_NEW )
{
End_Route( (TRACK*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
}
else if( DrawStruct->m_Flags == 0 )
{
......@@ -421,14 +426,14 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) )
{
End_Route( (TRACK*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
}
break;
case ID_PCB_ZONES_BUTT:
if ( End_Zone( DC ) )
{
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
SetCurItem( NULL );
}
break;
......@@ -441,13 +446,13 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct->Type() != TYPE_DRAWSEGMENT )
{
DisplayError( this, wxT( "DrawStruct Type error" ) );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
break;
}
if( (DrawStruct->m_Flags & IS_NEW) )
{
End_Edge( (DRAWSEGMENT*) DrawStruct, &dc );
DrawPanel->m_AutoPAN_Request = FALSE;
DrawPanel->m_AutoPAN_Request = false;
SetCurItem( NULL );
}
break;
......
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