Pcbnew: Enable some numbering options in pcbnew
The numbering axis priority (h then v or v then h), and alternate reversing are not actually numbering parameters, they are part of the geometry of the array (the items are physically in different orders). So enable these options, even when numbering is disabled. Also fix broken logic about when numbering scheme is enabled (it still applies even if the numbering offset is fixed.)
This commit is contained in:
parent
453a91f661
commit
ffaf99a600
|
@ -318,34 +318,32 @@ void DIALOG_CREATE_ARRAY::setControlEnablement()
|
|||
{
|
||||
if ( m_numberingEnabled )
|
||||
{
|
||||
const bool renumber = m_rbGridStartNumberingOpt->GetSelection() == 1;
|
||||
const bool use_set_start_grid = m_rbGridStartNumberingOpt->GetSelection() == 1;
|
||||
|
||||
// If we're not renumbering, we can't set the numbering scheme
|
||||
// or axis numbering types
|
||||
m_radioBoxGridNumberingScheme->Enable( renumber );
|
||||
m_labelPriAxisNumbering->Enable( renumber );
|
||||
m_choicePriAxisNumbering->Enable( renumber );
|
||||
m_radioBoxGridNumberingScheme->Enable( true );
|
||||
m_labelPriAxisNumbering->Enable( true );
|
||||
m_choicePriAxisNumbering->Enable( true );
|
||||
|
||||
// Disable the secondary axis numbering option if the
|
||||
// numbering scheme doesn't have two axes
|
||||
const bool num2d = m_radioBoxGridNumberingScheme->GetSelection() != 0;
|
||||
|
||||
m_labelSecAxisNumbering->Enable( renumber && num2d );
|
||||
m_choiceSecAxisNumbering->Enable( renumber && num2d );
|
||||
m_labelSecAxisNumbering->Enable( true && num2d );
|
||||
m_choiceSecAxisNumbering->Enable( true && num2d );
|
||||
|
||||
// We can only set an offset if we renumber
|
||||
m_labelGridNumberingOffset->Enable( renumber );
|
||||
m_entryGridPriNumberingOffset->Enable( renumber );
|
||||
m_entryGridSecNumberingOffset->Enable( renumber && num2d );
|
||||
// We can only set an offset if we're setting the start number
|
||||
m_labelGridNumberingOffset->Enable( use_set_start_grid );
|
||||
m_entryGridPriNumberingOffset->Enable( use_set_start_grid );
|
||||
m_entryGridSecNumberingOffset->Enable( use_set_start_grid && num2d );
|
||||
|
||||
m_entryCircNumberingStart->Enable( m_rbCircStartNumberingOpt->GetSelection() == 1 );
|
||||
// disable the circular number offset in the same way
|
||||
const bool use_set_start_circ = m_rbCircStartNumberingOpt->GetSelection() == 1;
|
||||
m_entryCircNumberingStart->Enable( use_set_start_circ );
|
||||
}
|
||||
else
|
||||
{
|
||||
// grid
|
||||
m_rbGridStartNumberingOpt->Enable( false );
|
||||
m_checkBoxGridReverseNumbering->Enable( false );
|
||||
m_radioBoxGridNumberingAxis->Enable( false );
|
||||
m_radioBoxGridNumberingScheme->Enable( false );
|
||||
m_choiceSecAxisNumbering->Enable( false );
|
||||
m_choicePriAxisNumbering->Enable( false );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Nov 10 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -109,7 +109,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
|||
|
||||
wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") };
|
||||
int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString );
|
||||
m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Pad Numbering Direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_radioBoxGridNumberingAxis->SetSelection( 0 );
|
||||
m_gridPadNumberingSizer->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
@ -259,7 +259,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
|||
|
||||
bSizer4->Add( 0, 0, 0, wxALL|wxEXPAND, 10 );
|
||||
|
||||
m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Pad Numbering Options:") ), wxVERTICAL );
|
||||
m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Numbering Options:") ), wxVERTICAL );
|
||||
|
||||
wxString m_rbCircStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") };
|
||||
int m_rbCircStartNumberingOptNChoices = sizeof( m_rbCircStartNumberingOptChoices ) / sizeof( wxString );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,11 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Nov 10 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_CREATE_ARRAY_BASE_H__
|
||||
#define __DIALOG_CREATE_ARRAY_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
|
@ -117,4 +116,3 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
|
|||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_CREATE_ARRAY_BASE_H__
|
||||
|
|
Loading…
Reference in New Issue