Inherit GAL settings from parent's GAL.
This commit is contained in:
parent
80c0e0080f
commit
fb4f37f39c
|
@ -234,7 +234,7 @@ void DIALOG_PAD_PROPERTIES::OnCancel( wxCommandEvent& event )
|
|||
{
|
||||
// Mandatory to avoid m_panelShowPadGal trying to draw something
|
||||
// in a non valid context during closing process:
|
||||
m_panelShowPadGal->StopDrawing();
|
||||
m_padPreviewGAL->StopDrawing();
|
||||
|
||||
// Now call default handler for wxID_CANCEL command event
|
||||
event.Skip();
|
||||
|
@ -256,6 +256,16 @@ void DIALOG_PAD_PROPERTIES::enablePrimitivePage( bool aEnable )
|
|||
void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
||||
{
|
||||
// Initialize the canvas to display the pad
|
||||
#ifdef __WXMAC__
|
||||
// Cairo renderer doesn't handle Retina displays
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
#else
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
#endif
|
||||
m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( this, -1, wxDefaultPosition, wxDefaultSize,
|
||||
m_parent->GetGalDisplayOptions(), backend );
|
||||
|
||||
m_padPreviewSizer->Add( m_padPreviewGAL, 12, wxEXPAND | wxALL, 5 );
|
||||
|
||||
// Show the X and Y axis. It is usefull because pad shape can have an offset
|
||||
// or be a complex shape.
|
||||
|
@ -266,16 +276,15 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
|||
VECTOR2D( m_dummyPad->GetPosition() ) );
|
||||
m_axisOrigin->SetDrawAtZero( true );
|
||||
|
||||
m_panelShowPadGal->UpdateColors();
|
||||
m_panelShowPadGal->SwitchBackend( m_parent->GetCanvas()->GetBackend() );
|
||||
m_panelShowPadGal->SetStealsFocus( false );
|
||||
m_padPreviewGAL->UpdateColors();
|
||||
m_padPreviewGAL->SetStealsFocus( false );
|
||||
|
||||
m_panelShowPadGal->GetViewControls()->ApplySettings(
|
||||
m_padPreviewGAL->GetViewControls()->ApplySettings(
|
||||
m_parent->GetCanvas()->GetViewControls()->GetSettings() );
|
||||
|
||||
m_panelShowPadGal->Show();
|
||||
m_padPreviewGAL->Show();
|
||||
|
||||
KIGFX::VIEW* view = m_panelShowPadGal->GetView();
|
||||
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
||||
|
||||
// fix the pad render mode (filled/not filled)
|
||||
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
|
||||
|
@ -293,7 +302,7 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
|||
view->Add( m_dummyPad );
|
||||
view->Add( m_axisOrigin );
|
||||
|
||||
m_panelShowPadGal->StartDrawing();
|
||||
m_padPreviewGAL->StartDrawing();
|
||||
Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
|
||||
}
|
||||
|
||||
|
@ -766,7 +775,7 @@ void DIALOG_PAD_PROPERTIES::onChangePadMode( wxCommandEvent& event )
|
|||
{
|
||||
m_sketchPreview = m_cbShowPadOutline->GetValue();
|
||||
|
||||
KIGFX::VIEW* view = m_panelShowPadGal->GetView();
|
||||
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
||||
|
||||
// fix the pad render mode (filled/not filled)
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings =
|
||||
|
@ -1199,8 +1208,11 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
|
|||
|
||||
void DIALOG_PAD_PROPERTIES::redraw()
|
||||
{
|
||||
KIGFX::VIEW* view = m_panelShowPadGal->GetView();
|
||||
m_panelShowPadGal->StopDrawing();
|
||||
if( !m_canUpdate )
|
||||
return;
|
||||
|
||||
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
||||
m_padPreviewGAL->StopDrawing();
|
||||
|
||||
// The layer used to place primitive items selected when editing custom pad shapes
|
||||
// we use here a layer never used in a pad:
|
||||
|
@ -1298,8 +1310,8 @@ void DIALOG_PAD_PROPERTIES::redraw()
|
|||
// Autozoom
|
||||
view->SetViewport( viewBox );
|
||||
|
||||
m_panelShowPadGal->StartDrawing();
|
||||
m_panelShowPadGal->Refresh();
|
||||
m_padPreviewGAL->StartDrawing();
|
||||
m_padPreviewGAL->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ private:
|
|||
// editing a custom pad shape
|
||||
|
||||
std::vector<DRAWSEGMENT*> m_highlight; // shapes highlighted in GAL mode
|
||||
PCB_DRAW_PANEL_GAL* m_padPreviewGAL;
|
||||
KIGFX::ORIGIN_VIEWITEM* m_axisOrigin; // origin of the preview canvas
|
||||
static bool m_sketchPreview; // session storage
|
||||
|
||||
|
|
|
@ -852,6 +852,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
|
|||
wxBoxSizer* bSizerDisplayPad;
|
||||
bSizerDisplayPad = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
bSizerDisplayPad->SetMinSize( wxSize( 290,-1 ) );
|
||||
|
||||
bSizerDisplayPad->Add( 0, 0, 0, wxBOTTOM|wxEXPAND|wxTOP, 3 );
|
||||
|
||||
|
@ -870,10 +871,11 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
|
|||
|
||||
bSizerDisplayPad->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_panelShowPadGal = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), wxDefaultSize, m_galOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO);
|
||||
m_panelShowPadGal->SetMinSize( wxSize( 280,-1 ) );
|
||||
m_padPreviewSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
bSizerDisplayPad->Add( m_panelShowPadGal, 12, wxEXPAND|wxALL, 5 );
|
||||
m_padPreviewSizer->SetMinSize( wxSize( 280,-1 ) );
|
||||
|
||||
bSizerDisplayPad->Add( m_padPreviewSizer, 12, wxEXPAND, 5 );
|
||||
|
||||
m_cbShowPadOutline = new wxCheckBox( this, wxID_ANY, _("Show pad in outline mode"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerDisplayPad->Add( m_cbShowPadOutline, 0, wxBOTTOM|wxRIGHT|wxTOP, 5 );
|
||||
|
|
|
@ -9624,7 +9624,7 @@
|
|||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="minimum_size">290,-1</property>
|
||||
<property name="name">bSizerDisplayPad</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
|
@ -9770,66 +9770,15 @@
|
|||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">12</property>
|
||||
<object class="CustomControl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="class">PCB_DRAW_PANEL_GAL</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="construction">m_panelShowPadGal = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), wxDefaultSize, m_galOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO);</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="declaration">PCB_DRAW_PANEL_GAL* m_panelShowPadGal;
KIGFX::GAL_DISPLAY_OPTIONS m_galOptions;</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include">#include <pcb_base_frame.h>
#include <pcb_draw_panel_gal.h></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size">280,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelShowPadGal</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="name">m_padPreviewSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="settings"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
|
|
|
@ -38,8 +38,6 @@ class WX_GRID;
|
|||
#include <wx/listctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/grid.h>
|
||||
|
@ -211,8 +209,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
wxButton* m_buttonDel;
|
||||
wxStaticText* m_parentInfoLine1;
|
||||
wxStaticText* m_parentInfoLine2;
|
||||
PCB_DRAW_PANEL_GAL* m_panelShowPadGal;
|
||||
KIGFX::GAL_DISPLAY_OPTIONS m_galOptions;
|
||||
wxBoxSizer* m_padPreviewSizer;
|
||||
wxCheckBox* m_cbShowPadOutline;
|
||||
wxStaticLine* m_staticline13;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
|
|
Loading…
Reference in New Issue