pcbnew: add new hotkey X - add new track/segment

This commit is contained in:
faa 2009-12-03 12:28:04 +00:00
parent a72ddb3804
commit 0084b53efb
4 changed files with 238 additions and 203 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -65,6 +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 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 );
@ -111,8 +112,9 @@ Ki_HotkeyInfo
Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = Ki_HotkeyInfo* s_board_edit_Hotkey_List[] =
{ {
&HkTrackDisplayMode, &HkDelete, &HkTrackDisplayMode, &HkDelete,
&HkBackspace, &HkAddVia, &HkAddMicroVia, &HkBackspace,
&HkEndTrack, &HkMoveFootprint, &HkAddNewTrack, &HkAddVia, &HkAddMicroVia,
&HkEndTrack, &HkMoveFootprint,
&HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint, &HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
&HkLoadfile, &HkFindItem, &HkSwitch2CopperLayer, &HkLoadfile, &HkFindItem, &HkSwitch2CopperLayer,
@ -465,6 +467,29 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
GetScreen()->SetRefreshReq(); GetScreen()->SetRefreshReq();
break; break;
case HK_ADD_NEW_TRACK: // Start new track
if( m_ID_current_state == ID_TRACK_BUTT && GetScreen()->m_Active_Layer
<= CMP_N )
{
if( ItemFree ) // no track in progress:
{
TRACK* track = Begin_Route( NULL, DC );
SetCurItem( track );
if( track )
DrawPanel->m_AutoPAN_Request = true;
}
else if( GetCurItem()->m_Flags & IS_NEW )
{
TRACK* track = Begin_Route( (TRACK*) GetCurItem(), DC );
// SetCurItem() must not write to the msg panel
// because a track info is displayed while moving the mouse cursor
if( track ) // A new segment was created
SetCurItem( track, false );
DrawPanel->m_AutoPAN_Request = true;
}
}
break;
// Footprint edition: // Footprint edition:
case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status: case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status:
// get any module, locked or not locked and toggle its locked status // get any module, locked or not locked and toggle its locked status

View File

@ -23,6 +23,7 @@ enum hotkey_id_commnand {
HK_FLIP_FOOTPRINT, HK_FLIP_FOOTPRINT,
HK_GET_AND_MOVE_FOOTPRINT, HK_GET_AND_MOVE_FOOTPRINT,
HK_LOCK_UNLOCK_FOOTPRINT, HK_LOCK_UNLOCK_FOOTPRINT,
HK_ADD_NEW_TRACK,
HK_ADD_VIA, HK_ADD_VIA,
HK_ADD_MICROVIA, HK_ADD_MICROVIA,
HK_END_TRACK, HK_END_TRACK,