Refinements in pad properties dialog

This commit is contained in:
jean-pierre charras 2017-09-20 15:37:20 +02:00
parent 6816b0dc99
commit 7c1ac6fbcc
4 changed files with 23 additions and 4 deletions

View File

@ -150,6 +150,20 @@ void DIALOG_PAD_PROPERTIES::OnInitDialog( wxInitDialogEvent& event )
m_PadNumCtrl->SetSelection( -1, -1 );
}
void DIALOG_PAD_PROPERTIES::enablePrimitivePage( bool aEnable )
{
// Enable or disable the widgets in page managing custom shape primitives
m_listCtrlPrimitives->Enable( aEnable );
m_buttonDel->Enable( aEnable );
m_buttonEditShape->Enable( aEnable );
m_buttonAddShape->Enable( aEnable );
m_buttonDup->Enable( aEnable );
m_buttonGeometry->Enable( aEnable );
m_buttonImport->Enable( aEnable );
}
void DIALOG_PAD_PROPERTIES::prepareCanvas()
{
// Initialize the canvases (legacy or gal) to display the pad
@ -629,6 +643,8 @@ void DIALOG_PAD_PROPERTIES::initValues()
break;
}
enablePrimitivePage( PAD_SHAPE_CUSTOM == m_dummyPad->GetShape() );
m_OrientValue = angle / 10.0;
// Type of pad selection
@ -815,6 +831,8 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
break;
}
enablePrimitivePage( is_custom );
// A few widgets are enabled only for rounded rect pads:
m_tcCornerSizeRatio->Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT );

View File

@ -98,6 +98,7 @@ private:
void redraw();
void editPrimitive();
void updateRoundRectCornerValues();
void enablePrimitivePage( bool aEnable ); ///< enable (or disable) the primitive page editor
/**
* Function setPadLayersList

View File

@ -63,7 +63,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_staticText45->Wrap( -1 );
fgSizerPadType->Add( m_staticText45, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
wxString m_PadShapeChoices[] = { _("Circular"), _("Oval"), _("Rectangular"), _("Trapezoidal"), _("Rounded Rectangle"), _("Custom Shape with Circular Anchor"), _("Custom Shape with Rectangular Anchor") };
wxString m_PadShapeChoices[] = { _("Circular"), _("Oval"), _("Rectangular"), _("Trapezoidal"), _("Rounded Rectangle"), _("Custom Shape (Circular Anchor)"), _("Custom Shape (Rectangular Anchor)") };
int m_PadShapeNChoices = sizeof( m_PadShapeChoices ) / sizeof( wxString );
m_PadShape = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PadShapeNChoices, m_PadShapeChoices, 0 );
m_PadShape->SetSelection( 0 );
@ -223,7 +223,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_staticline9 = new wxStaticLine( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizerShapeType->Add( m_staticline9, 0, wxEXPAND | wxALL, 5 );
m_staticTextCornerSizeRatio = new wxStaticText( m_panelGeneral, wxID_ANY, _("Corner size (percent of width):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCornerSizeRatio = new wxStaticText( m_panelGeneral, wxID_ANY, _("Corner size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCornerSizeRatio->Wrap( -1 );
m_staticTextCornerSizeRatio->SetToolTip( _("Corner radius in percent of the pad width.\nThe width is the smaller value between size X and size Y\nThe max value is 50 percent ") );

View File

@ -912,7 +912,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Circular&quot; &quot;Oval&quot; &quot;Rectangular&quot; &quot;Trapezoidal&quot; &quot;Rounded Rectangle&quot; &quot;Custom Shape with Circular Anchor&quot; &quot;Custom Shape with Rectangular Anchor&quot;</property>
<property name="choices">&quot;Circular&quot; &quot;Oval&quot; &quot;Rectangular&quot; &quot;Trapezoidal&quot; &quot;Rounded Rectangle&quot; &quot;Custom Shape (Circular Anchor)&quot; &quot;Custom Shape (Rectangular Anchor)&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -4193,7 +4193,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Corner size (percent of width):</property>
<property name="label">Corner size:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>