Zoom & grid menus for GAL canvases.

This commit is contained in:
Maciej Suminski 2015-04-30 10:46:05 +02:00
parent 06b978b829
commit 6379d80636
3 changed files with 31 additions and 7 deletions

View File

@ -284,6 +284,9 @@ set( PCBNEW_CLASS_SRCS
tools/common_actions.cpp
tools/grid_helper.cpp
tools/tools_common.cpp
tools/grid_menu.cpp
tools/zoom_menu.cpp
)
set( PCBNEW_SRCS ${PCBNEW_AUTOROUTER_SRCS} ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS} )

View File

@ -51,6 +51,8 @@
#include "selection_tool.h"
#include "selection_area.h"
#include "zoom_menu.h"
#include "grid_menu.h"
#include "bright_box.h"
#include "common_actions.h"
@ -70,12 +72,6 @@ SELECTION_TOOL::SELECTION_TOOL() :
m_frame( NULL ), m_additive( false ), m_multiple( false ),
m_editModules( false ), m_locked( true )
{
m_selArea = new SELECTION_AREA;
m_selection.group = new KIGFX::VIEW_GROUP;
AddSubMenu( new SELECT_MENU, _( "Select..." ),
(SELECTION_CONDITION) SELECTION_CONDITIONS::OnlyConnectedItems &&
SELECTION_CONDITIONS::Count( 1 ) );
}
@ -86,6 +82,28 @@ SELECTION_TOOL::~SELECTION_TOOL()
}
bool SELECTION_TOOL::Init()
{
m_selArea = new SELECTION_AREA;
m_selection.group = new KIGFX::VIEW_GROUP;
AddSubMenu( new SELECT_MENU, _( "Select..." ),
(SELECTION_CONDITION) SELECTION_CONDITIONS::OnlyConnectedItems &&
SELECTION_CONDITIONS::Count( 1 ) );
AddMenuItem( COMMON_ACTIONS::zoomCenter );
AddMenuItem( COMMON_ACTIONS::zoomIn );
AddMenuItem( COMMON_ACTIONS::zoomOut );
AddMenuItem( COMMON_ACTIONS::zoomFitScreen );
AddSubMenu( new ZOOM_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Zoom" );
AddSubMenu( new GRID_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Grid" );
return true;
}
void SELECTION_TOOL::Reset( RESET_REASON aReason )
{
if( aReason == TOOL_BASE::MODEL_RELOAD )

View File

@ -104,7 +104,10 @@ public:
SELECTION_TOOL();
~SELECTION_TOOL();
/// @copydoc TOOL_INTERACTIVE::Reset()
/// @copydoc TOOL_BASE::Init()
bool Init();
/// @copydoc TOOL_BASE::Reset()
void Reset( RESET_REASON aReason );
/**