From 93b9d3fd6f42a0f5b812585a56a113ee3684e9be Mon Sep 17 00:00:00 2001 From: charras Date: Thu, 3 Dec 2009 19:11:34 +0000 Subject: [PATCH] fixed 2 serious bugs in Libedit. fixed redundant hot keys in Eeschema --- CHANGELOG.txt | 8 ++++ eeschema/libedit_onleftclick.cpp | 46 +++++++++++----------- eeschema/pinedit.cpp | 4 ++ pcbnew/dialog_freeroute_exchange_help.html | 14 +++---- pcbnew/hotkeys.cpp | 24 +++++------ 5 files changed, 55 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2e2e4289f9..5bfeac178e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,14 @@ email address. This makes it easier to preview the page in a browser. Then autogenerate the *.h file from the html using a CMake script. +2009-Dec-2 UPDATE Wayne Stambaugh +================================================================================ +Compiler warning, object name, bug, and string fixes. +* Fixed EESchema options dialog focus bug so escape key now works in GTK. +* Rename schematic objects for improved readability. +* Fixed GCC compiler warnings in plot code. +* Added paragraph in UIpolicies.txt about setting dialog box sizes. +* Lots of message box string clean up. 2009-Nov-05 UPDATE Jean-Pierre Charras ================================================================================ diff --git a/eeschema/libedit_onleftclick.cpp b/eeschema/libedit_onleftclick.cpp index 62a7d007e9..f697cd6c65 100644 --- a/eeschema/libedit_onleftclick.cpp +++ b/eeschema/libedit_onleftclick.cpp @@ -39,6 +39,11 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawEntry = NULL; break; + case COMPONENT_PIN_DRAW_TYPE: + PlacePin( DC ); + DrawEntry = NULL; + break; + default: EndDrawGraphicItem( DC ); break; @@ -157,41 +162,38 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) { wxPoint pos = GetPosition(); - LIB_DRAW_ITEM* DrawEntry = m_drawItem; if( m_component == NULL ) return; - if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) + if( ( m_drawItem == NULL ) || ( m_drawItem->m_Flags == 0 ) ) { // We can locate an item - DrawEntry = m_drawItem = + m_drawItem = m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT, GetScreen()->m_MousePosition ); - if( DrawEntry == NULL ) + if( m_drawItem == NULL ) { - DrawEntry = m_drawItem = + m_drawItem = m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT, GetScreen()->m_Curseur ); } - if( DrawEntry == NULL ) + if( m_drawItem == NULL ) { EditComponentProperties(); } } - if( DrawEntry ) - DrawEntry->DisplayInfo( this ); + if( m_drawItem ) + m_drawItem->DisplayInfo( this ); else return; - m_drawItem = DrawEntry; - DrawPanel->m_IgnoreMouseEvents = TRUE; - switch( DrawEntry->Type() ) + switch( m_drawItem->Type() ) { case COMPONENT_PIN_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + if( m_drawItem->m_Flags == 0 ) { wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); cmd.SetId( ID_LIBEDIT_EDIT_PIN ); @@ -202,35 +204,35 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) case COMPONENT_ARC_DRAW_TYPE: case COMPONENT_CIRCLE_DRAW_TYPE: case COMPONENT_RECT_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + if( m_drawItem->m_Flags == 0 ) { - EditGraphicSymbol( DC, DrawEntry ); + EditGraphicSymbol( DC, m_drawItem ); } break; case COMPONENT_LINE_DRAW_TYPE: case COMPONENT_POLYLINE_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + if( m_drawItem->m_Flags == 0 ) { - EditGraphicSymbol( DC, DrawEntry ); + EditGraphicSymbol( DC, m_drawItem ); } - else if( DrawEntry->m_Flags & IS_NEW ) + else if( m_drawItem->m_Flags & IS_NEW ) { EndDrawGraphicItem( DC ); } break; case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + if( m_drawItem->m_Flags == 0 ) { - EditSymbolText( DC, DrawEntry ); + EditSymbolText( DC, m_drawItem ); } break; case COMPONENT_FIELD_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + if( m_drawItem->m_Flags == 0 ) { - EditField( DC, (LIB_FIELD*) DrawEntry ); + EditField( DC, (LIB_FIELD*) m_drawItem ); } break; @@ -239,7 +241,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) wxString msg; msg.Printf( wxT( "WinEDA_LibeditFrame::OnLeftDClick Error: unknown \ StructType %d" ), - DrawEntry->Type() ); + m_drawItem->Type() ); DisplayError( this, msg ); break; } diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index dcaa1606a1..65bb0b6498 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -43,6 +43,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE ) return; + int item_flags = m_drawItem->m_Flags; // save flags to restore them after editing LIB_PIN* pin = (LIB_PIN*) m_drawItem; DIALOG_LIB_EDIT_PIN dlg( this ); @@ -131,6 +132,9 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) } pin->EnableEditMode( false, g_EditPinByPinIsOn ); + + // Restore pin flags, that can be changed by the dialog editor + pin->m_Flags = item_flags; } diff --git a/pcbnew/dialog_freeroute_exchange_help.html b/pcbnew/dialog_freeroute_exchange_help.html index 44e7a3ca38..424eed5730 100644 --- a/pcbnew/dialog_freeroute_exchange_help.html +++ b/pcbnew/dialog_freeroute_exchange_help.html @@ -2,10 +2,9 @@

Freerouter Guidelines:

    -
  1. in pcbnew: establish the number of layers, and save the new *.brd file.

  2. - -
  3. in a text editor: load the board (*.brd) file, and edit the layer names and types. - These should look something like this: +
  4. in pcbnew, using the Layers Setup dialog:

  5. +
  6. choose the number of layers, and enter the name of each layer.

  7. + These should look something like this:
    • Layer[0] Back signal
    • Layer[1] Power power
    • @@ -13,14 +12,13 @@
    • Layer[3] H1_Signal signal
    • Layer[4] Ground power
    • Layer[15] Front signal
    • -

    - Notice that after the layer name there is a layer type field, either 'signal' or 'power'. + Notice that after the layer name there is a layer type field, either 'signal' or 'power'.
    Any layer identified as 'power' will be removed from the layer menu in Freerouter, as this will be assumed to contain a power zone. -
    +

    -
  8. in pcbnew: re-load the board, and establish board perimeter.

  9. +
  10. in pcbnew: establish board perimeter.

  11. in pcbnew: load in the netlist so you have all the components defined and instantiated.

  12. diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 8bd49c1258..1ee374d185 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -65,7 +65,7 @@ static Ki_HotkeyInfo HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL ); static Ki_HotkeyInfo HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE, WXK_BACK ); -static Ki_HotkeyInfo HkAddNewTrack( wxT( "Add New Track/Segment" ), HK_ADD_NEW_TRACK, 'X' ); +static Ki_HotkeyInfo HkAddNewTrack( wxT( "Add new track" ), HK_ADD_NEW_TRACK, 'X' ); static Ki_HotkeyInfo HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' ); static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL ); @@ -97,7 +97,6 @@ static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ), HK_SWITCH_TRACK_DISPLAY_MODE, 'K' ); static Ki_HotkeyInfo HkAddModule( wxT( "Add Module" ), HK_ADD_MODULE, 'O' ); -static Ki_HotkeyInfo HkAddTrack( wxT( "Add Track or Via" ), HK_ADD_TRACK, 'J' ); // List of common hotkey descriptors Ki_HotkeyInfo @@ -122,7 +121,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = &HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4, &HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer, &HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule, - &HkAddTrack, NULL + NULL }; // List of hotkey descriptors for the module editor @@ -318,11 +317,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct GetEventHandler()->ProcessEvent( cmd ); break; - case HK_ADD_TRACK: - cmd.SetId( ID_TRACK_BUTT ); - GetEventHandler()->ProcessEvent( cmd ); - break; - case HK_ZOOM_AUTO: cmd.SetId( ID_ZOOM_PAGE ); GetEventHandler()->ProcessEvent( cmd ); @@ -468,9 +462,18 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct break; case HK_ADD_NEW_TRACK: // Start new track - if( m_ID_current_state == ID_TRACK_BUTT && GetScreen()->m_Active_Layer - <= CMP_N ) + if( GetScreen()->m_Active_Layer > CMP_N ) + break; + + if( m_ID_current_state != ID_TRACK_BUTT && ItemFree ) { + cmd.SetId( ID_TRACK_BUTT ); + GetEventHandler()->ProcessEvent( cmd ); + } + + if( m_ID_current_state != ID_TRACK_BUTT ) + break; + if( ItemFree ) // no track in progress: { TRACK* track = Begin_Route( NULL, DC ); @@ -487,7 +490,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct SetCurItem( track, false ); DrawPanel->m_AutoPAN_Request = true; } - } break; // Footprint edition: