diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 6f720405b3..e1809881f5 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -124,7 +124,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type ) } newsegment->m_Flags = IS_NEW; - if( g_HVLines ) // We need 2 segments to go from a given start pint to + if( g_HVLines ) // We need 2 segments to go from a given start pin to // an end point { nextsegment = newsegment->GenCopy(); diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index c9d6511a4e..f1433ed4b6 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -49,7 +49,7 @@ static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC ) static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { - /* Drawing of the bus entry segment" while moving the cursor. */ + // Draws the bus entry while moving the cursor BASE_SCREEN* screen = panel->GetScreen(); SCH_BUS_ENTRY* BusEntry = (SCH_BUS_ENTRY*) screen->GetCurItem(); @@ -69,21 +69,12 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) SCH_BUS_ENTRY* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_type ) { - /* Create a new bus entry, and prepare moving function (for later place it) - */ + // Create and place a new bus entry at cursor position SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->m_Curseur, - s_LastShape, - entry_type ); - + s_LastShape, entry_type ); BusEntry->m_Flags = IS_NEW; - - DrawPanel->CursorOff( DC ); // Erase schematic cursor - RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode ); - DrawPanel->CursorOn( DC ); // Display schematic cursor - + BusEntry->Place( this, DC );; OnModify( ); - - StartMoveBusEntry( BusEntry, DC ); return BusEntry; } diff --git a/eeschema/class_text-label.cpp b/eeschema/class_text-label.cpp index d8c5eaf867..008d19eaaa 100644 --- a/eeschema/class_text-label.cpp +++ b/eeschema/class_text-label.cpp @@ -443,13 +443,8 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& aOffset, // Enable these line to draw the bounding box (debug tests purposes only) #if 0 { - EDA_Rect BoundaryBox; - BoundaryBox = GetBoundingBox(); - int x1 = BoundaryBox.GetX(); - int y1 = BoundaryBox.GetY(); - int x2 = BoundaryBox.GetRight(); - int y2 = BoundaryBox.GetBottom(); - GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN ); + EDA_Rect BoundaryBox = GetBoundingBox(); + GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); } #endif } @@ -1028,7 +1023,7 @@ void SCH_GLOBALLABEL::Mirror_Y( int aYaxis_position ) { /* The global label is NOT really mirrored. * for an horizontal label, the schematic orientation is changed. - * for a vericalal label, the schematic orientation is not changed. + * for a vertical label, the schematic orientation is not changed. * and the label is moved to a suitable position */ switch( GetSchematicTextOrientation() ) @@ -1210,13 +1205,8 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, // Enable these line to draw the bounding box (debug tests purposes only) #if 0 { - EDA_Rect BoundaryBox; - BoundaryBox = GetBoundingBox(); - int x1 = BoundaryBox.GetX(); - int y1 = BoundaryBox.GetY(); - int x2 = BoundaryBox.GetRight(); - int y2 = BoundaryBox.GetBottom(); - GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN ); + EDA_Rect BoundaryBox = GetBoundingBox(); + GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); } #endif } @@ -1555,13 +1545,8 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, // Enable these line to draw the bounding box (debug tests purposes only) #if 0 { - EDA_Rect BoundaryBox; - BoundaryBox = GetBoundingBox(); - int x1 = BoundaryBox.GetX(); - int y1 = BoundaryBox.GetY(); - int x2 = BoundaryBox.GetRight(); - int y2 = BoundaryBox.GetBottom(); - GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN ); + EDA_Rect BoundaryBox = GetBoundingBox(); + GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); } #endif } diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index e533d76ce3..1fbb5d9395 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -103,16 +103,21 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + // Schematic editor static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' ); +static Ki_HotkeyInfo HkAddHierarchicalLabel( wxT( "add Hierarchical Label" ), HK_ADD_HLABEL, 'H' ); +static Ki_HotkeyInfo HkAddGlobalLabel( wxT( "add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'L' ); static Ki_HotkeyInfo HkAddJunction( wxT( "add Junction" ), HK_ADD_JUNCTION, 'J' ); static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' ); -static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), - HK_ADD_NEW_COMPONENT, 'A' ); -static Ki_HotkeyInfo HkAddNoConn( wxT( "Add NoConnected Flag" ), - HK_ADD_NOCONN_FLAG, 'Q' ); -static Ki_HotkeyInfo HkMirrorYComponent( wxT( "Mirror Y Component" ), - HK_MIRROR_Y_COMPONENT, 'Y' ); -static Ki_HotkeyInfo HkMirrorXComponent( wxT( "Mirror X Component" ), - HK_MIRROR_X_COMPONENT, 'X' ); +static Ki_HotkeyInfo HkBeginBus( wxT( "begin Bus" ), HK_BEGIN_BUS, 'B' ); +static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A' ); +static Ki_HotkeyInfo HkAddPower( wxT( "Add Power" ), HK_ADD_NEW_POWER, 'P' ); +static Ki_HotkeyInfo HkAddNoConn( wxT( "Add NoConnected Flag" ), HK_ADD_NOCONN_FLAG, 'Q' ); +static Ki_HotkeyInfo HkAddHierSheet( wxT( "Add Sheet" ), HK_ADD_HIER_SHEET, 'S' ); +static Ki_HotkeyInfo HkAddBusEntry( wxT( "Add Bus Entry" ), HK_ADD_BUS_ENTRY, '/' ); +static Ki_HotkeyInfo HkAddWireEntry( wxT( "Add Wire Entry" ), HK_ADD_WIRE_ENTRY, 'Z' ); +static Ki_HotkeyInfo HkAddGraphicPolyLine( wxT( "Add Graphic PolyLine" ), HK_ADD_GRAPHIC_POLYLINE, 'I' ); +static Ki_HotkeyInfo HkAddGraphicText( wxT( "Add Graphic Text" ), HK_ADD_GRAPHIC_TEXT, 'T' ); +static Ki_HotkeyInfo HkMirrorYComponent( wxT( "Mirror Y Component" ), HK_MIRROR_Y_COMPONENT, 'Y' ); +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 HkRotate( wxT( "Rotate Item" ), HK_ROTATE, 'R' ); @@ -175,6 +180,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = &HkCopyComponentOrText, &HkDrag, &HkAddComponent, + &HkAddPower, &HkRotate, &HkMirrorXComponent, &HkMirrorYComponent, @@ -183,9 +189,17 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = &HkEditComponentValue, &HkEditComponentFootprint, &HkBeginWire, + &HkBeginBus, &HkAddLabel, + &HkAddHierarchicalLabel, + &HkAddGlobalLabel, &HkAddJunction, &HkAddNoConn, + &HkAddHierSheet, + &HkAddWireEntry, + &HkAddBusEntry, + &HkAddGraphicPolyLine, + &HkAddGraphicText, NULL }; @@ -382,6 +396,16 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; + case HK_ADD_NEW_POWER: // Add power component + if( !itemInEdit ) + { + // switch to m_ID_current_state = ID_PLACE_POWER_BUTT; + if( m_ID_current_state != ID_PLACE_POWER_BUTT ) + SetToolID( ID_PLACE_POWER_BUTT, wxCURSOR_PENCIL, _( "Add Power" ) ); + OnLeftClick( DC, MousePos ); + } + break; + case HK_ADD_LABEL: if( notBusy ) { @@ -392,6 +416,26 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; + case HK_ADD_HLABEL: + if( notBusy ) + { + // switch to m_ID_current_state = ID_HIERLABEL_BUTT; + if( m_ID_current_state != ID_HIERLABEL_BUTT ) + SetToolID( ID_HIERLABEL_BUTT, wxCURSOR_PENCIL, _( "Add Hierarchical Label" ) ); + OnLeftClick( DC, MousePos ); + } + break; + + case HK_ADD_GLABEL: + if( notBusy ) + { + // switch to m_ID_current_state = ID_GLABEL_BUTT; + if( m_ID_current_state != ID_GLABEL_BUTT ) + SetToolID( ID_GLABEL_BUTT, wxCURSOR_PENCIL, _( "Add Global Label" ) ); + OnLeftClick( DC, MousePos ); + } + break; + case HK_ADD_JUNCTION: if( notBusy ) { @@ -402,26 +446,99 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; - case HK_BEGIN_WIRE: - // An item is selected. If not a wire, a new command is not possible + case HK_ADD_WIRE_ENTRY: if( notBusy ) { - if( DrawStruct && DrawStruct->m_Flags ) - { - if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) - { - SCH_LINE* segment = (SCH_LINE*) DrawStruct; - if( segment->GetLayer() != LAYER_WIRE ) - break; - } - else - break; - } + // switch to m_ID_current_state = ID_WIRETOBUS_ENTRY_BUTT; + if( m_ID_current_state != ID_WIRETOBUS_ENTRY_BUTT ) + SetToolID( ID_WIRETOBUS_ENTRY_BUTT, wxCURSOR_PENCIL, _( "Add Wire to Bus entry" ) ); + OnLeftClick( DC, MousePos ); + } + break; + case HK_ADD_BUS_ENTRY: + if( notBusy ) + { + // switch to m_ID_current_state = ID_BUSTOBUS_ENTRY_BUTT; + if( m_ID_current_state != ID_BUSTOBUS_ENTRY_BUTT ) + SetToolID( ID_BUSTOBUS_ENTRY_BUTT, wxCURSOR_PENCIL, _( "Add Bus to Bus entry" ) ); + OnLeftClick( DC, MousePos ); + } + break; + + case HK_ADD_HIER_SHEET: + if( notBusy ) + { + // switch to m_ID_current_state = ID_SHEET_SYMBOL_BUTT; + if( m_ID_current_state != ID_SHEET_SYMBOL_BUTT ) + SetToolID( ID_SHEET_SYMBOL_BUTT, wxCURSOR_PENCIL, _( "Add Sheet" ) ); + OnLeftClick( DC, MousePos ); + } + break; + + case HK_ADD_GRAPHIC_TEXT: + if( notBusy ) + { + // switch to m_ID_current_state = ID_TEXT_COMMENT_BUTT; + if( m_ID_current_state != ID_TEXT_COMMENT_BUTT ) + SetToolID( ID_TEXT_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add Text" ) ); + OnLeftClick( DC, MousePos ); + } + break; + + case HK_ADD_GRAPHIC_POLYLINE: + if( notBusy ) + { + // switch to m_ID_current_state = ID_LINE_COMMENT_BUTT; + if( m_ID_current_state != ID_LINE_COMMENT_BUTT ) + SetToolID( ID_LINE_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add Lines" ) ); + OnLeftClick( DC, MousePos ); + } + break; + + case HK_BEGIN_BUS: + // An item can be selected. If not a Bus, a begin command is not possible + if( notBusy ) + { + // switch to m_ID_current_state = ID_WIRE_BUTT; + if( m_ID_current_state != ID_BUS_BUTT ) + SetToolID( ID_BUS_BUTT, wxCURSOR_PENCIL, _( "Add Bus" ) ); + OnLeftClick( DC, MousePos ); + break; + } + if( DrawStruct && DrawStruct->IsNew() && ( m_ID_current_state == ID_BUS_BUTT ) ) + { + if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) + { + SCH_LINE* segment = (SCH_LINE*) DrawStruct; + if( segment->GetLayer() != LAYER_BUS ) + break; + // Bus in progress: + OnLeftClick( DC, MousePos ); + } + } + break; + + case HK_BEGIN_WIRE: + // An item can be selected. If not a wire, a begin command is not possible + if( notBusy ) + { // switch to m_ID_current_state = ID_WIRE_BUTT; if( m_ID_current_state != ID_WIRE_BUTT ) SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add Wire" ) ); OnLeftClick( DC, MousePos ); + break; + } + if( DrawStruct && DrawStruct->IsNew() && ( m_ID_current_state == ID_WIRE_BUTT ) ) + { + if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) + { + SCH_LINE* segment = (SCH_LINE*) DrawStruct; + if( segment->GetLayer() != LAYER_WIRE ) + break; + // Wire in progress: + OnLeftClick( DC, MousePos ); + } } break; diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h index acd59b48c8..d7cfe462ce 100644 --- a/eeschema/hotkeys.h +++ b/eeschema/hotkeys.h @@ -30,9 +30,18 @@ enum hotkey_id_commnand { HK_COPY_COMPONENT_OR_LABEL, HK_DRAG, HK_ADD_NEW_COMPONENT, + HK_ADD_NEW_POWER, HK_BEGIN_WIRE, + HK_BEGIN_BUS, + HK_ADD_WIRE_ENTRY, + HK_ADD_BUS_ENTRY, HK_ADD_LABEL, + HK_ADD_HLABEL, + HK_ADD_GLABEL, HK_ADD_JUNCTION, + HK_ADD_HIER_SHEET, + HK_ADD_GRAPHIC_TEXT, + HK_ADD_GRAPHIC_POLYLINE, HK_ADD_NOCONN_FLAG }; diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index c8aa734ec2..c6440a83ee 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -249,7 +249,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() wxMenu* placeMenu = new wxMenu; /* Component */ - text = AddHotkeyName( _( "&Component" ), s_Schematic_Hokeys_Descr, + text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr, HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text, HELP_PLACE_COMPONENTS, wxITEM_NORMAL ); @@ -257,13 +257,15 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() placeMenu->Append( item ); /* Power port */ - item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, _( "&Power port" ), + text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr, + HK_ADD_NEW_POWER, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text, HELP_PLACE_POWERPORT, wxITEM_NORMAL ); item->SetBitmap( add_power_xpm ); placeMenu->Append( item ); /* Wire */ - text = AddHotkeyName( _( "&Wire" ), s_Schematic_Hokeys_Descr, + text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr, HK_BEGIN_WIRE, false ); // add comment, not a shortcut item = new wxMenuItem( placeMenu, ID_WIRE_BUTT, text, HELP_PLACE_WIRE, wxITEM_NORMAL ); @@ -271,19 +273,25 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() placeMenu->Append( item ); /* Bus */ - item = new wxMenuItem( placeMenu, ID_BUS_BUTT, _( "&Bus" ), + text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr, + HK_BEGIN_BUS, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_BUS_BUTT, text, HELP_PLACE_BUS, wxITEM_NORMAL ); item->SetBitmap( add_bus_xpm ); placeMenu->Append( item ); - /* Wire to Bus */ - item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, _( "W&ire to bus entry" ), + /* Wire to Bus entry */ + text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr, + HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text, HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_NORMAL ); item->SetBitmap( add_line2bus_xpm ); placeMenu->Append( item ); - /* Bus to Bus */ - item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, _( "B&us to bus entry" ), + /* Bus to Bus entry */ + text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr, + HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text, HELP_PLACE_BUS2BUS_ENTRY, wxITEM_NORMAL ); item->SetBitmap( add_bus2bus_xpm ); placeMenu->Append( item ); @@ -304,7 +312,9 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() placeMenu->Append( item ); /* Global label */ - item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ), + text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr, + HK_ADD_GLABEL, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, text, HELP_PLACE_GLOBALLABEL, wxITEM_NORMAL ); item->SetBitmap( add_glabel_xpm ); placeMenu->Append( item ); @@ -321,13 +331,17 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() placeMenu->AppendSeparator(); /* Hierarchical label */ - item = new wxMenuItem( placeMenu, ID_HIERLABEL_BUTT, _( "Hierarchical label" ), + text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr, + HK_ADD_HLABEL, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_HIERLABEL_BUTT, text, HELP_PLACE_HIER_LABEL, wxITEM_NORMAL ); item->SetBitmap( add_hierarchical_label_xpm ); placeMenu->Append( item ); /* Hierarchical sheet */ - item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, _( "Hierarchical sheet" ), + text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr, + HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text, HELP_PLACE_SHEET, wxITEM_NORMAL ); item->SetBitmap( add_hierarchical_subsheet_xpm ); placeMenu->Append( item ); @@ -348,13 +362,17 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() placeMenu->AppendSeparator(); /* Graphic line or polygon */ - item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, _( "Graphic line or polygon" ), + text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr, + HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text, HELP_PLACE_GRAPHICLINES, wxITEM_NORMAL ); item->SetBitmap( add_dashed_line_xpm ); placeMenu->Append( item ); /* Graphic text */ - item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, _( "Graphic text" ), + text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr, + HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut + item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text, HELP_PLACE_GRAPHICTEXTS, wxITEM_NORMAL ); item->SetBitmap( add_text_xpm ); placeMenu->Append( item ); diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index 7261faa2d2..bace629967 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -533,13 +533,13 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* fr PopMenu->AppendSeparator(); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm ); + msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm ); msg = AddHotkeyName( _( "Add Label" ), s_Schematic_Hokeys_Descr, HK_ADD_LABEL ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm ); // Add global label command only if the cursor is over one end of the wire. - if( ( pos.x == Wire->m_Start.x && pos.y == Wire->m_Start.y) - || ( pos.x == Wire->m_End.x && pos.y == Wire->m_End.y ) ) + if( ( pos == Wire->m_Start ) || ( pos == Wire->m_End ) ) ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm ); } @@ -548,24 +548,26 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, WinEDA_SchematicFrame* fram { bool is_new = (Bus->m_Flags & IS_NEW) ? TRUE : FALSE; wxPoint pos = frame->GetScreen()->m_Curseur; - + wxString msg; if( is_new ) { ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "Bus End" ), apply_xpm ); return; } - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Bus" ), delete_bus_xpm ); + msg = AddHotkeyName( _( "Delete Bus" ), s_Schematic_Hokeys_Descr, HK_DELETE ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_bus_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), break_bus_xpm ); PopMenu->AppendSeparator(); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm ); + msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm ); + msg = AddHotkeyName( _( "Add Label" ), s_Schematic_Hokeys_Descr, HK_ADD_LABEL ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm ); // Add global label command only if the cursor is over one end of the bus. - if( ( pos.x == Bus->m_Start.x && pos.y == Bus->m_Start.y) - || ( pos.x == Bus->m_End.x && pos.y == Bus->m_End.y ) ) + if( ( pos == Bus->m_Start ) || ( pos == Bus->m_End ) ) ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm ); } @@ -593,7 +595,6 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet ) else { msg = AddHotkeyName( _( "Edit Sheet" ), s_Schematic_Hokeys_Descr, HK_EDIT ); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, msg, edit_sheet_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize Sheet" ), @@ -606,7 +607,8 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet ) ADD_MENUITEM( PopMenu, ID_POPUP_SCH_CLEANUP_SHEET, _( "Cleanup PinSheets" ), options_pinsheet_xpm ); PopMenu->AppendSeparator(); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Sheet" ), delete_sheet_xpm ); + msg = AddHotkeyName( _( "Delete Sheet" ), s_Schematic_Hokeys_Descr, HK_DELETE ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_sheet_xpm ); } } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index a8f8bba1e3..ed9f07ba06 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -192,7 +192,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_LINE_COMMENT_BUTT: - SetToolID( id, wxCURSOR_PENCIL, _( "Add Drawing" ) ); + SetToolID( id, wxCURSOR_PENCIL, _( "Add Lines" ) ); break; case ID_JUNCTION_BUTT: @@ -208,7 +208,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_HIERLABEL_BUTT: - SetToolID( id, wxCURSOR_PENCIL, _( "Add Hierarchal label" ) ); + SetToolID( id, wxCURSOR_PENCIL, _( "Add Hierarchical label" ) ); break; case ID_TEXT_COMMENT_BUTT: diff --git a/include/gr_basic.h b/include/gr_basic.h index f89e047031..1e60f3af36 100644 --- a/include/gr_basic.h +++ b/include/gr_basic.h @@ -193,7 +193,7 @@ void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width, int Color, int BgColor ); void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int Color ); -void GRRect( EDA_Rect* ClipBox, wxDC* DC,const EDA_Rect& aRect, int Color ); +void GRRect( EDA_Rect* ClipBox, wxDC* DC,const EDA_Rect& aRect, int aWidth, int Color ); void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width, int Color ); void GRRectPs( EDA_Rect* aClipBox, wxDC* aDC,const EDA_Rect& aRect,