forked from KiCad/kicad-source-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* This program source code file is part of KiCad, a free EDA CAD application. | ||
* | ||
* Copyright (C) 2013 CERN | ||
* Copyright (C) 2013-2015 CERN | ||
* @author Tomasz Wlostowski <[email protected]> | ||
* @author Maciej Suminski <[email protected]> | ||
* | ||
|
@@ -41,18 +41,18 @@ struct BITMAP_OPAQUE; | |
* - running the DRC from the menu | ||
* and so on, and so forth.... | ||
* Action class groups all necessary properties of an action, including explanation, | ||
* icons, hotkeys,.menu items, etc. | ||
* icons, hotkeys, menu items, etc. | ||
*/ | ||
class TOOL_ACTION | ||
{ | ||
public: | ||
TOOL_ACTION( const std::string& aName, TOOL_ACTION_SCOPE aScope = AS_CONTEXT, | ||
int aDefaultHotKey = 0, const wxString aMenuItem = wxEmptyString, | ||
const wxString& aMenuDesc = wxEmptyString, const BITMAP_OPAQUE* aIcon = NULL, | ||
TOOL_ACTION_FLAGS aFlags = AF_NONE ) : | ||
TOOL_ACTION_FLAGS aFlags = AF_NONE, void* aParam = NULL ) : | ||
m_name( aName ), m_scope( aScope ), m_defaultHotKey( aDefaultHotKey ), | ||
m_currentHotKey( aDefaultHotKey ), m_menuItem( aMenuItem ), | ||
m_menuDescription( aMenuDesc ), m_icon( aIcon ), m_id( -1 ), m_flags( aFlags ) | ||
m_currentHotKey( aDefaultHotKey ), m_menuItem( aMenuItem ), m_menuDescription( aMenuDesc ), | ||
m_icon( aIcon ), m_id( -1 ), m_flags( aFlags ), m_param( aParam ) | ||
{ | ||
TOOL_MANAGER::GetActionList().push_back( this ); | ||
} | ||
|
@@ -150,11 +150,11 @@ class TOOL_ACTION | |
TOOL_EVENT MakeEvent() const | ||
{ | ||
if( IsActivation() ) | ||
return TOOL_EVENT( TC_COMMAND, TA_ACTIVATE, m_name, m_scope ); | ||
return TOOL_EVENT( TC_COMMAND, TA_ACTIVATE, m_name, m_scope, m_param ); | ||
else if( IsNotification() ) | ||
return TOOL_EVENT( TC_MESSAGE, TA_NONE, m_name, m_scope ); | ||
return TOOL_EVENT( TC_MESSAGE, TA_NONE, m_name, m_scope, m_param ); | ||
else | ||
return TOOL_EVENT( TC_COMMAND, TA_ACTION, m_name, m_scope ); | ||
return TOOL_EVENT( TC_COMMAND, TA_ACTION, m_name, m_scope, m_param ); | ||
} | ||
|
||
const wxString& GetMenuItem() const | ||
|
@@ -219,7 +219,7 @@ class TOOL_ACTION | |
/// Name of the action (convention is: app.[tool.]action.name) | ||
std::string m_name; | ||
|
||
/// Scope of the action (i.e. the event that is issued after activation). | ||
/// Scope of the action | ||
TOOL_ACTION_SCOPE m_scope; | ||
|
||
/// Default hot key that activates the action. | ||
|
@@ -243,11 +243,8 @@ class TOOL_ACTION | |
/// Action flags | ||
TOOL_ACTION_FLAGS m_flags; | ||
|
||
/// Origin of the action | ||
// const TOOL_BASE* m_origin; | ||
|
||
/// Originating UI object | ||
// wxWindow* m_uiOrigin; | ||
/// Generic parameter | ||
void* m_param; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* This program source code file is part of KiCad, a free EDA CAD application. | ||
* | ||
* Copyright (C) 2013 CERN | ||
* Copyright (C) 2013-2015 CERN | ||
* @author Maciej Suminski <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
|
@@ -25,6 +25,7 @@ | |
#include "common_actions.h" | ||
#include <tool/action_manager.h> | ||
#include <pcbnew_id.h> | ||
#include <layers_id_colors_and_visibility.h> | ||
#include <wx/defs.h> | ||
|
||
// These members are static in class COMMON_ACTIONS: Build them here: | ||
|
@@ -246,35 +247,35 @@ TOOL_ACTION COMMON_ACTIONS::highContrastDec( "pcbnew.Control.highContrastDec", | |
// Layer control | ||
TOOL_ACTION COMMON_ACTIONS::layerTop( "pcbnew.Control.layerTop", | ||
AS_GLOBAL, WXK_PAGEUP, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) F_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner1( "pcbnew.Control.layerInner1", | ||
AS_GLOBAL, WXK_F5, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In1_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner2( "pcbnew.Control.layerInner2", | ||
AS_GLOBAL, WXK_F6, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In2_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner3( "pcbnew.Control.layerInner3", | ||
AS_GLOBAL, WXK_F7, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In3_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner4( "pcbnew.Control.layerInner4", | ||
AS_GLOBAL, WXK_F8, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In4_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner5( "pcbnew.Control.layerInner5", | ||
AS_GLOBAL, WXK_F9, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In5_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerInner6( "pcbnew.Control.layerInner6", | ||
AS_GLOBAL, WXK_F10, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) In6_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerBottom( "pcbnew.Control.layerBottom", | ||
AS_GLOBAL, WXK_PAGEDOWN, | ||
"", "" ); | ||
"", "", NULL, AF_NONE, (void*) B_Cu ); | ||
|
||
TOOL_ACTION COMMON_ACTIONS::layerNext( "pcbnew.Control.layerNext", | ||
AS_GLOBAL, '+', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters