KiCad PCB EDA Suite
wizard_add_fplib_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Jun 17 2015)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
9 
11 
12 WIZARD_FPLIB_TABLE_BASE::WIZARD_FPLIB_TABLE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bitmap, const wxPoint& pos, long style )
13 {
14  this->Create( parent, id, title, bitmap, pos, style );
15  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
16 
17  wxWizardPageSimple* m_wizPage1 = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
18  m_pages.Add( m_wizPage1 );
19 
20  m_wizPage1->SetMinSize( wxSize( 720,480 ) );
21 
22  wxBoxSizer* bSizer1;
23  bSizer1 = new wxBoxSizer( wxVERTICAL );
24 
25  wxFlexGridSizer* fgSizer112;
26  fgSizer112 = new wxFlexGridSizer( 3, 1, 0, 0 );
27  fgSizer112->AddGrowableRow( 1 );
28  fgSizer112->SetFlexibleDirection( wxBOTH );
29  fgSizer112->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
30 
31  m_staticText1 = new wxStaticText( m_wizPage1, wxID_ANY, _("Welcome to the Add Footprint Libraries Wizard!\n\nPlease select the source for the libraries to add:"), wxDefaultPosition, wxDefaultSize, 0 );
32  m_staticText1->Wrap( -1 );
33  fgSizer112->Add( m_staticText1, 1, wxALL|wxEXPAND, 5 );
34 
35  wxBoxSizer* bSizer19;
36  bSizer19 = new wxBoxSizer( wxVERTICAL );
37 
38  m_radioAddLocal = new wxRadioButton( m_wizPage1, wxID_ANY, _("Files on my computer"), wxDefaultPosition, wxDefaultSize, 0 );
39  bSizer19->Add( m_radioAddLocal, 0, wxALL|wxEXPAND, 5 );
40 
41  wxFlexGridSizer* m_githubSizer;
42  m_githubSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
43  m_githubSizer->SetFlexibleDirection( wxBOTH );
44  m_githubSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
45 
46  m_radioAddGithub = new wxRadioButton( m_wizPage1, wxID_ANY, _("Github repository"), wxDefaultPosition, wxDefaultSize, 0 );
47  m_githubSizer->Add( m_radioAddGithub, 0, wxALL|wxEXPAND, 5 );
48 
49  m_textCtrlGithubURL = new wxTextCtrl( m_wizPage1, wxID_ANY, _("https://github.com/KiCad"), wxDefaultPosition, wxDefaultSize, 0 );
50  m_textCtrlGithubURL->SetMinSize( wxSize( 300,-1 ) );
51 
52  m_githubSizer->Add( m_textCtrlGithubURL, 1, wxALL|wxEXPAND, 5 );
53 
54 
55  m_githubSizer->Add( 0, 0, 1, wxEXPAND, 5 );
56 
57  m_downloadGithub = new wxCheckBox( m_wizPage1, wxID_ANY, _("Save a local copy to:"), wxDefaultPosition, wxDefaultSize, 0 );
58  m_downloadGithub->SetValue(true);
59  m_githubSizer->Add( m_downloadGithub, 0, wxALL, 5 );
60 
61 
62  m_githubSizer->Add( 0, 0, 1, wxEXPAND, 5 );
63 
64  wxBoxSizer* bSizer9;
65  bSizer9 = new wxBoxSizer( wxHORIZONTAL );
66 
67  m_downloadDir = new wxStaticText( m_wizPage1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
68  m_downloadDir->Wrap( -1 );
69  m_downloadDir->SetMinSize( wxSize( 300,-1 ) );
70 
71  bSizer9->Add( m_downloadDir, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
72 
73  m_btnBrowse = new wxButton( m_wizPage1, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
74  bSizer9->Add( m_btnBrowse, 0, wxALL, 5 );
75 
76 
77  m_githubSizer->Add( bSizer9, 1, wxEXPAND, 5 );
78 
79 
80  m_githubSizer->Add( 0, 0, 1, wxEXPAND, 5 );
81 
82  m_invalidDir = new wxStaticText( m_wizPage1, wxID_ANY, _("It is not possible to write in the selected directory.\nPlease choose another one."), wxDefaultPosition, wxDefaultSize, 0 );
83  m_invalidDir->Wrap( -1 );
84  m_invalidDir->SetForegroundColour( wxColour( 255, 0, 0 ) );
85 
86  m_githubSizer->Add( m_invalidDir, 0, wxALL, 5 );
87 
88 
89  bSizer19->Add( m_githubSizer, 1, wxEXPAND, 5 );
90 
91 
92  fgSizer112->Add( bSizer19, 1, wxEXPAND, 5 );
93 
94 
95  bSizer1->Add( fgSizer112, 1, wxEXPAND, 5 );
96 
97  wxBoxSizer* bSizerOfficialRepo;
98  bSizerOfficialRepo = new wxBoxSizer( wxHORIZONTAL );
99 
100  m_bitmapRepo = new wxStaticBitmap( m_wizPage1, wxID_ANY, wxArtProvider::GetBitmap( wxART_INFORMATION, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 );
101  bSizerOfficialRepo->Add( m_bitmapRepo, 0, wxALL, 5 );
102 
103 
104  bSizerOfficialRepo->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
105 
106  m_hyperlinkGithubKicad = new wxHyperlinkCtrl( m_wizPage1, wxID_ANY, _("Visit our official Kicad repository on Github and get more libraries"), wxT("https://github.com/KiCad"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
107  bSizerOfficialRepo->Add( m_hyperlinkGithubKicad, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
108 
109 
110  bSizer1->Add( bSizerOfficialRepo, 0, wxEXPAND, 5 );
111 
112 
113  m_wizPage1->SetSizer( bSizer1 );
114  m_wizPage1->Layout();
115  wxWizardPageSimple* m_wizPage2_Local = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
116  m_pages.Add( m_wizPage2_Local );
117 
118  wxBoxSizer* bSizer8;
119  bSizer8 = new wxBoxSizer( wxVERTICAL );
120 
121  m_staticText7 = new wxStaticText( m_wizPage2_Local, wxID_ANY, _("Select files or folders to add:"), wxDefaultPosition, wxDefaultSize, 0 );
122  m_staticText7->Wrap( -1 );
123  bSizer8->Add( m_staticText7, 0, wxALL, 5 );
124 
125  m_filePicker = new wxGenericDirCtrl( m_wizPage2_Local, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxDIRCTRL_MULTIPLE|wxDIRCTRL_SHOW_FILTERS|wxSUNKEN_BORDER, wxEmptyString, 0 );
126 
127  m_filePicker->ShowHidden( false );
128  bSizer8->Add( m_filePicker, 1, wxEXPAND | wxALL, 5 );
129 
130 
131  m_wizPage2_Local->SetSizer( bSizer8 );
132  m_wizPage2_Local->Layout();
133  bSizer8->Fit( m_wizPage2_Local );
134  wxWizardPageSimple* m_wizPage2_Github = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
135  m_pages.Add( m_wizPage2_Github );
136 
137  wxBoxSizer* bSizer111;
138  bSizer111 = new wxBoxSizer( wxVERTICAL );
139 
140  m_staticText112 = new wxStaticText( m_wizPage2_Github, wxID_ANY, _("Select Github libraries to add:"), wxDefaultPosition, wxDefaultSize, 0 );
141  m_staticText112->Wrap( -1 );
142  bSizer111->Add( m_staticText112, 0, wxALL|wxEXPAND, 5 );
143 
144  wxArrayString m_checkListGHChoices;
145  m_checkListGH = new wxCheckListBox( m_wizPage2_Github, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkListGHChoices, wxLB_MULTIPLE|wxLB_NEEDED_SB );
146  bSizer111->Add( m_checkListGH, 1, wxALL|wxEXPAND, 5 );
147 
148  wxBoxSizer* bSizer7;
149  bSizer7 = new wxBoxSizer( wxHORIZONTAL );
150 
151  m_btnSelectAllGH = new wxButton( m_wizPage2_Github, wxID_ANY, _("Select all"), wxDefaultPosition, wxDefaultSize, 0 );
152  bSizer7->Add( m_btnSelectAllGH, 1, wxALL, 5 );
153 
154  m_btnUnselectAllGH = new wxButton( m_wizPage2_Github, wxID_ANY, _("Unselect all"), wxDefaultPosition, wxDefaultSize, 0 );
155  bSizer7->Add( m_btnUnselectAllGH, 1, wxALL, 5 );
156 
157 
158  bSizer7->Add( 0, 0, 1, wxEXPAND, 5 );
159 
160  m_searchCtrlGH = new wxSearchCtrl( m_wizPage2_Github, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
161  #ifndef __WXMAC__
162  m_searchCtrlGH->ShowSearchButton( true );
163  #endif
164  m_searchCtrlGH->ShowCancelButton( false );
165  bSizer7->Add( m_searchCtrlGH, 2, wxALL, 5 );
166 
167 
168  bSizer111->Add( bSizer7, 0, wxEXPAND, 5 );
169 
170 
171  m_wizPage2_Github->SetSizer( bSizer111 );
172  m_wizPage2_Github->Layout();
173  bSizer111->Fit( m_wizPage2_Github );
174  wxWizardPageSimple* m_wizPage3_Review = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
175  m_pages.Add( m_wizPage3_Review );
176 
177  wxBoxSizer* bSizer1111;
178  bSizer1111 = new wxBoxSizer( wxVERTICAL );
179 
180  m_staticText1121 = new wxStaticText( m_wizPage3_Review, wxID_ANY, _("Review and confirm the changes to the libraries:"), wxDefaultPosition, wxDefaultSize, 0 );
181  m_staticText1121->Wrap( -1 );
182  bSizer1111->Add( m_staticText1121, 0, wxALL|wxEXPAND, 5 );
183 
184  m_listCtrlReview = new wxDataViewListCtrl( m_wizPage3_Review, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_HORIZ_RULES|wxDV_ROW_LINES|wxDV_VERT_RULES );
185  m_dvLibName = m_listCtrlReview->AppendTextColumn( _("Library") );
186  m_dvLibStatus = m_listCtrlReview->AppendTextColumn( _("Status") );
187  m_dvLibFormat = m_listCtrlReview->AppendTextColumn( _("Format") );
188  bSizer1111->Add( m_listCtrlReview, 1, wxALL|wxEXPAND, 5 );
189 
190 
191  m_wizPage3_Review->SetSizer( bSizer1111 );
192  m_wizPage3_Review->Layout();
193  bSizer1111->Fit( m_wizPage3_Review );
194  wxWizardPageSimple* m_wizPage4_SelectTarget = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
195  m_pages.Add( m_wizPage4_SelectTarget );
196 
197  wxBoxSizer* bSizer12;
198  bSizer12 = new wxBoxSizer( wxVERTICAL );
199 
200  m_staticText12 = new wxStaticText( m_wizPage4_SelectTarget, wxID_ANY, _("Where do you wish the new libraries to be added:"), wxDefaultPosition, wxDefaultSize, 0 );
201  m_staticText12->Wrap( -1 );
202  bSizer12->Add( m_staticText12, 0, wxALL|wxEXPAND, 5 );
203 
204  m_radioGlobal = new wxRadioButton( m_wizPage4_SelectTarget, wxID_ANY, _("To global library configuration (visible by all projects)"), wxDefaultPosition, wxDefaultSize, 0 );
205  bSizer12->Add( m_radioGlobal, 0, wxALL|wxEXPAND, 5 );
206 
207  m_radioProject = new wxRadioButton( m_wizPage4_SelectTarget, wxID_ANY, _("To the current project only"), wxDefaultPosition, wxDefaultSize, 0 );
208  bSizer12->Add( m_radioProject, 0, wxALL|wxEXPAND, 5 );
209 
210 
211  m_wizPage4_SelectTarget->SetSizer( bSizer12 );
212  m_wizPage4_SelectTarget->Layout();
213  bSizer12->Fit( m_wizPage4_SelectTarget );
214 
215  this->Centre( wxBOTH );
216 
217  for ( unsigned int i = 1; i < m_pages.GetCount(); i++ )
218  {
219  m_pages.Item( i )->SetPrev( m_pages.Item( i - 1 ) );
220  m_pages.Item( i - 1 )->SetNext( m_pages.Item( i ) );
221  }
222 
223  // Connect Events
224  this->Connect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnWizardFinished ) );
225  this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnPageChanged ) );
226  this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnPageChanging ) );
227  m_downloadGithub->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnCheckSaveCopy ), NULL, this );
228  m_btnBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnBrowseButtonClick ), NULL, this );
229  m_btnSelectAllGH->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnSelectAllGH ), NULL, this );
230  m_btnUnselectAllGH->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnUnselectAllGH ), NULL, this );
231  m_searchCtrlGH->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnChangeSearch ), NULL, this );
232 }
233 
235 {
236  // Disconnect Events
237  this->Disconnect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnWizardFinished ) );
238  this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnPageChanged ) );
239  this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_FPLIB_TABLE_BASE::OnPageChanging ) );
240  m_downloadGithub->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnCheckSaveCopy ), NULL, this );
241  m_btnBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnBrowseButtonClick ), NULL, this );
242  m_btnSelectAllGH->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnSelectAllGH ), NULL, this );
243  m_btnUnselectAllGH->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnUnselectAllGH ), NULL, this );
244  m_searchCtrlGH->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_FPLIB_TABLE_BASE::OnChangeSearch ), NULL, this );
245 
246  m_pages.Clear();
247 }
virtual void OnChangeSearch(wxCommandEvent &event)
virtual void OnWizardFinished(wxWizardEvent &event)
wxDataViewColumn * m_dvLibStatus
wxGenericDirCtrl * m_filePicker
virtual void OnUnselectAllGH(wxCommandEvent &event)
virtual void OnPageChanging(wxWizardEvent &event)
virtual void OnCheckSaveCopy(wxCommandEvent &event)
wxDataViewColumn * m_dvLibFormat
wxHyperlinkCtrl * m_hyperlinkGithubKicad
virtual void OnSelectAllGH(wxCommandEvent &event)
virtual void OnPageChanged(wxWizardEvent &event)
WIZARD_FPLIB_TABLE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Add Footprint Libraries Wizard"), const wxBitmap &bitmap=wxArtProvider::GetBitmap(wxART_HELP_BOOK, wxART_FRAME_ICON), const wxPoint &pos=wxDefaultPosition, long style=wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER)
virtual void OnBrowseButtonClick(wxCommandEvent &event)
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70
wxDataViewColumn * m_dvLibName
wxDataViewListCtrl * m_listCtrlReview