KiCad PCB EDA Suite
wizard_3DShape_Libs_downloader_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Jul 2 2017)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
9 
11 
12 WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::WIZARD_3DSHAPE_LIBS_DOWNLOADER_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  m_staticTextWelcome = new wxStaticText( m_wizPage1, wxID_ANY, _("Welcome to the 3D shape Libraries downloader Wizard!"), wxDefaultPosition, wxDefaultSize, 0 );
26  m_staticTextWelcome->Wrap( -1 );
27  bSizer1->Add( m_staticTextWelcome, 0, wxALL|wxEXPAND, 5 );
28 
29 
30  bSizer1->Add( 0, 20, 0, 0, 5 );
31 
32  wxBoxSizer* bSizer19;
33  bSizer19 = new wxBoxSizer( wxVERTICAL );
34 
35  m_staticText8 = new wxStaticText( m_wizPage1, wxID_ANY, _("Please select the URL for the 3D libraries to download"), wxDefaultPosition, wxDefaultSize, 0 );
36  m_staticText8->Wrap( -1 );
37  bSizer19->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
38 
39  m_textCtrlGithubURL = new wxTextCtrl( m_wizPage1, wxID_ANY, _("https://github.com/KiCad/packages3d"), wxDefaultPosition, wxDefaultSize, 0 );
40  m_textCtrlGithubURL->SetMinSize( wxSize( 300,-1 ) );
41 
42  bSizer19->Add( m_textCtrlGithubURL, 0, wxALL|wxEXPAND, 5 );
43 
44 
45  bSizer19->Add( 0, 10, 0, 0, 5 );
46 
47  wxFlexGridSizer* fgSizerLocalFolder;
48  fgSizerLocalFolder = new wxFlexGridSizer( 0, 2, 0, 0 );
49  fgSizerLocalFolder->AddGrowableCol( 0 );
50  fgSizerLocalFolder->SetFlexibleDirection( wxBOTH );
51  fgSizerLocalFolder->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
52 
53  wxBoxSizer* bSizerDinname;
54  bSizerDinname = new wxBoxSizer( wxVERTICAL );
55 
56  m_staticText9 = new wxStaticText( m_wizPage1, wxID_ANY, _("3D shape local folder:"), wxDefaultPosition, wxDefaultSize, 0 );
57  m_staticText9->Wrap( -1 );
58  bSizerDinname->Add( m_staticText9, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
59 
60  m_downloadDir = new wxTextCtrl( m_wizPage1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
61  bSizerDinname->Add( m_downloadDir, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
62 
63 
64  fgSizerLocalFolder->Add( bSizerDinname, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
65 
66  wxBoxSizer* bSizerButts;
67  bSizerButts = new wxBoxSizer( wxVERTICAL );
68 
69  m_btnBrowse = new wxButton( m_wizPage1, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
70  bSizerButts->Add( m_btnBrowse, 0, wxEXPAND|wxALL, 5 );
71 
72  m_buttonDefault3DPath = new wxButton( m_wizPage1, wxID_ANY, _("Default 3D Path"), wxDefaultPosition, wxDefaultSize, 0 );
73  bSizerButts->Add( m_buttonDefault3DPath, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
74 
75 
76  fgSizerLocalFolder->Add( bSizerButts, 0, wxEXPAND, 5 );
77 
78  wxBoxSizer* bSizerWarnMsg;
79  bSizerWarnMsg = new wxBoxSizer( wxHORIZONTAL );
80 
81  m_bitmapDirWarn = new wxStaticBitmap( m_wizPage1, wxID_ANY, wxArtProvider::GetBitmap( wxART_ERROR, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 );
82  bSizerWarnMsg->Add( m_bitmapDirWarn, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
83 
84  m_invalidDirWarningText = new wxStaticText( m_wizPage1, wxID_ANY, _("It is not possible to write in the selected directory.\nPlease choose another one."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
85  m_invalidDirWarningText->Wrap( -1 );
86  m_invalidDirWarningText->SetForegroundColour( wxColour( 255, 0, 0 ) );
87 
88  bSizerWarnMsg->Add( m_invalidDirWarningText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
89 
90 
91  fgSizerLocalFolder->Add( bSizerWarnMsg, 1, wxEXPAND, 5 );
92 
93 
94  fgSizerLocalFolder->Add( 10, 40, 0, 0, 5 );
95 
96 
97  bSizer19->Add( fgSizerLocalFolder, 1, wxEXPAND, 5 );
98 
99 
100  bSizer1->Add( bSizer19, 1, wxEXPAND, 5 );
101 
102  wxBoxSizer* bSizerOfficialRepo;
103  bSizerOfficialRepo = new wxBoxSizer( wxHORIZONTAL );
104 
105  m_bitmapRepo = new wxStaticBitmap( m_wizPage1, wxID_ANY, wxArtProvider::GetBitmap( wxART_INFORMATION, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 );
106  bSizerOfficialRepo->Add( m_bitmapRepo, 0, wxALL, 5 );
107 
108 
109  bSizerOfficialRepo->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
110 
111  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 );
112  bSizerOfficialRepo->Add( m_hyperlinkGithubKicad, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
113 
114 
115  bSizer1->Add( bSizerOfficialRepo, 0, wxEXPAND, 5 );
116 
117 
118  m_wizPage1->SetSizer( bSizer1 );
119  m_wizPage1->Layout();
120  wxWizardPageSimple* m_wizPage2_Github = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
121  m_pages.Add( m_wizPage2_Github );
122 
123  wxBoxSizer* bSizer111;
124  bSizer111 = new wxBoxSizer( wxVERTICAL );
125 
126  m_staticText112 = new wxStaticText( m_wizPage2_Github, wxID_ANY, _("Select Github libraries to add:"), wxDefaultPosition, wxDefaultSize, 0 );
127  m_staticText112->Wrap( -1 );
128  bSizer111->Add( m_staticText112, 0, wxALL|wxEXPAND, 5 );
129 
130  wxArrayString m_checkList3DlibnamesChoices;
131  m_checkList3Dlibnames = new wxCheckListBox( m_wizPage2_Github, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkList3DlibnamesChoices, wxLB_MULTIPLE|wxLB_NEEDED_SB );
132  bSizer111->Add( m_checkList3Dlibnames, 1, wxALL|wxEXPAND, 5 );
133 
134  wxBoxSizer* bSizer7;
135  bSizer7 = new wxBoxSizer( wxHORIZONTAL );
136 
137  m_btnSelectAll3Dlibs = new wxButton( m_wizPage2_Github, wxID_ANY, _("Select all"), wxDefaultPosition, wxDefaultSize, 0 );
138  bSizer7->Add( m_btnSelectAll3Dlibs, 1, wxALL, 5 );
139 
140  m_btnUnselectAll3Dlibs = new wxButton( m_wizPage2_Github, wxID_ANY, _("Unselect all"), wxDefaultPosition, wxDefaultSize, 0 );
141  bSizer7->Add( m_btnUnselectAll3Dlibs, 1, wxALL, 5 );
142 
143 
144  bSizer7->Add( 0, 0, 1, wxEXPAND, 5 );
145 
146  m_searchCtrl3Dlibs = new wxSearchCtrl( m_wizPage2_Github, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
147  #ifndef __WXMAC__
148  m_searchCtrl3Dlibs->ShowSearchButton( true );
149  #endif
150  m_searchCtrl3Dlibs->ShowCancelButton( false );
151  bSizer7->Add( m_searchCtrl3Dlibs, 2, wxALL, 5 );
152 
153 
154  bSizer111->Add( bSizer7, 0, wxEXPAND, 5 );
155 
156 
157  m_wizPage2_Github->SetSizer( bSizer111 );
158  m_wizPage2_Github->Layout();
159  bSizer111->Fit( m_wizPage2_Github );
160  wxWizardPageSimple* m_wizPage3_SelectTarget = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) );
161  m_pages.Add( m_wizPage3_SelectTarget );
162 
163  wxBoxSizer* bSizer12;
164  bSizer12 = new wxBoxSizer( wxVERTICAL );
165 
166  m_staticTextlocalfolder = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("Local library folder:"), wxDefaultPosition, wxDefaultSize, 0 );
167  m_staticTextlocalfolder->Wrap( -1 );
168  bSizer12->Add( m_staticTextlocalfolder, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
169 
170  m_LocalFolderInfo = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
171  m_LocalFolderInfo->Wrap( -1 );
172  bSizer12->Add( m_LocalFolderInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
173 
174  m_staticText12 = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("3D shape libraries to be downloaded:"), wxDefaultPosition, wxDefaultSize, 0 );
175  m_staticText12->Wrap( -1 );
176  bSizer12->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
177 
178  m_gridLibReview = new wxGrid( m_wizPage3_SelectTarget, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
179 
180  // Grid
181  m_gridLibReview->CreateGrid( 1, 2 );
182  m_gridLibReview->EnableEditing( false );
183  m_gridLibReview->EnableGridLines( true );
184  m_gridLibReview->EnableDragGridSize( false );
185  m_gridLibReview->SetMargins( 5, 0 );
186 
187  // Columns
188  m_gridLibReview->EnableDragColMove( false );
189  m_gridLibReview->EnableDragColSize( true );
190  m_gridLibReview->SetColLabelSize( 30 );
191  m_gridLibReview->SetColLabelValue( 0, _("Status") );
192  m_gridLibReview->SetColLabelValue( 1, _("Libraries") );
193  m_gridLibReview->SetColLabelValue( 2, wxEmptyString );
194  m_gridLibReview->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
195 
196  // Rows
197  m_gridLibReview->AutoSizeRows();
198  m_gridLibReview->EnableDragRowSize( true );
199  m_gridLibReview->SetRowLabelSize( 30 );
200  m_gridLibReview->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
201 
202  // Label Appearance
203 
204  // Cell Defaults
205  m_gridLibReview->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
206  bSizer12->Add( m_gridLibReview, 1, wxALL|wxEXPAND, 5 );
207 
208 
209  m_wizPage3_SelectTarget->SetSizer( bSizer12 );
210  m_wizPage3_SelectTarget->Layout();
211  bSizer12->Fit( m_wizPage3_SelectTarget );
212 
213  this->Centre( wxBOTH );
214 
215  for ( unsigned int i = 1; i < m_pages.GetCount(); i++ )
216  {
217  m_pages.Item( i )->SetPrev( m_pages.Item( i - 1 ) );
218  m_pages.Item( i - 1 )->SetNext( m_pages.Item( i ) );
219  }
220 
221  // Connect Events
222  this->Connect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnWizardFinished ) );
223  this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanged ) );
224  this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanging ) );
225  m_downloadDir->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnLocalFolderChange ), NULL, this );
226  m_btnBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnBrowseButtonClick ), NULL, this );
227  m_buttonDefault3DPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnDefault3DPathButtonClick ), NULL, this );
228  m_btnSelectAll3Dlibs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnSelectAll3Dlibs ), NULL, this );
229  m_btnUnselectAll3Dlibs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnUnselectAll3Dlibs ), NULL, this );
230  m_searchCtrl3Dlibs->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnChangeSearch ), NULL, this );
231  m_gridLibReview->Connect( wxEVT_SIZE, wxSizeEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnGridLibReviewSize ), NULL, this );
232 }
233 
235 {
236  // Disconnect Events
237  this->Disconnect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnWizardFinished ) );
238  this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanged ) );
239  this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanging ) );
240  m_downloadDir->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnLocalFolderChange ), NULL, this );
241  m_btnBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnBrowseButtonClick ), NULL, this );
242  m_buttonDefault3DPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnDefault3DPathButtonClick ), NULL, this );
243  m_btnSelectAll3Dlibs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnSelectAll3Dlibs ), NULL, this );
244  m_btnUnselectAll3Dlibs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnUnselectAll3Dlibs ), NULL, this );
245  m_searchCtrl3Dlibs->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnChangeSearch ), NULL, this );
246  m_gridLibReview->Disconnect( wxEVT_SIZE, wxSizeEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnGridLibReviewSize ), NULL, this );
247 
248  m_pages.Clear();
249 }
virtual void OnUnselectAll3Dlibs(wxCommandEvent &event)
virtual void OnDefault3DPathButtonClick(wxCommandEvent &event)
virtual void OnGridLibReviewSize(wxSizeEvent &event)
virtual void OnLocalFolderChange(wxCommandEvent &event)
virtual void OnWizardFinished(wxWizardEvent &event)
virtual void OnSelectAll3Dlibs(wxCommandEvent &event)
virtual void OnChangeSearch(wxCommandEvent &event)
virtual void OnPageChanged(wxWizardEvent &event)
virtual void OnPageChanging(wxWizardEvent &event)
virtual void OnBrowseButtonClick(wxCommandEvent &event)
WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Add 3D Shape 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)
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70