Browse Source

Gerbview: code cleaning: update a .fbp dialog to use our usual .fbp settings

It does not really change the actual code.
pull/18/head
jean-pierre charras 4 months ago
parent
commit
e6c36703d0
  1. 31
      gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.cpp
  2. 16
      gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.fbp
  3. 18
      gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.h

31
gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.cpp

@ -9,13 +9,6 @@
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE, DIALOG_SHIM )
EVT_COMBOBOX( ID_M_COMBOCOPPERLAYERSCOUNT, DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::_wxFB_OnBrdLayersCountSelection )
EVT_BUTTON( ID_STORE_CHOICE, DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::_wxFB_OnStoreSetup )
EVT_BUTTON( ID_GET_PREVIOUS_CHOICE, DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::_wxFB_OnGetSetup )
EVT_BUTTON( ID_RESET_CHOICE, DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::_wxFB_OnResetClick )
END_EVENT_TABLE()
DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
@ -49,7 +42,7 @@ DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWi
m_bSizerLayerList->Add( m_flexLeftColumnBoxSizer, 1, wxEXPAND, 5 );
m_staticlineSep = new wxStaticLine( this, ID_M_STATICLINESEP, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
m_staticlineSep = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
m_bSizerLayerList->Add( m_staticlineSep, 0, wxEXPAND | wxALL, 5 );
m_flexRightColumnBoxSizer = new wxFlexGridSizer( 4, 0, 0 );
@ -75,11 +68,11 @@ DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWi
wxBoxSizer* bSizerLyrCnt;
bSizerLyrCnt = new wxBoxSizer( wxVERTICAL );
m_staticTextCopperlayerCount = new wxStaticText( this, ID_M_STATICTEXTCOPPERLAYERCOUNT, _("Copper layers count:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCopperlayerCount = new wxStaticText( this, wxID_ANY, _("Copper layers count:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCopperlayerCount->Wrap( -1 );
bSizerLyrCnt->Add( m_staticTextCopperlayerCount, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_comboCopperLayersCount = new wxComboBox( this, ID_M_COMBOCOPPERLAYERSCOUNT, _("2 Layers"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_comboCopperLayersCount = new wxComboBox( this, wxID_ANY, _("2 Layers"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_comboCopperLayersCount->Append( _("2 Layers") );
m_comboCopperLayersCount->Append( _("4 Layers") );
m_comboCopperLayersCount->Append( _("6 Layers") );
@ -107,13 +100,13 @@ DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWi
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxVERTICAL );
m_buttonStore = new wxButton( this, ID_STORE_CHOICE, _("Store Choice"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonStore = new wxButton( this, wxID_ANY, _("Store Choice"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonStore, 0, wxALL|wxEXPAND, 5 );
m_buttonRetrieve = new wxButton( this, ID_GET_PREVIOUS_CHOICE, _("Get Stored Choice"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRetrieve = new wxButton( this, wxID_ANY, _("Get Stored Choice"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonRetrieve, 0, wxALL|wxEXPAND, 5 );
m_buttonReset = new wxButton( this, ID_RESET_CHOICE, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonReset = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonReset, 0, wxALL|wxEXPAND, 5 );
@ -140,8 +133,20 @@ DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWi
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_comboCopperLayersCount->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnBrdLayersCountSelection ), NULL, this );
m_buttonStore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnStoreSetup ), NULL, this );
m_buttonRetrieve->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnGetSetup ), NULL, this );
m_buttonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnResetClick ), NULL, this );
}
DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::~DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE()
{
// Disconnect Events
m_comboCopperLayersCount->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnBrdLayersCountSelection ), NULL, this );
m_buttonStore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnStoreSetup ), NULL, this );
m_buttonRetrieve->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnGetSetup ), NULL, this );
m_buttonReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE::OnResetClick ), NULL, this );
}

16
gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.fbp

@ -5,7 +5,7 @@
<property name="code_generation">C++</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">table</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
@ -45,7 +45,7 @@
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_LAYERS_MAP_DIALOG_BASE</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE</property>
@ -213,7 +213,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_M_STATICLINESEP</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -312,7 +312,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_M_STATICTEXTCOPPERLAYERCOUNT</property>
<property name="id">wxID_ANY</property>
<property name="label">Copper layers count:</property>
<property name="markup">0</property>
<property name="max_size"></property>
@ -375,7 +375,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_M_COMBOCOPPERLAYERSCOUNT</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -468,7 +468,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_STORE_CHOICE</property>
<property name="id">wxID_ANY</property>
<property name="label">Store Choice</property>
<property name="margins"></property>
<property name="markup">0</property>
@ -543,7 +543,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_GET_PREVIOUS_CHOICE</property>
<property name="id">wxID_ANY</property>
<property name="label">Get Stored Choice</property>
<property name="margins"></property>
<property name="markup">0</property>
@ -618,7 +618,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_RESET_CHOICE</property>
<property name="id">wxID_ANY</property>
<property name="label">Reset</property>
<property name="margins"></property>
<property name="markup">0</property>

18
gerbview/dialogs/dialog_map_gerber_layers_to_pcb_base.h

@ -28,29 +28,13 @@
///////////////////////////////////////////////////////////////////////////
#define ID_LAYERS_MAP_DIALOG_BASE 1000
#define ID_M_STATICLINESEP 1001
#define ID_M_STATICTEXTCOPPERLAYERCOUNT 1002
#define ID_M_COMBOCOPPERLAYERSCOUNT 1003
#define ID_STORE_CHOICE 1004
#define ID_GET_PREVIOUS_CHOICE 1005
#define ID_RESET_CHOICE 1006
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnBrdLayersCountSelection( wxCommandEvent& event ){ OnBrdLayersCountSelection( event ); }
void _wxFB_OnStoreSetup( wxCommandEvent& event ){ OnStoreSetup( event ); }
void _wxFB_OnGetSetup( wxCommandEvent& event ){ OnGetSetup( event ); }
void _wxFB_OnResetClick( wxCommandEvent& event ){ OnResetClick( event ); }
protected:
wxStaticText* m_staticTextLayerSel;
wxBoxSizer* m_bSizerLayerList;
@ -75,7 +59,7 @@ class DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE : public DIALOG_SHIM
public:
DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWindow* parent, wxWindowID id = ID_LAYERS_MAP_DIALOG_BASE, const wxString& title = _("Layer Selection"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Selection"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE();

Loading…
Cancel
Save