added " pcbnew module editor toolbar items now in menubar" patch from Jerry Jacobs. Fixed TODO, and some issues.

Fixed some minor translation issues (different help texts for the same command in tools and menus).
minor code cleaning.
fixed minor warnings in debug mode.
This commit is contained in:
jean-pierre charras 2010-07-29 22:55:18 +02:00
commit 92676ee070
23 changed files with 5628 additions and 5362 deletions

View File

@ -107,7 +107,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelBasic->SetSizer( bSizerBasicPanel );
m_PanelBasic->Layout();
bSizerBasicPanel->Fit( m_PanelBasic );
m_NoteBook->AddPage( m_PanelBasic, _("Options"), true );
m_NoteBook->AddPage( m_PanelBasic, _("Options"), false );
m_PanelDoc = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_PanelDocBoxSizer;
m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL );
@ -123,7 +123,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_staticTextKeywords = new wxStaticText( m_PanelDoc, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextKeywords->Wrap( -1 );
m_staticTextKeywords->SetToolTip( _("Enter keys words that can be used to select this composant\nkeys words cannot have spaces and are separated by a space") );
m_staticTextKeywords->SetToolTip( _("Enter keys words that can be used to select this composant.\nKey words cannot have spaces and are separated by a space.") );
m_PanelDocBoxSizer->Add( m_staticTextKeywords, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
@ -153,7 +153,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelDoc->SetSizer( m_PanelDocBoxSizer );
m_PanelDoc->Layout();
m_PanelDocBoxSizer->Fit( m_PanelDoc );
m_NoteBook->AddPage( m_PanelDoc, _("Description"), false );
m_NoteBook->AddPage( m_PanelDoc, _("Description"), true );
m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bSizerMainPanelAlias;
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );

View File

@ -128,7 +128,7 @@
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Options</property>
<property name="select">1</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
@ -851,7 +851,7 @@
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Description</property>
<property name="select">0</property>
<property name="select">1</property>
<object class="wxPanel" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
@ -1026,7 +1026,7 @@
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Enter keys words that can be used to select this composant&#x0A;keys words cannot have spaces and are separated by a space</property>
<property name="tooltip">Enter keys words that can be used to select this composant.&#x0A;Key words cannot have spaces and are separated by a space.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>

View File

@ -429,7 +429,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
{
if( m_ID_current_state != ID_NOCONN_BUTT )
SetToolID( ID_NOCONN_BUTT, wxCURSOR_PENCIL,
_( "Add a no connected flag" ) );
_( "Add \"NoNonnect\" Flags" ) );
OnLeftClick( DC, MousePos );
}
break;

View File

@ -144,6 +144,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit EESchema" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
#endif /* !defined( __WXMAC__) */

View File

@ -76,6 +76,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit Library Editor" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
#endif

View File

@ -90,7 +90,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( wxID_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBVIEW_SELECT_LAYER,
WinEDA_GerberFrame::Process_Special_Functions )

View File

@ -68,7 +68,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
filesMenu->AppendSeparator();
filesMenu->Append( ID_GEN_PRINT, _( "P&rint" ), _( "Print gerber" ) );
filesMenu->Append( wxID_PRINT, _( "P&rint" ), _( "Print gerber" ) );
filesMenu->Append( ID_GEN_PLOT, _( "Plot" ),
_( "Plotting in various formats" ) );
@ -177,7 +177,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
_( "Undelete" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString,
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString,
wxBitmap( print_button ),
_( "Print world" ) );

View File

@ -43,7 +43,6 @@ enum main_id
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
ID_PREFERENCES_HOTKEY_END,
ID_GEN_PRINT,
ID_GEN_PLOT,
ID_GEN_PLOT_PS,
ID_GEN_PLOT_HPGL,
@ -52,7 +51,6 @@ enum main_id
ID_GEN_PLOT_DXF,
ID_GEN_COPY_SHEET_TO_CLIPBOARD,
ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
ID_GEN_UNUSED0,
ID_GEN_EXPORT_FILE,
ID_GEN_EXPORT_SPECCTRA,

View File

@ -1073,6 +1073,8 @@ public:
void InstallOptionsFrame( const wxPoint& pos );
void OnCloseWindow( wxCloseEvent& Event );
void CloseModuleEditor( wxCommandEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar();

View File

@ -40,7 +40,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Geometry:") ), wxVERTICAL );
wxFlexGridSizer* fgSizerGeometry;
fgSizerGeometry = new wxFlexGridSizer( 9, 3, 0, 0 );
fgSizerGeometry = new wxFlexGridSizer( 12, 3, 0, 0 );
fgSizerGeometry->SetFlexibleDirection( wxBOTH );
fgSizerGeometry->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -230,7 +230,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
sbClearancesSizer->Add( m_staticText20, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgClearancesGridSizer;
fgClearancesGridSizer = new wxFlexGridSizer( 4, 3, 0, 0 );
fgClearancesGridSizer = new wxFlexGridSizer( 5, 3, 0, 0 );
fgClearancesGridSizer->SetFlexibleDirection( wxBOTH );
fgClearancesGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

View File

@ -331,7 +331,7 @@
<property name="name">fgSizerGeometry</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">9</property>
<property name="rows">12</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
@ -2207,7 +2207,7 @@
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMiddleSizer</property>
<property name="orient">wxVERTICAL</property>
@ -2590,7 +2590,7 @@
<property name="name">fgClearancesGridSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">4</property>
<property name="rows">5</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>

View File

@ -1,7 +1,7 @@
/************************************************/
/* menubarmodedit.cpp - Module editor menu bar. */
/************************************************/
/***
* @file menubarmodedit.cpp
* Module editor menu bar.
***/
#include "fctsys.h"
#include "common.h"
@ -12,75 +12,304 @@
#include "protos.h"
#include "pcbnew_id.h"
/* Create the menubar for the module editor */
void WinEDA_ModuleEditFrame::ReCreateMenuBar()
{
wxMenuBar* menuBar = GetMenuBar();
wxMenuItem* item;
if( !menuBar )
{
if( menuBar )
return;
menuBar = new wxMenuBar();
wxMenu* sizes_menu = new wxMenu;
/* File menu */
wxMenu* fileMenu = new wxMenu;
item = new wxMenuItem( sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Sizes and Widths" ),
_( "Adjust width for texts and drawings" ) );
/* New module */
item = new wxMenuItem( fileMenu,
ID_MODEDIT_NEW_MODULE,
_( "New Module" ),
_( "Create new module" ) );
item->SetBitmap( new_footprint_xpm );
fileMenu->Append( item );
/* Open submenu */
wxMenu* openSubmenu = new wxMenu;
/* from File */
item = new wxMenuItem( openSubmenu,
ID_MODEDIT_IMPORT_PART,
_( "from File (Import)" ),
_( "Import a footprint from an existing file" ) );
item->SetBitmap( import_module_xpm );
openSubmenu->Append( item );
/* from Library */
item = new wxMenuItem( openSubmenu,
ID_MODEDIT_LOAD_MODULE,
_( "Load from Library" ),
_( "Open a footprint module from a Library" ) );
item->SetBitmap( module_xpm );
openSubmenu->Append( item );
/* from current Board */
item = new wxMenuItem( openSubmenu,
ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
_( "Load from current Board" ),
_( "Load a footprint module from the current loaded board" ) );
item->SetBitmap( load_module_board_xpm );
openSubmenu->Append( item );
/* Append openSubmenu to fileMenu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openSubmenu, -1,
_( "&Load Module" ), _( "Load a footprint module" ), open_xpm );
/* Save module */
item = new wxMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBMODULE,
_( "&Save Module in Current Lib" ),
_( "Save Module in working library" ) );
item->SetBitmap( save_library_xpm );
fileMenu->Append( item );
item = new wxMenuItem( fileMenu,
ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
_( "&Save Module in a New Lib" ),
_( "Create new library and save current module" ) );
item->SetBitmap( new_library_xpm );
fileMenu->Append( item );
item = new wxMenuItem( fileMenu,
ID_MODEDIT_EXPORT_PART,
_( "&Export module" ),
_( "Save the current loaded module to a file on the harddisk" ) );
item->SetBitmap( export_module_xpm );
fileMenu->Append( item );
/* Separator */
fileMenu->AppendSeparator();
/* Print */
item = new wxMenuItem( fileMenu, wxID_PRINT, _( "&Print" ),
_( "Print the current module" ) );
item->SetBitmap( plot_xpm );
fileMenu->Append( item );
/* Separator */
fileMenu->AppendSeparator();
/* Close editor */
item = new wxMenuItem( fileMenu, wxID_EXIT, _( "Close" ),
_( "Close the footprint editor" ) );
item->SetBitmap( exit_xpm );
fileMenu->Append( item );
/* Edit menu */
wxMenu* editMenu = new wxMenu;
/* Undo */
item = new wxMenuItem( editMenu,
wxID_UNDO,
_( "Undo" ),
_( "Undo last edit" ) );
item->SetBitmap( undo_xpm );
editMenu->Append( item );
/* Redo */
item = new wxMenuItem( editMenu,
wxID_REDO,
_( "Redo" ),
_( "Redo the last undo action" ) );
item->SetBitmap( redo_xpm );
editMenu->Append( item );
/* Delete items */
item = new wxMenuItem( editMenu,
ID_MODEDIT_DELETE_ITEM_BUTT,
_( "Delete" ),
_( "Delete objects with the eraser" ) );
item->SetBitmap( delete_body_xpm );
editMenu->Append( item );
/* Separator */
editMenu->AppendSeparator();
/* Properties */
item = new wxMenuItem( editMenu,
ID_MODEDIT_EDIT_MODULE_PROPERTIES,
_( "Properties" ),
_( "Edit module properties" ) );
item->SetBitmap( module_options_xpm );
editMenu->Append( item );
/* Dimensions submenu */
wxMenu* dimensions_Submenu = new wxMenu;
/* Sizes and Widths */
item = new wxMenuItem( dimensions_Submenu,
ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Sizes and Widths" ),
_( "Adjust width for texts and drawings" ) );
item->SetBitmap( options_text_xpm );
sizes_menu->Append( item );
dimensions_Submenu->Append( item );
item = new wxMenuItem( sizes_menu, ID_PCB_PAD_SETUP, _( "Pad Settings" ),
_( "Adjust size, shape, layers... for pads" ) );
item->SetBitmap( pad_xpm );
sizes_menu->Append( item );
item =
new wxMenuItem( sizes_menu, ID_PCB_USER_GRID_SETUP,
_( "User Grid Size" ),
_( "Adjust user grid" ) );
/* Pad settings */
item = new wxMenuItem( dimensions_Submenu,
ID_MODEDIT_PAD_SETTINGS,
_( "Pad settings" ),
_( "Edit the settings for new pads" ) );
item->SetBitmap( options_pad_xpm );
dimensions_Submenu->Append( item );
/* User Grid Size */
item = new wxMenuItem( dimensions_Submenu,
ID_PCB_USER_GRID_SETUP,
_( "User Grid Size" ),
_( "Adjust user grid" ) );
item->SetBitmap( grid_xpm );
sizes_menu->Append( item );
dimensions_Submenu->Append( item );
/* Append dimensions_Submenu to editMenu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( editMenu,
dimensions_Submenu, -1,
_( "&Dimensions" ),
_( "Edit dimensions preferences" ),
add_dimension_xpm );
////////////////
// Menu Help: //
////////////////
/* View menu */
wxMenu* viewMenu = new wxMenu;
/* Zoom In */
item = new wxMenuItem( viewMenu,
ID_ZOOM_IN,
_( "Zoom In" ),
_( "Zoom in on the module" ) );
item->SetBitmap( zoom_in_xpm );
viewMenu->Append( item );
/* Zoom Out */
item = new wxMenuItem( viewMenu,
ID_ZOOM_OUT,
_( "Zoom Out" ),
_( "Zoom out on the module" ) );
item->SetBitmap( zoom_out_xpm );
viewMenu->Append( item );
/* Fit on Screen */
item = new wxMenuItem( viewMenu,
ID_ZOOM_PAGE,
_( "Fit on Screen" ),
_( "Zoom and fit the module in the window" ) );
item->SetBitmap( zoom_auto_xpm );
viewMenu->Append( item );
/* Separator */
viewMenu->AppendSeparator();
/* Redraw */
item = new wxMenuItem( viewMenu,
ID_ZOOM_REDRAW,
_( "Redraw" ),
_( "Redraw the window's viewport" ) );
item->SetBitmap( zoom_redraw_xpm );
viewMenu->Append( item );
/* 3D Viewer */
item = new wxMenuItem( viewMenu,
ID_MENU_PCB_SHOW_3D_FRAME,
_( "3D View" ),
_( "Show board in 3D viewer" ) );
item->SetBitmap( show_3d_xpm );
viewMenu->Append( item );
/* Place menu */
wxMenu* placeMenu = new wxMenu;
/* Pad */
item = new wxMenuItem( placeMenu,
ID_MODEDIT_ADD_PAD,
_( "Pad" ),
_( "Add Pads" ) );
item->SetBitmap( pad_xpm );
placeMenu->Append( item );
/* Separator */
placeMenu->AppendSeparator();
/* Circle */
item = new wxMenuItem( placeMenu,
ID_PCB_CIRCLE_BUTT,
_( "Circle" ),
_( "Add graphic circle" ) );
item->SetBitmap( add_circle_xpm );
placeMenu->Append( item );
/* Line or Polygon */
item = new wxMenuItem( placeMenu,
ID_PCB_ADD_LINE_BUTT,
_( "Line or Polygon" ),
_( "Add graphic line or polygon" ) );
item->SetBitmap( add_polygon_xpm );
placeMenu->Append( item );
/* Arc */
item = new wxMenuItem( placeMenu,
ID_PCB_ARC_BUTT,
_( "Arc" ),
_( "Add graphic arc" ) );
item->SetBitmap( add_arc_xpm );
placeMenu->Append( item );
/* Text */
item = new wxMenuItem( placeMenu,
ID_PCB_ADD_TEXT_BUTT,
_( "Text" ),
_( "Add graphic text" ) );
item->SetBitmap( add_text_xpm );
placeMenu->Append( item );
/* Anchor */
placeMenu->AppendSeparator();
item = new wxMenuItem( placeMenu,
ID_MODEDIT_PLACE_ANCHOR,
_( "Anchor" ),
_( "Place the footprint module reference anchor" ) );
item->SetBitmap( anchor_xpm );
placeMenu->Append( item );
/* Help menu */
wxMenu* helpMenu = new wxMenu;
// Contents
/* Contents */
item = new wxMenuItem( helpMenu,
ID_GENERAL_HELP,
_( "&Contents" ),
_( "Open the pcbnew manual" ) );
ID_GENERAL_HELP,
_( "&Contents" ),
_( "Open the PCBNew pdf manual" ) );
item->SetBitmap( online_help_xpm );
helpMenu->Append( item );
// About pcbnew
/* About PCBNew */
item = new wxMenuItem( helpMenu,
ID_KICAD_ABOUT,
_( "&About pcbnew" ),
_( "About pcbnew PCB designer" ) );
ID_KICAD_ABOUT,
_( "&About PCBNew" ),
_( "About PCBNew PCB designer" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );
//////////////////////
// Menu Display 3D: //
//////////////////////
wxMenu* Display3DMenu = new wxMenu;
item = new wxMenuItem( Display3DMenu,
ID_MENU_PCB_SHOW_3D_FRAME,
_( "3D Display" ),
_( "Show board in 3D viewer" ) );
item->SetBitmap( show_3d_xpm );
Display3DMenu->Append( item );
menuBar->Append( sizes_menu, _( "&Dimensions" ) );
menuBar->Append( Display3DMenu, _( "&3D Display" ) );
/* Append all the menu's to the menubar */
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
// Associate the menu bar with the frame
/* Associate the menu bar with the frame */
SetMenuBar( menuBar );
}
}

View File

@ -195,7 +195,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
/* Print */
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "&Print" ),
item = new wxMenuItem( filesMenu, wxID_PRINT, _( "&Print" ),
_( "Print pcb board" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
@ -237,6 +237,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit PCBNew" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
#endif /* !defined( __WXMAC__ ) */

View File

@ -135,6 +135,9 @@ m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
case ID_MODEDIT_PLACE_ANCHOR:
{
MODULE* module = GetBoard()->m_Modules;
if( module == NULL // No module loaded
|| (module->m_Flags != 0) )
break;
module->m_Flags = 0;
SaveCopyInUndoList( module, UR_MODEDIT );
Place_Ancre( module ); // set the new relatives internal
@ -145,7 +148,7 @@ m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
// Replace the module in position 0, to recalculate absolutes
// coordinates of items
module->SetPosition( wxPoint( 0, 0 ) );
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
SetToolID( 0, 0, wxEmptyString );
SetCurItem( NULL );
DrawPanel->Refresh();
}
@ -159,6 +162,8 @@ m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
break;
case ID_PCB_ADD_TEXT_BUTT:
if( GetBoard()->m_Modules == NULL )
break;
SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT );
CreateTextModule( GetBoard()->m_Modules, DC );
break;
@ -172,10 +177,9 @@ m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
break;
default:
DrawPanel->SetCursor( wxCURSOR_ARROW );
DisplayError( this,
wxT( "WinEDA_ModuleEditFrame::ProcessCommand error" ) );
m_ID_current_state = 0;
SetToolID( 0, 0, wxEmptyString );
break;
}

View File

@ -2,10 +2,6 @@
/* moduleframe.cpp - Footprint (module) editor main window. */
/************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
@ -31,119 +27,121 @@ static BOARD_DESIGN_SETTINGS s_ModuleEditorDesignSetting;
/* class WinEDA_ModuleEditFrame */
/********************************/
BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame )
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow )
EVT_SIZE( WinEDA_ModuleEditFrame::OnSize )
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow )
EVT_MENU( wxID_EXIT, WinEDA_ModuleEditFrame::CloseModuleEditor )
EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT,
WinEDA_ModuleEditFrame::OnSelectZoom )
EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT,
WinEDA_ModuleEditFrame::OnSelectGrid )
EVT_SIZE( WinEDA_ModuleEditFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ModuleEditFrame::OnZoom )
EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT,
WinEDA_ModuleEditFrame::OnSelectZoom )
EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT,
WinEDA_ModuleEditFrame::OnSelectGrid )
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_DELETE_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_NEW_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_IMPORT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_EXPORT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SHEET_SET,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_ModuleEditFrame::ToPrinter )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_CHECK,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_PAD_SETTINGS,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
WinEDA_ModuleEditFrame::LoadModuleFromBoard )
EVT_TOOL( ID_MODEDIT_INSERT_MODULE_IN_BOARD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_UPDATE_MODULE_IN_BOARD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( wxID_UNDO,
WinEDA_ModuleEditFrame::GetComponentFromUndoList )
EVT_TOOL( wxID_REDO,
WinEDA_ModuleEditFrame::GetComponentFromRedoList )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ModuleEditFrame::OnZoom )
// Vertical toolbar (left click):
EVT_TOOL( ID_NO_SELECT_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_ADD_PAD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ARC_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_CIRCLE_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_TEXT_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_DELETE_ITEM_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_PLACE_ANCHOR,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_PLACE_GRID_COORD_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_DELETE_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_NEW_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_IMPORT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_EXPORT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SHEET_SET,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( wxID_PRINT, WinEDA_ModuleEditFrame::ToPrinter )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_CHECK,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_PAD_SETTINGS,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
WinEDA_ModuleEditFrame::LoadModuleFromBoard )
EVT_TOOL( ID_MODEDIT_INSERT_MODULE_IN_BOARD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_UPDATE_MODULE_IN_BOARD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( wxID_UNDO,
WinEDA_ModuleEditFrame::GetComponentFromUndoList )
EVT_TOOL( wxID_REDO,
WinEDA_ModuleEditFrame::GetComponentFromRedoList )
// Vertical toolbar (right click):
EVT_TOOL_RCLICKED( ID_MODEDIT_ADD_PAD,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_TRACK_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_CIRCLE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
// Vertical toolbar (left click):
EVT_TOOL( ID_NO_SELECT_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_ADD_PAD,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ARC_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_CIRCLE_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_TEXT_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_DELETE_ITEM_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_PLACE_ANCHOR,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_PLACE_GRID_COORD_BUTT,
WinEDA_ModuleEditFrame::Process_Special_Functions )
// Options Toolbar
EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END,
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
// Vertical toolbar (right click):
EVT_TOOL_RCLICKED( ID_MODEDIT_ADD_PAD,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_TRACK_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_CIRCLE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
// popup commands
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
// Options Toolbar
EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END,
WinEDA_ModuleEditFrame::OnSelectOptionToolbar )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
// popup commands
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
// Module transformations
EVT_MENU( ID_MODEDIT_MODULE_ROTATE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_MODEDIT_MODULE_MIRROR,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_PAD_SETUP,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_USER_GRID_SETUP,
WinEDA_PcbFrame::Process_Special_Functions )
// Module transformations
EVT_MENU( ID_MODEDIT_MODULE_ROTATE,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_MODEDIT_MODULE_MIRROR,
WinEDA_ModuleEditFrame::Process_Special_Functions )
// Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_ModuleEditFrame::Show3D_Frame )
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_PAD_SETUP,
WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_USER_GRID_SETUP,
WinEDA_PcbFrame::Process_Special_Functions )
// Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_ModuleEditFrame::Show3D_Frame )
END_EVENT_TABLE()
@ -192,7 +190,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
ReCreateOptToolbar();
if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE;
DrawPanel->m_Block_Enable = true;
m_auimgr.SetManagedWindow( this );
@ -210,8 +208,8 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
horiz.LeftDockable( false ).RightDockable( false );
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().
Row( 0 ) );
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().
Row( 0 ) );
m_auimgr.AddPane( m_AuxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_AuxiliaryToolBar" ) ).
@ -225,10 +223,10 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
Left() );
m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
m_auimgr.AddPane( MsgPanel,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update();
@ -268,13 +266,31 @@ void WinEDA_ModuleEditFrame::OnCloseWindow( wxCloseEvent& Event )
}
void WinEDA_ModuleEditFrame::CloseModuleEditor( wxCommandEvent& Event )
{
Close();
}
/** function WinEDA_ModuleEditFrame::SetToolbars()
* Enable or disable some tools and menus, according to
* the current state of the footprint editor:
* >> a footprint is loaded or not
* >> a working library is selected or not
*/
void WinEDA_ModuleEditFrame::SetToolbars()
{
bool active, islib = TRUE;
bool active, islib = true;
WinEDA_PcbFrame* frame = (WinEDA_PcbFrame*) wxGetApp().GetTopWindow();
if( m_HToolBar == NULL )
return;
wxMenuBar* menuBar = GetMenuBar();
if( menuBar == NULL )
return;
if( m_VToolBar == NULL )
return;
if( m_OptionsToolBar == NULL )
return;
if( m_CurrentLib == wxEmptyString )
islib = false;
@ -285,12 +301,17 @@ void WinEDA_ModuleEditFrame::SetToolbars()
if( GetBoard()->m_Modules == NULL )
active = false;
else
active = TRUE;
active = true;
m_HToolBar->EnableTool( ID_MODEDIT_EXPORT_PART, active );
m_HToolBar->EnableTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
active );
menuBar->Enable( ID_MODEDIT_EXPORT_PART, active );
m_HToolBar->EnableTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, active );
menuBar->Enable( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, active );
m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, active && islib );
menuBar->Enable( ID_MODEDIT_SAVE_LIBMODULE, active && islib );
MODULE* module_in_edit = GetBoard()->m_Modules;
if( module_in_edit && module_in_edit->m_Link ) // this is not a new module
{
@ -322,73 +343,66 @@ void WinEDA_ModuleEditFrame::SetToolbars()
m_HToolBar->EnableTool( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, false );
}
if( GetScreen() )
{
m_HToolBar->EnableTool( wxID_UNDO,
GetScreen()->GetUndoCommandCount()>0 && active );
m_HToolBar->EnableTool( wxID_REDO,
GetScreen()->GetRedoCommandCount()>0 && active );
}
m_HToolBar->EnableTool( wxID_UNDO, GetScreen()->GetUndoCommandCount()>0 && active );
menuBar->Enable( wxID_UNDO, GetScreen()->GetUndoCommandCount()>0 && active );
m_HToolBar->EnableTool( wxID_REDO,
GetScreen()->GetRedoCommandCount()>0 && active );
menuBar->Enable( wxID_REDO, GetScreen()->GetRedoCommandCount()>0 && active );
if( frame->GetBoard()->m_Modules )
{
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, TRUE );
}
else
{
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, false );
}
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, GetBoard()->m_Modules != NULL );
menuBar->Enable( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, GetBoard()->m_Modules != NULL );
m_HToolBar->Refresh();
if( m_VToolBar )
// Enable/disable tools to edit module items:
int idtools[] =
{
m_VToolBar->EnableTool( ID_MODEDIT_ADD_PAD, active );
m_VToolBar->EnableTool( ID_PCB_ADD_LINE_BUTT, active );
m_VToolBar->EnableTool( ID_PCB_CIRCLE_BUTT, active );
m_VToolBar->EnableTool( ID_PCB_ARC_BUTT, active );
m_VToolBar->EnableTool( ID_PCB_ADD_TEXT_BUTT, active );
m_VToolBar->EnableTool( ID_MODEDIT_PLACE_ANCHOR, active );
m_VToolBar->EnableTool( ID_PCB_DELETE_ITEM_BUTT, active );
m_VToolBar->Refresh();
ID_MODEDIT_ADD_PAD, ID_MODEDIT_ADD_PAD,
ID_PCB_ADD_LINE_BUTT, ID_PCB_CIRCLE_BUTT,
ID_PCB_ARC_BUTT, ID_PCB_ADD_TEXT_BUTT,
ID_MODEDIT_PLACE_ANCHOR, ID_MODEDIT_DELETE_ITEM_BUTT
};
for( unsigned ii = 0; ii < sizeof(idtools) / sizeof(int); ii++ )
{
m_VToolBar->EnableTool( idtools[ii], active );
menuBar->Enable( idtools[ii], active );
}
if( m_OptionsToolBar )
{
m_OptionsToolBar->ToggleTool(
ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UserUnit ==
MILLIMETRES ? TRUE : false );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UserUnit == INCHES ? TRUE : false );
m_VToolBar->Refresh();
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood ?
_( "Display rectangular coordinates" ) :
_( "Display polar coordinates" ) );
m_OptionsToolBar->ToggleTool(
ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UserUnit == MILLIMETRES ? true : false );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UserUnit == INCHES ? true : false );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible( ) );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible( ) ?
_( "Hide grid" ) :
_( "Show grid" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood ?
_( "Display rectangular coordinates" ) :
_( "Display polar coordinates" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible() );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible() ?
_( "Hide grid" ) :
_( "Show grid" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR,
m_CursorShape );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR,
m_CursorShape );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
!m_DisplayPadFill );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
!m_DisplayPadFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_DisplayPadFill ?
_( "Show pads in sketch mode" ) :
_( "Show pads in filled mode" ) );
m_OptionsToolBar->Refresh();
}
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_DisplayPadFill ?
_( "Show pads in sketch mode" ) :
_( "Show pads in filled mode" ) );
m_OptionsToolBar->Refresh();
if( m_AuxiliaryToolBar )
{
@ -435,7 +449,7 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
}
m_Draw3DFrame = new WinEDA3D_DrawFrame( this, _( "3D Viewer" ) );
m_Draw3DFrame->Show( TRUE );
m_Draw3DFrame->Show( true );
}
@ -447,7 +461,7 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh( );
DrawPanel->Refresh();
// We must return here, instead of proceeding.
// If we let the cursor move during a refresh request,
@ -519,7 +533,7 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
DrawPanel->ManageCurseur( DrawPanel, DC, true );
}
}
@ -530,22 +544,23 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh( );
DrawPanel->Refresh();
wxSafeYield();
}
SetToolbars();
UpdateStatusBar();
}
/** Virtual Function OnModify()
* Must be called after a change
* in order to set the "modify" flag of the current screen
* and prepare, if needed the refresh of the 3D frame showing the footprint
* do not forget to call the basic OnModify function to update auxiliary info
*/
void WinEDA_ModuleEditFrame::OnModify( )
void WinEDA_ModuleEditFrame::OnModify()
{
WinEDA_BasePcbFrame::OnModify( );
WinEDA_BasePcbFrame::OnModify();
if( m_Draw3DFrame )
m_Draw3DFrame->ReloadRequest( );
m_Draw3DFrame->ReloadRequest();
}

View File

@ -166,7 +166,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, WinEDA_PcbFrame::GetBoardFromUndoList )
EVT_TOOL( wxID_REDO, WinEDA_PcbFrame::GetBoardFromRedoList )
EVT_TOOL( ID_GEN_PRINT, WinEDA_PcbFrame::ToPrinter )
EVT_TOOL( wxID_PRINT, WinEDA_PcbFrame::ToPrinter )
EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions )

25
pcbnew/polygons_defs.h Normal file
View File

@ -0,0 +1,25 @@
/*
* file polygons_defs.h
* definitions to use boost::polygon in Kicad
*/
#ifndef _POLYGONS_DEFS_H_
#define _POLYGONS_DEFS_H_
#ifdef USE_BOOST_POLYGON_LIBRARY
#include "boost/polygon/polygon.hpp"
// Define some types used here from boost::polygon
namespace bpl = boost::polygon; // bpl = boost polygon library
using namespace bpl::operators; // +, -, =, ...
typedef int coordinate_type;
typedef bpl::polygon_data<int> KPolygon;
typedef std::vector<KPolygon> KPolygonSet;
typedef bpl::point_data<int> KPolyPoint;
#endif // USE_BOOST_POLYGON_LIBRARY
#endif // #ifndef _POLYGONS_DEFS_H_

View File

@ -96,7 +96,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
_( "Module Properties" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString, wxBitmap( print_button ),
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString, wxBitmap( print_button ),
_( "Print Module" ) );
m_HToolBar->AddSeparator();
@ -173,7 +173,8 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar()
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_PLACE_ANCHOR, wxEmptyString,
wxBitmap( anchor_xpm ),
_( "Place anchor" ), wxITEM_CHECK );
_( "Place the footprint module reference anchor" ),
wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_DELETE_ITEM_BUTT, wxEmptyString,

View File

@ -222,7 +222,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
HELP_REDO );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString, wxBitmap( print_button ),
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString, wxBitmap( print_button ),
_( "Print board" ) );
m_HToolBar->AddTool( ID_GEN_PLOT, wxEmptyString, wxBitmap( plot_xpm ),
_( "Plot (HPGL, PostScript, or GERBER format)" ) );

View File

@ -22,29 +22,18 @@
#include <math.h>
#include <vector>
#include "boost/polygon/polygon.hpp"
#include "fctsys.h"
#include "polygons_defs.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "trigo.h"
#include "zones.h"
#include "PolyLine.h"
#include "boost/polygon/polygon.hpp"
// Define some types used here from boost::polygon
namespace bpl = boost::polygon; // bpl = boost polygon library
using namespace bpl::operators; // +, -, =, ...
using namespace bpl;
typedef int coordinate_type;
typedef bpl::point_data<int> KPolyPoint;
typedef bpl::polygon_data<int> KPolygon;
typedef std::vector< KPolygon > KPolygonSet;
extern void Test_For_Copper_Island_And_Remove( BOARD* aPcb,
ZONE_CONTAINER* aZone_container );

View File

@ -246,16 +246,16 @@ sp_after_type = force # ignore/add/remove/force
# Add or remove space in 'template <' vs 'template<'.
# If set to ignore, sp_before_angle is used.
sp_template_angle = ignore # ignore/add/remove/force
sp_template_angle = force # ignore/add/remove/force
# Add or remove space before '<>'
sp_before_angle = ignore # ignore/add/remove/force
# Add or remove space inside '<' and '>'
sp_inside_angle = ignore # ignore/add/remove/force
sp_inside_angle = remove # ignore/add/remove/force
# Add or remove space after '<>'
sp_after_angle = ignore # ignore/add/remove/force
sp_after_angle = force # ignore/add/remove/force
# Add or remove space between '<>' and '(' as found in 'new List<byte>();'
sp_angle_paren = ignore # ignore/add/remove/force