Commit 1a139a7f authored by stambaughw's avatar stambaughw

More comment translation and capitalization fixes.

parent 0acb404f
/***********************************************************************/ /************************************************/
/* menubarmodedit.cpp - creation du menu general de l'editeur de module*/ /* menubarmodedit.cpp - Module editor menu bar. */
/***********************************************************************/ /************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -13,80 +13,74 @@ ...@@ -13,80 +13,74 @@
#include "pcbnew_id.h" #include "pcbnew_id.h"
/***********************************************/
void WinEDA_ModuleEditFrame::ReCreateMenuBar() void WinEDA_ModuleEditFrame::ReCreateMenuBar()
/***********************************************/
/* Cree ou reinitialise le menu du haut d'ecran
*/
{ {
wxMenuBar * menuBar = GetMenuBar(); wxMenuBar* menuBar = GetMenuBar();
wxMenuItem * item; wxMenuItem* item;
if( ! menuBar ) if( !menuBar )
{ {
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
///////////////////////////// wxMenu* sizes_menu = new wxMenu;
// Ajustage de dimensions: //
/////////////////////////////
wxMenu * sizes_menu = new wxMenu;
item = new wxMenuItem(sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP, item = new wxMenuItem( sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_("Sizes and Widths"), _( "Sizes and Widths" ),
_("Adjust width for texts and drawings")); _( "Adjust width for texts and drawings" ) );
item->SetBitmap(options_text_xpm); item->SetBitmap( options_text_xpm );
sizes_menu->Append(item); sizes_menu->Append( item );
item = new wxMenuItem(sizes_menu, ID_PCB_PAD_SETUP, _("Pad Settings"), item = new wxMenuItem( sizes_menu, ID_PCB_PAD_SETUP, _( "Pad Settings" ),
_("Adjust size,shape,layers... for Pads")); _( "Adjust size, shape, layers... for pads" ) );
item->SetBitmap(pad_xpm); item->SetBitmap( pad_xpm );
sizes_menu->Append(item); sizes_menu->Append( item );
item = new wxMenuItem(sizes_menu, ID_PCB_USER_GRID_SETUP, _("User Grid Size"), item =
_("Adjust User Grid")); new wxMenuItem( sizes_menu, ID_PCB_USER_GRID_SETUP,
item->SetBitmap(grid_xpm); _( "User Grid Size" ),
sizes_menu->Append(item); _( "Adjust user grid" ) );
item->SetBitmap( grid_xpm );
sizes_menu->Append( item );
//////////////// ////////////////
// Menu Help: // // Menu Help: //
//////////////// ////////////////
wxMenu *helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
// Contents // Contents
item = new wxMenuItem(helpMenu , item = new wxMenuItem( helpMenu,
ID_GENERAL_HELP, ID_GENERAL_HELP,
_("&Contents"), // Menu entry name _( "&Contents" ),
_("Open the pcbnew manual")); // Statusbar message _( "Open the pcbnew manual" ) );
item->SetBitmap(help_xpm); item->SetBitmap( help_xpm );
helpMenu->Append(item); helpMenu->Append( item );
// About pcbnew // About pcbnew
item = new wxMenuItem(helpMenu , item = new wxMenuItem( helpMenu,
ID_KICAD_ABOUT, ID_KICAD_ABOUT,
_("&About pcbnew"), // Menu entry name _( "&About pcbnew" ),
_("About pcbnew PCB designer")); // Statusbar message _( "About pcbnew PCB designer" ) );
item->SetBitmap(info_xpm); item->SetBitmap( info_xpm );
helpMenu->Append(item); helpMenu->Append( item );
////////////////////// //////////////////////
// Menu Display 3D: // // Menu Display 3D: //
////////////////////// //////////////////////
wxMenu *Display3DMenu = new wxMenu; wxMenu* Display3DMenu = new wxMenu;
item = new wxMenuItem(Display3DMenu , ID_MENU_PCB_SHOW_3D_FRAME, _("3D Display"), _("Show board in 3D viewer")); item = new wxMenuItem( Display3DMenu,
item->SetBitmap(show_3d_xpm); ID_MENU_PCB_SHOW_3D_FRAME,
Display3DMenu->Append(item); _( "3D Display" ),
_( "Show board in 3D viewer" ) );
menuBar->Append(sizes_menu, _("&Dimensions")); item->SetBitmap( show_3d_xpm );
menuBar->Append(Display3DMenu, _("&3D Display")); Display3DMenu->Append( item );
menuBar->Append(helpMenu, _("&Help"));
menuBar->Append( sizes_menu, _( "&Dimensions" ) );
menuBar->Append( Display3DMenu, _( "&3D Display" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
// Associate the menu bar with the frame // Associate the menu bar with the frame
SetMenuBar(menuBar); SetMenuBar( menuBar );
} }
} }
/******************************************************************/ /*****************************************/
/* menubarpcb.cpp - creation du menu general de l'editeur de board*/ /* menubarpcb.cpp - PCB editor menu bar. */
/******************************************************************/ /*****************************************/
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
...@@ -11,12 +11,8 @@ ...@@ -11,12 +11,8 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
/***********************************************/
void WinEDA_PcbFrame::ReCreateMenuBar()
/***********************************************/
/* Cree ou reinitialise le menu du haut d'ecran void WinEDA_PcbFrame::ReCreateMenuBar()
*/
{ {
wxMenuItem* item; wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar(); wxMenuBar* menuBar = GetMenuBar();
...@@ -62,7 +58,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -62,7 +58,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
// Add save menu // Add save menu
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); _( "&Save Board\tCtrl-S" ),
_( "Save current board" ) );
item->SetBitmap( save_xpm ); item->SetBitmap( save_xpm );
filesMenu->Append( item ); filesMenu->Append( item );
...@@ -125,7 +122,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -125,7 +122,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( import_xpm ); // @todo need better bitmap item->SetBitmap( import_xpm ); // @todo need better bitmap
submenuImport->Append( item ); submenuImport->Append( item );
/* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in specctra_import.cpp /* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in
* specctra_import.cpp
* item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN, * item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN,
* _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") ); * _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") );
* item->SetBitmap(export_xpm); // @todo need better bitmap * item->SetBitmap(export_xpm); // @todo need better bitmap
...@@ -167,7 +165,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -167,7 +165,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu ); wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
/////////////////////////////////// ///////////////////////////////////
// Preferences an configuration // // Preferences and configuration //
/////////////////////////////////// ///////////////////////////////////
wxMenu* configmenu = new wxMenu; wxMenu* configmenu = new wxMenu;
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ), item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
...@@ -175,8 +173,9 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -175,8 +173,9 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( library_xpm ); item->SetBitmap( library_xpm );
configmenu->Append( item ); configmenu->Append( item );
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ), item = new wxMenuItem( configmenu, ID_COLORS_SETUP,
_( "Select colors and visibilty of layers and some items" ) ); _( "&Colors and Visibility" ),
_( "Select colors and visibility of layers and some items" ) );
item->SetBitmap( palette_xpm ); item->SetBitmap( palette_xpm );
configmenu->Append( item ); configmenu->Append( item );
...@@ -185,7 +184,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -185,7 +184,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( preference_xpm ); item->SetBitmap( preference_xpm );
configmenu->Append( item ); configmenu->Append( item );
item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
_( "&Display" ),
_( "Select how items (pads, tracks texts ... ) are displayed" ) ); _( "Select how items (pads, tracks texts ... ) are displayed" ) );
item->SetBitmap( display_options_xpm ); item->SetBitmap( display_options_xpm );
configmenu->Append( item ); configmenu->Append( item );
...@@ -206,13 +206,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -206,13 +206,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
configmenu->Append( item ); configmenu->Append( item );
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Add access to the Design Rules Dialog and layers setup // // Add access to the Design Rules Dialog and layers setup //
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
wxMenu* designRulesMenu = new wxMenu; wxMenu* designRulesMenu = new wxMenu;
item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
_( "Design Rules" ), _( "Open the design rules dialog editor" ) ); _( "Design Rules" ),
_( "Open the design rules dialog editor" ) );
item->SetBitmap( hammer_xpm ); item->SetBitmap( hammer_xpm );
designRulesMenu->Append( item ); designRulesMenu->Append( item );
...@@ -255,9 +255,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -255,9 +255,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( save_xpm ); item->SetBitmap( save_xpm );
sizes_menu->Append( item ); sizes_menu->Append( item );
//////////////////////////////////////////////////////////////////
// Menu postprocess ( generation fichiers percage, placement... //
//////////////////////////////////////////////////////////////////
wxMenu* postprocess_menu = new wxMenu; wxMenu* postprocess_menu = new wxMenu;
item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_POS_MODULES_FILE, item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_POS_MODULES_FILE,
_( "Generate &Modules Position" ), _( "Generate &Modules Position" ),
...@@ -283,9 +280,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -283,9 +280,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( tools_xpm ); item->SetBitmap( tools_xpm );
postprocess_menu->Append( item ); postprocess_menu->Append( item );
//////////////////////////
// Menu d'outils divers //
//////////////////////////
wxMenu* miscellaneous_menu = new wxMenu; wxMenu* miscellaneous_menu = new wxMenu;
item = new wxMenuItem( miscellaneous_menu, ID_PCB_GLOBAL_DELETE, item = new wxMenuItem( miscellaneous_menu, ID_PCB_GLOBAL_DELETE,
_( "Global &Deletions" ), _( "Global &Deletions" ),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************/ /***********************************************/
/* PCBNEW - Gestion des Options et Reglages de modeedit*/ /* PCBNEW - Footprint (module) editor options. */
/*******************************************************/ /***********************************************/
/* Fichier modeditoptions.cpp */
/*
Affichage et modifications des parametres de travail de Modedit
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -21,70 +15,68 @@ ...@@ -21,70 +15,68 @@
#include "protos.h" #include "protos.h"
void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
/***********************************************************************/
void WinEDA_ModuleEditFrame::OnSelectOptionToolbar(wxCommandEvent& event)
/***********************************************************************/
{ {
int id = event.GetId(); int id = event.GetId();
wxClientDC dc(DrawPanel); wxClientDC dc( DrawPanel );
DrawPanel->CursorOff( &dc); DrawPanel->CursorOff( &dc );
DrawPanel->PrepareGraphicContext(&dc); DrawPanel->PrepareGraphicContext( &dc );
switch ( id ) switch( id )
{ {
case ID_TB_OPTIONS_SHOW_GRID: case ID_TB_OPTIONS_SHOW_GRID:
m_Draw_Grid = m_OptionsToolBar->GetToolState(id); m_Draw_Grid = m_OptionsToolBar->GetToolState( id );
DrawPanel->ReDraw(&dc, TRUE); DrawPanel->ReDraw( &dc, TRUE );
break; break;
case ID_TB_OPTIONS_SELECT_UNIT_MM: case ID_TB_OPTIONS_SELECT_UNIT_MM:
g_UnitMetric = MILLIMETRE; g_UnitMetric = MILLIMETRE;
case ID_TB_OPTIONS_SELECT_UNIT_INCH: case ID_TB_OPTIONS_SELECT_UNIT_INCH:
if ( id == ID_TB_OPTIONS_SELECT_UNIT_INCH ) if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH )
g_UnitMetric = INCHES; g_UnitMetric = INCHES;
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar();
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
break; break;
case ID_TB_OPTIONS_SHOW_POLAR_COORD: case ID_TB_OPTIONS_SHOW_POLAR_COORD:
Affiche_Message(wxEmptyString); Affiche_Message( wxEmptyString );
DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState(id); DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState( id );
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar();
break; break;
case ID_TB_OPTIONS_SELECT_CURSOR: case ID_TB_OPTIONS_SELECT_CURSOR:
m_CursorShape = m_OptionsToolBar->GetToolState(id); m_CursorShape = m_OptionsToolBar->GetToolState( id );
break; break;
case ID_TB_OPTIONS_SHOW_PADS_SKETCH: case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
m_DisplayPadFill = ! m_OptionsToolBar->GetToolState(id); m_DisplayPadFill = !m_OptionsToolBar->GetToolState( id );
DrawPanel->ReDraw(&dc, TRUE); DrawPanel->ReDraw( &dc, TRUE );
break; break;
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
m_DisplayViaFill = ! m_OptionsToolBar->GetToolState(id); m_DisplayViaFill = !m_OptionsToolBar->GetToolState( id );
DrawPanel->ReDraw(&dc, TRUE); DrawPanel->ReDraw( &dc, TRUE );
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
m_DisplayModText = m_DisplayModText =
m_OptionsToolBar->GetToolState(id) ? SKETCH : FILLED; m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
DrawPanel->ReDraw(&dc, TRUE); DrawPanel->ReDraw( &dc, TRUE );
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
m_DisplayModEdge = m_DisplayModEdge =
m_OptionsToolBar->GetToolState(id) ? SKETCH : FILLED; m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
DrawPanel->ReDraw(&dc, TRUE); DrawPanel->ReDraw( &dc, TRUE );
break; break;
default: default:
DisplayError(this, wxT("WinEDA_ModuleEditFrame::OnSelectOptionToolbar error") ); DisplayError( this,
wxT( "WinEDA_ModuleEditFrame::OnSelectOptionToolbar error" ) );
break; break;
} }
SetToolbars(); SetToolbars();
DrawPanel->CursorOn(&dc); DrawPanel->CursorOn( &dc );
} }
This diff is collapsed.
This diff is collapsed.
/*************************/ /************************/
/* Edition des Pastilles */ /* Edit footprint pads. */
/*************************/ /************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -15,21 +15,14 @@ ...@@ -15,21 +15,14 @@
#include "protos.h" #include "protos.h"
/* Routines Locales */
/* Variables locales */ static D_PAD* s_CurrentSelectedPad;
static D_PAD* s_CurrentSelectedPad; /* pointeur sur le pad selecte pour edition */
static wxPoint Pad_OldPos; static wxPoint Pad_OldPos;
/************************************************************/ /* Cancel move pad command.
static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************/
/* Routine de sortie du menu EDIT PADS.
* Sortie simple si pad de pad en mouvement
* Remise en etat des conditions initiales avant move si move en cours
*/ */
static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
D_PAD* pad = s_CurrentSelectedPad; D_PAD* pad = s_CurrentSelectedPad;
...@@ -42,10 +35,10 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -42,10 +35,10 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
pad->m_Flags = 0; pad->m_Flags = 0;
pad->m_Pos = Pad_OldPos; pad->m_Pos = Pad_OldPos;
pad->Draw( Panel, DC, GR_XOR ); pad->Draw( Panel, DC, GR_XOR );
/* Pad Move en cours : remise a l'etat d'origine */
/* Pad move in progress: the restore origin. */
if( g_Drag_Pistes_On ) if( g_Drag_Pistes_On )
{ {
/* Effacement des segments dragges */
DRAG_SEGM* pt_drag = g_DragSegmentList; DRAG_SEGM* pt_drag = g_DragSegmentList;
for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext ) for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext )
{ {
...@@ -63,10 +56,9 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -63,10 +56,9 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
/*************************************************************************/ /* Draw in drag mode when moving a pad.
*/
static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/*************************************************************************/
/* Affiche le pad et les pistes en mode drag lors des deplacements du pad */
{ {
TRACK* Track; TRACK* Track;
DRAG_SEGM* pt_drag; DRAG_SEGM* pt_drag;
...@@ -82,7 +74,6 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -82,7 +74,6 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( !g_Drag_Pistes_On ) if( !g_Drag_Pistes_On )
return; return;
/* Tracage des segments dragges */
pt_drag = g_DragSegmentList; pt_drag = g_DragSegmentList;
for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext ) for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext )
{ {
...@@ -102,12 +93,9 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -102,12 +93,9 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
/*************************************************************/ /* Load list of features for default pad selection.
void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
/*************************************************************/
/* Charge en liste des caracteristiques par defaut celles du pad selecte
*/ */
void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
{ {
MODULE* Module; MODULE* Module;
...@@ -133,15 +121,12 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad ) ...@@ -133,15 +121,12 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
} }
/***********************************************************************/ /* Imports the new values of dimensions of the pad edge by pt_pad
void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) * - Source: selected values of general characteristics
/***********************************************************************/ * - Measurements are modified
* - The position, names, and keys are not.
/* Met a jour les nouvelles valeurs de dimensions du pad pointe par pt_pad
* - Source : valeurs choisies des caracteristiques generales
* - les dimensions sont modifiees
* - la position et les noms ne sont pas touches
*/ */
void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
{ {
if( aDraw ) if( aDraw )
{ {
...@@ -161,7 +146,6 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -161,7 +146,6 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
aPad->m_Drill = g_Pad_Master.m_Drill; aPad->m_Drill = g_Pad_Master.m_Drill;
aPad->m_DrillShape = g_Pad_Master.m_DrillShape; aPad->m_DrillShape = g_Pad_Master.m_DrillShape;
/* Traitement des cas particuliers : */
switch( g_Pad_Master.m_PadShape ) switch( g_Pad_Master.m_PadShape )
{ {
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
...@@ -186,14 +170,14 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -186,14 +170,14 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( aDraw ) if( aDraw )
DrawPanel->PostDirtyRect( aPad->GetBoundingBox() ); DrawPanel->PostDirtyRect( aPad->GetBoundingBox() );
( (MODULE*) aPad->GetParent() )->m_LastEdit_Time = time( NULL ); ( (MODULE*) aPad->GetParent() )->m_LastEdit_Time = time( NULL );
} }
/***********************************************************/ /* Add a pad on the selected module.
*/
void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/***********************************************************/
/* Routine d'ajout d'un pad sur l'module selectionnee */
{ {
D_PAD* Pad; D_PAD* Pad;
int rX, rY; int rX, rY;
...@@ -203,10 +187,10 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -203,10 +187,10 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
Pad = new D_PAD( Module ); Pad = new D_PAD( Module );
/* Chainage de la structure en fin de liste des pads : */ /* Add the new pad to end of the module pad list. */
Module->m_Pads.PushBack( Pad ); Module->m_Pads.PushBack( Pad );
/* Mise a jour des caract de la pastille : */ /* Update the pad properties. */
Import_Pad_Settings( Pad, false ); Import_Pad_Settings( Pad, false );
Pad->SetNetname( wxEmptyString ); Pad->SetNetname( wxEmptyString );
...@@ -220,12 +204,14 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -220,12 +204,14 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
Pad->m_Pos0.x = rX; Pad->m_Pos0.x = rX;
Pad->m_Pos0.y = rY; Pad->m_Pos0.y = rY;
/* Increment automatique de la reference courante Current_PadName */ /* Automatically increment the current pad number and name. */
long num = 0; int ponder = 1; long num = 0;
int ponder = 1;
while( g_Current_PadName.Len() && g_Current_PadName.Last() >= '0' while( g_Current_PadName.Len() && g_Current_PadName.Last() >= '0'
&& g_Current_PadName.Last() <= '9' ) && g_Current_PadName.Last() <= '9' )
{ {
num += (g_Current_PadName.Last() - '0') * ponder; num += ( g_Current_PadName.Last() - '0' ) * ponder;
g_Current_PadName.RemoveLast(); g_Current_PadName.RemoveLast();
ponder *= 10; ponder *= 10;
} }
...@@ -234,7 +220,6 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -234,7 +220,6 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
g_Current_PadName << num; g_Current_PadName << num;
Pad->SetPadName( g_Current_PadName ); Pad->SetPadName( g_Current_PadName );
/* Redessin du module */
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->DisplayInfo( this ); Pad->DisplayInfo( this );
if( draw ) if( draw )
...@@ -242,10 +227,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -242,10 +227,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
} }
/*********************************************************/ /* Function to delete the pad. */
void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad ) void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad )
/*********************************************************/
/* Function to delete the pad "pad" */
{ {
MODULE* Module; MODULE* Module;
wxString line; wxString line;
...@@ -274,10 +257,8 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad ) ...@@ -274,10 +257,8 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad )
} }
/*************************************************************/ /* Function to initialize the "move pad" command */
void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC ) void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC )
/*************************************************************/
/* Function to initialise the "move pad" command */
{ {
MODULE* Module; MODULE* Module;
...@@ -305,10 +286,8 @@ void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC ) ...@@ -305,10 +286,8 @@ void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC )
} }
/*********************************************************/ /* Routine to place a moved pad. */
void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
/*********************************************************/
/* Routine to Place a moved pad */
{ {
int dX, dY; int dX, dY;
TRACK* Track; TRACK* Track;
...@@ -323,7 +302,9 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -323,7 +302,9 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
PICKED_ITEMS_LIST pickList; PICKED_ITEMS_LIST pickList;
/* Save dragged track segments in undo list */ /* Save dragged track segments in undo list */
for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext ) for( DRAG_SEGM* pt_drag = g_DragSegmentList;
pt_drag;
pt_drag = pt_drag->Pnext )
{ {
Track = pt_drag->m_Segm; Track = pt_drag->m_Segm;
...@@ -355,13 +336,13 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -355,13 +336,13 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
if( g_DragSegmentList ) if( g_DragSegmentList )
SaveCopyInUndoList( pickList, UR_CHANGED ); SaveCopyInUndoList( pickList, UR_CHANGED );
/* Placement du pad */
Pad->m_Pos = pad_curr_position; Pad->m_Pos = pad_curr_position;
Pad->Draw( DrawPanel, DC, GR_XOR ); Pad->Draw( DrawPanel, DC, GR_XOR );
/* Redraw dragged track segments */ /* Redraw dragged track segments */
for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext ) for( DRAG_SEGM* pt_drag = g_DragSegmentList;
pt_drag;
pt_drag = pt_drag->Pnext )
{ {
Track = pt_drag->m_Segm; Track = pt_drag->m_Segm;
...@@ -376,7 +357,8 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -376,7 +357,8 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Track->Draw( DrawPanel, DC, GR_OR ); Track->Draw( DrawPanel, DC, GR_OR );
} }
/* Compute local coordinates (i.e refer to Module position and for Module orient = 0)*/ /* Compute local coordinates (i.e refer to Module position and for Module
* orient = 0) */
dX = Pad->m_Pos.x - Pad_OldPos.x; dX = Pad->m_Pos.x - Pad_OldPos.x;
dY = Pad->m_Pos.y - Pad_OldPos.y; dY = Pad->m_Pos.y - Pad_OldPos.y;
RotatePoint( &dX, &dY, -Module->m_Orient ); RotatePoint( &dX, &dY, -Module->m_Orient );
...@@ -392,23 +374,18 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -392,23 +374,18 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
EraseDragListe(); EraseDragListe();
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
m_Pcb->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK); m_Pcb->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK );
} }
/**********************************************************/ /* Rotate selected pad 90 degrees.
void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
/**********************************************************/
/* Tourne de 90 degres le pad selectionne :
* c.a.d intervertit dim X et Y et offsets
*/ */
void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
{ {
MODULE* Module; MODULE* Module;
...@@ -429,12 +406,10 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC ) ...@@ -429,12 +406,10 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Pad->m_Offset.y = -Pad->m_Offset.y; Pad->m_Offset.y = -Pad->m_Offset.y;
EXCHG( Pad->m_DeltaSize.x, Pad->m_DeltaSize.y ); EXCHG( Pad->m_DeltaSize.x, Pad->m_DeltaSize.y );
Pad->m_DeltaSize.x = -Pad->m_DeltaSize.x; /* ceci est la variation Pad->m_DeltaSize.x = -Pad->m_DeltaSize.x;
* de la dim Y sur l'axe X */
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->DisplayInfo( this ); Pad->DisplayInfo( this );
if( DC ) if( DC )
Module->Draw( DrawPanel, DC, GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
This diff is collapsed.
This diff is collapsed.
/*****************************************************/ /*****************************************************/
/* muwave_command.cpp: micro wave functions commands */ /* muwave_command.cpp: micro wave functions commands */
/*****************************************************/ /*****************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -14,62 +14,60 @@ ...@@ -14,62 +14,60 @@
#include "protos.h" #include "protos.h"
/*********************************************************************/ /* Handle microwave commands.
void WinEDA_PcbFrame::ProcessMuWaveFunctions(wxCommandEvent& event) */
/*********************************************************************/ void WinEDA_PcbFrame::ProcessMuWaveFunctions( wxCommandEvent& event )
/* Traite les selections d'outils et les commandes appelees du menu POPUP
*/
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
wxClientDC dc(DrawPanel); wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext(&dc); DrawPanel->PrepareGraphicContext( &dc );
wxGetMousePosition(&pos.x, &pos.y); wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20; pos.y += 20;
switch ( id ) // Arret eventuel de la commande de dplacement en cours switch( id ) // End any command in progress.
{ {
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
break; break;
default: // Arret de la commande de dplacement en cours default: // End block command in progress.
if( DrawPanel->ManageCurseur && if( DrawPanel->ManageCurseur
DrawPanel->ForceCloseManageCurseur ) && DrawPanel->ForceCloseManageCurseur )
{ {
DrawPanel->ForceCloseManageCurseur(DrawPanel, &dc); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
} }
SetToolID(0, wxCURSOR_ARROW,wxEmptyString); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break; break;
} }
switch ( id ) // Traitement des commandes switch( id )
{ {
case ID_PCB_MUWAVE_TOOL_SELF_CMD: case ID_PCB_MUWAVE_TOOL_SELF_CMD:
SetToolID( id, wxCURSOR_PENCIL, _("Add Line")); SetToolID( id, wxCURSOR_PENCIL, _( "Add Line" ) );
break; break;
case ID_PCB_MUWAVE_TOOL_GAP_CMD: case ID_PCB_MUWAVE_TOOL_GAP_CMD:
SetToolID( id, wxCURSOR_PENCIL, _("Add Gap")); SetToolID( id, wxCURSOR_PENCIL, _( "Add Gap" ) );
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_CMD: case ID_PCB_MUWAVE_TOOL_STUB_CMD:
SetToolID( id, wxCURSOR_PENCIL, _("Add Stub")); SetToolID( id, wxCURSOR_PENCIL, _( "Add Stub" ) );
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD: case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD:
SetToolID( id, wxCURSOR_PENCIL, _("Add Arc Stub")); SetToolID( id, wxCURSOR_PENCIL, _( "Add Arc Stub" ) );
break; break;
case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD: case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD:
SetToolID( id, wxCURSOR_PENCIL, _("Add Polynomial Shape")); SetToolID( id, wxCURSOR_PENCIL, _( "Add Polynomial Shape" ) );
break; break;
default: default:
DisplayError(this, wxT("WinEDA_PcbFrame::ProcessMuWaveFunctions() id error")); DisplayError( this,
wxT( "WinEDA_PcbFrame::ProcessMuWaveFunctions() id error" ) );
break; break;
} }
...@@ -77,45 +75,42 @@ wxClientDC dc(DrawPanel); ...@@ -77,45 +75,42 @@ wxClientDC dc(DrawPanel);
} }
void WinEDA_PcbFrame::MuWaveCommand( wxDC* DC, const wxPoint& MousePos )
/***************************************************************************/
void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos)
/***************************************************************************/
{ {
MODULE* module = NULL; MODULE* module = NULL;
switch ( m_ID_current_state )
switch( m_ID_current_state )
{ {
case ID_PCB_MUWAVE_TOOL_SELF_CMD: case ID_PCB_MUWAVE_TOOL_SELF_CMD:
Begin_Self(DC); Begin_Self( DC );
break; break;
case ID_PCB_MUWAVE_TOOL_GAP_CMD: case ID_PCB_MUWAVE_TOOL_GAP_CMD:
module = Create_MuWaveComponent( 0); module = Create_MuWaveComponent( 0 );
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_CMD: case ID_PCB_MUWAVE_TOOL_STUB_CMD:
module = Create_MuWaveComponent( 1); module = Create_MuWaveComponent( 1 );
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD: case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD:
module = Create_MuWaveComponent( 2); module = Create_MuWaveComponent( 2 );
break; break;
case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD: case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD:
module = Create_MuWavePolygonShape(); module = Create_MuWavePolygonShape();
break; break;
default : default:
DrawPanel->SetCursor(wxCURSOR_ARROW); DrawPanel->SetCursor( wxCURSOR_ARROW );
DisplayError(this, wxT("WinEDA_PcbFrame::MuWaveCommand() id error")); DisplayError( this, wxT( "WinEDA_PcbFrame::MuWaveCommand() id error" ) );
SetToolID(0, wxCURSOR_ARROW,wxEmptyString); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break; break;
} }
if ( module ) if( module )
{ {
StartMove_Module( module, DC ); StartMove_Module( module, DC );
} }
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
} }
This diff is collapsed.
This diff is collapsed.
/***********************************/ /****************************************/
/** pcbcfg() : configuration **/ /** pcbnew_config.cpp : configuration **/
/***********************************/ /****************************************/
/* lit ou met a jour la configuration de PCBNEW */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -24,12 +22,10 @@ ...@@ -24,12 +22,10 @@
#include "dialog_general_options.h" #include "dialog_general_options.h"
#define HOTKEY_FILENAME wxT( "pcbnew" ) #define HOTKEY_FILENAME wxT( "pcbnew" )
/***********************************************************/
void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
/***********************************************************/
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
...@@ -54,7 +50,7 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) ...@@ -54,7 +50,7 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
DisplayDialogLayerSetup( this ); DisplayDialogLayerSetup( this );
break; break;
case ID_CONFIG_REQ: // Creation de la fenetre de configuration case ID_CONFIG_REQ:
InstallConfigFrame( pos ); InstallConfigFrame( pos );
break; break;
...@@ -147,13 +143,10 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) ...@@ -147,13 +143,10 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
} }
/***************************************************************/
bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
/***************************************************************/
/* /*
* Read the hotkey files config for pcbnew and module_edit * Read the hotkey files config for pcbnew and module_edit
*/ */
bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
{ {
wxString FullFileName = ReturnHotkeyConfigFilePath( wxString FullFileName = ReturnHotkeyConfigFilePath(
g_ConfigFileLocationChoice ); g_ConfigFileLocationChoice );
...@@ -183,7 +176,7 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName ) ...@@ -183,7 +176,7 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName )
wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer ); wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer );
/* Init des valeurs par defaut */ /* Initialize default values. */
g_LibName_List.Clear(); g_LibName_List.Clear();
wxGetApp().ReadProjectConfig( fn.GetFullPath(), wxGetApp().ReadProjectConfig( fn.GetFullPath(),
...@@ -217,10 +210,7 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName ) ...@@ -217,10 +210,7 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName )
} }
/**********************************************************/
void WinEDA_PcbFrame::Update_config( wxWindow* displayframe ) void WinEDA_PcbFrame::Update_config( wxWindow* displayframe )
/***********************************************************/
/* enregistrement de la config */
{ {
wxFileName fn; wxFileName fn;
...@@ -234,7 +224,6 @@ void WinEDA_PcbFrame::Update_config( wxWindow* displayframe ) ...@@ -234,7 +224,6 @@ void WinEDA_PcbFrame::Update_config( wxWindow* displayframe )
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
/* ecriture de la configuration */
wxGetApp().WriteProjectConfig( fn.GetFullPath(), wxT( "/pcbnew" ), wxGetApp().WriteProjectConfig( fn.GetFullPath(), wxT( "/pcbnew" ),
ParamCfgList ); ParamCfgList );
} }
This diff is collapsed.
This diff is collapsed.
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