Formatting.

This commit is contained in:
Jeff Young 2022-02-25 15:32:13 +00:00
parent 4c81bac9e3
commit 6d8507d44f
6 changed files with 22 additions and 21 deletions

View File

@ -167,7 +167,7 @@ wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry
BITMAPS icon = aAction.GetIcon(); BITMAPS icon = aAction.GetIcon();
// Allow the label to be overridden at point of use // Allow the label to be overridden at point of use
wxString menuLabel = aOverrideLabel.IsEmpty() ? aAction.GetMenuItem() : aOverrideLabel; wxString menuLabel = aOverrideLabel.IsEmpty() ? aAction.GetMenuItem() : aOverrideLabel;
wxMenuItem* item = new wxMenuItem( this, aAction.GetUIId(), menuLabel, wxMenuItem* item = new wxMenuItem( this, aAction.GetUIId(), menuLabel,
aAction.GetDescription(), aAction.GetDescription(),

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2014-2016 CERN * Copyright (C) 2014-2016 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch> * @author Maciej Suminski <maciej.suminski@cern.ch>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -164,7 +164,7 @@ int COMMON_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent )
KIWAY_PLAYER* editor = m_frame->Kiway().Player( playerType, true ); KIWAY_PLAYER* editor = m_frame->Kiway().Player( playerType, true );
// editor can be null if Player() fails: // editor can be null if Player() fails:
wxCHECK_MSG( editor != nullptr, 0, "Cannot open/create the editor frame" ); wxCHECK_MSG( editor != nullptr, 0, wxT( "Cannot open/create the editor frame" ) );
// Needed on Windows, other platforms do not use it, but it creates no issue // Needed on Windows, other platforms do not use it, but it creates no issue
if( editor->IsIconized() ) if( editor->IsIconized() )
@ -187,8 +187,8 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
wxString msg; wxString msg;
// the URL of help files is "https://docs.kicad.org/<version>/<language>/<name>/" // the URL of help files is "https://docs.kicad.org/<version>/<language>/<name>/"
const wxString baseUrl = URL_DOCUMENTATION + GetMajorMinorVersion() + "/" const wxString baseUrl = URL_DOCUMENTATION + GetMajorMinorVersion() + wxT( "/" )
+ Pgm().GetLocale()->GetName().BeforeLast( '_' ) + "/"; + Pgm().GetLocale()->GetName().BeforeLast( '_' ) + wxT( "/" );
/* We have to get document for beginners, /* We have to get document for beginners,
* or the full specific doc * or the full specific doc

View File

@ -107,12 +107,14 @@ void CONDITIONAL_MENU::Resolve()
Evaluate( g_resolveDummySelection ); Evaluate( g_resolveDummySelection );
UpdateAll(); UpdateAll();
runOnSubmenus( [] ( ACTION_MENU* aMenu ) { runOnSubmenus(
CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( aMenu ); [] ( ACTION_MENU* aMenu )
{
CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( aMenu );
if( conditionalMenu ) if( conditionalMenu )
conditionalMenu->Resolve(); conditionalMenu->Resolve();
} ); } );
} }
@ -186,13 +188,13 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
// they are updated. This is also required on GTK to make sure the menus have the proper // they are updated. This is also required on GTK to make sure the menus have the proper
// size when created. // size when created.
runOnSubmenus( runOnSubmenus(
[&aSelection]( ACTION_MENU* aMenu ) [&aSelection]( ACTION_MENU* aMenu )
{ {
CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( aMenu ); CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( aMenu );
if( conditionalMenu ) if( conditionalMenu )
conditionalMenu->Evaluate( aSelection ); conditionalMenu->Evaluate( aSelection );
} ); } );
} }
@ -210,6 +212,7 @@ void CONDITIONAL_MENU::addEntry( ENTRY aEntry )
m_entries.insert( it, aEntry ); m_entries.insert( it, aEntry );
} }
CONDITIONAL_MENU::ENTRY::ENTRY( const ENTRY& aEntry ) CONDITIONAL_MENU::ENTRY::ENTRY( const ENTRY& aEntry )
{ {
m_type = aEntry.m_type; m_type = aEntry.m_type;

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2017-2019 KiCad Developers, see CHANGELOG.txt for contributors. * Copyright (C) 2017-2022 KiCad Developers, see CHANGELOG.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -26,8 +26,6 @@
#include <tool/tool_interactive.h> #include <tool/tool_interactive.h>
#include <tool/action_menu.h> #include <tool/action_menu.h>
#include <tool/actions.h> #include <tool/actions.h>
#include <tool/zoom_menu.h>
#include <tool/grid_menu.h>
#include <tool/selection.h> #include <tool/selection.h>

View File

@ -30,9 +30,7 @@
#include <tool/actions.h> #include <tool/actions.h>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <convert_to_biu.h>
#include <functional> #include <functional>
#include <zoom_defines.h>
using namespace std::placeholders; using namespace std::placeholders;

View File

@ -281,8 +281,10 @@ void EE_SELECTION_TOOL::Reset( RESET_REASON aReason )
m_isSymbolViewer = symbolViewerFrame != nullptr; m_isSymbolViewer = symbolViewerFrame != nullptr;
} }
else else
{
// Restore previous properties of selected items and remove them from containers // Restore previous properties of selected items and remove them from containers
ClearSelection(); ClearSelection();
}
// Reinsert the VIEW_GROUP, in case it was removed from the VIEW // Reinsert the VIEW_GROUP, in case it was removed from the VIEW
getView()->Remove( &m_selection ); getView()->Remove( &m_selection );