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 ...@@ -113,7 +113,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
if( !GetBoard() ) if( !GetBoard() )
return; return;
bool erase; bool erase = false;
int Color; int Color;
bool filled; bool filled;
......
...@@ -168,7 +168,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -168,7 +168,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
switch( id ) // Execute command switch( id ) // Execute command
{ {
case ID_EXIT: case ID_EXIT:
Close( TRUE ); Close( true );
break; break;
case ID_OPEN_MODULE_EDITOR: case ID_OPEN_MODULE_EDITOR:
...@@ -179,11 +179,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -179,11 +179,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
_( "Module Editor" ), _( "Module Editor" ),
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( 600, 400 ) ); wxSize( 600, 400 ) );
m_ModuleEditFrame->Show( TRUE ); m_ModuleEditFrame->Show( true );
m_ModuleEditFrame->Zoom_Automatique( TRUE ); m_ModuleEditFrame->Zoom_Automatique( true );
} }
else else
m_ModuleEditFrame->Iconize( FALSE ); m_ModuleEditFrame->Iconize( false );
break; break;
case ID_NEW_PROJECT: case ID_NEW_PROJECT:
...@@ -197,14 +197,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -197,14 +197,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_MOVE; GetScreen()->BlockLocate.m_Command = BLOCK_MOVE;
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY; GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
GetScreen()->BlockLocate.SetMessageBlock( this ); GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
...@@ -259,7 +259,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -259,7 +259,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DisplayTrackSettings(); DisplayTrackSettings();
if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
{ {
Compile_Ratsnest( &dc, TRUE ); Compile_Ratsnest( &dc, true );
} }
break; break;
...@@ -308,7 +308,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -308,7 +308,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_PCB_SHOW_1_RATSNEST_BUTT: case ID_PCB_SHOW_1_RATSNEST_BUTT:
SetToolID( id, wxCURSOR_HAND, _( "Local Ratsnest" ) ); SetToolID( id, wxCURSOR_HAND, _( "Local Ratsnest" ) );
if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
Compile_Ratsnest( &dc, TRUE ); Compile_Ratsnest( &dc, true );
break; break;
case ID_POPUP_CLOSE_CURRENT_TOOL: case ID_POPUP_CLOSE_CURRENT_TOOL:
...@@ -354,11 +354,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -354,11 +354,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if( GetCurItem() == NULL ) if( GetCurItem() == NULL )
break; break;
{ {
bool resize_vias = TRUE, resize_track = TRUE; bool resize_vias = true, resize_track = true;
if( id == ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE ) if( id == ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE )
resize_track = FALSE; resize_track = false;
if( id == ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE ) if( id == ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE )
resize_vias = FALSE; resize_vias = false;
if( Resize_Pistes_Vias( &dc, resize_track, resize_vias ) ) if( Resize_Pistes_Vias( &dc, resize_track, resize_vias ) )
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
...@@ -425,27 +425,27 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -425,27 +425,27 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_LOCK_ON_TRACKSEG: case ID_POPUP_PCB_LOCK_ON_TRACKSEG:
Attribut_Segment( (TRACK*) GetCurItem(), &dc, TRUE ); Attribut_Segment( (TRACK*) GetCurItem(), &dc, true );
break; break;
case ID_POPUP_PCB_LOCK_OFF_TRACKSEG: case ID_POPUP_PCB_LOCK_OFF_TRACKSEG:
Attribut_Segment( (TRACK*) GetCurItem(), &dc, FALSE ); Attribut_Segment( (TRACK*) GetCurItem(), &dc, false );
break; break;
case ID_POPUP_PCB_LOCK_ON_TRACK: case ID_POPUP_PCB_LOCK_ON_TRACK:
Attribut_Track( (TRACK*) GetCurItem(), &dc, TRUE ); Attribut_Track( (TRACK*) GetCurItem(), &dc, true );
break; break;
case ID_POPUP_PCB_LOCK_OFF_TRACK: case ID_POPUP_PCB_LOCK_OFF_TRACK:
Attribut_Track( (TRACK*) GetCurItem(), &dc, FALSE ); Attribut_Track( (TRACK*) GetCurItem(), &dc, false );
break; break;
case ID_POPUP_PCB_LOCK_ON_NET: case ID_POPUP_PCB_LOCK_ON_NET:
Attribut_net( &dc, ( (TRACK*) GetCurItem() )->GetNet(), TRUE ); Attribut_net( &dc, ( (TRACK*) GetCurItem() )->GetNet(), true );
break; break;
case ID_POPUP_PCB_LOCK_OFF_NET: case ID_POPUP_PCB_LOCK_OFF_NET:
Attribut_net( &dc, ( (TRACK*) GetCurItem() )->GetNet(), FALSE ); Attribut_net( &dc, ( (TRACK*) GetCurItem() )->GetNet(), false );
break; break;
case ID_POPUP_PCB_SETFLAGS_TRACK_MNU: case ID_POPUP_PCB_SETFLAGS_TRACK_MNU:
...@@ -466,11 +466,13 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -466,11 +466,13 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE: case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawPanel->m_AutoPAN_Request = true;
Add_Similar_Zone( &dc, (ZONE_CONTAINER*) GetCurItem() ); Add_Similar_Zone( &dc, (ZONE_CONTAINER*) GetCurItem() );
break; break;
case ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE: case ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawPanel->m_AutoPAN_Request = true;
Add_Zone_Cutout( &dc, (ZONE_CONTAINER*) GetCurItem() ); Add_Zone_Cutout( &dc, (ZONE_CONTAINER*) GetCurItem() );
break; break;
...@@ -490,6 +492,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -490,6 +492,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
DrawPanel->m_AutoPAN_Request = true;
Start_Move_Zone_Corner( &dc, Start_Move_Zone_Corner( &dc,
zone_cont, zone_cont,
zone_cont->m_CornerSelection, zone_cont->m_CornerSelection,
...@@ -501,6 +504,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -501,6 +504,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
DrawPanel->m_AutoPAN_Request = true;
Start_Move_Zone_Drag_Outline_Edge( &dc, Start_Move_Zone_Drag_Outline_Edge( &dc,
zone_cont, zone_cont,
zone_cont->m_CornerSelection ); zone_cont->m_CornerSelection );
...@@ -511,6 +515,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -511,6 +515,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
DrawPanel->m_AutoPAN_Request = true;
Start_Move_Zone_Outlines( &dc, zone_cont ); Start_Move_Zone_Outlines( &dc, zone_cont );
break; break;
} }
...@@ -531,6 +536,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -531,6 +536,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
pos.y ); pos.y );
zone_cont->m_CornerSelection++; zone_cont->m_CornerSelection++;
zone_cont->Draw( DrawPanel, &dc, GR_XOR ); zone_cont->Draw( DrawPanel, &dc, GR_XOR );
DrawPanel->m_AutoPAN_Request = true;
Start_Move_Zone_Corner( &dc, Start_Move_Zone_Corner( &dc,
zone_cont, zone_cont,
zone_cont->m_CornerSelection, zone_cont->m_CornerSelection,
...@@ -544,6 +550,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -544,6 +550,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
End_Move_Zone_Corner_Or_Outlines( &dc, zone_cont ); End_Move_Zone_Corner_Or_Outlines( &dc, zone_cont );
DrawPanel->m_AutoPAN_Request = false;
break; break;
} }
...@@ -590,11 +597,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -590,11 +597,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST: case ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST:
Process_Move_Item( this, GetCurItem(), &dc ); Process_Move_Item( this, GetCurItem(), &dc );
DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true;
break; break;
case ID_POPUP_PCB_DRAG_MODULE_REQUEST: case ID_POPUP_PCB_DRAG_MODULE_REQUEST:
g_Drag_Pistes_On = TRUE; g_Drag_Pistes_On = true;
case ID_POPUP_PCB_MOVE_MODULE_REQUEST: case ID_POPUP_PCB_MOVE_MODULE_REQUEST:
...@@ -603,7 +610,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -603,7 +610,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
{ {
g_Drag_Pistes_On = FALSE; g_Drag_Pistes_On = false;
break; break;
} }
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
...@@ -643,7 +650,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -643,7 +650,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
break; break;
Rotate_Module( &dc, (MODULE*) GetCurItem(), -900, TRUE ); Rotate_Module( &dc, (MODULE*) GetCurItem(), -900, true );
break; break;
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
...@@ -655,7 +662,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -655,7 +662,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
break; break;
Rotate_Module( &dc, (MODULE*) GetCurItem(), 900, TRUE ); Rotate_Module( &dc, (MODULE*) GetCurItem(), 900, true );
break; break;
case ID_POPUP_PCB_CHANGE_SIDE_MODULE: case ID_POPUP_PCB_CHANGE_SIDE_MODULE:
...@@ -681,7 +688,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -681,7 +688,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_DRAG_PAD_REQUEST: case ID_POPUP_PCB_DRAG_PAD_REQUEST:
g_Drag_Pistes_On = TRUE; g_Drag_Pistes_On = true;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
StartMovePad( (D_PAD*) GetCurItem(), &dc ); StartMovePad( (D_PAD*) GetCurItem(), &dc );
break; break;
...@@ -780,7 +787,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -780,7 +787,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer =
(int) ( (size_t) m_SelLayerBox->GetClientData( itmp ) ); (int) ( (size_t) m_SelLayerBox->GetClientData( itmp ) );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
break; break;
case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB:
...@@ -867,6 +874,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -867,6 +874,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if( End_Zone( &dc ) ) if( End_Zone( &dc ) )
SetCurItem( NULL ); SetCurItem( NULL );
} }
DrawPanel->m_AutoPAN_Request = false;
break; break;
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER: case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
...@@ -887,8 +895,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -887,8 +895,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_CurrentTrackWidth =
g_DesignSettings.m_TrackWidthHistory[ii]; g_DesignSettings.m_TrackWidthHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = FALSE; m_SelTrackWidthBox_Changed = false;
m_SelViaSizeBox_Changed = FALSE; m_SelViaSizeBox_Changed = false;
g_DesignSettings.m_UseConnectedTrackWidth = false; g_DesignSettings.m_UseConnectedTrackWidth = false;
} }
break; break;
...@@ -930,8 +938,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -930,8 +938,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
g_DesignSettings.m_CurrentViaSize = g_DesignSettings.m_CurrentViaSize =
g_DesignSettings.m_ViaSizeHistory[ii]; g_DesignSettings.m_ViaSizeHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = FALSE; m_SelTrackWidthBox_Changed = false;
m_SelViaSizeBox_Changed = FALSE; m_SelViaSizeBox_Changed = false;
} }
break; break;
...@@ -1014,11 +1022,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1014,11 +1022,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_MENU_ARCHIVE_NEW_MODULES: case ID_MENU_ARCHIVE_NEW_MODULES:
Archive_Modules( wxEmptyString, TRUE ); Archive_Modules( wxEmptyString, true );
break; break;
case ID_MENU_ARCHIVE_ALL_MODULES: case ID_MENU_ARCHIVE_ALL_MODULES:
Archive_Modules( wxEmptyString, FALSE ); Archive_Modules( wxEmptyString, false );
break; break;
default: default:
...@@ -1029,7 +1037,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1029,7 +1037,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolbars(); SetToolbars();
DrawPanel->CursorOn( &dc ); DrawPanel->CursorOn( &dc );
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = false;
} }
......
...@@ -96,8 +96,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -96,8 +96,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
if( aTrack == NULL ) /* Starting a new track */ if( aTrack == NULL ) /* Starting a new track */
{ {
D(printf("Begin_Route NULL\n");)
/* erase old highlight */ /* erase old highlight */
OldNetCodeSurbrillance = g_HightLigth_NetCode; OldNetCodeSurbrillance = g_HightLigth_NetCode;
OldEtatSurbrillance = g_HightLigt_Status; OldEtatSurbrillance = g_HightLigt_Status;
...@@ -148,10 +146,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -148,10 +146,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
Hight_Light( DC ); Hight_Light( DC );
/* done above
g_CurrentTrackSegment->m_Flags = IS_NEW;
*/
g_CurrentTrackSegment->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); g_CurrentTrackSegment->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth; g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
...@@ -205,8 +199,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -205,8 +199,6 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
} }
else /* Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor*/ else /* Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor*/
{ {
D(printf("Begin_Route in progress\n");)
/* Tst for a D.R.C. error: */ /* Tst for a D.R.C. error: */
if( Drc_On ) if( Drc_On )
{ {
......
...@@ -30,7 +30,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -30,7 +30,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( (m_ID_current_state == 0) || ( DrawStruct && DrawStruct->m_Flags ) ) 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 if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress
{ {
DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = TRUE;
...@@ -40,7 +40,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -40,7 +40,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
if ( (DrawStruct->m_Flags & IS_NEW) ) if ( (DrawStruct->m_Flags & IS_NEW) )
{
DrawPanel->m_AutoPAN_Request = true;
Begin_Zone( DC ); Begin_Zone( DC );
}
else else
End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct ); End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct );
exit = true; exit = true;
...@@ -98,7 +101,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -98,7 +101,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
} }
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = false;
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
if ( exit ) return; if ( exit ) return;
} }
...@@ -225,6 +228,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -225,6 +228,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
if ( Begin_Zone( DC ) ) if ( Begin_Zone( DC ) )
{ {
DrawPanel->m_AutoPAN_Request = true;
DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
...@@ -233,6 +237,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -233,6 +237,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&& (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && (DrawStruct->Type() == TYPE_ZONE_CONTAINER)
&& (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) )
{ {
DrawPanel->m_AutoPAN_Request = true;
Begin_Zone( DC ); Begin_Zone( DC );
DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
...@@ -251,7 +256,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -251,7 +256,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else if( DrawStruct->Type() == TYPE_TEXTE ) else if( DrawStruct->Type() == TYPE_TEXTE )
{ {
Place_Texte_Pcb( (TEXTE_PCB*) DrawStruct, DC ); Place_Texte_Pcb( (TEXTE_PCB*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
} }
else else
DisplayError( this, wxT( "Internal err: Struct not TYPE_TEXTE" ) ); DisplayError( this, wxT( "Internal err: Struct not TYPE_TEXTE" ) );
...@@ -269,7 +274,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -269,7 +274,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else if( DrawStruct->Type() == TYPE_MODULE ) else if( DrawStruct->Type() == TYPE_MODULE )
{ {
Place_Module( (MODULE*) DrawStruct, DC ); Place_Module( (MODULE*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
} }
else else
DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) ); DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) );
...@@ -363,7 +368,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -363,7 +368,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct->m_Flags & IS_NEW ) if( DrawStruct->m_Flags & IS_NEW )
{ {
End_Route( (TRACK*) DrawStruct, DC ); End_Route( (TRACK*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
} }
else if( DrawStruct->m_Flags == 0 ) else if( DrawStruct->m_Flags == 0 )
{ {
...@@ -421,14 +426,14 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -421,14 +426,14 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) )
{ {
End_Route( (TRACK*) DrawStruct, DC ); End_Route( (TRACK*) DrawStruct, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
} }
break; break;
case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT:
if ( End_Zone( DC ) ) if ( End_Zone( DC ) )
{ {
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
SetCurItem( NULL ); SetCurItem( NULL );
} }
break; break;
...@@ -441,13 +446,13 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -441,13 +446,13 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct->Type() != TYPE_DRAWSEGMENT ) if( DrawStruct->Type() != TYPE_DRAWSEGMENT )
{ {
DisplayError( this, wxT( "DrawStruct Type error" ) ); DisplayError( this, wxT( "DrawStruct Type error" ) );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
break; break;
} }
if( (DrawStruct->m_Flags & IS_NEW) ) if( (DrawStruct->m_Flags & IS_NEW) )
{ {
End_Edge( (DRAWSEGMENT*) DrawStruct, &dc ); End_Edge( (DRAWSEGMENT*) DrawStruct, &dc );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = false;
SetCurItem( NULL ); SetCurItem( NULL );
} }
break; 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