Make KiCad project tree tab traversable so mouse is not required to open files. (fixes lp:1426556)

* Add wxTAB_TRAVERSAL to TREE_PROJECT_FRAME ctor.
* Please note that there is still a focus issue when closing a child window (at least on
  windows) that prevents this from being an ideal solution.
* Minor code cleaning.
This commit is contained in:
Wayne Stambaugh 2015-02-28 14:00:48 -05:00
parent 873e0740e8
commit 9131d89e80
1 changed files with 20 additions and 17 deletions

View File

@ -8,7 +8,7 @@
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -80,7 +80,7 @@ static const wxChar* s_allowedExtensionsToList[] =
wxT( "^.*\\.htm$" ),
wxT( "^.*\\.html$" ),
wxT( "^.*\\.rpt$" ), // Report files
wxT( "^.*\\.csv$" ), // Report files in comma separateed format
wxT( "^.*\\.csv$" ), // Report files in comma separated format
wxT( "^.*\\.pos$" ), // Footprint position files
wxT( "^.*\\.cmp$" ), // Cvpcb cmp/footprint link files
wxT( "^.*\\.drl$" ), // Excellon drill files
@ -125,7 +125,7 @@ TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ) :
ID_LEFT_FRAME,
wxDefaultPosition,
wxDefaultSize,
wxNO_BORDER | wxSW_3D )
wxNO_BORDER | wxSW_3D | wxTAB_TRAVERSAL )
{
m_Parent = parent;
m_TreeProject = NULL;
@ -752,7 +752,7 @@ void TREE_PROJECT_FRAME::OnRenameFile( wxCommandEvent& )
wxTextEntryDialog dlg( this, msg, _( "Change filename" ), buffer );
if( dlg.ShowModal() != wxID_OK )
return; // cancelled by user
return; // canceled by user
buffer = dlg.GetValue();
buffer.Trim( true );
@ -793,6 +793,7 @@ void TREE_PROJECT_FRAME::OnExpand( wxTreeEvent& Event )
wxTreeItemId kid = m_TreeProject->GetFirstChild( itemId, cookie );
bool subdir_populated = false;
for( ; kid.IsOk(); kid = m_TreeProject->GetNextChild( itemId, cookie ) )
{
TREEPROJECT_ITEM* itemData = GetItemIdData( kid );
@ -866,6 +867,7 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir )
std::stack < wxTreeItemId > subdirs_id;
wxTreeItemId kid = m_TreeProject->GetFirstChild( root_id, cookie );
while( 1 )
{
if( ! kid.IsOk() )
@ -1018,6 +1020,7 @@ void TREE_PROJECT_FRAME::FileWatcherReset()
std::stack < wxTreeItemId > subdirs_id;
wxTreeItemId kid = m_TreeProject->GetFirstChild( root_id, cookie );
while( 1 )
{
if( !kid.IsOk() )