Commit 93b9d3fd authored by charras's avatar charras

fixed 2 serious bugs in Libedit.

fixed redundant hot keys in Eeschema
parent 0084b53e
...@@ -12,6 +12,14 @@ email address. ...@@ -12,6 +12,14 @@ email address.
This makes it easier to preview the page in a browser. Then autogenerate This makes it easier to preview the page in a browser. Then autogenerate
the *.h file from the html using a CMake script. the *.h file from the html using a CMake script.
2009-Dec-2 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
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 <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-Nov-05 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
......
...@@ -39,6 +39,11 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -39,6 +39,11 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawEntry = NULL; DrawEntry = NULL;
break; break;
case COMPONENT_PIN_DRAW_TYPE:
PlacePin( DC );
DrawEntry = NULL;
break;
default: default:
EndDrawGraphicItem( DC ); EndDrawGraphicItem( DC );
break; break;
...@@ -157,41 +162,38 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -157,41 +162,38 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{ {
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
LIB_DRAW_ITEM* DrawEntry = m_drawItem;
if( m_component == NULL ) if( m_component == NULL )
return; return;
if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) if( ( m_drawItem == NULL ) || ( m_drawItem->m_Flags == 0 ) )
{ // We can locate an item { // We can locate an item
DrawEntry = m_drawItem = m_drawItem =
m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT, m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_MousePosition ); 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, m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_Curseur ); GetScreen()->m_Curseur );
} }
if( DrawEntry == NULL ) if( m_drawItem == NULL )
{ {
EditComponentProperties(); EditComponentProperties();
} }
} }
if( DrawEntry ) if( m_drawItem )
DrawEntry->DisplayInfo( this ); m_drawItem->DisplayInfo( this );
else else
return; return;
m_drawItem = DrawEntry;
DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = TRUE;
switch( DrawEntry->Type() ) switch( m_drawItem->Type() )
{ {
case COMPONENT_PIN_DRAW_TYPE: case COMPONENT_PIN_DRAW_TYPE:
if( DrawEntry->m_Flags == 0 ) if( m_drawItem->m_Flags == 0 )
{ {
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN ); cmd.SetId( ID_LIBEDIT_EDIT_PIN );
...@@ -202,35 +204,35 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -202,35 +204,35 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case COMPONENT_ARC_DRAW_TYPE: case COMPONENT_ARC_DRAW_TYPE:
case COMPONENT_CIRCLE_DRAW_TYPE: case COMPONENT_CIRCLE_DRAW_TYPE:
case COMPONENT_RECT_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; break;
case COMPONENT_LINE_DRAW_TYPE: case COMPONENT_LINE_DRAW_TYPE:
case COMPONENT_POLYLINE_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 ); EndDrawGraphicItem( DC );
} }
break; break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: 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; break;
case COMPONENT_FIELD_DRAW_TYPE: 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; break;
...@@ -239,7 +241,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -239,7 +241,7 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
wxString msg; wxString msg;
msg.Printf( wxT( "WinEDA_LibeditFrame::OnLeftDClick Error: unknown \ msg.Printf( wxT( "WinEDA_LibeditFrame::OnLeftDClick Error: unknown \
StructType %d" ), StructType %d" ),
DrawEntry->Type() ); m_drawItem->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
break; break;
} }
......
...@@ -43,6 +43,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) ...@@ -43,6 +43,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE ) if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
return; return;
int item_flags = m_drawItem->m_Flags; // save flags to restore them after editing
LIB_PIN* pin = (LIB_PIN*) m_drawItem; LIB_PIN* pin = (LIB_PIN*) m_drawItem;
DIALOG_LIB_EDIT_PIN dlg( this ); DIALOG_LIB_EDIT_PIN dlg( this );
...@@ -131,6 +132,9 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) ...@@ -131,6 +132,9 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
} }
pin->EnableEditMode( false, g_EditPinByPinIsOn ); pin->EnableEditMode( false, g_EditPinByPinIsOn );
// Restore pin flags, that can be changed by the dialog editor
pin->m_Flags = item_flags;
} }
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
<!-- This file is used to autogenerate a *.h file, but you can load it into a browser to preview --> <!-- This file is used to autogenerate a *.h file, but you can load it into a browser to preview -->
<h1>Freerouter Guidelines:</h1> <h1>Freerouter Guidelines:</h1>
<ol> <ol>
<li> in pcbnew: establish the number of layers, and save the new *.brd file.</li><br> <li> in pcbnew, using the Layers Setup dialog:</li><br>
<li>choose the number of layers, and enter the name of each layer.</li><br>
<li> in a text editor: load the board (*.brd) file, and edit the layer names and types. These should look something like this:
These should look something like this:
<ul> <ul>
<li>Layer[0] Back signal</li> <li>Layer[0] Back signal</li>
<li>Layer[1] Power power</li> <li>Layer[1] Power power</li>
...@@ -13,14 +12,13 @@ ...@@ -13,14 +12,13 @@
<li>Layer[3] H1_Signal signal</li> <li>Layer[3] H1_Signal signal</li>
<li>Layer[4] Ground power</li> <li>Layer[4] Ground power</li>
<li>Layer[15] Front signal</li> <li>Layer[15] Front signal</li>
</ul><br> </ul><br>
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'.<br>
Any layer identified as 'power' will be removed from the layer menu in Freerouter, Any layer identified as 'power' will be removed from the layer menu in Freerouter,
as this will be assumed to contain a power zone. as this will be assumed to contain a power zone.
</li><br> </li><br><br>
<li> in pcbnew: re-load the board, and establish board perimeter.</li><br> <li> in pcbnew: establish board perimeter.</li><br>
<li> in pcbnew: load in the netlist so you have all the components defined and instantiated.</li><br> <li> in pcbnew: load in the netlist so you have all the components defined and instantiated.</li><br>
......
...@@ -65,7 +65,7 @@ static Ki_HotkeyInfo HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F' ...@@ -65,7 +65,7 @@ static Ki_HotkeyInfo HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F'
+ GR_KB_CTRL ); + GR_KB_CTRL );
static Ki_HotkeyInfo HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE, static Ki_HotkeyInfo HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE,
WXK_BACK ); 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 HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' );
static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V'
+ GR_KB_CTRL ); + GR_KB_CTRL );
...@@ -97,7 +97,6 @@ static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' ...@@ -97,7 +97,6 @@ static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U'
static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ), static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ),
HK_SWITCH_TRACK_DISPLAY_MODE, 'K' ); HK_SWITCH_TRACK_DISPLAY_MODE, 'K' );
static Ki_HotkeyInfo HkAddModule( wxT( "Add Module" ), HK_ADD_MODULE, 'O' ); 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 // List of common hotkey descriptors
Ki_HotkeyInfo Ki_HotkeyInfo
...@@ -122,7 +121,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = ...@@ -122,7 +121,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] =
&HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4, &HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4,
&HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer, &HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer,
&HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule, &HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule,
&HkAddTrack, NULL NULL
}; };
// List of hotkey descriptors for the module editor // List of hotkey descriptors for the module editor
...@@ -318,11 +317,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -318,11 +317,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
break; break;
case HK_ADD_TRACK:
cmd.SetId( ID_TRACK_BUTT );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_ZOOM_AUTO: case HK_ZOOM_AUTO:
cmd.SetId( ID_ZOOM_PAGE ); cmd.SetId( ID_ZOOM_PAGE );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
...@@ -468,9 +462,18 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -468,9 +462,18 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
break; break;
case HK_ADD_NEW_TRACK: // Start new track case HK_ADD_NEW_TRACK: // Start new track
if( m_ID_current_state == ID_TRACK_BUTT && GetScreen()->m_Active_Layer if( GetScreen()->m_Active_Layer > CMP_N )
<= 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: if( ItemFree ) // no track in progress:
{ {
TRACK* track = Begin_Route( NULL, DC ); TRACK* track = Begin_Route( NULL, DC );
...@@ -487,7 +490,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -487,7 +490,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
SetCurItem( track, false ); SetCurItem( track, false );
DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true;
} }
}
break; break;
// Footprint edition: // Footprint edition:
......
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