2015-07-09 11:35:51 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 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 <dialogs/dialog_track_via_properties_base.h>
|
2017-11-10 23:27:46 +00:00
|
|
|
#include <widgets/unit_binder.h>
|
2017-11-01 11:14:16 +00:00
|
|
|
#include <core/optional.h>
|
2015-07-09 11:35:51 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
|
|
|
|
2017-02-28 03:04:44 +00:00
|
|
|
class SELECTION;
|
2016-06-20 13:46:58 +00:00
|
|
|
class COMMIT;
|
|
|
|
|
2015-07-09 11:35:51 +00:00
|
|
|
class PCB_BASE_FRAME;
|
|
|
|
|
|
|
|
class DIALOG_TRACK_VIA_PROPERTIES : public DIALOG_TRACK_VIA_PROPERTIES_BASE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParent, const SELECTION& aItems );
|
|
|
|
|
|
|
|
///> Applies values from the dialog to the selected items.
|
2016-06-20 13:46:58 +00:00
|
|
|
bool Apply( COMMIT& aCommit );
|
2015-07-09 11:35:51 +00:00
|
|
|
|
|
|
|
private:
|
2016-09-24 18:53:15 +00:00
|
|
|
void onClose( wxCloseEvent& aEvent ) override;
|
|
|
|
void onTrackNetclassCheck( wxCommandEvent& aEvent ) override;
|
|
|
|
void onViaNetclassCheck( wxCommandEvent& aEvent ) override;
|
|
|
|
void onCancelClick( wxCommandEvent& aEvent ) override;
|
|
|
|
void onOkClick( wxCommandEvent& aEvent ) override;
|
2017-09-18 08:28:08 +00:00
|
|
|
void onViaSelect( wxCommandEvent& aEvent );
|
|
|
|
void onViaEdit( wxCommandEvent& aEvent );
|
2015-07-09 11:35:51 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void OnInitDlg( wxInitDialogEvent& event ) override
|
2016-07-14 17:30:25 +00:00
|
|
|
{
|
|
|
|
// Call the default wxDialog handler of a wxInitDialogEvent
|
|
|
|
TransferDataToWindow();
|
|
|
|
|
|
|
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
|
|
|
FinishDialogSettings();
|
|
|
|
}
|
|
|
|
|
2015-07-09 11:35:51 +00:00
|
|
|
///> Checks if the dialog values are correct.
|
|
|
|
bool check() const;
|
|
|
|
|
2017-11-01 11:14:16 +00:00
|
|
|
///> Sets wxTextEntry to the value stored in OPT<T> or "<...>" if it is not available.
|
2015-07-09 11:35:51 +00:00
|
|
|
template<typename T>
|
2017-11-10 23:27:46 +00:00
|
|
|
void setCommonVal( const OPT<T>& aVal, wxTextEntry* aTxtEntry, UNIT_BINDER& aBinder )
|
2015-07-09 11:35:51 +00:00
|
|
|
{
|
|
|
|
if( aVal )
|
|
|
|
aBinder.SetValue( *aVal );
|
|
|
|
else
|
2017-08-25 14:46:49 +00:00
|
|
|
aTxtEntry->SetValue( "<...>" );
|
2015-07-09 11:35:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
///> Selected items to be modified.
|
|
|
|
const SELECTION& m_items;
|
|
|
|
|
2017-11-10 23:27:46 +00:00
|
|
|
UNIT_BINDER m_trackStartX, m_trackStartY;
|
|
|
|
UNIT_BINDER m_trackEndX, m_trackEndY;
|
|
|
|
UNIT_BINDER m_trackWidth;
|
2015-07-09 11:35:51 +00:00
|
|
|
|
2017-11-10 23:27:46 +00:00
|
|
|
UNIT_BINDER m_viaX, m_viaY;
|
|
|
|
UNIT_BINDER m_viaDiameter, m_viaDrill;
|
2015-07-09 11:35:51 +00:00
|
|
|
|
|
|
|
///> Flag that determines if the dialog displays track properties.
|
|
|
|
bool m_tracks;
|
|
|
|
|
|
|
|
///> Flag that determines if the dialog displays via properties.
|
|
|
|
bool m_vias;
|
2017-07-03 17:14:35 +00:00
|
|
|
|
|
|
|
///> Fixme
|
|
|
|
bool m_haveUniqueNet;
|
2015-07-09 11:35:51 +00:00
|
|
|
};
|