Minor changes in dialogs: use wxWidgets default event handlers for wxID_CANCEL and wxID_OK buttons
This commit is contained in:
parent
d8eab321f7
commit
e10242a0a9
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -23,7 +23,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerMain->Add( m_staticTextDim, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizerMain->Add( m_staticTextDim, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_Name = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_Name = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_Name->SetMaxLength( 0 );
|
|
||||||
m_Name->SetMinSize( wxSize( 400,-1 ) );
|
m_Name->SetMinSize( wxSize( 400,-1 ) );
|
||||||
|
|
||||||
bSizerMain->Add( m_Name, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bSizerMain->Add( m_Name, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
@ -39,7 +38,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerLeft->Add( m_staticTextSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_staticTextSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_TxtSizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_TxtSizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_TxtSizeXCtrl->SetMaxLength( 0 );
|
|
||||||
bSizerLeft->Add( m_TxtSizeXCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bSizerLeft->Add( m_TxtSizeXCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextSizeY = new wxStaticText( this, wxID_ANY, _("Text Height"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextSizeY = new wxStaticText( this, wxID_ANY, _("Text Height"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -47,7 +45,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerLeft->Add( m_staticTextSizeY, 0, wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_staticTextSizeY, 0, wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_TxtSizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_TxtSizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_TxtSizeYCtrl->SetMaxLength( 0 );
|
|
||||||
bSizerLeft->Add( m_TxtSizeYCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bSizerLeft->Add( m_TxtSizeYCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Text Thickness"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Text Thickness"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -55,7 +52,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerLeft->Add( m_staticTextWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_staticTextWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_TxtWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_TxtWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_TxtWidthCtrl->SetMaxLength( 0 );
|
|
||||||
bSizerLeft->Add( m_TxtWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bSizerLeft->Add( m_TxtWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextPosX = new wxStaticText( this, wxID_ANY, _("Text Position X"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextPosX = new wxStaticText( this, wxID_ANY, _("Text Position X"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -63,7 +59,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerLeft->Add( m_staticTextPosX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_staticTextPosX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_textCtrlPosX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_textCtrlPosX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_textCtrlPosX->SetMaxLength( 0 );
|
|
||||||
bSizerLeft->Add( m_textCtrlPosX, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bSizerLeft->Add( m_textCtrlPosX, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextPosY = new wxStaticText( this, wxID_ANY, _("Text Position Y"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextPosY = new wxStaticText( this, wxID_ANY, _("Text Position Y"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -71,7 +66,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
bSizerLeft->Add( m_staticTextPosY, 0, wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_staticTextPosY, 0, wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_textCtrlPosY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_textCtrlPosY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_textCtrlPosY->SetMaxLength( 0 );
|
|
||||||
bSizerLeft->Add( m_textCtrlPosY, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bSizerLeft->Add( m_textCtrlPosY, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,14 +113,12 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx
|
||||||
this->Centre( wxBOTH );
|
this->Centre( wxBOTH );
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
m_sdbSizerBtsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnCancelClick ), NULL, this );
|
|
||||||
m_sdbSizerBtsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this );
|
m_sdbSizerBtsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
DIALOG_DIMENSION_EDITOR_BASE::~DIALOG_DIMENSION_EDITOR_BASE()
|
DIALOG_DIMENSION_EDITOR_BASE::~DIALOG_DIMENSION_EDITOR_BASE()
|
||||||
{
|
{
|
||||||
// Disconnect Events
|
// Disconnect Events
|
||||||
m_sdbSizerBtsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnCancelClick ), NULL, this );
|
|
||||||
m_sdbSizerBtsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this );
|
m_sdbSizerBtsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1532,7 +1532,7 @@
|
||||||
<property name="name">m_sdbSizerBts</property>
|
<property name="name">m_sdbSizerBts</property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<event name="OnApplyButtonClick"></event>
|
<event name="OnApplyButtonClick"></event>
|
||||||
<event name="OnCancelButtonClick">OnCancelClick</event>
|
<event name="OnCancelButtonClick"></event>
|
||||||
<event name="OnContextHelpButtonClick"></event>
|
<event name="OnContextHelpButtonClick"></event>
|
||||||
<event name="OnHelpButtonClick"></event>
|
<event name="OnHelpButtonClick"></event>
|
||||||
<event name="OnNoButtonClick"></event>
|
<event name="OnNoButtonClick"></event>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -61,7 +61,6 @@ class DIALOG_DIMENSION_EDITOR_BASE : public DIALOG_SHIM
|
||||||
wxButton* m_sdbSizerBtsCancel;
|
wxButton* m_sdbSizerBtsCancel;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,7 @@ private:
|
||||||
*/
|
*/
|
||||||
void initDialog();
|
void initDialog();
|
||||||
|
|
||||||
void OnOkClick( wxCommandEvent& event );
|
virtual void OnOkClick( wxCommandEvent& event ) override;
|
||||||
void OnCancelClick( wxCommandEvent& event );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function AcceptOptionsForKeepOut
|
* Function AcceptOptionsForKeepOut
|
||||||
|
@ -95,7 +94,10 @@ ZONE_EDIT_T InvokeKeepoutAreaEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSe
|
||||||
{
|
{
|
||||||
DIALOG_KEEPOUT_AREA_PROPERTIES dlg( aCaller, aSettings );
|
DIALOG_KEEPOUT_AREA_PROPERTIES dlg( aCaller, aSettings );
|
||||||
|
|
||||||
ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
|
ZONE_EDIT_T result = ZONE_ABORT;
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_OK )
|
||||||
|
result = ZONE_OK;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -111,13 +113,10 @@ DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME*
|
||||||
m_ptr = aSettings;
|
m_ptr = aSettings;
|
||||||
m_zonesettings = *aSettings;
|
m_zonesettings = *aSettings;
|
||||||
|
|
||||||
SetReturnCode( ZONE_ABORT ); // Will be changed on button OK click
|
|
||||||
|
|
||||||
initDialog();
|
initDialog();
|
||||||
|
|
||||||
m_sdbSizerButtonsOK->SetDefault();
|
m_sdbSizerButtonsOK->SetDefault();
|
||||||
GetSizer()->SetSizeHints( this );
|
|
||||||
Center();
|
FinishDialogSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,18 +184,12 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event )
|
|
||||||
{
|
|
||||||
EndModal( ZONE_ABORT );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( AcceptOptionsForKeepOut() )
|
if( AcceptOptionsForKeepOut() )
|
||||||
{
|
{
|
||||||
*m_ptr = m_zonesettings;
|
*m_ptr = m_zonesettings;
|
||||||
EndModal( ZONE_OK );
|
event.Skip(); // ends returning wxID_OK (default behavior)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -10,7 +10,6 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE, DIALOG_SHIM )
|
BEGIN_EVENT_TABLE( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE, DIALOG_SHIM )
|
||||||
EVT_BUTTON( wxID_CANCEL, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnCancelClick )
|
|
||||||
EVT_BUTTON( wxID_OK, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnOkClick )
|
EVT_BUTTON( wxID_OK, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnOkClick )
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
@ -59,13 +58,13 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind
|
||||||
wxStaticBoxSizer* sbSizerCutoutOpts;
|
wxStaticBoxSizer* sbSizerCutoutOpts;
|
||||||
sbSizerCutoutOpts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Keepout Options:") ), wxVERTICAL );
|
sbSizerCutoutOpts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Keepout Options:") ), wxVERTICAL );
|
||||||
|
|
||||||
m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("No tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbTracksCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerCutoutOpts->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
sbSizerCutoutOpts->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbViasCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("No copper pour"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbCopperPourCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No copper pour"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerCutoutOpts->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 );
|
sbSizerCutoutOpts->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -583,6 +583,7 @@
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">sbSizerCutoutOpts</property>
|
<property name="name">sbSizerCutoutOpts</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="parent">1</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
|
@ -953,7 +954,7 @@
|
||||||
<property name="name">m_sdbSizerButtons</property>
|
<property name="name">m_sdbSizerButtons</property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<event name="OnApplyButtonClick"></event>
|
<event name="OnApplyButtonClick"></event>
|
||||||
<event name="OnCancelButtonClick">OnCancelClick</event>
|
<event name="OnCancelButtonClick"></event>
|
||||||
<event name="OnContextHelpButtonClick"></event>
|
<event name="OnContextHelpButtonClick"></event>
|
||||||
<event name="OnHelpButtonClick"></event>
|
<event name="OnHelpButtonClick"></event>
|
||||||
<event name="OnNoButtonClick"></event>
|
<event name="OnNoButtonClick"></event>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -42,7 +42,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private event handlers
|
// Private event handlers
|
||||||
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
|
|
||||||
void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
|
void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,7 +60,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
|
||||||
wxButton* m_sdbSizerButtonsCancel;
|
wxButton* m_sdbSizerButtonsCancel;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -80,9 +80,9 @@ class DIALOG_DIMENSION_EDITOR : public DIALOG_DIMENSION_EDITOR_BASE
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
PCB_EDIT_FRAME* m_Parent;
|
PCB_EDIT_FRAME* m_parent;
|
||||||
wxDC* m_DC;
|
wxDC* m_DC;
|
||||||
DIMENSION* CurrentDimension;
|
DIMENSION* m_currentDimension;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -94,8 +94,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnCancelClick( wxCommandEvent& event );
|
virtual void OnOKClick( wxCommandEvent& event ) override;
|
||||||
void OnOKClick( wxCommandEvent& event );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,10 +104,10 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent,
|
||||||
{
|
{
|
||||||
SetFocus();
|
SetFocus();
|
||||||
|
|
||||||
m_Parent = aParent;
|
m_parent = aParent;
|
||||||
m_DC = aDC;
|
m_DC = aDC;
|
||||||
|
|
||||||
CurrentDimension = aDimension;
|
m_currentDimension = aDimension;
|
||||||
|
|
||||||
if( aDimension->Text().IsMirrored() )
|
if( aDimension->Text().IsMirrored() )
|
||||||
m_rbMirror->SetSelection( 1 );
|
m_rbMirror->SetSelection( 1 );
|
||||||
|
@ -134,14 +133,14 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent,
|
||||||
AddUnitSymbol( *m_staticTextPosY );
|
AddUnitSymbol( *m_staticTextPosY );
|
||||||
|
|
||||||
// Configure the layers list selector
|
// Configure the layers list selector
|
||||||
if( !m_Parent->GetBoard()->IsLayerEnabled( aDimension->GetLayer() ) )
|
if( !m_parent->GetBoard()->IsLayerEnabled( aDimension->GetLayer() ) )
|
||||||
// Should not happens, because one cannot select a board item on a
|
// Should not happens, because one cannot select a board item on a
|
||||||
// not activated layer, but ...
|
// not activated layer, but ...
|
||||||
m_SelLayerBox->ShowNonActivatedLayers( true );
|
m_SelLayerBox->ShowNonActivatedLayers( true );
|
||||||
|
|
||||||
m_SelLayerBox->SetLayersHotkeys( false );
|
m_SelLayerBox->SetLayersHotkeys( false );
|
||||||
m_SelLayerBox->SetLayerSet( LSET::AllCuMask().set( Edge_Cuts ) );
|
m_SelLayerBox->SetLayerSet( LSET::AllCuMask().set( Edge_Cuts ) );
|
||||||
m_SelLayerBox->SetBoardFrame( m_Parent );
|
m_SelLayerBox->SetBoardFrame( m_parent );
|
||||||
m_SelLayerBox->Resync();
|
m_SelLayerBox->Resync();
|
||||||
|
|
||||||
if( m_SelLayerBox->SetLayerSelection( aDimension->GetLayer() ) < 0 )
|
if( m_SelLayerBox->SetLayerSelection( aDimension->GetLayer() ) < 0 )
|
||||||
|
@ -152,15 +151,11 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent,
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sdbSizerBtsOK->SetDefault();
|
m_sdbSizerBtsOK->SetDefault();
|
||||||
GetSizer()->Fit( this );
|
|
||||||
GetSizer()->SetSizeHints( this );
|
|
||||||
Centre();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
FixOSXCancelButtonIssue();
|
||||||
|
|
||||||
void DIALOG_DIMENSION_EDITOR::OnCancelClick( wxCommandEvent& event )
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||||
{
|
FinishDialogSettings();
|
||||||
EndModal( -1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,7 +163,7 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
LAYER_ID newlayer = ToLAYER_ID( m_SelLayerBox->GetLayerSelection() );
|
LAYER_ID newlayer = ToLAYER_ID( m_SelLayerBox->GetLayerSelection() );
|
||||||
|
|
||||||
if( !m_Parent->GetBoard()->IsLayerEnabled( newlayer ) )
|
if( !m_parent->GetBoard()->IsLayerEnabled( newlayer ) )
|
||||||
{
|
{
|
||||||
wxMessageBox( _( "The layer currently selected is not enabled for this board\n"
|
wxMessageBox( _( "The layer currently selected is not enabled for this board\n"
|
||||||
"You cannot use it" ) );
|
"You cannot use it" ) );
|
||||||
|
@ -178,24 +173,24 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
|
||||||
#ifndef USE_WX_OVERLAY
|
#ifndef USE_WX_OVERLAY
|
||||||
if( m_DC ) // Delete old text.
|
if( m_DC ) // Delete old text.
|
||||||
{
|
{
|
||||||
CurrentDimension->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
|
m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_XOR );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_Parent->SaveCopyInUndoList(CurrentDimension, UR_CHANGED);
|
m_parent->SaveCopyInUndoList(m_currentDimension, UR_CHANGED);
|
||||||
|
|
||||||
if( m_Name->GetValue() != wxEmptyString )
|
if( m_Name->GetValue() != wxEmptyString )
|
||||||
{
|
{
|
||||||
CurrentDimension->SetText( m_Name->GetValue() );
|
m_currentDimension->SetText( m_Name->GetValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
// Get new size value:
|
// Get new size value:
|
||||||
msg = m_TxtSizeXCtrl->GetValue();
|
msg = m_TxtSizeXCtrl->GetValue();
|
||||||
CurrentDimension->Text().SetWidth( ValueFromString( g_UserUnit, msg ) );
|
m_currentDimension->Text().SetWidth( ValueFromString( g_UserUnit, msg ) );
|
||||||
msg = m_TxtSizeYCtrl->GetValue();
|
msg = m_TxtSizeYCtrl->GetValue();
|
||||||
CurrentDimension->Text().SetHeight( ValueFromString( g_UserUnit, msg ) );
|
m_currentDimension->Text().SetHeight( ValueFromString( g_UserUnit, msg ) );
|
||||||
|
|
||||||
// Get new position value:
|
// Get new position value:
|
||||||
// It will be copied later in dimension, because
|
// It will be copied later in dimension, because
|
||||||
|
@ -204,12 +199,12 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
|
||||||
pos.x = ValueFromString( g_UserUnit, msg );
|
pos.x = ValueFromString( g_UserUnit, msg );
|
||||||
msg = m_textCtrlPosY->GetValue();
|
msg = m_textCtrlPosY->GetValue();
|
||||||
pos.y = ValueFromString( g_UserUnit, msg );
|
pos.y = ValueFromString( g_UserUnit, msg );
|
||||||
CurrentDimension->Text().SetTextPosition( pos );
|
m_currentDimension->Text().SetTextPosition( pos );
|
||||||
|
|
||||||
// Get new line thickness value:
|
// Get new line thickness value:
|
||||||
msg = m_TxtWidthCtrl->GetValue();
|
msg = m_TxtWidthCtrl->GetValue();
|
||||||
int width = ValueFromString( g_UserUnit, msg );
|
int width = ValueFromString( g_UserUnit, msg );
|
||||||
int maxthickness = Clamp_Text_PenSize( width, CurrentDimension->Text().GetSize() );
|
int maxthickness = Clamp_Text_PenSize( width, m_currentDimension->Text().GetSize() );
|
||||||
|
|
||||||
if( width > maxthickness )
|
if( width > maxthickness )
|
||||||
{
|
{
|
||||||
|
@ -219,39 +214,39 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
|
||||||
width = maxthickness;
|
width = maxthickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentDimension->SetWidth( width );
|
m_currentDimension->SetWidth( width );
|
||||||
CurrentDimension->Text().SetThickness( width );
|
m_currentDimension->Text().SetThickness( width );
|
||||||
CurrentDimension->Text().SetMirrored( ( m_rbMirror->GetSelection() == 1 ) ? true : false );
|
m_currentDimension->Text().SetMirrored( ( m_rbMirror->GetSelection() == 1 ) ? true : false );
|
||||||
CurrentDimension->SetLayer( newlayer );
|
m_currentDimension->SetLayer( newlayer );
|
||||||
|
|
||||||
#ifndef USE_WX_OVERLAY
|
#ifndef USE_WX_OVERLAY
|
||||||
if( m_DC ) // Display new text
|
if( m_DC ) // Display new text
|
||||||
{
|
{
|
||||||
CurrentDimension->Draw( m_Parent->GetCanvas(), m_DC, GR_OR );
|
m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_OR );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
m_Parent->Refresh();
|
m_parent->Refresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_parent->OnModify();
|
||||||
EndModal( 1 );
|
event.Skip(); // ends returning wxID_OK (default behavior)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void AbortBuildDimension( EDA_DRAW_PANEL* Panel, wxDC* aDC )
|
static void AbortBuildDimension( EDA_DRAW_PANEL* Panel, wxDC* aDC )
|
||||||
{
|
{
|
||||||
DIMENSION* Dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem();
|
DIMENSION* dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem();
|
||||||
|
|
||||||
if( Dimension )
|
if( dimension )
|
||||||
{
|
{
|
||||||
if( Dimension->IsNew() )
|
if( dimension->IsNew() )
|
||||||
{
|
{
|
||||||
Dimension->Draw( Panel, aDC, GR_XOR );
|
dimension->Draw( Panel, aDC, GR_XOR );
|
||||||
Dimension->DeleteStructure();
|
dimension->DeleteStructure();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Dimension->Draw( Panel, aDC, GR_OR );
|
dimension->Draw( Panel, aDC, GR_OR );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,9 +354,8 @@ void PCB_EDIT_FRAME::ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* a
|
||||||
if( aDimension == NULL )
|
if( aDimension == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DIALOG_DIMENSION_EDITOR* frame = new DIALOG_DIMENSION_EDITOR( this, aDimension, aDC );
|
DIALOG_DIMENSION_EDITOR dlg( this, aDimension, aDC );
|
||||||
frame->ShowModal();
|
dlg.ShowModal();
|
||||||
frame->Destroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ columnset = compfields | partfields # union
|
||||||
columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset))
|
columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset))
|
||||||
|
|
||||||
# Create a new csv writer object to use as the output formatter
|
# Create a new csv writer object to use as the output formatter
|
||||||
out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_MINIMAL )
|
out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_ALL )
|
||||||
|
|
||||||
# override csv.writer's writerow() to support encoding conversion (initial encoding is utf8):
|
# override csv.writer's writerow() to support encoding conversion (initial encoding is utf8):
|
||||||
def writerow( acsvwriter, columns ):
|
def writerow( acsvwriter, columns ):
|
||||||
|
|
Loading…
Reference in New Issue