Cleanup code

This commit is contained in:
jean-pierre charras 2017-09-28 08:38:21 +02:00
parent 068a29952c
commit 54d34c341b
4 changed files with 1060 additions and 1058 deletions

View File

@ -58,8 +58,9 @@ public:
private:
PCB_BASE_FRAME* m_parent;
wxConfigBase* m_config; ///< Current config
ZONE_SETTINGS m_zonesettings;
ZONE_SETTINGS* m_ptr;
ZONE_SETTINGS m_zonesettings; ///< the working copy of zone settings
ZONE_SETTINGS* m_ptr; ///< the pointer to the zone settings
///< of the zone to edit
/**
* Function initDialog
@ -67,7 +68,10 @@ private:
*/
void initDialog();
virtual void OnOkClick( wxCommandEvent& event ) override;
/**
* automatically called by wxWidgets before closing the dialog
*/
virtual bool TransferDataFromWindow() override;
virtual void OnLayerSelection( wxDataViewEvent& event ) override;
@ -190,13 +194,15 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog()
}
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event )
bool DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataFromWindow()
{
if( AcceptOptionsForKeepOut() )
{
*m_ptr = m_zonesettings;
event.Skip(); // ends returning wxID_OK (default behavior)
return true;
}
return false;
}
@ -210,7 +216,6 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::OnLayerSelection( wxDataViewEvent& event )
wxDataViewItem item = event.GetItem();
int row = m_layers->ItemToRow( item );
bool selected = m_layers->GetToggleValue( row, 0 );
BOARD* board = m_parent->GetBoard();
@ -275,8 +280,8 @@ bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut()
else
m_zonesettings.m_Zone_45_Only = true;
m_zonesettings.m_ZonePriority = 0; //m_PriorityLevelCtrl->GetValue();
m_zonesettings.m_ZonePriority = 0; // for a keepout, this param is not used.
// set it to 0
return true;
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 22 2017)
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -11,7 +11,6 @@
BEGIN_EVENT_TABLE( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE, DIALOG_SHIM )
EVT_DATAVIEW_ITEM_VALUE_CHANGED( wxID_ANY, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnLayerSelection )
EVT_BUTTON( wxID_OK, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnOkClick )
END_EVENT_TABLE()
DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
@ -44,7 +43,7 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind
m_staticTextprops->Wrap( -1 );
bSizerRight->Add( m_staticTextprops, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("180, 90, and 45 degrees") };
wxString m_OrientEdgesOptChoices[] = { _("Any orientation"), _("180, 90, and 45 degrees") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edge Orientation:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 1 );

View File

@ -88,25 +88,25 @@
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_UpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_layersListSizer</property>
<property name="orient">wxVERTICAL</property>
@ -264,11 +264,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerRight</property>
<property name="orient">wxVERTICAL</property>
@ -374,7 +374,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Any&quot; &quot;180, 90, and 45 degrees&quot;</property>
<property name="choices">&quot;Any orientation&quot; &quot;180, 90, and 45 degrees&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -921,7 +921,7 @@
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">OnOkClick</event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 22 2017)
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -42,7 +42,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
// Private event handlers
void _wxFB_OnLayerSelection( wxDataViewEvent& event ){ OnLayerSelection( event ); }
void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
protected:
@ -61,7 +60,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class
virtual void OnLayerSelection( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: