Commit 709dfcc1 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Added settings dialog for Pad Enumeration tool.

parent 2bcbb675
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -59,6 +59,8 @@ set( PCBNEW_DIALOGS
    dialogs/dialog_edit_module_for_Modedit.cpp
    dialogs/dialog_edit_module_for_Modedit.cpp
    dialogs/dialog_edit_module_text.cpp
    dialogs/dialog_edit_module_text.cpp
    dialogs/dialog_edit_module_text_base.cpp
    dialogs/dialog_edit_module_text_base.cpp
    dialogs/dialog_enum_pads.cpp
    dialogs/dialog_enum_pads_base.cpp
    dialogs/dialog_exchange_modules_base.cpp
    dialogs/dialog_exchange_modules_base.cpp
    dialogs/dialog_export_idf.cpp
    dialogs/dialog_export_idf.cpp
    dialogs/dialog_export_idf_base.cpp
    dialogs/dialog_export_idf_base.cpp
+42 −0
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2014 CERN
 * @author Maciej Suminski <maciej.suminski@cern.ch>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#include "dialog_enum_pads.h"

DIALOG_ENUM_PADS::DIALOG_ENUM_PADS( wxWindow* aParent ) :
    DIALOG_ENUM_PADS_BASE( aParent )
{
}


int DIALOG_ENUM_PADS::GetStartNumber() const
{
    return m_padStartNum->GetValue();
}


wxString DIALOG_ENUM_PADS::GetPrefix() const
{
    return m_padPrefix->GetValue();
}
+49 −0
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2014 CERN
 * @author Maciej Suminski <maciej.suminski@cern.ch>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#ifndef __dialog_enum_pads__
#define __dialog_enum_pads__

/**
@file
Subclass of DIALOG_ENUM_PADS_BASE, which is generated by wxFormBuilder.
*/

#include "dialog_enum_pads_base.h"

/** Implementing DIALOG_ENUM_PADS_BASE */
class DIALOG_ENUM_PADS : public DIALOG_ENUM_PADS_BASE
{
public:
    /** Constructor */
    DIALOG_ENUM_PADS( wxWindow* parent );

    ///> Returns the starting number that is going to be used for the first enumerated pad.
    int GetStartNumber() const;

    ///> Returns common prefix for all enumerated pads.
    wxString GetPrefix() const;
};

#endif // __dialog_enum_pads__
+68 −0
Original line number Original line Diff line number Diff line
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "dialog_enum_pads_base.h"

///////////////////////////////////////////////////////////////////////////

DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bMainSizer;
	bMainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bPrefixSizer;
	bPrefixSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_lblPadPrefix = new wxStaticText( this, wxID_ANY, _("Pad name prefix:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_lblPadPrefix->Wrap( -1 );
	bPrefixSizer->Add( m_lblPadPrefix, 1, wxALL, 5 );
	
	m_padPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_padPrefix->SetMaxLength( 4 ); 
	bPrefixSizer->Add( m_padPrefix, 0, wxALL, 5 );
	
	
	bMainSizer->Add( bPrefixSizer, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bPadNumSizer;
	bPadNumSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_lblPadStartNum = new wxStaticText( this, wxID_ANY, _("First pad number:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_lblPadStartNum->Wrap( -1 );
	bPadNumSizer->Add( m_lblPadStartNum, 1, wxALL, 5 );
	
	m_padStartNum = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999, 1 );
	bPadNumSizer->Add( m_padStartNum, 0, wxALL, 5 );
	
	
	bMainSizer->Add( bPadNumSizer, 1, wxEXPAND, 5 );
	
	m_lblInfo = new wxStaticText( this, wxID_ANY, _("Pad names are restricted to 4 characters (including number)."), wxDefaultPosition, wxDefaultSize, 0 );
	m_lblInfo->Wrap( 320 );
	bMainSizer->Add( m_lblInfo, 0, wxALL, 5 );
	
	m_stdButtons = new wxStdDialogButtonSizer();
	m_stdButtonsOK = new wxButton( this, wxID_OK );
	m_stdButtons->AddButton( m_stdButtonsOK );
	m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
	m_stdButtons->AddButton( m_stdButtonsCancel );
	m_stdButtons->Realize();
	
	bMainSizer->Add( m_stdButtons, 2, wxEXPAND, 5 );
	
	
	this->SetSizer( bMainSizer );
	this->Layout();
	
	this->Centre( wxBOTH );
}

DIALOG_ENUM_PADS_BASE::~DIALOG_ENUM_PADS_BASE()
{
}
+572 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading