Commit 6379d806 authored by Maciej Suminski's avatar Maciej Suminski

Zoom & grid menus for GAL canvases.

parent 06b978b8
......@@ -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} )
......
......@@ -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"
......@@ -69,6 +71,18 @@ SELECTION_TOOL::SELECTION_TOOL() :
TOOL_INTERACTIVE( "pcbnew.InteractiveSelection" ),
m_frame( NULL ), m_additive( false ), m_multiple( false ),
m_editModules( false ), m_locked( true )
{
}
SELECTION_TOOL::~SELECTION_TOOL()
{
delete m_selArea;
delete m_selection.group;
}
bool SELECTION_TOOL::Init()
{
m_selArea = new SELECTION_AREA;
m_selection.group = new KIGFX::VIEW_GROUP;
......@@ -76,13 +90,17 @@ SELECTION_TOOL::SELECTION_TOOL() :
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 );
SELECTION_TOOL::~SELECTION_TOOL()
{
delete m_selArea;
delete m_selection.group;
AddSubMenu( new ZOOM_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Zoom" );
AddSubMenu( new GRID_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Grid" );
return true;
}
......
......@@ -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 );
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment