diff --git a/common/class_page_info.cpp b/common/class_page_info.cpp index 4ee98e8da8..e7c111213d 100644 --- a/common/class_page_info.cpp +++ b/common/class_page_info.cpp @@ -139,7 +139,7 @@ void PAGE_INFO::setMargins() m_left_margin = m_right_margin = m_top_margin = - m_bottom_margin = 400; + m_bottom_margin = 400; // Units = mils } } diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index a8dc43fe6c..4d221cdf5e 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -45,10 +45,6 @@ #include -// dialog should remember its previous screen position and size -wxPoint DIALOG_PAGES_SETTINGS::s_LastPos( -1, -1 ); -wxSize DIALOG_PAGES_SETTINGS::s_LastSize; - // List of page formats. // should be statically initialized, because we need both // the translated and the not translated version. @@ -130,7 +126,7 @@ void DIALOG_PAGES_SETTINGS::initDialog() #ifdef EESCHEMA - // Init display value for sheet User size + // Init display value for schematic sub-sheet number wxString format = m_TextSheetCount->GetLabel(); msg.Printf( format, m_Screen->m_NumberOfScreens ); m_TextSheetCount->SetLabel( msg ); @@ -214,35 +210,6 @@ void DIALOG_PAGES_SETTINGS::initDialog() } -bool DIALOG_PAGES_SETTINGS::Show( bool show ) -{ - bool ret; - - if( show ) - { - ret = DIALOG_PAGES_SETTINGS_BASE::Show( show ); - - if( s_LastPos.x != -1 ) - { - SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 ); - } - else - { - // Do nothing: last position not yet saved. - } - } - else - { - // Save the dialog's position before hiding - s_LastPos = GetPosition(); - s_LastSize = GetSize(); - ret = DIALOG_PAGES_SETTINGS_BASE::Show( show ); - } - - return ret; -} - - void DIALOG_PAGES_SETTINGS::OnCloseWindow( wxCloseEvent& event ) { EndModal( m_modified ); diff --git a/common/dialogs/dialog_page_settings.h b/common/dialogs/dialog_page_settings.h index 64d61caeaa..38d02fd988 100644 --- a/common/dialogs/dialog_page_settings.h +++ b/common/dialogs/dialog_page_settings.h @@ -47,21 +47,10 @@ private: PAGE_INFO m_pageInfo; /// Temporary page info. TITLE_BLOCK m_tb; /// Temporary title block (basic inscriptions). - static wxSize s_LastSize; /// Last position and size. - static wxPoint s_LastPos; - public: DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ); ~DIALOG_PAGES_SETTINGS(); - /** - * Function Show - * overloads the wxDialog::Show() function so it can position the - * dialog at its remembered size and position. - */ - bool Show( bool show ); - - private: /// Initialises member variables void initDialog(); diff --git a/common/dialogs/dialog_page_settings_base.cpp b/common/dialogs/dialog_page_settings_base.cpp index 8999d9ef78..fded851900 100644 --- a/common/dialogs/dialog_page_settings_base.cpp +++ b/common/dialogs/dialog_page_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_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 ); diff --git a/common/dialogs/dialog_page_settings_base.fbp b/common/dialogs/dialog_page_settings_base.fbp index 4e009d05ef..b7c9e6b11f 100644 --- a/common/dialogs/dialog_page_settings_base.fbp +++ b/common/dialogs/dialog_page_settings_base.fbp @@ -25,62 +25,28 @@ 0 0 - 1 - 1 - 1 - 1 - 0 - - - - + wxAUI_MGR_DEFAULT - - 1 - 0 - 1 1 - 0 - Dock - 0 - Left 1 impl_virtual - 1 - 0 0 wxID_ANY - - 0 - - 0 - 1 DIALOG_PAGES_SETTINGS_BASE - 1 - - - 1 - Resizable - 1 748,495 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Page Settings - 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -216,10 +182,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -391,10 +353,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -843,10 +801,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - wxFULL_REPAINT_ON_RESIZE|wxSIMPLE_BORDER @@ -980,10 +934,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -1077,10 +1027,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - diff --git a/common/dialogs/dialog_page_settings_base.h b/common/dialogs/dialog_page_settings_base.h index 26a05da85d..2bdb65f231 100644 --- a/common/dialogs/dialog_page_settings_base.h +++ b/common/dialogs/dialog_page_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,7 @@ #include #include #include +#include "dialog_shim.h" #include #include #include @@ -54,7 +55,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_PAGES_SETTINGS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAGES_SETTINGS_BASE : public wxDialog +class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM { private: diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp b/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp index 8206be0e38..6673e5adb0 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( 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,8 +49,10 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i m_buttonLibDown = new wxButton( this, ID_LIB_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerLibButtons->Add( m_buttonLibDown, 0, wxRIGHT|wxLEFT, 5 ); + sbLibsChoiceSizer->Add( bSizerLibButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bMainSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbEquivChoiceSizer; @@ -86,8 +88,10 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i m_buttonEquDown = new wxButton( this, ID_EQU_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerEquButtons->Add( m_buttonEquDown, 0, wxRIGHT|wxLEFT, 5 ); + sbEquivChoiceSizer->Add( bSizerEquButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bMainSizer->Add( sbEquivChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbModulesDocSizer; @@ -99,6 +103,7 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i m_buttonModDoc = new wxButton( this, ID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); sbModulesDocSizer->Add( m_buttonModDoc, 0, wxRIGHT|wxLEFT, 5 ); + bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbSizer4; @@ -113,6 +118,7 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i bUserListSizer->Add( m_listUserPaths, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); wxBoxSizer* bUserPathsButtonsSizer; @@ -127,8 +133,10 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i m_buttonRemovePath = new wxButton( this, ID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bMainSizer->Add( sbSizer4, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbSizer6; @@ -140,6 +148,7 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i sbSizer6->Add( m_DefaultLibraryPathslistBox, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bMainSizer->Add( sbSizer6, 1, wxALL|wxEXPAND, 5 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -151,8 +160,10 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer2->AddButton( m_sdbSizer2Cancel ); m_sdbSizer2->Realize(); + bMainSizer->Add( m_sdbSizer2, 0, wxALL|wxEXPAND, 5 ); + this->SetSizer( bMainSizer ); this->Layout(); diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp b/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp index ef8b51f8f6..5de4feca9e 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp @@ -1,12 +1,14 @@ - + C++ 1 source_name + 0 0 + res UTF-8 connect dialog_cvpcb_config_fbp @@ -18,10 +20,13 @@ . 1 + 1 1 1 0 + 0 + wxAUI_MGR_DEFAULT wxBOTH @@ -39,18 +44,20 @@ 570,625 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h - - wxFILTER_NONE - wxDefaultValidator - + + + + + + OnCloseWindow @@ -101,23 +108,54 @@ wxEXPAND|wxRIGHT|wxLEFT 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 -1,-1 + + 0 450,90 + 1 m_ListLibr + 1 + + protected + 1 + Resizable + 1 wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + 0 List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. wxFILTER_NONE @@ -167,24 +205,55 @@ wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_ADD_LIB Add + + 0 + + 0 + 1 m_buttonAddLib + 1 + + protected + 1 + Resizable + 1 + 0 Add a new library after the selected library, and load it wxFILTER_NONE @@ -224,24 +293,55 @@ wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_INSERT_LIB Insert + + 0 + + 0 + 1 m_buttonInsLib + 1 + + protected + 1 + Resizable + 1 + 0 Add a new library before the selected library, and load it wxFILTER_NONE @@ -281,24 +381,55 @@ wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_REMOVE_LIB Remove + + 0 + + 0 + 1 m_buttonRemoveLib + 1 + + protected + 1 + Resizable + 1 + 0 Unload the selected library wxFILTER_NONE @@ -338,24 +469,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_LIB_UP Up + + 0 + + 0 + 1 m_buttonLibUp + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -395,24 +557,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_LIB_DOWN Down + + 0 + + 0 + 1 m_buttonLibDown + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -468,23 +661,54 @@ wxEXPAND|wxRIGHT|wxLEFT 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 -1,-1 + + 0 400,-1 + 1 m_ListEquiv + 1 + + protected + 1 + Resizable + 1 wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + 0 List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. wxFILTER_NONE @@ -534,24 +758,55 @@ wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_ADD_EQU Add + + 0 + + 0 + 1 m_buttonAddEqu + 1 + + protected + 1 + Resizable + 1 + 0 Add a new library after the selected library, and load it wxFILTER_NONE @@ -591,24 +846,55 @@ wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_INSERT_EQU Insert + + 0 + + 0 + 1 m_buttonInsEqu + 1 + + protected + 1 + Resizable + 1 + 0 Add a new library before the selected library, and load it wxFILTER_NONE @@ -648,24 +934,55 @@ wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_REMOVE_EQU Remove + + 0 + + 0 + 1 m_buttonRemoveEqu + 1 + + protected + 1 + Resizable + 1 + 0 Unload the selected library wxFILTER_NONE @@ -705,24 +1022,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_EQU_UP Up + + 0 + + 0 + 1 m_buttonEquUp + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -762,24 +1110,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_EQU_DOWN Down + + 0 + + 0 + 1 m_buttonEquDown + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -835,23 +1214,54 @@ wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_TextHelpModulesFileName + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -895,24 +1305,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_BROWSE_MOD_DOC Browse + + 0 + + 0 + 1 m_buttonModDoc + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -975,23 +1416,54 @@ wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 -1,-1 + + 0 -1,70 + 1 m_listUserPaths + 1 + + protected + 1 + Resizable + 1 wxLB_NEEDED_SB + 0 Additional paths used in this project. The priority is higher than default KiCad paths. wxFILTER_NONE @@ -1043,24 +1515,55 @@ wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_LIB_PATH_SEL Add + + 0 + + 0 + 1 m_buttonAddPath + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1100,24 +1603,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_INSERT_PATH Insert + + 0 + + 0 + 1 m_buttonInsPath + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1157,24 +1691,55 @@ wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_REMOVE_PATH Remove + + 0 + + 0 + 1 m_buttonRemovePath + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1230,23 +1795,54 @@ wxEXPAND|wxRIGHT|wxLEFT 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 -1,70 + 1 m_DefaultLibraryPathslistBox + 1 + + protected + 1 + Resizable + 1 wxLB_NEEDED_SB + 0 System and user paths used to search and load library files and component doc files. Sorted by decreasing priority order. wxFILTER_NONE @@ -1289,27 +1885,54 @@ wxEXPAND|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_staticline2 + 1 + + protected + 1 + Resizable + 1 wxLI_HORIZONTAL + 0 - - wxFILTER_NONE - wxDefaultValidator - diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.h b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h index aee31e10b0..429bb4751d 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.h +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h @@ -1,15 +1,17 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_cvpcb_config_fbp__ -#define __dialog_cvpcb_config_fbp__ +#ifndef __DIALOG_CVPCB_CONFIG_FBP_H__ +#define __DIALOG_CVPCB_CONFIG_FBP_H__ +#include +#include #include - +#include "dialog_shim.h" #include #include #include @@ -28,7 +30,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_CVPCB_CONFIG_FBP /////////////////////////////////////////////////////////////////////////////// -class DIALOG_CVPCB_CONFIG_FBP : public wxDialog +class DIALOG_CVPCB_CONFIG_FBP : public DIALOG_SHIM { private: @@ -48,7 +50,7 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog ID_BROWSE_MOD_DOC, ID_LIB_PATH_SEL, ID_INSERT_PATH, - ID_REMOVE_PATH, + ID_REMOVE_PATH }; wxListBox* m_ListLibr; @@ -90,9 +92,9 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog public: - DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_CVPCB_CONFIG_FBP(); }; -#endif //__dialog_cvpcb_config_fbp__ +#endif //__DIALOG_CVPCB_CONFIG_FBP_H__ diff --git a/cvpcb/dialogs/dialog_display_options_base.cpp b/cvpcb/dialogs/dialog_display_options_base.cpp index ce5dc7c283..7c3c24d344 100644 --- a/cvpcb/dialogs/dialog_display_options_base.cpp +++ b/cvpcb/dialogs/dialog_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_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 ); @@ -53,7 +53,7 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( bSizerRight->Add( sbSizerPads, 1, wxEXPAND|wxALL, 5 ); wxStaticBoxSizer* sbSizerViewOpt; - sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("View:") ), wxVERTICAL ); + sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan:") ), wxVERTICAL ); m_IsMiddleButtonPan = new wxCheckBox( this, wxID_ANY, _("Middle Button PAN Enabled"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerViewOpt->Add( m_IsMiddleButtonPan, 0, wxALL|wxEXPAND, 5 ); diff --git a/cvpcb/dialogs/dialog_display_options_base.fbp b/cvpcb/dialogs/dialog_display_options_base.fbp index 28c2d13af8..762a6b3117 100644 --- a/cvpcb/dialogs/dialog_display_options_base.fbp +++ b/cvpcb/dialogs/dialog_display_options_base.fbp @@ -25,62 +25,28 @@ 0 0 - 1 - 1 - 1 - 1 - 0 - - - - + wxAUI_MGR_DEFAULT - - 1 - 0 - 1 1 - 0 - Dock - 0 - Left 1 impl_virtual - 1 - 0 0 wxID_ANY - - 0 - - 0 - 1 DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE - 1 - - - 1 - Resizable - 1 362,251 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Display Options - 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -771,10 +737,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - diff --git a/cvpcb/dialogs/dialog_display_options_base.h b/cvpcb/dialogs/dialog_display_options_base.h index 4ad10bbd32..f3beb8b4ea 100644 --- a/cvpcb/dialogs/dialog_display_options_base.h +++ b/cvpcb/dialogs/dialog_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,7 @@ #include #include #include +#include "dialog_shim.h" #include #include #include @@ -33,7 +34,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public wxDialog +class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM { private: diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp b/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp index 757c1b9da5..58919a71d8 100644 --- a/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 17 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -BEGIN_EVENT_TABLE( LAYERS_MAP_DIALOG_BASE, wxDialog ) +BEGIN_EVENT_TABLE( LAYERS_MAP_DIALOG_BASE, DIALOG_SHIM ) EVT_COMBOBOX( ID_M_COMBOCOPPERLAYERSCOUNT, LAYERS_MAP_DIALOG_BASE::_wxFB_OnBrdLayersCountSelection ) EVT_BUTTON( ID_STORE_CHOICE, LAYERS_MAP_DIALOG_BASE::_wxFB_OnStoreSetup ) EVT_BUTTON( ID_GET_PREVIOUS_CHOICE, LAYERS_MAP_DIALOG_BASE::_wxFB_OnGetSetup ) @@ -18,7 +18,7 @@ BEGIN_EVENT_TABLE( LAYERS_MAP_DIALOG_BASE, wxDialog ) EVT_BUTTON( wxID_OK, LAYERS_MAP_DIALOG_BASE::_wxFB_OnOkClick ) END_EVENT_TABLE() -LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_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 ); @@ -38,11 +38,13 @@ LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_BASE( wxWindow* parent, wxWindowID id, 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 ); + sbUpperSizer->Add( sbSizerLayersTable, 1, wxEXPAND, 5 ); wxBoxSizer* bRightSizer; @@ -66,6 +68,7 @@ LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_BASE( wxWindow* parent, wxWindowID id, m_comboCopperLayersCount->Append( _("16 Layers") ); bSizerLyrCnt->Add( m_comboCopperLayersCount, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bRightSizer->Add( bSizerLyrCnt, 0, wxEXPAND, 5 ); @@ -83,10 +86,13 @@ LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_BASE( wxWindow* parent, wxWindowID id, m_buttonReset = new wxButton( this, ID_RESET_CHOICE, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonReset, 0, wxALL|wxEXPAND, 5 ); + bRightSizer->Add( bSizerButtons, 0, wxEXPAND, 5 ); + sbUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerMain->Add( sbUpperSizer, 1, wxEXPAND, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -98,8 +104,10 @@ LAYERS_MAP_DIALOG_BASE::LAYERS_MAP_DIALOG_BASE( wxWindow* parent, wxWindowID id, 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(); diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp b/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp index dc710fe612..b29dbe5907 100644 --- a/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.fbp @@ -44,7 +44,7 @@ 400,286 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Layer selection: diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb_base.h b/gerbview/dialogs/dialog_layers_select_to_pcb_base.h index 57aa8f42b1..069c2ef9bc 100644 --- a/gerbview/dialogs/dialog_layers_select_to_pcb_base.h +++ b/gerbview/dialogs/dialog_layers_select_to_pcb_base.h @@ -1,22 +1,24 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 17 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_layers_select_to_pcb_base__ -#define __dialog_layers_select_to_pcb_base__ +#ifndef __DIALOG_LAYERS_SELECT_TO_PCB_BASE_H__ +#define __DIALOG_LAYERS_SELECT_TO_PCB_BASE_H__ +#include +#include #include - +#include "dialog_shim.h" #include #include #include -#include #include #include #include +#include #include #include #include @@ -28,7 +30,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class LAYERS_MAP_DIALOG_BASE /////////////////////////////////////////////////////////////////////////////// -class LAYERS_MAP_DIALOG_BASE : public wxDialog +class LAYERS_MAP_DIALOG_BASE : public DIALOG_SHIM { DECLARE_EVENT_TABLE() private: @@ -51,7 +53,7 @@ class LAYERS_MAP_DIALOG_BASE : public wxDialog ID_M_COMBOCOPPERLAYERSCOUNT, ID_STORE_CHOICE, ID_GET_PREVIOUS_CHOICE, - ID_RESET_CHOICE, + ID_RESET_CHOICE }; wxStaticBoxSizer* sbSizerLayersTable; @@ -59,7 +61,6 @@ class LAYERS_MAP_DIALOG_BASE : public wxDialog wxStaticLine* m_staticlineSep; wxStaticText* m_staticTextCopperlayerCount; wxComboBox* m_comboCopperLayersCount; - wxButton* m_buttonStore; wxButton* m_buttonRetrieve; wxButton* m_buttonReset; @@ -84,4 +85,4 @@ class LAYERS_MAP_DIALOG_BASE : public wxDialog }; -#endif //__dialog_layers_select_to_pcb_base__ +#endif //__DIALOG_LAYERS_SELECT_TO_PCB_BASE_H__ diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index 8573e1306f..a926274217 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -1,451 +1,417 @@ -/****************************************/ -/* File: dialog_print_using_printer.cpp */ -/****************************************/ - -// Set this to 1 if you want to test PostScript printing under MSW. -#define wxTEST_POSTSCRIPT_IN_MSW 1 - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#define WIDTH_MAX_VALUE 1000 -#define WIDTH_MIN_VALUE 1 - -static long s_SelectedLayers; -static double s_ScaleList[] = -{ 0, 0.5, 0.7, 0.999, 1.0, 1.4, 2.0, 3.0, 4.0 }; - -// Define min et max reasonnable values for print scale -#define MIN_SCALE 0.01 -#define MAX_SCALE 100.0 - -// static print data and page setup data, to remember settings during the session -static wxPrintData* g_PrintData; -static wxPageSetupDialogData* g_pageSetupData = (wxPageSetupDialogData*) NULL; - -// Variables locales -static PRINT_PARAMETERS s_Parameters; - - -/* Dialog to print schematic. Class derived from DIALOG_PRINT_USING_PRINTER_base - * created by wxFormBuilder - */ -class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_base -{ -private: - GERBVIEW_FRAME* m_Parent; - wxConfig* m_Config; - wxCheckBox* m_BoxSelectLayer[32]; - static wxPoint s_LastPos; - static wxSize s_LastSize; - -public: - DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ); - ~DIALOG_PRINT_USING_PRINTER() {}; - -private: - void OnCloseWindow( wxCloseEvent& event ); - void OnInitDialog( wxInitDialogEvent& event ); - void OnPageSetup( wxCommandEvent& event ); - void OnPrintPreview( wxCommandEvent& event ); - void OnPrintButtonClick( wxCommandEvent& event ); - void OnScaleSelectionClick( wxCommandEvent& event ); - - void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } - void SetPrintParameters( ); - void InitValues( ); - - bool Show( bool show ); // overload stock function - -public: - bool IsMirrored() { return m_Print_Mirror->IsChecked(); } - bool PrintUsingSinglePage() { return true; } - int SetLayerMaskFromListSelection(); -}; - -// We want our dialog to remember its previous screen position -wxPoint DIALOG_PRINT_USING_PRINTER::s_LastPos( -1, -1 ); -wxSize DIALOG_PRINT_USING_PRINTER::s_LastSize; - - -/*******************************************************/ -void GERBVIEW_FRAME::ToPrinter( wxCommandEvent& event ) -/*******************************************************/ - -/* Virtual function: - * Display the print dialog - */ -{ - if( g_PrintData == NULL ) // First print - { - g_PrintData = new wxPrintData(); - - if( !g_PrintData->Ok() ) - { - DisplayError( this, _( "Error Init Printer info" ) ); - } - g_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGHT; - } - - g_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); - - DIALOG_PRINT_USING_PRINTER* frame = new DIALOG_PRINT_USING_PRINTER( this ); - - frame->ShowModal(); - frame->Destroy(); -} - - -/*************************************************************************************/ -DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ) : - DIALOG_PRINT_USING_PRINTER_base( parent ) -/*************************************************************************************/ -{ - m_Parent = parent; - m_Config = wxGetApp().GetSettings(); - - InitValues( ); - - if( GetSizer() ) - { - GetSizer()->SetSizeHints( this ); - } -#ifdef __WXMAC__ - /* Problems with modal on wx-2.9 - Anyway preview is standard for OSX */ - m_buttonPreview->Hide(); -#endif - - m_buttonPrint->SetDefault(); -} - - -/************************************************************************/ -void DIALOG_PRINT_USING_PRINTER::InitValues( ) -/************************************************************************/ -{ - SetFocus(); - int layer_max = GERBVIEW_LAYER_COUNT; - wxString msg; - - if( g_pageSetupData == NULL ) - { - g_pageSetupData = new wxPageSetupDialogData; - // Set initial page margins. - // Margins are already set in Pcbnew, so we cans use 0 - g_pageSetupData->SetMarginTopLeft(wxPoint(0, 0)); - g_pageSetupData->SetMarginBottomRight(wxPoint(0, 0)); - } - - s_Parameters.m_PageSetupData = g_pageSetupData; - - layer_max = 32; - /* Create layer list */ - int mask = 1, ii; - for( ii = 0; ii < layer_max; ii++, mask <<= 1 ) - { - msg = _( "Layer" ); - msg << wxT( " " ) << ii + 1; - m_BoxSelectLayer[ii] = new wxCheckBox( this, -1, msg ); - - if( mask & s_SelectedLayers ) - m_BoxSelectLayer[ii]->SetValue( true ); - if( ii < 16 ) - m_leftLayersBoxSizer->Add( m_BoxSelectLayer[ii], - wxGROW | wxLEFT | wxRIGHT | wxTOP ); - else - m_rightLayersBoxSizer->Add( m_BoxSelectLayer[ii], - wxGROW | wxLEFT | wxRIGHT | wxTOP ); - } - - - // Read the scale adjust option - int scale_idx = 4; // default selected scale = ScaleList[4] = 1.000 - - if( m_Config ) - { - m_Config->Read( OPTKEY_PRINT_X_FINESCALE_ADJ, &s_Parameters.m_XScaleAdjust ); - m_Config->Read( OPTKEY_PRINT_Y_FINESCALE_ADJ, &s_Parameters.m_YScaleAdjust ); - m_Config->Read( OPTKEY_PRINT_SCALE, &scale_idx ); - m_Config->Read( OPTKEY_PRINT_PAGE_FRAME, &s_Parameters.m_Print_Sheet_Ref, 1); - m_Config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1); - - // Test for a reasonnable scale value. Set to 1 if problem - if( s_Parameters.m_XScaleAdjust < MIN_SCALE || - s_Parameters.m_YScaleAdjust < MIN_SCALE || - s_Parameters.m_XScaleAdjust > MAX_SCALE || - s_Parameters.m_YScaleAdjust > MAX_SCALE ) - s_Parameters.m_XScaleAdjust = s_Parameters.m_YScaleAdjust = 1.0; - - s_SelectedLayers = 0; - for( int layer = 0; layerRead( layerKey, &option ) ) - { - m_BoxSelectLayer[layer]->SetValue( option ); - if( option ) - s_SelectedLayers |= 1 << layer; - } - } - } - - m_ScaleOption->SetSelection( scale_idx ); - scale_idx = m_ScaleOption->GetSelection(); - s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; - m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); - - - if( s_Parameters.m_Print_Black_and_White ) - m_ModeColorOption->SetSelection( 1 ); - else - m_ModeColorOption->SetSelection( 0 ); - - s_Parameters.m_PenDefaultSize = 0; - - // Create scale adjust option - msg.Printf( wxT( "%f" ), s_Parameters.m_XScaleAdjust ); - m_FineAdjustXscaleOpt->SetValue( msg ); - msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); - m_FineAdjustYscaleOpt->SetValue( msg ); - - bool enable = (s_Parameters.m_PrintScale == 1.0); - if( m_FineAdjustXscaleOpt ) - m_FineAdjustXscaleOpt->Enable(enable); - if( m_FineAdjustYscaleOpt ) - m_FineAdjustYscaleOpt->Enable(enable); -} - -/*************************************************/ -bool DIALOG_PRINT_USING_PRINTER::Show( bool show ) -/*************************************************/ -{ - bool ret; - - if( show ) - { - if( s_LastPos.x != -1 ) - { - SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 ); - } - ret = DIALOG_PRINT_USING_PRINTER_base::Show( show ); - } - else - { - // Save the dialog's position before hiding - s_LastPos = GetPosition(); - s_LastSize = GetSize(); - - ret = DIALOG_PRINT_USING_PRINTER_base::Show( show ); - } - - return ret; -} - -/**************************************************************/ -int DIALOG_PRINT_USING_PRINTER::SetLayerMaskFromListSelection() -/**************************************************************/ -{ - int page_count; - s_Parameters.m_PrintMaskLayer = 0; - int ii; - for( ii = 0, page_count = 0; ii < GERBVIEW_LAYER_COUNT; ii++ ) - { - if( m_BoxSelectLayer[ii]->IsChecked() ) - { - page_count++; - s_Parameters.m_PrintMaskLayer |= 1 << ii; - } - } - - s_Parameters.m_PageCount = page_count; - - return page_count; -} - - -/********************************************************************/ -void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) -/********************************************************************/ -{ - SetPrintParameters(); - - if( m_Config ) - { - m_Config->Write( OPTKEY_PRINT_X_FINESCALE_ADJ, s_Parameters.m_XScaleAdjust ); - m_Config->Write( OPTKEY_PRINT_Y_FINESCALE_ADJ, s_Parameters.m_YScaleAdjust ); - m_Config->Write( OPTKEY_PRINT_SCALE, m_ScaleOption->GetSelection() ); - m_Config->Write( OPTKEY_PRINT_PAGE_FRAME, s_Parameters.m_Print_Sheet_Ref); - m_Config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White); - wxString layerKey; - for( int layer = 0; layer < GERBVIEW_LAYER_COUNT; ++layer ) - { - layerKey.Printf( OPTKEY_LAYERBASE, layer ); - m_Config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() ); - } - } - EndModal( 0 ); -} - - -/******************************************************************/ -void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) -/******************************************************************/ -{ - s_Parameters.m_PrintMirror = m_Print_Mirror->GetValue(); - s_Parameters.m_Print_Black_and_White = - m_ModeColorOption->GetSelection() != 0; - - // Due to negative objects in gerber objects, always use one page per image, - // because these objects create artefact when they are printed on an existing image. - s_Parameters.m_OptionPrintPage = false; - - SetLayerMaskFromListSelection(); - - int idx = m_ScaleOption->GetSelection(); - s_Parameters.m_PrintScale = s_ScaleList[idx]; - - if( m_FineAdjustXscaleOpt ) - { - if( s_Parameters.m_XScaleAdjust > MAX_SCALE || - s_Parameters.m_YScaleAdjust > MAX_SCALE ) - DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very large value" ) ); - m_FineAdjustXscaleOpt->GetValue().ToDouble( &s_Parameters.m_XScaleAdjust ); - } - if( m_FineAdjustYscaleOpt ) - { - // Test for a reasonnable scale value - if( s_Parameters.m_XScaleAdjust < MIN_SCALE || - s_Parameters.m_YScaleAdjust < MIN_SCALE ) - DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very small value" ) ); - m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust ); - } -} - -void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) -{ - double scale = s_ScaleList[m_ScaleOption->GetSelection()]; - bool enable = (scale == 1.0); - if( m_FineAdjustXscaleOpt ) - m_FineAdjustXscaleOpt->Enable(enable); - if( m_FineAdjustYscaleOpt ) - m_FineAdjustYscaleOpt->Enable(enable); -} - -/**********************************************************/ -void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) -/**********************************************************/ - -/* Open a dialog box for printer setup (printer options, page size ...) - */ -{ - *g_pageSetupData = *g_PrintData; - - wxPageSetupDialog pageSetupDialog(this, g_pageSetupData); - pageSetupDialog.ShowModal(); - - (*g_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData(); - (*g_pageSetupData) = pageSetupDialog.GetPageSetupDialogData(); -} - - -/************************************************************/ -void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) -/************************************************************/ - -/* Open and display a previewer frame for printing - */ -{ - SetPrintParameters( ); - - // Pass two printout objects: for preview, and possible printing. - wxString title = _( "Print Preview" ); - wxPrintPreview* preview = - new wxPrintPreview( new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), - new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), - g_PrintData ); - - if( preview == NULL ) - { - DisplayError( this, wxT( "OnPrintPreview() problem" ) ); - return; - } - - SetLayerMaskFromListSelection(); - - // If no layer selected, we have no plot. prompt user if it happens - // because he could think there is a bug in Pcbnew: - if( s_Parameters.m_PrintMaskLayer == 0 ) - { - DisplayError( this, _( "No layer selected" ) ); - return; - } - - - // Uses the parent position and size. - // @todo uses last position and size ans store them when exit in m_Config - wxPoint WPos = m_Parent->GetPosition(); - wxSize WSize = m_Parent->GetSize(); - - wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize ); - - frame->Initialize(); - frame->Show( true ); -} - - -/***************************************************************************/ -void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event ) -/***************************************************************************/ - -/* Called on activate Print button - */ -{ - SetPrintParameters( ); - - // If no layer selected, we have no plot. prompt user if it happens - // because he could think there is a bug in Pcbnew: - if( s_Parameters.m_PrintMaskLayer == 0 ) - { - DisplayError( this, _( "No layer selected" ) ); - return; - } - - wxPrintDialogData printDialogData( *g_PrintData ); - - wxPrinter printer( &printDialogData ); - - wxString title = _( "Print" ); - BOARD_PRINTOUT_CONTROLER printout( s_Parameters, m_Parent, title ); - -#if !defined(__WINDOWS__) && !wxCHECK_VERSION(2,9,0) - wxDC* dc = printout.GetDC(); - ( (wxPostScriptDC*) dc )->SetResolution( 600 ); // Postscript DC resolution is 600 ppi -#endif - - if( !printer.Print( this, &printout, true ) ) - { - if( wxPrinter::GetLastError() == wxPRINTER_ERROR ) - DisplayError( this, _( "There was a problem printing" ) ); - return; - } - else - { - *g_PrintData = printer.GetPrintDialogData().GetPrintData(); - } -} - +/****************************************/ +/* File: dialog_print_using_printer.cpp */ +/****************************************/ + +// Set this to 1 if you want to test PostScript printing under MSW. +#define wxTEST_POSTSCRIPT_IN_MSW 1 + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#define WIDTH_MAX_VALUE 1000 +#define WIDTH_MIN_VALUE 1 + +static long s_SelectedLayers; +static double s_ScaleList[] = +{ 0, 0.5, 0.7, 0.999, 1.0, 1.4, 2.0, 3.0, 4.0 }; + +// Define min et max reasonnable values for print scale +#define MIN_SCALE 0.01 +#define MAX_SCALE 100.0 + +// static print data and page setup data, to remember settings during the session +static wxPrintData* g_PrintData; +static wxPageSetupDialogData* g_pageSetupData = (wxPageSetupDialogData*) NULL; + +// Variables locales +static PRINT_PARAMETERS s_Parameters; + + +/* Dialog to print schematic. Class derived from DIALOG_PRINT_USING_PRINTER_base + * created by wxFormBuilder + */ +class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_base +{ +private: + GERBVIEW_FRAME* m_Parent; + wxConfig* m_Config; + wxCheckBox* m_BoxSelectLayer[32]; + +public: + DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ); + ~DIALOG_PRINT_USING_PRINTER() {}; + +private: + void OnCloseWindow( wxCloseEvent& event ); + void OnInitDialog( wxInitDialogEvent& event ); + void OnPageSetup( wxCommandEvent& event ); + void OnPrintPreview( wxCommandEvent& event ); + void OnPrintButtonClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); + + void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } + void SetPrintParameters( ); + void InitValues( ); + +public: + bool IsMirrored() { return m_Print_Mirror->IsChecked(); } + bool PrintUsingSinglePage() { return true; } + int SetLayerMaskFromListSelection(); +}; + + +/*******************************************************/ +void GERBVIEW_FRAME::ToPrinter( wxCommandEvent& event ) +/*******************************************************/ + +/* Virtual function: + * Display the print dialog + */ +{ + if( g_PrintData == NULL ) // First print + { + g_PrintData = new wxPrintData(); + + if( !g_PrintData->Ok() ) + { + DisplayError( this, _( "Error Init Printer info" ) ); + } + g_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGHT; + } + + g_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); + + DIALOG_PRINT_USING_PRINTER* frame = new DIALOG_PRINT_USING_PRINTER( this ); + + frame->ShowModal(); + frame->Destroy(); +} + + +/*************************************************************************************/ +DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ) : + DIALOG_PRINT_USING_PRINTER_base( parent ) +/*************************************************************************************/ +{ + m_Parent = parent; + m_Config = wxGetApp().GetSettings(); + + InitValues( ); + + if( GetSizer() ) + { + GetSizer()->SetSizeHints( this ); + } +#ifdef __WXMAC__ + /* Problems with modal on wx-2.9 - Anyway preview is standard for OSX */ + m_buttonPreview->Hide(); +#endif + + m_buttonPrint->SetDefault(); +} + + +/************************************************************************/ +void DIALOG_PRINT_USING_PRINTER::InitValues( ) +/************************************************************************/ +{ + SetFocus(); + int layer_max = GERBVIEW_LAYER_COUNT; + wxString msg; + + if( g_pageSetupData == NULL ) + { + g_pageSetupData = new wxPageSetupDialogData; + // Set initial page margins. + // Margins are already set in Pcbnew, so we cans use 0 + g_pageSetupData->SetMarginTopLeft(wxPoint(0, 0)); + g_pageSetupData->SetMarginBottomRight(wxPoint(0, 0)); + } + + s_Parameters.m_PageSetupData = g_pageSetupData; + + layer_max = 32; + /* Create layer list */ + int mask = 1, ii; + for( ii = 0; ii < layer_max; ii++, mask <<= 1 ) + { + msg = _( "Layer" ); + msg << wxT( " " ) << ii + 1; + m_BoxSelectLayer[ii] = new wxCheckBox( this, -1, msg ); + + if( mask & s_SelectedLayers ) + m_BoxSelectLayer[ii]->SetValue( true ); + if( ii < 16 ) + m_leftLayersBoxSizer->Add( m_BoxSelectLayer[ii], + wxGROW | wxLEFT | wxRIGHT | wxTOP ); + else + m_rightLayersBoxSizer->Add( m_BoxSelectLayer[ii], + wxGROW | wxLEFT | wxRIGHT | wxTOP ); + } + + + // Read the scale adjust option + int scale_idx = 4; // default selected scale = ScaleList[4] = 1.000 + + if( m_Config ) + { + m_Config->Read( OPTKEY_PRINT_X_FINESCALE_ADJ, &s_Parameters.m_XScaleAdjust ); + m_Config->Read( OPTKEY_PRINT_Y_FINESCALE_ADJ, &s_Parameters.m_YScaleAdjust ); + m_Config->Read( OPTKEY_PRINT_SCALE, &scale_idx ); + m_Config->Read( OPTKEY_PRINT_PAGE_FRAME, &s_Parameters.m_Print_Sheet_Ref, 1); + m_Config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1); + + // Test for a reasonnable scale value. Set to 1 if problem + if( s_Parameters.m_XScaleAdjust < MIN_SCALE || + s_Parameters.m_YScaleAdjust < MIN_SCALE || + s_Parameters.m_XScaleAdjust > MAX_SCALE || + s_Parameters.m_YScaleAdjust > MAX_SCALE ) + s_Parameters.m_XScaleAdjust = s_Parameters.m_YScaleAdjust = 1.0; + + s_SelectedLayers = 0; + for( int layer = 0; layerRead( layerKey, &option ) ) + { + m_BoxSelectLayer[layer]->SetValue( option ); + if( option ) + s_SelectedLayers |= 1 << layer; + } + } + } + + m_ScaleOption->SetSelection( scale_idx ); + scale_idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; + m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); + + + if( s_Parameters.m_Print_Black_and_White ) + m_ModeColorOption->SetSelection( 1 ); + else + m_ModeColorOption->SetSelection( 0 ); + + s_Parameters.m_PenDefaultSize = 0; + + // Create scale adjust option + msg.Printf( wxT( "%f" ), s_Parameters.m_XScaleAdjust ); + m_FineAdjustXscaleOpt->SetValue( msg ); + msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); + m_FineAdjustYscaleOpt->SetValue( msg ); + + bool enable = (s_Parameters.m_PrintScale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + +/**************************************************************/ +int DIALOG_PRINT_USING_PRINTER::SetLayerMaskFromListSelection() +/**************************************************************/ +{ + int page_count; + s_Parameters.m_PrintMaskLayer = 0; + int ii; + for( ii = 0, page_count = 0; ii < GERBVIEW_LAYER_COUNT; ii++ ) + { + if( m_BoxSelectLayer[ii]->IsChecked() ) + { + page_count++; + s_Parameters.m_PrintMaskLayer |= 1 << ii; + } + } + + s_Parameters.m_PageCount = page_count; + + return page_count; +} + + +/********************************************************************/ +void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) +/********************************************************************/ +{ + SetPrintParameters(); + + if( m_Config ) + { + m_Config->Write( OPTKEY_PRINT_X_FINESCALE_ADJ, s_Parameters.m_XScaleAdjust ); + m_Config->Write( OPTKEY_PRINT_Y_FINESCALE_ADJ, s_Parameters.m_YScaleAdjust ); + m_Config->Write( OPTKEY_PRINT_SCALE, m_ScaleOption->GetSelection() ); + m_Config->Write( OPTKEY_PRINT_PAGE_FRAME, s_Parameters.m_Print_Sheet_Ref); + m_Config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White); + wxString layerKey; + for( int layer = 0; layer < GERBVIEW_LAYER_COUNT; ++layer ) + { + layerKey.Printf( OPTKEY_LAYERBASE, layer ); + m_Config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() ); + } + } + EndModal( 0 ); +} + + +/******************************************************************/ +void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) +/******************************************************************/ +{ + s_Parameters.m_PrintMirror = m_Print_Mirror->GetValue(); + s_Parameters.m_Print_Black_and_White = + m_ModeColorOption->GetSelection() != 0; + + // Due to negative objects in gerber objects, always use one page per image, + // because these objects create artefact when they are printed on an existing image. + s_Parameters.m_OptionPrintPage = false; + + SetLayerMaskFromListSelection(); + + int idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[idx]; + + if( m_FineAdjustXscaleOpt ) + { + if( s_Parameters.m_XScaleAdjust > MAX_SCALE || + s_Parameters.m_YScaleAdjust > MAX_SCALE ) + DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very large value" ) ); + m_FineAdjustXscaleOpt->GetValue().ToDouble( &s_Parameters.m_XScaleAdjust ); + } + if( m_FineAdjustYscaleOpt ) + { + // Test for a reasonnable scale value + if( s_Parameters.m_XScaleAdjust < MIN_SCALE || + s_Parameters.m_YScaleAdjust < MIN_SCALE ) + DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very small value" ) ); + m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust ); + } +} + +void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) +{ + double scale = s_ScaleList[m_ScaleOption->GetSelection()]; + bool enable = (scale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + +/**********************************************************/ +void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) +/**********************************************************/ + +/* Open a dialog box for printer setup (printer options, page size ...) + */ +{ + *g_pageSetupData = *g_PrintData; + + wxPageSetupDialog pageSetupDialog(this, g_pageSetupData); + pageSetupDialog.ShowModal(); + + (*g_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData(); + (*g_pageSetupData) = pageSetupDialog.GetPageSetupDialogData(); +} + + +/************************************************************/ +void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) +/************************************************************/ + +/* Open and display a previewer frame for printing + */ +{ + SetPrintParameters( ); + + // Pass two printout objects: for preview, and possible printing. + wxString title = _( "Print Preview" ); + wxPrintPreview* preview = + new wxPrintPreview( new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), + new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), + g_PrintData ); + + if( preview == NULL ) + { + DisplayError( this, wxT( "OnPrintPreview() problem" ) ); + return; + } + + SetLayerMaskFromListSelection(); + + // If no layer selected, we have no plot. prompt user if it happens + // because he could think there is a bug in Pcbnew: + if( s_Parameters.m_PrintMaskLayer == 0 ) + { + DisplayError( this, _( "No layer selected" ) ); + return; + } + + + // Uses the parent position and size. + // @todo uses last position and size ans store them when exit in m_Config + wxPoint WPos = m_Parent->GetPosition(); + wxSize WSize = m_Parent->GetSize(); + + wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize ); + + frame->Initialize(); + frame->Show( true ); +} + + +/***************************************************************************/ +void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event ) +/***************************************************************************/ + +/* Called on activate Print button + */ +{ + SetPrintParameters( ); + + // If no layer selected, we have no plot. prompt user if it happens + // because he could think there is a bug in Pcbnew: + if( s_Parameters.m_PrintMaskLayer == 0 ) + { + DisplayError( this, _( "No layer selected" ) ); + return; + } + + wxPrintDialogData printDialogData( *g_PrintData ); + + wxPrinter printer( &printDialogData ); + + wxString title = _( "Print" ); + BOARD_PRINTOUT_CONTROLER printout( s_Parameters, m_Parent, title ); + +#if !defined(__WINDOWS__) && !wxCHECK_VERSION(2,9,0) + wxDC* dc = printout.GetDC(); + ( (wxPostScriptDC*) dc )->SetResolution( 600 ); // Postscript DC resolution is 600 ppi +#endif + + if( !printer.Print( this, &printout, true ) ) + { + if( wxPrinter::GetLastError() == wxPRINTER_ERROR ) + DisplayError( this, _( "There was a problem printing" ) ); + return; + } + else + { + *g_PrintData = printer.GetPrintDialogData().GetPrintData(); + } +} + diff --git a/gerbview/dialogs/dialog_print_using_printer_base.cpp b/gerbview/dialogs/dialog_print_using_printer_base.cpp index 2957e21f1a..c198bb48c1 100644 --- a/gerbview/dialogs/dialog_print_using_printer_base.cpp +++ b/gerbview/dialogs/dialog_print_using_printer_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_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( wxSize( -1,-1 ), wxDefaultSize ); @@ -24,14 +24,18 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare m_leftLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL ); + bleftSizer->Add( m_leftLayersBoxSizer, 1, wxALL, 5 ); m_rightLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL ); + bleftSizer->Add( m_rightLayersBoxSizer, 1, wxALL, 5 ); + sbLayersSizer->Add( bleftSizer, 1, wxEXPAND, 5 ); + bMainSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); wxBoxSizer* bmiddleLeftSizer; @@ -61,6 +65,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare bmiddleLeftSizer->Add( m_FineAdjustYscaleOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bMainSizer->Add( bmiddleLeftSizer, 0, wxEXPAND, 5 ); wxBoxSizer* bmiddleRightSizer; @@ -72,6 +77,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare m_Print_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, 0 ); sbOptionsSizer->Add( m_Print_Mirror, 0, wxALL, 5 ); + bmiddleRightSizer->Add( sbOptionsSizer, 0, wxEXPAND|wxALL, 5 ); wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; @@ -82,6 +88,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare bmiddleRightSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( bmiddleRightSizer, 0, wxEXPAND, 5 ); wxBoxSizer* b_buttonsSizer; @@ -99,8 +106,10 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bMainSizer->Add( b_buttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + this->SetSizer( bMainSizer ); this->Layout(); diff --git a/gerbview/dialogs/dialog_print_using_printer_base.fbp b/gerbview/dialogs/dialog_print_using_printer_base.fbp index 724b188815..532d2d7c3e 100644 --- a/gerbview/dialogs/dialog_print_using_printer_base.fbp +++ b/gerbview/dialogs/dialog_print_using_printer_base.fbp @@ -44,7 +44,7 @@ 551,314 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Print diff --git a/gerbview/dialogs/dialog_print_using_printer_base.h b/gerbview/dialogs/dialog_print_using_printer_base.h index 0c954986e6..6ea886d8c5 100644 --- a/gerbview/dialogs/dialog_print_using_printer_base.h +++ b/gerbview/dialogs/dialog_print_using_printer_base.h @@ -1,15 +1,17 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_print_using_printer_base__ -#define __dialog_print_using_printer_base__ +#ifndef __DIALOG_PRINT_USING_PRINTER_BASE_H__ +#define __DIALOG_PRINT_USING_PRINTER_BASE_H__ +#include +#include #include - +#include "dialog_shim.h" #include #include #include @@ -29,7 +31,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_PRINT_USING_PRINTER_base /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PRINT_USING_PRINTER_base : public wxDialog +class DIALOG_PRINT_USING_PRINTER_base : public DIALOG_SHIM { private: @@ -38,7 +40,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog { wxID_PRINT_MODE = 1000, wxID_PRINT_OPTIONS, - wxID_PRINT_ALL, + wxID_PRINT_ALL }; wxStaticBoxSizer* m_leftLayersBoxSizer; @@ -66,9 +68,9 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog public: - DIALOG_PRINT_USING_PRINTER_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 551,314 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_PRINT_USING_PRINTER_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 551,314 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PRINT_USING_PRINTER_base(); }; -#endif //__dialog_print_using_printer_base__ +#endif //__DIALOG_PRINT_USING_PRINTER_BASE_H__ diff --git a/gerbview/dialogs/dialog_show_page_borders_base.cpp b/gerbview/dialogs/dialog_show_page_borders_base.cpp index 4db019d158..394c2e185a 100644 --- a/gerbview/dialogs/dialog_show_page_borders_base.cpp +++ b/gerbview/dialogs/dialog_show_page_borders_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::DIALOG_PAGE_SHOW_PAGE_BORDERS_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 ); @@ -28,8 +28,10 @@ DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( wxWindow m_ShowPageLimits->SetSelection( 0 ); bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 ); + bUpperSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); + bDialogSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -41,8 +43,10 @@ DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( wxWindow m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); + this->SetSizer( bDialogSizer ); this->Layout(); diff --git a/gerbview/dialogs/dialog_show_page_borders_base.fbp b/gerbview/dialogs/dialog_show_page_borders_base.fbp index 80828042e8..f1fe18ee50 100644 --- a/gerbview/dialogs/dialog_show_page_borders_base.fbp +++ b/gerbview/dialogs/dialog_show_page_borders_base.fbp @@ -44,7 +44,7 @@ 263,254 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Page Borders diff --git a/gerbview/dialogs/dialog_show_page_borders_base.h b/gerbview/dialogs/dialog_show_page_borders_base.h index 953ed08dc7..cf1b2b3d7e 100644 --- a/gerbview/dialogs/dialog_show_page_borders_base.h +++ b/gerbview/dialogs/dialog_show_page_borders_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,7 @@ #include #include #include +#include "dialog_shim.h" #include #include #include @@ -28,7 +29,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE : public wxDialog +class DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE : public DIALOG_SHIM { private: diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp index 3f5e2a3a14..9bfb92a757 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_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 ); diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp index 00d74864b4..6eaf27353e 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp @@ -44,7 +44,7 @@ 446,330 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DIALOG_SHIM; dialog_shim.h Gerbview Options diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h index 03610e8cfa..6b0e9c69e2 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 17 2012) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,7 @@ #include #include #include +#include "dialog_shim.h" #include #include #include @@ -30,7 +31,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_DISPLAY_OPTIONS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_DISPLAY_OPTIONS_BASE : public wxDialog +class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM { private: diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index c874e6b549..d60d7405ce 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -55,13 +55,6 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) : } -bool DIALOG_DRC_CONTROL::Show( bool show ) -{ - return DIALOG_DRC_CONTROL_BASE::Show( show ); -} - - - void DIALOG_DRC_CONTROL::InitValues() { // Connect events and objects diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 4aa1436854..4c1fb5b660 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -60,14 +60,6 @@ public: DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ); ~DIALOG_DRC_CONTROL(){}; - /** - * Function Show - * overloads the wxDialog::Show() function so it can position the - * dialog at its remembered size and position. - */ - bool Show( bool show ); - - private: /** * Function writeReport diff --git a/pcbnew/dialogs/dialog_layers_setup.cpp b/pcbnew/dialogs/dialog_layers_setup.cpp index bf1ee5855c..879330b5d7 100644 --- a/pcbnew/dialogs/dialog_layers_setup.cpp +++ b/pcbnew/dialogs/dialog_layers_setup.cpp @@ -155,8 +155,6 @@ public: DIALOG_LAYERS_SETUP( PCB_EDIT_FRAME* parent ); ~DIALOG_LAYERS_SETUP( ) { }; - bool Show( bool show ); // overload stock function - /** * Function Layout * overrides the standard Layout() function so that the column titles can @@ -307,12 +305,6 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( PCB_EDIT_FRAME* parent ) : } -bool DIALOG_LAYERS_SETUP::Show( bool show ) -{ - return DIALOG_LAYERS_SETUP_BASE::Show( show ); -} - - void DIALOG_LAYERS_SETUP::showCopperChoice( int copperCount ) { static const int copperCounts[] = { 2,4,6,8,10,12,14,16 };