Commit a70a5805 authored by charras's avatar charras

committed newfont patch. Pcbnew: board date automatically updated at each change.

parent 815bbddf
......@@ -42,6 +42,7 @@ set(COMMON_SRCS
gr_basic.cpp
hotkeys_basic.cpp
msgpanel.cpp
newstroke_font.cpp
projet_config.cpp
# pyhandler.cpp
richio.cpp
......
......@@ -107,7 +107,7 @@ int NegableTextLength( const wxString& aText )
static const char* GetHersheyShapeDescription( int AsciiCode )
{
/* calculate font length */
int font_length_max = sizeof(newstroke_font)/sizeof(*newstroke_font);
int font_length_max = newstroke_font_bufsize;
if ( AsciiCode >= (32 + font_length_max) )
AsciiCode = '?';
if( AsciiCode < 32 )
......
......@@ -304,7 +304,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
placeMenu->Append( item );
/* Net name */
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, _( "Net name" ),
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, _( "Label" ),
_( "Place net name" ), wxITEM_NORMAL );
item->SetBitmap( add_line_label_xpm );
placeMenu->Append( item );
......
This diff is collapsed.
......@@ -216,6 +216,14 @@ public:
MODULE* Select_1_Module_From_BOARD( BOARD* Pcb );
MODULE* GetModuleByName();
/** Function OnModify()
* Virtual
* Must be called after a schematic change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
*/
virtual void OnModify( );
// Modules (footprints)
MODULE* Create_1_Module( wxDC* DC,
const wxString& module_name );
......
No preview for this file type
This diff is collapsed.
......@@ -22,7 +22,7 @@ void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
if( track == NULL )
return;
GetScreen()->SetModify();
OnModify();
DrawPanel->CursorOff( DC ); // Erase cursor shape
track->SetState( SEGM_FIXE, Flag_On );
track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
......@@ -53,7 +53,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
DrawPanel->CursorOn( DC ); // Display cursor shape
GetScreen()->SetModify();
OnModify();
}
......@@ -81,12 +81,12 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
if( (net_code >= 0 ) && (net_code != Track->GetNet()) )
break;
GetScreen()->SetModify();
OnModify();
Track->SetState( SEGM_FIXE, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
Track = Track->Next();
}
DrawPanel->CursorOn( DC ); // Display cursor shape
GetScreen()->SetModify();
OnModify();
}
......@@ -294,7 +294,7 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe )
Module->SetLocked( Fixe );
Module->DisplayInfo( this );
GetScreen()->SetModify();
OnModify();
}
else
{
......@@ -305,7 +305,7 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe )
Module->m_Reference->m_Text ) )
{
Module->SetLocked( Fixe );
GetScreen()->SetModify();
OnModify();
}
}
}
......
......@@ -416,3 +416,18 @@ void WinEDA_BasePcbFrame::SaveSettings()
cfg->Write( m_FrameName + DisplayModuleEdgeEntry, ( long )m_DisplayModEdge );
cfg->Write( m_FrameName + DisplayModuleTextEntry, ( long )m_DisplayModText );
}
/** Function OnModify()
* Must be called after a schematic change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
*/
void WinEDA_BasePcbFrame::OnModify( )
{
GetScreen()->SetModify( );
wxString date = GenDate();
GetScreen()->m_Date = date;
}
......@@ -279,7 +279,7 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC )
break;
}
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......@@ -589,7 +589,7 @@ void WinEDA_PcbFrame::Block_Delete()
if( GetScreen()->m_BlockLocate.GetCount() == 0 )
return;
GetScreen()->SetModify();
OnModify();
SetCurItem( NULL );
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
......@@ -668,7 +668,7 @@ void WinEDA_PcbFrame::Block_Rotate()
oldpos = GetScreen()->m_Curseur;
centre = GetScreen()->m_BlockLocate.Centre();
GetScreen()->SetModify();
OnModify();
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
itemsList->m_Status = UR_ROTATED;
......@@ -734,7 +734,7 @@ void WinEDA_PcbFrame::Block_Flip()
if( GetScreen()->m_BlockLocate.GetCount() == 0 )
return;
GetScreen()->SetModify();
OnModify();
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
itemsList->m_Status = UR_FLIPPED;
......@@ -804,7 +804,7 @@ void WinEDA_PcbFrame::Block_Move()
if( GetScreen()->m_BlockLocate.GetCount() == 0 )
return;
GetScreen()->SetModify();
OnModify();
wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector;
......@@ -874,7 +874,7 @@ void WinEDA_PcbFrame::Block_Duplicate()
if( GetScreen()->m_BlockLocate.GetCount() == 0 )
return;
GetScreen()->SetModify();
OnModify();
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
......
......@@ -268,7 +268,7 @@ void WinEDA_ModuleEditFrame::HandleBlockPlace( wxDC* DC )
break;
}
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......
......@@ -597,7 +597,7 @@ void WinEDA_PcbFrame::GetBoardFromUndoList( wxCommandEvent& event )
List->ReversePickersListOrder();
GetScreen()->PushCommandToRedoList( List );
GetScreen()->SetModify();
OnModify();
ReCreateHToolbar();
SetToolbars();
......@@ -627,7 +627,7 @@ void WinEDA_PcbFrame::GetBoardFromRedoList( wxCommandEvent& event )
List->ReversePickersListOrder();
GetScreen()->PushCommandToUndoList( List );
GetScreen()->SetModify();
OnModify();
ReCreateHToolbar();
SetToolbars();
......
......@@ -154,7 +154,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
frame->Compile_Ratsnest( DC, AFFICHE );
frame->GetScreen()->SetModify();
frame->OnModify();
}
......
......@@ -251,7 +251,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( flgmodify ) // Set the flags m_Modify cleared by SavePcbFile()
{
GetScreen()->SetModify();
OnModify();
GetScreen()->SetSave(); // Set the flags m_FlagSave cleared by SetModify()
}
GetScreen()->m_FileName = tmpFileName;
......
......@@ -116,7 +116,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() );
SaveCopyInUndoList( aTrack, UR_DELETED );
GetScreen()->SetModify();
OnModify();
test_1_net_connexion( DC, current_net_code );
GetBoard()->DisplayInfo( this );
......@@ -130,7 +130,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack )
{
int current_net_code = aTrack->GetNet();
Remove_One_Track( DC, aTrack );
GetScreen()->SetModify();
OnModify();
test_1_net_connexion( DC, current_net_code );
}
}
......@@ -170,7 +170,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
}
SaveCopyInUndoList( itemsList, UR_DELETED );
GetScreen()->SetModify();
OnModify();
test_1_net_connexion( DC, net_code_delete );
GetBoard()->DisplayInfo( this );
}
......
......@@ -434,7 +434,7 @@ void dialog_copper_zone::ExportSetupToOtherCopperZones( wxCommandEvent& event )
{
ZONE_CONTAINER* zone = pcb->GetArea( ii );
m_Zone_Setting->ExportSetting( *zone, false ); // false = partiel export
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
}
m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
......
......@@ -141,7 +141,7 @@ void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
// null timestamp
{
m_CurrentModule->m_TimeStamp = GetTimeStamp();
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
}
EndModal( 2 );
......@@ -561,7 +561,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->Set_Rectangle_Encadrement();
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
......
......@@ -408,7 +408,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->Set_Rectangle_Encadrement();
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
}
......
......@@ -199,7 +199,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ) );
}
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
if( m_Module )
m_Module->m_LastEdit_Time = time( NULL );
......
......@@ -219,7 +219,7 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
m_Item->m_Angle = angle;
}
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
if ( m_DC )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Item->DisplayInfo( m_Parent );
......
......@@ -545,7 +545,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
}
}
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
m_Parent->ReCreateLayerBox( NULL );
m_Parent->ReFillLayerWidget();
......
......@@ -253,7 +253,7 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
if( WildCompareString( ModuleMask, module->m_Reference->m_Text, FALSE ) )
{
GetScreen()->SetModify();
OnModify();
redraw = true;
Rotate_Module( NULL, module, Orient, FALSE );
}
......
......@@ -634,7 +634,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
m_CurrentPad->DisplayInfo( m_Parent );
// redraw the area where the pad was
m_Parent->DrawPanel->PostDirtyRect( m_CurrentPad->GetBoundingBox() );
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
}
EndModal(1);
......
......@@ -252,6 +252,6 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
{
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
}
......@@ -181,7 +181,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
}
......@@ -276,7 +276,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
/* Insertion de la structure dans le Chainage .Drawings du PCB */
GetBoard()->Add( Cotation );
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......@@ -368,7 +368,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
SaveCopyInUndoList(Cotation, UR_DELETED);
Cotation->UnLink();
GetScreen()->SetModify();
OnModify();
}
......
......@@ -64,7 +64,7 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
MODULE* Module = (MODULE*) Edge->GetParent();
Module->Set_Rectangle_Encadrement();
}
......@@ -143,7 +143,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge )
else
Edge->m_Width = ModuleSegmentWidth;
GetScreen()->SetModify();
OnModify();
DrawPanel->Refresh( TRUE );
Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL );
......@@ -196,7 +196,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
else
Edge->SetLayer( new_layer );
GetScreen()->SetModify();
OnModify();
Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL );
DrawPanel->Refresh( TRUE );
......@@ -234,7 +234,7 @@ void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
Edge->m_Width = ModuleSegmentWidth;
Module->DrawEdgesOnly( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Set_Rectangle_Encadrement();
GetScreen()->SetModify();
OnModify();
}
}
......@@ -260,7 +260,7 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge )
Edge->DeleteStructure();
Module->m_LastEdit_Time = time( NULL );
Module->Set_Rectangle_Encadrement();
GetScreen()->SetModify();
OnModify();
}
......@@ -389,7 +389,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
module->Set_Rectangle_Encadrement();
module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify();
OnModify();
}
}
else
......@@ -414,7 +414,7 @@ void WinEDA_ModuleEditFrame::End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
}
Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
}
......@@ -300,7 +300,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
Edit_Track_Width( &dc, (TRACK*) GetCurItem() );
DrawPanel->MouseToCursorSchema();
GetScreen()->SetModify();
OnModify();
break;
case ID_POPUP_PCB_EDIT_TRACKSEG:
......@@ -308,7 +308,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
Edit_TrackSegm_Width( &dc, (TRACK*) GetCurItem() );
DrawPanel->MouseToCursorSchema();
GetScreen()->SetModify();
OnModify();
break;
case ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE:
......@@ -365,7 +365,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
DrawPanel->MouseToCursorSchema();
SetCurItem( Delete_Segment( &dc, (TRACK*) GetCurItem() ) );
GetScreen()->SetModify();
OnModify();
break;
case ID_POPUP_PCB_DELETE_TRACK:
......@@ -374,14 +374,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
Delete_Track( &dc, (TRACK*) GetCurItem() );
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
break;
case ID_POPUP_PCB_DELETE_TRACKNET:
DrawPanel->MouseToCursorSchema();
Delete_net( &dc, (TRACK*) GetCurItem() );
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
break;
case ID_POPUP_PCB_LOCK_ON_TRACKSEG:
......@@ -421,7 +421,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
Delete_Zone_Fill( zsegm );
SetCurItem( NULL );
test_1_net_connexion( NULL, netcode );
GetScreen()->SetModify();
OnModify();
GetBoard()->DisplayInfo( this );
}
break;
......@@ -537,7 +537,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) GetCurItem();
Delete_Zone_Fill( NULL, zone_container->m_TimeStamp );
test_1_net_connexion( NULL, zone_container->GetNet() );
GetScreen()->SetModify();
OnModify();
GetBoard()->DisplayInfo( this );
DrawPanel->Refresh();
}
......@@ -556,7 +556,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer
test_connexions( NULL );
Tst_Ratsnest( NULL, 0 ); // Recalculate the active ratsnest, i.e. the unconnected links */
GetScreen()->SetModify();
OnModify();
GetBoard()->DisplayInfo( this );
DrawPanel->Refresh();
break;
......
......@@ -68,7 +68,7 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
return;
TextePcb->Draw( DrawPanel, DC, GR_OR );
GetScreen()->SetModify();
OnModify();
if( (TextePcb->m_Flags & IS_NEW) ) // If new: prepare undo command
{
......@@ -202,5 +202,5 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
else // set flag edit, to show it was a complex command
TextePcb->m_Flags |= IN_EDIT;
GetScreen()->SetModify();
OnModify();
}
......@@ -78,7 +78,7 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
if( change_ok )
{
GetScreen()->SetModify();
OnModify();
if( aItemsListPicker )
{
aTrackItem->m_Width = initial_width;
......
......@@ -52,7 +52,7 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
drawitem->m_Flags = 0;
}
......@@ -110,7 +110,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
SaveCopyInUndoList(Segment, UR_DELETED);
Segment->UnLink();
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
}
}
......@@ -162,7 +162,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
if( pickList.GetCount() )
{
GetScreen()->SetModify();
OnModify();
SaveCopyInUndoList(pickList, UR_DELETED);
}
}
......@@ -238,7 +238,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
SaveCopyInUndoList(Segment, UR_NEW );
GetBoard()->Add( Segment );
GetScreen()->SetModify();
OnModify();
Segment->m_Flags = 0;
Segment->Draw( DrawPanel, DC, GR_OR );
......@@ -281,7 +281,7 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{
Segment->m_Flags = 0;
GetBoard()->Add( Segment );
GetScreen()->SetModify();
OnModify();
SaveCopyInUndoList( Segment, UR_NEW );
}
......
......@@ -86,7 +86,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
test_1_net_connexion( DC, pt_track->GetNet() );
pt_track->DisplayInfo( this );
GetScreen()->SetModify();
OnModify();
}
......
......@@ -529,7 +529,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
// owner of picked items
/* compute the new rastnest */
test_1_net_connexion( DC, netcode );
GetScreen()->SetModify();
OnModify();
GetBoard()->DisplayInfo( this );
}
......
......@@ -94,7 +94,7 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
if( module )
module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify();
OnModify();
}
......@@ -114,7 +114,7 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
{
DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
Text->DeleteStructure();
GetScreen()->SetModify();
OnModify();
Module->m_LastEdit_Time = time( NULL );
}
}
......@@ -216,7 +216,7 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
Text->m_Flags = 0;
Module->m_Flags = 0;
Module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify();
OnModify();
/* Redraw text. */
DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
......
......@@ -139,7 +139,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
if( Append )
{
GetScreen()->m_FileName = wxEmptyString;
GetScreen()->SetModify();
OnModify();
GetBoard()->m_Status_Pcb = 0;
}
......@@ -233,7 +233,7 @@ this file again."));
new_filename += PcbExtBuffer;
GetScreen()->SetModify();
OnModify();
GetScreen()->m_FileName = new_filename;
}
......
......@@ -280,5 +280,5 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
}
GetScreen()->SetModify();
OnModify();
}
......@@ -254,7 +254,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
break;
case HK_SWITCH_LAYER_TO_PREVIOUS:
ll = GetScreen()->m_Active_Layer;
ll = getActiveLayer();
if( (ll <= LAYER_N_BACK) || (ll > LAYER_N_FRONT) )
break;
......@@ -269,7 +269,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
break;
case HK_SWITCH_LAYER_TO_NEXT:
ll = GetScreen()->m_Active_Layer;
ll = getActiveLayer();
if( (ll < LAYER_N_BACK) || (ll >= LAYER_N_FRONT) )
break;
if( GetBoard()->GetCopperLayerCount() < 2 ) // Single layer
......@@ -369,7 +369,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
DisplayOpt.DisplayPcbTrackFill ^= 1;
DisplayOpt.DisplayPcbTrackFill &= 1;
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
GetScreen()->SetRefreshReq();
DrawPanel->Refresh();
break;
case HK_DELETE:
......@@ -377,7 +377,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
break;
case HK_BACK_SPACE:
if( m_ID_current_state == ID_TRACK_BUTT && GetScreen()->m_Active_Layer
if( m_ID_current_state == ID_TRACK_BUTT && getActiveLayer()
<= LAYER_N_FRONT )
{
if( ItemFree )
......@@ -395,7 +395,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
Delete_Segment( DC, (TRACK*) DrawStruct );
SetCurItem( NULL );
}
GetScreen()->SetModify();
OnModify();
}
else if( GetCurItem()->Type() == TYPE_TRACK )
{
......@@ -404,7 +404,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
TRACK* track = (TRACK*) GetCurItem();
track = Delete_Segment( DC, track );
SetCurItem( track );
GetScreen()->SetModify();
OnModify();
}
}
break;
......@@ -475,7 +475,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
Other_Layer_Route( (TRACK*) GetCurItem(), DC );
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = v_type;
if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq();
DrawPanel->Refresh();
}
break;
......@@ -493,11 +493,11 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
return;
Other_Layer_Route( (TRACK*) GetCurItem(), DC ); // place via and switch layer
if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq();
DrawPanel->Refresh();
break;
case HK_ADD_NEW_TRACK: // Start new track
if( GetScreen()->m_Active_Layer > LAYER_N_FRONT )
if( getActiveLayer() > LAYER_N_FRONT )
break;
if( m_ID_current_state != ID_TRACK_BUTT && ItemFree )
......@@ -771,7 +771,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
switch( m_ID_current_state )
{
case ID_TRACK_BUTT:
if( GetScreen()->m_Active_Layer > LAYER_N_FRONT )
if( getActiveLayer() > LAYER_N_FRONT )
return FALSE;
if( ItemFree )
{
......@@ -786,7 +786,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
TRACK* track = (TRACK*) GetCurItem();
track = Delete_Segment( DC, track );
SetCurItem( track );
GetScreen()->SetModify();
OnModify();
return TRUE;
}
break;
......@@ -810,7 +810,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
return FALSE;
}
GetScreen()->SetModify();
OnModify();
SetCurItem( NULL );
return TRUE;
}
......@@ -133,7 +133,7 @@ void WinEDA_PcbGlobalDeleteFrame::AcceptPcbDelete( wxCommandEvent& event )
}
m_Parent->DrawPanel->Refresh();
m_Parent->DrawPanel->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
}
......
......@@ -158,7 +158,7 @@ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event )
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC,
( m_MirePcb->m_Flags & IS_MOVED ) ? GR_XOR : GR_OR );
m_Parent->GetScreen()->SetModify();
m_Parent->OnModify();
EndModal( 1 );
}
......@@ -254,7 +254,7 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC )
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
if( (MirePcb->m_Flags & IS_NEW) )
{
......
......@@ -91,7 +91,7 @@ void WinEDA_ModuleEditFrame::GetComponentFromRedoList( wxCommandEvent& event )
SetCurItem( NULL );
GetScreen()->SetModify();
OnModify();
ReCreateHToolbar();
SetToolbars();
DrawPanel->Refresh();
......@@ -129,7 +129,7 @@ void WinEDA_ModuleEditFrame::GetComponentFromUndoList( wxCommandEvent& event )
SetCurItem( NULL );;
GetScreen()->SetModify();
OnModify();
ReCreateHToolbar();
SetToolbars();
DrawPanel->Refresh();
......
......@@ -242,7 +242,7 @@ MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
if( module == NULL )
return NULL;
GetScreen()->SetModify();
OnModify();
/* Duplicate module */
GetBoard()->m_Status_Pcb = 0;
......@@ -316,7 +316,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module,
}
}
GetScreen()->SetModify();
OnModify();
/* Remove module from list, and put it in undo command list */
m_Pcb->m_Modules.Remove( module );
......@@ -350,7 +350,7 @@ void WinEDA_PcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
&& ( Module->GetLayer() != LAYER_N_BACK ) )
return;
GetScreen()->SetModify();
OnModify();
if( !( Module->m_Flags & IS_MOVED ) ) /* This is a simple flip, no other
*edition in progress */
......@@ -421,7 +421,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module,
if( module == 0 )
return;
GetScreen()->SetModify();
OnModify();
GetBoard()->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK);
if( module->m_Flags & IS_NEW )
......@@ -506,7 +506,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
if( module == NULL )
return;
GetScreen()->SetModify();
OnModify();
if( !( module->m_Flags & IS_MOVED ) ) /* This is a simple rotation, no other
* edition in progress */
......
......@@ -253,7 +253,7 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad )
Module->Set_Rectangle_Encadrement();
GetScreen()->SetModify();
OnModify();
}
......@@ -376,7 +376,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
EraseDragListe();
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
m_Pcb->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK );
......@@ -395,7 +395,7 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Module = (MODULE*) Pad->GetParent();
Module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify();
OnModify();
if( DC )
Module->Draw( DrawPanel, DC, GR_XOR );
......
......@@ -1016,7 +1016,7 @@ bool WinEDA_PcbFrame::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner
// of picked items
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......
......@@ -782,7 +782,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type )
Module->Set_Rectangle_Encadrement();
GetBoard()->m_Status_Pcb = 0;
GetScreen()->SetModify();
OnModify();
return Module;
}
......@@ -1120,7 +1120,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape()
Module->Set_Rectangle_Encadrement();
GetBoard()->m_Status_Pcb = 0;
GetScreen()->SetModify();
OnModify();
return Module;
}
......
......@@ -178,7 +178,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
// Clear undo and redo lists to avoid inconsistencies between lists
aFrame->GetScreen()->ClearUndoRedoList();
aFrame->GetScreen()->SetModify();
aFrame->OnModify();
aFrame->GetBoard()->m_Status_Pcb = 0;
State = 0; LineNum = 0; Comment = 0;
s_NbNewModules = 0;
......
......@@ -367,7 +367,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawPanel->DrawAuxiliaryAxis( DC, GR_XOR );
m_Auxiliary_Axis_Position = GetScreen()->m_Curseur;
DrawPanel->DrawAuxiliaryAxis( DC, GR_COPY );
GetScreen()->SetModify();
OnModify();
break;
default:
......
......@@ -479,7 +479,7 @@ void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event )
if( returncode == wxID_OK ) // New rules, or others changes.
{
ReCreateLayerBox( NULL );
GetScreen()->SetModify();
OnModify();
}
}
......@@ -613,3 +613,4 @@ void WinEDA_PcbFrame::SetVisibleAlls( )
for( int ii = 0; ii < PCB_VISIBLE(END_PCB_VISIBLE_LIST); ii++ )
m_Layers->SetRenderState( ii, true );
}
......@@ -113,7 +113,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
m_TrackAndViasSizesList_Changed = true;
GetScreen()->SetModify();
OnModify();
GetBoard()->m_Status_Pcb = 0;
/* At this point we should call Compile_Ratsnest()
......
......@@ -2,7 +2,9 @@
/* Dialog frame to swap layers */
/*******************************/
/* Fichier swap_layers */
/*
* swap_layers.cpp
*/
#include "fctsys.h"
#include "common.h"
......@@ -356,7 +358,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
pt_segm = GetBoard()->m_Track;
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{
GetScreen()->SetModify();
OnModify();
if( pt_segm->Type() == TYPE_VIA )
{
SEGVIA* Via = (SEGVIA*) pt_segm;
......@@ -383,7 +385,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
/* Change zones. */
for( pt_segm = GetBoard()->m_Zone; pt_segm; pt_segm = pt_segm->Next() )
{
GetScreen()->SetModify();
OnModify();
jj = pt_segm->GetLayer();
if( New_Layer[jj] >= 0 && New_Layer[jj] < LAYER_NO_CHANGE )
pt_segm->SetLayer( New_Layer[jj] );
......@@ -395,7 +397,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
{
if( PtStruct->Type() == TYPE_DRAWSEGMENT )
{
GetScreen()->SetModify();
OnModify();
pt_drawsegm = (DRAWSEGMENT*) PtStruct;
jj = pt_drawsegm->GetLayer();
if( New_Layer[jj] >= 0 && New_Layer[jj] < LAYER_NO_CHANGE )
......
/*******************************/
/* Pcbnew: exchange of modules */
/* Pcbnew: exchange modules */
/*******************************/
#include "fctsys.h"
......@@ -529,7 +529,7 @@ void WinEDA_PcbFrame::Exchange_Module( MODULE* aOldModule,
GetBoard()->m_Status_Pcb = 0;
aNewModule->m_Flags = 0;
GetScreen()->SetModify();
OnModify();
}
......
......@@ -283,7 +283,7 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
DrawPanel->ForceCloseManageCurseur = NULL;
if( DC )
zone_container->Draw( DrawPanel, DC, GR_OR );
GetScreen()->SetModify();
OnModify();
s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL;
......@@ -324,7 +324,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
* the member .m_CornerSelection is used as selected corner
*/
{
GetScreen()->SetModify();
OnModify();
if( zone_container->m_Poly->GetNumCorners() <= 3 )
{
......@@ -715,7 +715,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
SaveCopyInUndoList(s_PickedList, UR_UNSPECIFIED);
s_PickedList.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items
GetScreen()->SetModify();
OnModify();
return true;
}
......@@ -826,7 +826,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
SaveCopyInUndoList(s_PickedList, UR_UNSPECIFIED);
s_PickedList.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items
GetScreen()->SetModify();
OnModify();
}
......@@ -863,6 +863,6 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
DrawPanel->PostDirtyRect( dirty );
GetScreen()->SetModify();
OnModify();
}
......@@ -81,7 +81,7 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp )
if( modify )
{
GetScreen()->SetModify();
OnModify();
GetScreen()->SetRefreshReq();
}
}
......@@ -136,7 +136,7 @@ int WinEDA_PcbFrame::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
Delete_Zone_Fill( NULL, zone_container->m_TimeStamp );
zone_container->BuildFilledPolysListData( GetBoard() );
GetScreen()->SetModify();
OnModify();
return 0;
}
......
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