Commit 73f83c05 authored by jerryjacobs's avatar jerryjacobs

See CHANGELOG.txt

parent bf02bc4d
......@@ -4,6 +4,16 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-Jan-17 UPDATE Jerry Jacobs <xor.gate.engineering[at]gmail[dot]com>
================================================================================
+ EESchema
+ Added Torsten Huter's patch for hotkeys
+ Moved recent opened documents to submenu
+ Pcbnew
+ Big (re)organisation of pcbframe menubar and cleanup
2010-Jan-13 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
Minor bug fixes, compiler warning fixes and code cleaning.
......
......@@ -163,6 +163,7 @@ enum id_eeschema_frm
/* Library editor context menu IDs */
ID_LIBEDIT_EDIT_PIN,
ID_LIBEDIT_ROTATE_PIN,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
......
......@@ -74,8 +74,8 @@ static Ki_HotkeyInfo HkMirrorXComponent( wxT( "Mirror X Component" ),
HK_MIRROR_X_COMPONENT, 'X' );
static Ki_HotkeyInfo HkOrientNormalComponent( wxT( "Orient Normal Component" ),
HK_ORIENT_NORMAL_COMPONENT, 'N' );
static Ki_HotkeyInfo HkRotateComponent( wxT( "Rotate Component or Label" ),
HK_ROTATE_COMPONENT_OR_LABEL, 'R' );
static Ki_HotkeyInfo HkRotateComponentOrItem( wxT( "Rotate Schematic Item" ),
HK_ROTATE_COMPONENT_OR_ITEM, 'R' );
static Ki_HotkeyInfo HkEditComponent( wxT( "Edit Component or Label" ),
HK_EDIT_COMPONENT_OR_LABEL, 'E' );
static Ki_HotkeyInfo HkEditComponentValue( wxT( "Edit Component Value" ),
......@@ -83,8 +83,8 @@ static Ki_HotkeyInfo HkEditComponentValue( wxT( "Edit Component Value" ),
static Ki_HotkeyInfo HkEditComponentFootprint( wxT( "Edit Component Footprint" ),
HK_EDIT_COMPONENT_FOOTPRINT,
'F' );
static Ki_HotkeyInfo HkMoveComponentOrText( wxT( "Move Component or Label" ),
HK_MOVE_COMPONENT_OR_LABEL, 'M',
static Ki_HotkeyInfo HkMoveComponentOrItem( wxT( "Move Schematic Item" ),
HK_MOVE_COMPONENT_OR_ITEM, 'M',
ID_POPUP_SCH_MOVE_CMP_REQUEST );
static Ki_HotkeyInfo HkCopyComponentOrText( wxT( "Copy Component or Label" ),
......@@ -107,6 +107,7 @@ static Ki_HotkeyInfo HkInsertPin( wxT( "Repeat Pin" ), HK_REPEAT_LAST,
WXK_INSERT );
static Ki_HotkeyInfo HkEditPin( wxT( "Edit Pin" ), HK_EDIT_PIN, 'E' );
static Ki_HotkeyInfo HkMovePin( wxT( "Move Pin" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
static Ki_HotkeyInfo HkRotatePin( wxT( "Rotate Pin" ), HK_LIBEDIT_ROTATE_PIN, 'R' );
static Ki_HotkeyInfo HkDeletePin( wxT( "Delete Pin" ), HK_DELETE_PIN,
WXK_DELETE );
......@@ -127,9 +128,9 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] =
{
&HkNextSearch,
&HkDelete, &HkInsert, &HkMove2Drag,
&HkMoveComponentOrText, &HkCopyComponentOrText,
&HkMoveComponentOrItem, &HkCopyComponentOrText,
&HkDragComponent, &HkAddComponent,
&HkRotateComponent, &HkMirrorXComponent, &HkMirrorYComponent,
&HkRotateComponentOrItem, &HkMirrorXComponent, &HkMirrorYComponent,
&HkOrientNormalComponent,
&HkEditComponent,&HkEditComponentValue,&HkEditComponentFootprint,
&HkBeginWire,
......@@ -143,6 +144,7 @@ Ki_HotkeyInfo* s_LibEdit_Hotkey_List[] =
&HkEditPin,
&HkMovePin,
&HkDeletePin,
&HkRotatePin,
NULL
};
......@@ -333,47 +335,53 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
}
break;
case HK_ROTATE_COMPONENT_OR_LABEL: // Component Rotation
case HK_ROTATE_COMPONENT_OR_ITEM: // Component or other schematic item rotation
if( DrawStruct == NULL )
{
DrawStruct = PickStruct( GetScreen()->m_Curseur,
GetScreen(), LIBITEM | TEXTITEM |
LABELITEM );
// Find the schematic object to rotate under the cursor
DrawStruct = SchematicGeneralLocateAndDisplay( false );
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct == NULL )
break;
}
switch( DrawStruct->Type() )
if (DrawStruct)
{
case TYPE_SCH_COMPONENT:
if( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList( (SCH_ITEM*) DrawStruct, UR_CHANGED );
RefreshToolBar = TRUE;
}
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
CmpRotationMiroir( (SCH_COMPONENT*) DrawStruct, DC,
CMP_ROTATE_COUNTERCLOCKWISE );
break;
// Create the events for rotating a component or other schematic item
wxCommandEvent eventRotateComponent( wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE );
wxCommandEvent eventRotateText(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_ROTATE_TEXT );
wxCommandEvent eventRotateField(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_ROTATE_FIELD );
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
if( DrawStruct->m_Flags == 0 )
switch( DrawStruct->Type() )
{
SaveCopyInUndoList( (SCH_ITEM*) DrawStruct, UR_CHANGED );
RefreshToolBar = TRUE;
case TYPE_SCH_COMPONENT:
wxPostEvent( this, eventRotateComponent );
break;
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
wxPostEvent( this, eventRotateText );
break;
case DRAW_PART_TEXT_STRUCT_TYPE:
wxPostEvent( this, eventRotateField );
default:
;
}
ChangeTextOrient( (SCH_TEXT*) DrawStruct, DC );
break;
default:
;
}
break;
......@@ -422,20 +430,33 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break;
case HK_DRAG_COMPONENT: // Start drag component
case HK_MOVE_COMPONENT_OR_LABEL: // Start move component or text/label
case HK_MOVE_COMPONENT_OR_ITEM: // Start move component or other schematic item
case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label
if( ItemInEdit )
if( ItemInEdit )
break;
if( DrawStruct == NULL )
{
DrawStruct = PickStruct( GetScreen()->m_Curseur,
GetScreen(), LIBITEM | TEXTITEM |
LABELITEM );
// Find the schematic object to move under the cursor
DrawStruct = SchematicGeneralLocateAndDisplay( false );
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ){
// If it's a sheet, then check if a pinsheet is under the cursor
SCH_SHEET_PIN* slabel = LocateSheetLabel( (SCH_SHEET*) DrawStruct,
GetScreen()->m_Curseur );
if (slabel)
DrawStruct = slabel;
}
if (DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE){
// If it's a junction, pick the underlying wire instead
DrawStruct = PickStruct( GetScreen()->m_Curseur,
GetScreen(), WIREITEM);
}
if( DrawStruct == NULL )
break;
}
......@@ -449,33 +470,52 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break;
}
switch( DrawStruct->Type() )
{
case TYPE_SCH_COMPONENT:
if( DrawStruct && (DrawStruct->m_Flags ==0) )
{
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
}
break;
if( DrawStruct && (DrawStruct->m_Flags == 0) ){
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
if( DrawStruct->m_Flags == 0 )
// Create the events for moving a component or other schematic item
wxCommandEvent eventMoveComponent( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
wxCommandEvent eventMoveItem(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_MOVE_ITEM_REQUEST );
wxCommandEvent eventMovePinsheet(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_MOVE_PINSHEET);
wxCommandEvent eventDragWire(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_DRAG_WIRE_REQUEST);
switch( DrawStruct->Type() )
{
SaveCopyInUndoList( (SCH_ITEM*) DrawStruct, UR_CHANGED );
RefreshToolBar = TRUE;
}
StartMoveTexte( (SCH_TEXT*) DrawStruct, DC );
break;
default:
;
// select the correct event for moving an schematic object
// and add it to the event queue
case TYPE_SCH_COMPONENT:
wxPostEvent( this, eventMoveComponent );
break;
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_PART_TEXT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
wxPostEvent( this, eventMoveItem );
break;
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
wxPostEvent( this, eventMovePinsheet );
break;
case DRAW_SEGMENT_STRUCT_TYPE:
if (((SCH_ITEM*)DrawStruct)->GetLayer() == LAYER_WIRE)
wxPostEvent( this, eventDragWire );
break;
default:
;
}
}
break;
case HK_EDIT_COMPONENT_OR_LABEL:
......@@ -486,7 +526,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
{
DrawStruct = PickStruct( GetScreen()->m_Curseur,
GetScreen(), LIBITEM | TEXTITEM |
LABELITEM );
LABELITEM | SHEETITEM );
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
......@@ -495,21 +535,32 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break;
}
switch( DrawStruct->Type() )
if( DrawStruct )
{
case TYPE_SCH_COMPONENT:
InstallCmpeditFrame( this, MousePos,(SCH_COMPONENT*) DrawStruct );
break;
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
EditSchematicText( (SCH_TEXT*) DrawStruct );
break;
default:
;
wxCommandEvent eventEditPinsheet(wxEVT_COMMAND_TOOL_CLICKED,
ID_POPUP_SCH_EDIT_SHEET);
switch( DrawStruct->Type() )
{
case TYPE_SCH_COMPONENT:
InstallCmpeditFrame( this, MousePos,(SCH_COMPONENT*) DrawStruct );
break;
case DRAW_SHEET_STRUCT_TYPE:
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
wxPostEvent( this, eventEditPinsheet );
break;
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
EditSchematicText( (SCH_TEXT*) DrawStruct );
break;
default:
;
}
}
break;
......@@ -654,6 +705,18 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
break;
case HK_LIBEDIT_ROTATE_PIN:
m_drawItem = LocateItemUsingCursor();
if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
{
cmd.SetId( ID_LIBEDIT_ROTATE_PIN );
GetEventHandler()->ProcessEvent( cmd );
}
break;
case HK_DELETE_PIN:
m_drawItem = LocateItemUsingCursor();
......
......@@ -20,18 +20,19 @@ enum hotkey_id_commnand {
HK_REPEAT_LAST,
HK_EDIT_PIN,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM,
HK_LIBEDIT_ROTATE_PIN,
HK_DELETE_PIN,
HK_UNDO,
HK_REDO,
HK_MOVEBLOCK_TO_DRAGBLOCK,
HK_ROTATE_COMPONENT_OR_LABEL,
HK_ROTATE_COMPONENT_OR_ITEM,
HK_EDIT_COMPONENT_OR_LABEL,
HK_EDIT_COMPONENT_VALUE,
HK_EDIT_COMPONENT_FOOTPRINT,
HK_MIRROR_X_COMPONENT,
HK_MIRROR_Y_COMPONENT,
HK_ORIENT_NORMAL_COMPONENT,
HK_MOVE_COMPONENT_OR_LABEL,
HK_MOVE_COMPONENT_OR_ITEM,
HK_COPY_COMPONENT_OR_LABEL,
HK_DRAG_COMPONENT,
HK_ADD_NEW_COMPONENT,
......
......@@ -239,6 +239,9 @@ void AddMenusForPin( wxMenu* PopMenu,
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
msg = AddHotkeyName( _( "Rotate Pin " ), s_Libedit_Hokeys_Descr, HK_LIBEDIT_ROTATE_PIN );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_PIN, msg, rotate_pin_xpm );
if( not_in_move )
{
msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr,
......
......@@ -54,6 +54,7 @@ public:
void OnCheckComponent( wxCommandEvent& event );
void OnSelectBodyStyle( wxCommandEvent& event );
void OnEditPin( wxCommandEvent& event );
void OnRotatePin( wxCommandEvent& event );
void OnUpdateEditingPart( wxUpdateUIEvent& event );
void OnUpdateNotEditingPart( wxUpdateUIEvent& event );
......
......@@ -115,6 +115,8 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
/* Context menu events and commands. */
EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin )
EVT_MENU( ID_LIBEDIT_ROTATE_PIN, WinEDA_LibeditFrame::OnRotatePin )
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
WinEDA_LibeditFrame::Process_Special_Functions )
......
......@@ -412,6 +412,12 @@ bool IsItemInBox( EDA_Rect& aBox, SCH_ITEM* DrawStruct )
break;
case DRAW_JUNCTION_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (SCH_JUNCTION*) DrawStruct )
if( aBox.Inside(STRUCT->m_Pos) )
return true;
break;
case DRAW_NOCONNECT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_TEXT:
......
......@@ -49,13 +49,12 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
item->SetBitmap( open_xpm );
filesMenu->Append( item );
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save Project" ),
_( "Save all sheets in the schematic project" ) );
item->SetBitmap( save_project_xpm );
filesMenu->Append( item );
/* Open Recent submenu */
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
filesMenu->AppendSubMenu( openRecentMenu, _( "Open &Recent" ),
_( "Open a recent opened document" ) );
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET, _( "&Save" ),
_( "Save only current schematic sheet" ) );
item->SetBitmap( save_xpm );
......@@ -66,8 +65,15 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
item->SetBitmap( save_as_xpm );
filesMenu->Append( item );
// Print and Plot section:
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save Project" ),
_( "Save all sheets in the schematic project" ) );
item->SetBitmap( save_project_xpm );
filesMenu->Append( item );
filesMenu->AppendSeparator();
// Print and Plot section:
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
_( "Print schematic sheet" ) );
item->SetBitmap( print_button );
......@@ -116,8 +122,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
/* Add the file history */
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
// Menu Edit:
wxMenu* editMenu = new wxMenu;
......
......@@ -15,6 +15,9 @@
#include "protos.h"
#include "hotkeys.h"
#include "class_library.h"
#include <iostream>
using namespace std;
static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame );
......@@ -57,10 +60,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
return true;
}
if (DrawStruct)
cout << "Drawstruct Type before: " << DrawStruct -> Type() << endl;
// Try to locate items at cursor position.
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{
DrawStruct = SchematicGeneralLocateAndDisplay( false );
if (DrawStruct)
cout << "Drawstruct Type locate : " << DrawStruct -> Type() << endl;
if( DrawStruct && (DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE) )
{
SCH_SHEET_PIN* slabel;
......@@ -71,6 +81,9 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
}
}
if (DrawStruct)
cout << "Drawstruct Type : " << DrawStruct -> Type() << endl;
// If Command in progress: add "cancel" and "end tool" menu
if( m_ID_current_state )
{
......@@ -125,9 +138,13 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
break;
case DRAW_BUSENTRY_STRUCT_TYPE:
if( !flags )
if( !flags ){
wxString msg = AddHotkeyName( _( "Move Bus Entry" ),
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move Bus Entry" ), move_xpm );
msg, move_xpm );
}
if( GetBusEntryShape( (SCH_BUS_ENTRY*) DrawStruct ) == '\\' )
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH,
_( "Set Bus Entry /" ) );
......@@ -229,11 +246,19 @@ DrawType %d" ),
void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
{
if( !Field->m_Flags )
wxString msg;
if( !Field->m_Flags ){
msg = AddHotkeyName( _( "Move Field" ),
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move Field" ), move_text_xpm );
msg, move_text_xpm );
}
msg = AddHotkeyName( _( "Rotate Field" ),
s_Schematic_Hokeys_Descr, HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_FIELD,
_( "Rotate Field" ), rotate_field_xpm );
msg, rotate_field_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_FIELD,
_( "Edit Field" ), edit_text_xpm );
}
......@@ -265,7 +290,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
{
msg = _( "Move Component" );
msg << wxT( " " ) << Component->GetField( REFERENCE )->m_Text;
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_LABEL );
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_CMP_REQUEST,
msg, move_xpm );
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr,
......@@ -276,7 +301,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_LABEL );
HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE,
msg, rotate_pos_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE,
......@@ -367,7 +392,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
if( !GLabel->m_Flags )
{
msg = AddHotkeyName( _( "Move Global Label" ),
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_LABEL );
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Global Label" ),
......@@ -377,7 +402,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Global Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_LABEL );
HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
msg, rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Global Label" ), s_Schematic_Hokeys_Descr,
......@@ -411,7 +436,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
{
msg = AddHotkeyName( _( "Move Hierarchical Label" ),
s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_LABEL );
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Hierarchical Label" ),
......@@ -421,7 +446,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_LABEL );
HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
_( "Rotate Hierarchical Label" ), rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Hierarchical Label" ), s_Schematic_Hokeys_Descr,
......@@ -454,7 +479,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
if( !Label->m_Flags )
{
msg = AddHotkeyName( _( "Move Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_LABEL );
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Label" ),
......@@ -464,7 +489,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_LABEL );
HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
msg, rotate_pos_xpm );
msg = AddHotkeyName( _( "Edit Label" ), s_Schematic_Hokeys_Descr,
......@@ -498,7 +523,7 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
{
msg = AddHotkeyName( _( "Move Text" ),
s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_LABEL );
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Text" ),
......@@ -508,7 +533,7 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Text" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_LABEL );
HK_ROTATE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg,
rotate_pos_xpm );
msg = AddHotkeyName( _( "Edit Text" ), s_Schematic_Hokeys_Descr,
......@@ -584,7 +609,9 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire,
return;
}
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, _( "Drag Wire" ),
msg = AddHotkeyName( _( "Drag Wire" ), s_Schematic_Hokeys_Descr,
HK_DRAG_COMPONENT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, msg,
move_track_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Wire" ), s_Schematic_Hokeys_Descr,
......@@ -649,13 +676,17 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus,
void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
{
wxString msg;
if( !Sheet->m_Flags )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ENTER_SHEET,
_( "Enter Sheet" ), enter_sheet_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Move Sheet" ),
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move Sheet" ), move_sheet_xpm );
msg, move_sheet_xpm );
}
if( Sheet->m_Flags )
......@@ -665,8 +696,12 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
}
else
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, _( "Edit Sheet" ),
msg = AddHotkeyName( _( "Edit Sheet" ),
s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, msg,
edit_sheet_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize Sheet" ),
resize_sheet_xpm );
PopMenu->AppendSeparator();
......@@ -684,9 +719,14 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
void AddMenusForPinSheet( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
{
if( !PinSheet->m_Flags )
wxString msg;
if( !PinSheet->m_Flags ){
msg = AddHotkeyName( _( "Move PinSheet" ),
s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_PINSHEET,
_( "Move PinSheet" ), move_xpm );
msg, move_xpm );
}
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_PINSHEET, _( "Edit PinSheet" ),
edit_xpm );
......
......@@ -37,6 +37,38 @@ static bool LastPinCommonConvert = false;
static bool LastPinCommonUnit = false;
static bool LastPinVisible = true;
void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){
// Check, if the item is a pin, else return
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
return;
// save flags to restore them after rotating
int item_flags = m_drawItem->m_Flags;
LIB_PIN* pin = (LIB_PIN*) m_drawItem;
// Save old pin orientation
LastPinOrient = pin -> m_Orient;
SaveCopyInUndoList( pin->GetParent() );
// Get the actual pin orientation index
int orientationIndex = pin -> GetOrientationCodeIndex(pin -> m_Orient);
// Compute the next orientation, swap lower two bits for the right order
orientationIndex = ((orientationIndex & 2) >> 1) | ((orientationIndex & 1) << 1);
orientationIndex = orientationIndex + 1;
orientationIndex = ((orientationIndex & 2) >> 1) | ((orientationIndex & 1) << 1);
// Set the new orientation
pin->SetOrientation(pin->GetOrientationCode(orientationIndex));
GetScreen()->SetModify();
pin->DisplayInfo( this );
DrawPanel->Refresh();
// Restore pin flags
pin->m_Flags = item_flags;
}
void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
{
......
......@@ -115,8 +115,8 @@ set(PCBNEW_SRCS
loadcmp.cpp
locate.cpp
magnetic_tracks_functions.cpp
menubarmodedit.cpp
menubarpcb.cpp
menubar_modedit.cpp
menubar_pcbframe.cpp
mirepcb.cpp
modedit.cpp
modedit_onclick.cpp
......
......@@ -14,24 +14,10 @@
#include "pcbnew_id.h"
#include "dialog_display_options.h"
#include "dialog_display_options_base.h"
class Dialog_Display_Options : public DialogDisplayOptions_base
{
private:
WinEDA_BasePcbFrame* m_Parent;
void init();
public:
Dialog_Display_Options( WinEDA_BasePcbFrame* parent );
~Dialog_Display_Options( ) { };
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
void WinEDA_PcbFrame::InstallDisplayOptionsDialog( wxCommandEvent& aEvent )
{
Dialog_Display_Options* DisplayOptionsDialog =
......
/**
* @file dialog_display_options.h
*/
#include "dialog_display_options_base.h"
class Dialog_Display_Options : public DialogDisplayOptions_base
{
private:
WinEDA_BasePcbFrame* m_Parent;
void init();
public:
Dialog_Display_Options( WinEDA_BasePcbFrame* parent );
Dialog_Display_Options(WinEDA_BasePcbFrame*, wxWindow*);
~Dialog_Display_Options( ) { };
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
/***************/
/* hotkeys.h */
/***************/
#ifndef KOTKEYS_H
#define KOTKEYS_H
/**
* @file hotkeys.h
* PCBNew hotkeys
*/
#ifndef _PCBNEW_KOTKEYS_H
#define _PCBNEW_HOTKEYS_H
#include "hotkeys_basic.h"
......@@ -63,4 +64,4 @@ extern struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[];
// List of hotkey descriptors for the footprint editor only
extern struct Ki_HotkeyInfoSectionDescriptor s_Module_Editor_Hokeys_Descr[];
#endif // KOTKEYS_H
#endif /* _PCBNEW_HOTKEYS_H_ */
/*****************************************/
/* menubarpcb.cpp - PCB editor menu bar. */
/*****************************************/
/**
* @file menubarpcb.cpp
* PCBNew editor menu bar
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
......@@ -11,132 +12,196 @@
#include "hotkeys.h"
#include "pcbnew_id.h"
void WinEDA_PcbFrame::ReCreateMenuBar()
/**
* PCBNew mainframe menubar
*/
void
WinEDA_PcbFrame::ReCreateMenuBar()
{
wxString text;
wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar();
/* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */
/**
* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly.
*/
if( menuBar )
SetMenuBar( NULL );
menuBar = new wxMenuBar();
/**
* File Menu
*/
wxMenu* filesMenu = new wxMenu;
// New board
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New Board" ),
_( "Clear old board and initialize a new one" ) );
/* New Board */
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New" ),
_( "Clear current board and initialize a new one" ));
item->SetBitmap( new_xpm );
filesMenu->Append( item );
// Load board
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, _( "&Load Board" ),
_( "Delete old board and load new board" ) );
/* Load Board */
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, _( "&Open" ),
_( "Delete current board and load new board" ) );
item->SetBitmap( open_xpm );
filesMenu->Append( item );
// Append board
item = new wxMenuItem( filesMenu, ID_APPEND_FILE, _( "Append Board" ),
_( "Add board to old board" ) );
item->SetBitmap( import_xpm );
/* Load Recent submenu */
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
filesMenu->AppendSubMenu( openRecentMenu, _( "Open &Recent" ),
_("Open a recent opened document"));
/* Save */
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save" ),
_( "Save current board" ) );
item->SetBitmap( save_xpm );
filesMenu->Append( item );
/* Save As */
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
_( "Save as..." ),
_( "Save the current board as.." ) );
item->SetBitmap( save_as_xpm );
filesMenu->Append( item );
/* Separator */
filesMenu->AppendSeparator();
/* Rescue */
item = new wxMenuItem( filesMenu, ID_MENU_RECOVER_BOARD, _( "&Rescue" ),
_( "Clear old board and get last rescue file" ) );
item->SetBitmap( hammer_xpm );
filesMenu->Append( item );
/* Revert */
item = new wxMenuItem( filesMenu, ID_MENU_READ_LAST_SAVED_VERSION_BOARD,
_( "&Previous Version" ),
_( "&Revert" ),
_( "Clear old board and get old version of board" ) );
item->SetBitmap( jigsaw_xpm );
filesMenu->Append( item );
// Add save menu
/* Separator */
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save Board\tCtrl-S" ),
_( "Save current board" ) );
item->SetBitmap( save_xpm );
filesMenu->Append( item );
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
_( "Save Board as..." ),
_( "Save current board as.." ) );
item->SetBitmap( save_as_xpm );
filesMenu->Append( item );
// Add print menu
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
_( "Print pcb board" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG, _( "Print S&VG" ),
_( "Plot pcb board in SVG format" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
/* Fabrication Outputs submenu */
wxMenu* fabricationOutputsMenu = new wxMenu;
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
_( "&Modules Position" ),
_( "Generate modules position file for pick and place" ) );
item->SetBitmap( post_compo_xpm );
fabricationOutputsMenu->Append( item );
// Add plot menu
item = new wxMenuItem( filesMenu, ID_GEN_PLOT, _( "&Plot" ),
_( "Plot (HPGL, PostScript, or Gerber format)" ) );
item->SetBitmap( plot_xpm );
filesMenu->Append( item );
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
_( "&Drill File" ),
_( "Generate excellon2 drill file" ) );
item->SetBitmap( post_drill_xpm );
fabricationOutputsMenu->Append( item );
// Add Export menu
filesMenu->AppendSeparator();
/* Component File */
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_CMP_FILE,
_( "&Component File" ),
_( "(Re)create components file for CvPcb" ) );
item->SetBitmap( save_cmpstuff_xpm );
fabricationOutputsMenu->Append( item );
/* BOM File */
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
_( "&BOM File" ),
_( "(Re)create bill of materials file for CvPCB" ) );
item->SetBitmap( tools_xpm );
fabricationOutputsMenu->Append( item );
/* Fabrications Outputs submenu append */
filesMenu->AppendSubMenu( fabricationOutputsMenu,
_( "Fabrication Outputs "),
_( "Generate files for fabrication" ) );
/* Import submenu */
wxMenu* submenuImport = new wxMenu();
/* PCBNew Board */
item = new wxMenuItem( submenuImport, ID_APPEND_FILE, _( "PCBNew Board" ),
_( "Append a other PCBNew board to the current loaded board" ) );
item->SetBitmap( pcbnew_xpm );
submenuImport->Append( item );
/* Specctra Session */
item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
_( "&Specctra Session" ),
_( "Import a routed \"Specctra Session\" (*.ses) file" ) );
item->SetBitmap( import_xpm ); // @todo need better bitmap
submenuImport->Append( item );
/**
* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in
* specctra_import.cpp
* item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN,
* _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") );
* item->SetBitmap(export_xpm); // @todo need better bitmap
* submenuImport->Append(item);
*/
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm );
/* Export submenu */
wxMenu* submenuexport = new wxMenu();
/* Specctra DSN */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_SPECCTRA,
_( "&Specctra DSN" ),
_( "Export the current board to a \"Specctra DSN\" file" ) );
item->SetBitmap( export_xpm );
submenuexport->Append( item );
/* Export GenCAD Format */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
_( "&GenCAD" ), _( "Export GenCAD Format" ) );
item->SetBitmap( export_xpm );
submenuexport->Append( item );
/* Module Report */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
_( "&Module Report" ),
_( "Create a board report (footprint report)" ) );
_( "Create a report of all modules on the current board" ) );
item->SetBitmap( tools_xpm );
submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm );
/* Separator */
filesMenu->AppendSeparator();
//-----<Add import menu>-----------------------------------------------
// no separator, keep it next to Import
wxMenu* submenuImport = new wxMenu();
item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
_( "&Specctra Session" ),
_( "Import a routed \"Specctra Session\" (*.ses) file" ) );
item->SetBitmap( import_xpm ); // @todo need better bitmap
submenuImport->Append( item );
/* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in
* specctra_import.cpp
* item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN,
* _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") );
* item->SetBitmap(export_xpm); // @todo need better bitmap
* submenuImport->Append(item);
*/
/* Print */
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
_( "Print pcb board" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm );
/* Print SVG */
item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG, _( "Print S&VG" ),
_( "Plot board in Scalable Vector Graphics format" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
//-----</Add import menu>----------------------------------------------
/* Plot */
item = new wxMenuItem( filesMenu, ID_GEN_PLOT, _( "&Plot" ),
_( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) );
item->SetBitmap( plot_xpm );
filesMenu->Append( item );
// Add archive footprints menu
/* Archive Footprints */
filesMenu->AppendSeparator();
wxMenu* submenuarchive = new wxMenu();
item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_NEW_MODULES,
......@@ -155,188 +220,265 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
_( "Archive or add footprints in a library file" ),
library_xpm );
// Add exit menu
/* Exit */
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_EXIT, _( "E&xit" ),
_( "Quit PCBnew" ) );
item = new wxMenuItem( filesMenu, ID_EXIT, _( "&Quit" ),
_( "Quit PCBNew" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
///////////////////////////////////
// Preferences and configuration //
///////////////////////////////////
/**
* Edit menu
*/
wxMenu* editMenu = new wxMenu;
/* Undo */
/* TODO add Undo hotkey */
item = new wxMenuItem( editMenu, ID_UNDO_BUTT, _( "Undo"),
_( "Undo last edition" ), wxITEM_NORMAL );
item->SetBitmap( undo_xpm );
editMenu->Append( item );
/* Redo */
/* TODO add Redo hotkey */
item = new wxMenuItem( editMenu, ID_REDO_BUTT, _( "Redo" ),
_( "Redo the last undo command" ), wxITEM_NORMAL );
item->SetBitmap( redo_xpm );
editMenu->Append( item );
/* Separator */
editMenu->AppendSeparator();
/* Find */
text = AddHotkeyName( _( "&Find..." ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM);
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text,
_("Find components and text in current loaded board") );
editMenu->Append( item );
/* Separator */
editMenu->AppendSeparator();
/* Global Deletions */
item = new wxMenuItem( editMenu, ID_PCB_GLOBAL_DELETE,
_( "Global &Deletions" ),
_( "Delete tracks, modules, texts... on board" ) );
item->SetBitmap( general_deletions_xpm );
editMenu->Append( item );
/* Tracks */
item = new wxMenuItem( editMenu, ID_MENU_PCB_CLEAN,
_( "&Tracks" ),
_( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
item->SetBitmap( delete_body_xpm );
editMenu->Append( item );
/* Swap Layers */
item = new wxMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on others layers" ) );
item->SetBitmap( swap_layer_xpm );
editMenu->Append( item );
/**
* View menu
*/
wxMenu* viewMenu = new wxMenu;
/* Zoom in */
text = AddHotkeyName( _( "Zoom in" ), s_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN);
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, _( "Zoom in" ),
wxITEM_NORMAL );
item->SetBitmap( zoom_in_xpm );
viewMenu->Append( item );
/* Zoom out */
text = AddHotkeyName( _( "Zoom out" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, _( "Zoom out" ),
wxITEM_NORMAL );
item->SetBitmap( zoom_out_xpm );
viewMenu->Append( item );
/* Zoom auto */
text = AddHotkeyName( _( "Zoom auto" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom auto" ),
wxITEM_NORMAL );
item->SetBitmap( zoom_auto_xpm );
viewMenu->Append( item );
viewMenu->AppendSeparator();
/* Redraw view */
text = AddHotkeyName( _( "Redraw view" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, _( "Zoom auto" ),
wxITEM_NORMAL );
item->SetBitmap( zoom_redraw_xpm );
viewMenu->Append( item );
/* Separator */
viewMenu->AppendSeparator();
/* List of Nets */
item = new wxMenuItem( viewMenu, ID_MENU_LIST_NETS, _( "&List Nets" ),
_( "View a list of nets with names and id's" ) );
item->SetBitmap( tools_xpm );
viewMenu->Append( item );
/* 3D Display */
item = new wxMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME,
_( "3D Display" ), _( "Show board in the 3D viewer" ) );
item->SetBitmap( show_3d_xpm );
viewMenu->Append( item );
/**
* Preferences and configuration
*/
wxMenu* configmenu = new wxMenu;
/* Library */
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
_( "Setting libraries, directories and others..." ) );
item->SetBitmap( library_xpm );
configmenu->Append( item );
/* Colors and Visibility */
item = new wxMenuItem( configmenu, ID_COLORS_SETUP,
_( "&Colors and Visibility" ),
_( "Select colors and visibility of layers and some items" ) );
item->SetBitmap( palette_xpm );
configmenu->Append( item );
/* General */
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, _( "&General" ),
_( "Select general options for PCBnew" ) );
item->SetBitmap( preference_xpm );
configmenu->Append( item );
/* Display */
item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
_( "&Display" ),
_( "Select how items (pads, tracks texts ... ) are displayed" ) );
item->SetBitmap( display_options_xpm );
configmenu->Append( item );
/* Dimensions submenu */
wxMenu* dimensionsMenu = new wxMenu;
/* Grid */
item = new wxMenuItem( dimensionsMenu, ID_PCB_USER_GRID_SETUP, _( "Grid" ),
_( "Adjust user grid dimensions" ) );
item->SetBitmap( grid_xpm );
dimensionsMenu->Append( item );
/* Text and Drawings */
item = new wxMenuItem( dimensionsMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Texts and Drawings" ),
_( "Adjust dimensions for texts and drawings" ) );
item->SetBitmap( options_text_xpm );
dimensionsMenu->Append( item );
/* Pads */
item = new wxMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP, _( "Pads" ),
_( "Adjust pads shape, dimensions, layers" ) );
item->SetBitmap( pad_xpm );
dimensionsMenu->Append( item );
/* Pads Mask Clearance */
item = new wxMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE,
_( "Pads Mask Clearance" ),
_( "Adjust the global clearance between pads and the solder resist mask" ) );
item->SetBitmap( pad_xpm );
dimensionsMenu->Append( item );
/* Save */
dimensionsMenu->AppendSeparator();
item = new wxMenuItem( dimensionsMenu, ID_CONFIG_SAVE, _( "&Save" ),
_( "Save dimension preferences" ) );
item->SetBitmap( save_xpm );
dimensionsMenu->Append( item );
configmenu->AppendSubMenu( dimensionsMenu, _( "Di&mensions" ),
_( "Global dimensions preferences" ));
/* Language submenu */
wxGetApp().AddMenuLanguageList( configmenu );
/* Hotkey submenu */
AddHotkeyConfigMenu( configmenu );
/* Separator */
configmenu->AppendSeparator();
/* Save Preferences */
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save Preferences" ),
_( "Save application preferences" ) );
item->SetBitmap( save_setup_xpm );
configmenu->Append( item );
/* Read Preferences */
item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read Preferences" ),
_( "Read application preferences" ) );
item->SetBitmap( read_setup_xpm );
configmenu->Append( item );
////////////////////////////////////////////////////////////
// Add access to the Design Rules Dialog and layers setup //
////////////////////////////////////////////////////////////
/**
* Design Rules menu
*/
wxMenu* designRulesMenu = new wxMenu;
/* Design Rules */
item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
_( "Design Rules" ),
_( "Open the design rules dialog editor" ) );
item->SetBitmap( hammer_xpm );
designRulesMenu->Append( item );
/* Layers Setup */
item = new wxMenuItem( configmenu, ID_PCB_LAYERS_SETUP, _( "&Layers Setup" ),
_( "Enable and set properties of layers" ) );
item->SetBitmap( copper_layers_setup_xpm );
designRulesMenu->Append( item );
/////////////////////////////////////////////////////////
// dimensions of some items (excluding tracks and vias //
/////////////////////////////////////////////////////////
wxMenu* sizes_menu = new wxMenu;
item = new wxMenuItem( sizes_menu, ID_PCB_MASK_CLEARANCE,
_( "Pads Mask Clearance" ),
_( "Adjust the global clearance between pads and the solder resist mask" ) );
item->SetBitmap( pad_xpm );
sizes_menu->Append( item );
item = new wxMenuItem( sizes_menu, ID_PCB_USER_GRID_SETUP, _( "Grid" ),
_( "Adjust User Grid" ) );
item->SetBitmap( grid_xpm );
sizes_menu->Append( item );
item = new wxMenuItem( sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Texts and Drawings" ),
_( "Adjust width for texts and drawings" ) );
item->SetBitmap( options_text_xpm );
sizes_menu->Append( item );
item = new wxMenuItem( sizes_menu, ID_PCB_PAD_SETUP, _( "Pads" ),
_( "Adjust size,shape,layers... for pads" ) );
item->SetBitmap( pad_xpm );
sizes_menu->Append( item );
sizes_menu->AppendSeparator();
item = new wxMenuItem( sizes_menu, ID_CONFIG_SAVE, _( "&Save Setup" ),
_( "Save options in current directory" ) );
item->SetBitmap( save_xpm );
sizes_menu->Append( item );
wxMenu* postprocess_menu = new wxMenu;
item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_POS_MODULES_FILE,
_( "Generate &Modules Position" ),
_( "Generate modules position file" ) );
item->SetBitmap( post_compo_xpm );
postprocess_menu->Append( item );
item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_DRILL_FILE,
_( "Create &Drill File" ),
_( "Generate excellon2 drill file" ) );
item->SetBitmap( post_drill_xpm );
postprocess_menu->Append( item );
item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_CMP_FILE,
_( "Create &Component File" ),
_( "Recreate .cmp file for CvPcb" ) );
item->SetBitmap( save_cmpstuff_xpm );
postprocess_menu->Append( item );
item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
_( "Create &BOM File" ),
_( "Recreate .csv file for CvPcb" ) );
item->SetBitmap( tools_xpm );
postprocess_menu->Append( item );
wxMenu* miscellaneous_menu = new wxMenu;
item = new wxMenuItem( miscellaneous_menu, ID_PCB_GLOBAL_DELETE,
_( "Global &Deletions" ),
_( "Delete tracks, modules, texts... on board" ) );
item->SetBitmap( general_deletions_xpm );
miscellaneous_menu->Append( item );
item =
new wxMenuItem( miscellaneous_menu, ID_MENU_LIST_NETS, _( "&List Nets" ),
_( "List nets (names and id)" ) );
item->SetBitmap( tools_xpm );
miscellaneous_menu->Append( item );
item = new wxMenuItem( miscellaneous_menu, ID_MENU_PCB_CLEAN,
_( "&Track Operations" ),
_( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
item->SetBitmap( delete_body_xpm );
miscellaneous_menu->Append( item );
item = new wxMenuItem( miscellaneous_menu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on others layers" ) );
item->SetBitmap( swap_layer_xpm );
miscellaneous_menu->Append( item );
////////////////
// Menu Help: //
////////////////
/**
* Help menu
*/
wxMenu* helpMenu = new wxMenu;
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
_( "Open the PCBnew manual" ) );
item->SetBitmap( help_xpm );
helpMenu->Append( item );
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About PCBnew" ),
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
_( "About PCBnew printed circuit board 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 );
/**
* Append all menus to the menuBar
*/
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit") );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( designRulesMenu, _( "&Design Rules" ) );
menuBar->Append( sizes_menu, _( "&Dimensions" ) );
menuBar->Append( miscellaneous_menu, _( "&Miscellaneous" ) );
menuBar->Append( postprocess_menu, _( "P&ostprocess" ) );
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 );
}
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