From a7a4dab4e69c6926955fea2e47d5bd9633632b8c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 23 Apr 2011 21:08:00 +0200 Subject: [PATCH] Gerbview: export_to_pcbnew enhancement and fixes. --- .../dialog_layers_select_to_pcb_base.cpp | 86 +++ .../dialog_layers_select_to_pcb_base.fbp | 551 ++++++++++++++++++ .../dialog_layers_select_to_pcb_base.h | 68 +++ 3 files changed, 705 insertions(+) create mode 100644 gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp create mode 100644 gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp create mode 100644 gerbview/dialogs/dialog_layers_select_to_pcb_base.h diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp b/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp new file mode 100644 index 0000000000..d24b388438 --- /dev/null +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 17 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_layers_select_to_pcb_base.h" + +/////////////////////////////////////////////////////////////////////////// + +BEGIN_EVENT_TABLE( LAYERS_TABLE_DIALOG_BASE, wxDialog ) + EVT_BUTTON( wxID_CANCEL, LAYERS_TABLE_DIALOG_BASE::_wxFB_OnCancelClick ) + EVT_BUTTON( wxID_OK, LAYERS_TABLE_DIALOG_BASE::_wxFB_OnOkClick ) +END_EVENT_TABLE() + +LAYERS_TABLE_DIALOG_BASE::LAYERS_TABLE_DIALOG_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* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* sbUpperSizer; + sbUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + sbSizerLayersTable = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers selection:") ), wxHORIZONTAL ); + + m_flexLeftColumnBoxSizer = new wxFlexGridSizer( 16, 4, 0, 0 ); + m_flexLeftColumnBoxSizer->AddGrowableCol( 0 ); + m_flexLeftColumnBoxSizer->AddGrowableCol( 1 ); + m_flexLeftColumnBoxSizer->AddGrowableCol( 2 ); + m_flexLeftColumnBoxSizer->AddGrowableCol( 3 ); + m_flexLeftColumnBoxSizer->SetFlexibleDirection( wxBOTH ); + m_flexLeftColumnBoxSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + sbSizerLayersTable->Add( m_flexLeftColumnBoxSizer, 1, wxEXPAND, 5 ); + + m_staticlineSep = new wxStaticLine( this, ID_M_STATICLINESEP, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + sbSizerLayersTable->Add( m_staticlineSep, 0, wxEXPAND | wxALL, 5 ); + + m_flexRightColumnBoxSizer = new wxFlexGridSizer( 16, 4, 0, 0 ); + m_flexRightColumnBoxSizer->AddGrowableCol( 0 ); + m_flexRightColumnBoxSizer->AddGrowableCol( 1 ); + m_flexRightColumnBoxSizer->AddGrowableCol( 2 ); + m_flexRightColumnBoxSizer->AddGrowableCol( 3 ); + m_flexRightColumnBoxSizer->SetFlexibleDirection( wxBOTH ); + m_flexRightColumnBoxSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + sbSizerLayersTable->Add( m_flexRightColumnBoxSizer, 1, wxEXPAND, 5 ); + + sbUpperSizer->Add( sbSizerLayersTable, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerButtons; + bSizerButtons = new wxBoxSizer( wxVERTICAL ); + + 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, wxID_ANY, _("Get Stored Choice"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButtons->Add( m_buttonRetrieve, 0, wxALL|wxEXPAND, 5 ); + + sbUpperSizer->Add( bSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerMain->Add( sbUpperSizer, 1, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizerButtons = new wxStdDialogButtonSizer(); + m_sdbSizerButtonsOK = new wxButton( this, wxID_OK ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK ); + m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel ); + m_sdbSizerButtons->Realize(); + bSizerMain->Add( m_sdbSizerButtons, 0, wxALIGN_RIGHT|wxALL, 5 ); + + this->SetSizer( bSizerMain ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +LAYERS_TABLE_DIALOG_BASE::~LAYERS_TABLE_DIALOG_BASE() +{ +} diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp b/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp new file mode 100644 index 0000000000..a5a0e4b644 --- /dev/null +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp @@ -0,0 +1,551 @@ + + + + + + C++ + 1 + source_name + 0 + UTF-8 + table + dialog_layers_select_to_pcb_base + 1000 + none + 1 + dialog_layers_select_to_pcb_base + + . + + 1 + 1 + 1 + 0 + + 1 + 1 + 1 + 1 + 0 + + + + 1 + wxBOTH + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + impl_virtual + + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + LAYERS_TABLE_DIALOG_BASE + 1 + + + 1 + + + Resizable + + 1 + 400,286 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Layer selection: + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + sbUpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + Layers selection: + + sbSizerLayersTable + wxHORIZONTAL + protected + + + 5 + wxEXPAND + 1 + + 4 + wxBOTH + 0,1,2,3 + + 0 + + m_flexLeftColumnBoxSizer + wxFLEX_GROWMODE_SPECIFIED + protected + 16 + 0 + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_STATICLINESEP + + 0 + + 0 + + 1 + m_staticlineSep + 1 + + + protected + 1 + + + Resizable + + 1 + + wxLI_VERTICAL + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 4 + wxBOTH + 0,1,2,3 + + 0 + + m_flexRightColumnBoxSizer + wxFLEX_GROWMODE_SPECIFIED + protected + 16 + 0 + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bSizerButtons + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Store Choice + + 0 + + 0 + + 1 + m_buttonStore + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Get Stored Choice + + 0 + + 0 + + 1 + m_buttonRetrieve + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + + Resizable + + 1 + + wxLI_HORIZONTAL + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizerButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.h b/gerbview/dialogs/dialog_layers_select_to_pcb_base.h new file mode 100644 index 0000000000..a6796eeb48 --- /dev/null +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.h @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 17 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_layers_select_to_pcb_base__ +#define __dialog_layers_select_to_pcb_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class LAYERS_TABLE_DIALOG_BASE +/////////////////////////////////////////////////////////////////////////////// +class LAYERS_TABLE_DIALOG_BASE : public wxDialog +{ + DECLARE_EVENT_TABLE() + private: + + // Private event handlers + void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } + void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } + + + protected: + enum + { + ID_M_STATICLINESEP = 1000, + }; + + wxStaticBoxSizer* sbSizerLayersTable; + wxFlexGridSizer* m_flexLeftColumnBoxSizer; + wxStaticLine* m_staticlineSep; + wxFlexGridSizer* m_flexRightColumnBoxSizer; + wxButton* m_buttonStore; + wxButton* m_buttonRetrieve; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizerButtons; + wxButton* m_sdbSizerButtonsOK; + wxButton* m_sdbSizerButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + LAYERS_TABLE_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer selection:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,286 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~LAYERS_TABLE_DIALOG_BASE(); + +}; + +#endif //__dialog_layers_select_to_pcb_base__