Commit dca4667e authored by Maciej Suminski's avatar Maciej Suminski

PCB_LAYER_WIDGET became able to cooperate with PCB_BASE_FRAME.

parent 0306ec7e
...@@ -252,6 +252,7 @@ public: ...@@ -252,6 +252,7 @@ public:
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent ); void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent ); void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent ); void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
void OnLayerColorChange( wxCommandEvent& aEvent );
/** /**
* Function RecordMacros. * Function RecordMacros.
......
...@@ -81,7 +81,7 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = { ...@@ -81,7 +81,7 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = {
}; };
PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( PCB_EDIT_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize ) : PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize ) :
LAYER_WIDGET( aParent, aFocusOwner, aPointSize ), LAYER_WIDGET( aParent, aFocusOwner, aPointSize ),
myframe( aParent ) myframe( aParent )
{ {
...@@ -213,7 +213,7 @@ void PCB_LAYER_WIDGET::SetLayersManagerTabsText() ...@@ -213,7 +213,7 @@ void PCB_LAYER_WIDGET::SetLayersManagerTabsText()
void PCB_LAYER_WIDGET::ReFillRender() void PCB_LAYER_WIDGET::ReFillRender()
{ {
BOARD* board = myframe->GetBoard(); BOARD* board = myframe->GetBoard();
ClearRenderRows(); ClearRenderRows();
// Add "Render" tab rows to LAYER_WIDGET, after setting color and checkbox state. // Add "Render" tab rows to LAYER_WIDGET, after setting color and checkbox state.
...@@ -356,7 +356,6 @@ void PCB_LAYER_WIDGET::ReFill() ...@@ -356,7 +356,6 @@ void PCB_LAYER_WIDGET::ReFill()
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor ) void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor )
{ {
myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor ); myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );
myframe->ReCreateLayerBox( false );
if( myframe->IsGalCanvasActive() ) if( myframe->IsGalCanvasActive() )
{ {
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#ifndef CLASS_PCB_LAYER_WIDGET_H_ #ifndef CLASS_PCB_LAYER_WIDGET_H_
#define CLASS_PCB_LAYER_WIDGET_H_ #define CLASS_PCB_LAYER_WIDGET_H_
#include <layer_widget.h>
/** /**
* Class PCB_LAYER_WIDGET * Class PCB_LAYER_WIDGET
* is here to implement the abtract functions of LAYER_WIDGET so they * is here to implement the abtract functions of LAYER_WIDGET so they
...@@ -49,7 +51,7 @@ public: ...@@ -49,7 +51,7 @@ public:
* effectively sets the overal size of the widget via the row height and bitmap * effectively sets the overal size of the widget via the row height and bitmap
* button sizes. * button sizes.
*/ */
PCB_LAYER_WIDGET( PCB_EDIT_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize = 10 ); PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize = 10 );
void ReFill(); void ReFill();
...@@ -108,7 +110,7 @@ protected: ...@@ -108,7 +110,7 @@ protected:
bool m_alwaysShowActiveCopperLayer; // If true: Only shows the current active layer bool m_alwaysShowActiveCopperLayer; // If true: Only shows the current active layer
// even if it is changed // even if it is changed
PCB_EDIT_FRAME* myframe; PCB_BASE_FRAME* myframe;
// popup menu ids. // popup menu ids.
#define ID_SHOW_ALL_COPPERS wxID_HIGHEST #define ID_SHOW_ALL_COPPERS wxID_HIGHEST
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#define BUTT_SIZE_Y 18 #define BUTT_SIZE_Y 18
#define BUTT_VOID 4 #define BUTT_VOID 4
const wxEventType LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE = wxNewEventType();
/* XPM /* XPM
* This bitmap is used for not selected layers * This bitmap is used for not selected layers
*/ */
...@@ -294,6 +296,10 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& event ) ...@@ -294,6 +296,10 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& event )
// tell the client code. // tell the client code.
OnLayerColorChange( layer, newColor ); OnLayerColorChange( layer, newColor );
// notify others
wxCommandEvent event( EVT_LAYER_COLOR_CHANGE );
wxPostEvent( this, event );
} }
passOnFocus(); passOnFocus();
......
...@@ -98,6 +98,7 @@ public: ...@@ -98,6 +98,7 @@ public:
} }
}; };
static const wxEventType EVT_LAYER_COLOR_CHANGE;
protected: protected:
......
...@@ -294,6 +294,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) ...@@ -294,6 +294,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle ) PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle )
EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD, EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
PCB_EDIT_FRAME::OnUpdateMuWaveToolbar ) PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
EVT_COMMAND( wxID_ANY, LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE, PCB_EDIT_FRAME::OnLayerColorChange )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -1007,6 +1009,12 @@ void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent ) ...@@ -1007,6 +1009,12 @@ void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent )
} }
void PCB_EDIT_FRAME::OnLayerColorChange( wxCommandEvent& aEvent )
{
ReCreateLayerBox();
}
void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
{ {
DIALOG_PLOT dlg( this ); DIALOG_PLOT dlg( this );
......
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