Commit 557bb43d authored by Maciej Suminski's avatar Maciej Suminski

Moved TOOL_MANAGER & TOOL_DISPATCHER to EDA_DRAW_FRAME.

parent 5c984aa0
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include <view/view.h> #include <view/view.h>
#include <view/view_controls.h> #include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
/** /**
* Definition for enabling and disabling scroll bar setting trace output. See the * Definition for enabling and disabling scroll bar setting trace output. See the
...@@ -110,6 +112,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, ...@@ -110,6 +112,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_canvas = NULL; m_canvas = NULL;
m_galCanvas = NULL; m_galCanvas = NULL;
m_galCanvasActive = false; m_galCanvasActive = false;
m_toolManager = NULL;
m_toolDispatcher = NULL;
m_messagePanel = NULL; m_messagePanel = NULL;
m_currentScreen = NULL; m_currentScreen = NULL;
m_toolId = ID_NO_TOOL_SELECTED; m_toolId = ID_NO_TOOL_SELECTED;
...@@ -180,6 +184,10 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, ...@@ -180,6 +184,10 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
EDA_DRAW_FRAME::~EDA_DRAW_FRAME() EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
{ {
delete m_toolManager;
delete m_toolDispatcher;
delete m_galCanvas;
delete m_currentScreen; delete m_currentScreen;
m_currentScreen = NULL; m_currentScreen = NULL;
......
...@@ -72,6 +72,9 @@ protected: ...@@ -72,6 +72,9 @@ protected:
/// The area to draw on. /// The area to draw on.
EDA_DRAW_PANEL* m_canvas; EDA_DRAW_PANEL* m_canvas;
TOOL_MANAGER* m_toolManager;
TOOL_DISPATCHER* m_toolDispatcher;
/// Tool ID of previously active draw tool bar button. /// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId; int m_lastDrawToolId;
...@@ -730,6 +733,12 @@ public: ...@@ -730,6 +733,12 @@ public:
EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; } EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; } void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
/**
* Function GetToolManager
* returns the tool manager instance, if any.
*/
TOOL_MANAGER* GetToolManager() const { return m_toolManager; }
/** /**
* Function GetDisplayOptions * Function GetDisplayOptions
* A way to pass info to draw functions. the base class has no knowledge about * A way to pass info to draw functions. the base class has no knowledge about
......
...@@ -86,9 +86,6 @@ protected: ...@@ -86,9 +86,6 @@ protected:
/// main window. /// main window.
wxAuiToolBar* m_auxiliaryToolBar; wxAuiToolBar* m_auxiliaryToolBar;
TOOL_MANAGER* m_toolManager;
TOOL_DISPATCHER* m_toolDispatcher;
void updateGridSelectBox(); void updateGridSelectBox();
void updateZoomSelectBox(); void updateZoomSelectBox();
virtual void unitsChangeRefresh(); virtual void unitsChangeRefresh();
......
...@@ -72,6 +72,8 @@ class PAGE_INFO; ...@@ -72,6 +72,8 @@ class PAGE_INFO;
class PLOTTER; class PLOTTER;
class TITLE_BLOCK; class TITLE_BLOCK;
class MSG_PANEL_ITEM; class MSG_PANEL_ITEM;
class TOOL_MANAGER;
class TOOL_DISPATCHER;
enum id_librarytype { enum id_librarytype {
......
...@@ -96,8 +96,6 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame ...@@ -96,8 +96,6 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ) EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName )
{ {
m_Pcb = NULL; m_Pcb = NULL;
m_toolManager = NULL;
m_toolDispatcher = NULL;
m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL) m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL)
m_UserGridSize = wxRealPoint( 100.0, 100.0 ); m_UserGridSize = wxRealPoint( 100.0, 100.0 );
...@@ -119,12 +117,7 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame ...@@ -119,12 +117,7 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
PCB_BASE_FRAME::~PCB_BASE_FRAME() PCB_BASE_FRAME::~PCB_BASE_FRAME()
{ {
delete m_Collector; delete m_Collector;
delete m_toolManager;
delete m_toolDispatcher;
delete m_Pcb; delete m_Pcb;
delete GetGalCanvas();
} }
......
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