KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_properties_3d_model.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2015 Dick Hollenbeck, [email protected]
6 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
28
31#include <env_vars.h>
32#include <bitmaps.h>
35#include <widgets/wx_grid.h>
37#include <footprint.h>
38#include <fp_lib_table.h>
39#include <footprint.h>
43#include "filename_resolver.h"
44#include <pgm_base.h>
45#include <kiplatform/ui.h>
50#include <project_pcb.h>
51
52#include <wx/defs.h>
53#include <wx/msgdlg.h>
54
56{
59 COL_SHOWN = 2
60};
61
62wxDEFINE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
63
65 FOOTPRINT* aFootprint,
66 DIALOG_SHIM* aDialogParent,
67 PANEL_EMBEDDED_FILES* aFilesPanel,
68 wxWindow* aParent, wxWindowID aId,
69 const wxPoint& aPos,
70 const wxSize& aSize, long aStyle,
71 const wxString& aName ) :
72 PANEL_FP_PROPERTIES_3D_MODEL_BASE( aParent, aId, aPos, aSize, aStyle, aName ),
73 m_parentDialog( aDialogParent ),
74 m_frame( aFrame ),
75 m_footprint( aFootprint ),
76 m_filesPanel( aFilesPanel ),
77 m_inSelect( false )
78{
79 m_splitter1->SetSashPosition( FromDIP( m_splitter1->GetSashPosition() ) );
80 m_splitter1->SetMinimumPaneSize( FromDIP( m_splitter1->GetMinimumPaneSize() ) );
81
82 m_modelsGrid->SetDefaultRowSize( m_modelsGrid->GetDefaultRowSize() + 4 );
83
84 GRID_TRICKS* trick = new GRID_TRICKS( m_modelsGrid, [this]( wxCommandEvent& aEvent )
85 {
86 OnAdd3DRow( aEvent );
87 } );
89
90 m_modelsGrid->PushEventHandler( trick );
91
92 // Get the last 3D directory
94 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
95
96 if( cfg->m_lastFootprint3dDir.IsEmpty() )
97 {
98 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ),
100 }
101
102 // Icon showing warning/error information
103 wxGridCellAttr* attr = new wxGridCellAttr;
104 attr->SetReadOnly();
105 m_modelsGrid->SetColAttr( COL_PROBLEM, attr );
106
107 // Filename
108 attr = new wxGridCellAttr;
110 &cfg->m_lastFootprint3dDir, wxT( "*.*" ), true,
111 m_frame->Prj().GetProjectPath() ) );
112 m_modelsGrid->SetColAttr( COL_FILENAME, attr );
113
114 // Show checkbox
115 attr = new wxGridCellAttr;
116 attr->SetRenderer( new wxGridCellBoolRenderer() );
117 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
118 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
119 m_modelsGrid->SetColAttr( COL_SHOWN, attr );
120 m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );
121
123
126
127 m_LowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
128
129 // Configure button logos
130 m_button3DShapeAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
131 m_button3DShapeBrowse->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
132 m_button3DShapeRemove->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
133
134 Bind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
136 this );
137}
138
139
141{
142 // Delete the GRID_TRICKS.
143 m_modelsGrid->PopEventHandler( true );
144
145 // Unbind OnShowEvent to prevent unnecessary event handling.
146 Unbind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
147
148 // free the memory used by all models, otherwise models which were
149 // browsed but not used would consume memory
151
152 delete m_previewPane;
153}
154
155
157{
159 return true;
160}
161
162
164{
166}
167
168
170{
171 wxString default_path;
172 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &default_path );
173
174#ifdef __WINDOWS__
175 default_path.Replace( wxT( "/" ), wxT( "\\" ) );
176#endif
177
178 m_shapes3D_list.clear();
180
181 wxString origPath, alias, shortPath;
183
184 for( const FP_3DMODEL& model : m_footprint->Models() )
185 {
186 m_shapes3D_list.push_back( model );
187 origPath = model.m_Filename;
188
189 if( res && res->SplitAlias( origPath, alias, shortPath ) )
190 origPath = alias + wxT( ":" ) + shortPath;
191
192 m_modelsGrid->AppendRows( 1 );
193 int row = m_modelsGrid->GetNumberRows() - 1;
194 m_modelsGrid->SetCellValue( row, COL_FILENAME, origPath );
195 m_modelsGrid->SetCellValue( row, COL_SHOWN, model.m_Show ? wxT( "1" ) : wxT( "0" ) );
196
197 // Must be after the filename is set
199 }
200
201 select3DModel( 0 );
202
204 m_modelsGrid->SetColSize( COL_SHOWN, m_modelsGrid->GetVisibleWidth( COL_SHOWN, true, false ) );
205
206 Layout();
207}
208
209
211{
212 m_inSelect = true;
213
214 aModelIdx = std::max( 0, aModelIdx );
215 aModelIdx = std::min( aModelIdx, m_modelsGrid->GetNumberRows() - 1 );
216
217 if( m_modelsGrid->GetNumberRows() )
218 {
219 m_modelsGrid->SelectRow( aModelIdx );
220 m_modelsGrid->SetGridCursor( aModelIdx, COL_FILENAME );
221 }
222
223 m_previewPane->SetSelectedModel( aModelIdx );
224
225 m_inSelect = false;
226}
227
228
230{
231 if( !m_inSelect )
232 select3DModel( aEvent.GetRow() );
233}
234
235
237{
238 if( aEvent.GetCol() == COL_FILENAME )
239 {
240 bool hasAlias = false;
242 wxString filename = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_FILENAME );
243
244 // Perform cleanup and validation on the filename if it isn't empty
245 if( !filename.empty() )
246 {
247 filename.Replace( wxT( "\n" ), wxT( "" ) );
248 filename.Replace( wxT( "\r" ), wxT( "" ) );
249 filename.Replace( wxT( "\t" ), wxT( "" ) );
250
251 res->ValidateFileName( filename, hasAlias );
252
253 // If the user has specified an alias in the name then prepend ':'
254 if( hasAlias )
255 filename.insert( 0, wxT( ":" ) );
256
257#ifdef __WINDOWS__
258 // In KiCad files, filenames and paths are stored using Unix notation
259 filename.Replace( wxT( "\\" ), wxT( "/" ) );
260#endif
261
262 // Update the grid with the modified filename
263 m_modelsGrid->SetCellValue( aEvent.GetRow(), COL_FILENAME, filename );
264 }
265
266 // Save the filename in the 3D shapes table
267 m_shapes3D_list[ aEvent.GetRow() ].m_Filename = filename;
268
269 // Update the validation status
270 updateValidateStatus( aEvent.GetRow() );
271 }
272 else if( aEvent.GetCol() == COL_SHOWN )
273 {
274 wxString showValue = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_SHOWN );
275
276 m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT( "1" ) );
277 }
278
280 onModify();
281}
282
283
285{
287 return;
288
289 int idx = m_modelsGrid->GetGridCursorRow();
290
291 if( idx >= 0 && m_modelsGrid->GetNumberRows() && !m_shapes3D_list.empty() )
292 {
293 // Don't allow selection until we call select3DModel(), below. Otherwise wxWidgets
294 // has a tendency to get its knickers in a knot....
295 m_inSelect = true;
296
297 // Not all files are embedded but this will ignore the ones that are not
298 m_filesPanel->RemoveEmbeddedFile( m_shapes3D_list[ idx ].m_Filename );
299 m_shapes3D_list.erase( m_shapes3D_list.begin() + idx );
300 m_modelsGrid->DeleteRows( idx );
301
302 select3DModel( idx ); // will clamp idx within bounds
304 }
305
306 onModify();
307}
308
309
311{
313 return;
314
315 int selected = m_modelsGrid->GetGridCursorRow();
316
317 PROJECT& prj = m_frame->Prj();
318 FP_3DMODEL model;
321
322 wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
323 wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
324 int filter = 0;
325
326 // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the 3DMODEL_DIR environment
327 // variable and fall back to the project path if necessary.
328 if( initialpath.IsEmpty() )
329 {
330 if( !wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &initialpath )
331 || initialpath.IsEmpty() )
332 {
333 initialpath = prj.GetProjectPath();
334 }
335 }
336
337 if( !sidx.empty() )
338 {
339 long tmp;
340 sidx.ToLong( &tmp );
341
342 if( tmp > 0 && tmp <= INT_MAX )
343 filter = (int) tmp;
344 }
345
346
347 DIALOG_SELECT_3DMODEL dm( m_parentDialog, cache, &model, initialpath, filter );
348
349 // Use QuasiModal so that Configure3DPaths (and its help window) will work
350 int retval = dm.ShowQuasiModal();
351
352 if( retval != wxID_OK || model.m_Filename.empty() )
353 {
354 if( selected >= 0 )
355 {
356 select3DModel( selected );
357 updateValidateStatus( selected );
358 }
359
360 return;
361 }
362
363 if( dm.IsEmbedded3DModel() )
364 {
365 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
366 const FP_LIB_TABLE_ROW* fpRow = nullptr;
367
368 wxString footprintBasePath = wxEmptyString;
369
370 try
371 {
372 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
373
374 if( fpRow )
375 footprintBasePath = fpRow->GetFullURI( true );
376 }
377 catch( ... )
378 {
379 // if libraryName is not found in table, do nothing
380 }
381
382
383 wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, nullptr );
384 wxFileName fname( fullPath );
385
386 EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesPanel->AddEmbeddedFile( fname.GetFullPath() ); ;
387
388 if( !result )
389 {
390
391 wxString msg = wxString::Format( _( "Error adding 3D model" ) );
392 wxMessageBox( msg, _( "Error" ), wxICON_ERROR | wxOK, this );
393 return;
394 }
395
396 model.m_Filename = result->GetLink();
397 }
398
399
400 prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
401 sidx = wxString::Format( wxT( "%i" ), filter );
403
404 wxString alias;
405 wxString shortPath;
406 wxString filename = model.m_Filename;
407
408 if( res && res->SplitAlias( filename, alias, shortPath ) )
409 filename = alias + wxT( ":" ) + shortPath;
410
411#ifdef __WINDOWS__
412 // In KiCad files, filenames and paths are stored using Unix notation
413 model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
414#endif
415
416 model.m_Show = true;
417 m_shapes3D_list.push_back( model );
418
419 int idx = m_modelsGrid->GetNumberRows();
420 m_modelsGrid->AppendRows( 1 );
421 m_modelsGrid->SetCellValue( idx, COL_FILENAME, filename );
422 m_modelsGrid->SetCellValue( idx, COL_SHOWN, wxT( "1" ) );
423
424 select3DModel( idx );
426
428 onModify();
429}
430
431
433{
435 return;
436
437 FP_3DMODEL model;
438
439 model.m_Show = true;
440 m_shapes3D_list.push_back( model );
441
442 int row = m_modelsGrid->GetNumberRows();
443 m_modelsGrid->AppendRows( 1 );
444 m_modelsGrid->SetCellValue( row, COL_SHOWN, wxT( "1" ) );
445 m_modelsGrid->SetCellValue( row, COL_PROBLEM, "" );
446
447 select3DModel( row );
448
449 m_modelsGrid->SetFocus();
450 m_modelsGrid->MakeCellVisible( row, COL_FILENAME );
451 m_modelsGrid->SetGridCursor( row, COL_FILENAME );
452
453 m_modelsGrid->EnableCellEditControl( true );
454 m_modelsGrid->ShowCellEditControl();
455
457 onModify();
458}
459
460
462{
463 int icon = 0;
464 wxString errStr;
465
466 switch( validateModelExists( m_modelsGrid->GetCellValue( aRow, COL_FILENAME) ) )
467 {
468 case MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR:
469 icon = 0;
470 errStr = "";
471 break;
472
473 case MODEL_VALIDATE_ERRORS::NO_FILENAME:
474 icon = wxICON_WARNING;
475 errStr = _( "No filename entered" );
476 break;
477
478 case MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME:
479 icon = wxICON_ERROR;
480 errStr = _( "Illegal filename" );
481 break;
482
483 case MODEL_VALIDATE_ERRORS::RESOLVE_FAIL:
484 icon = wxICON_ERROR;
485 errStr = _( "File not found" );
486 break;
487
488 case MODEL_VALIDATE_ERRORS::OPEN_FAIL:
489 icon = wxICON_ERROR;
490 errStr = _( "Unable to open file" );
491 break;
492
493 default:
494 icon = wxICON_ERROR;
495 errStr = _( "Unknown error" );
496 break;
497 }
498
499 m_modelsGrid->SetCellValue( aRow, COL_PROBLEM, errStr );
500 m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM,
501 new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
502}
503
504
506{
507 if( aFilename.empty() )
508 return MODEL_VALIDATE_ERRORS::NO_FILENAME;
509
510 bool hasAlias = false;
512
513 if( !resolv )
514 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
515
516 if( !resolv->ValidateFileName( aFilename, hasAlias ) )
517 return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME;
518
519 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
520 const FP_LIB_TABLE_ROW* fpRow = nullptr;
521 try
522 {
523 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
524 }
525 catch( ... )
526 {
527 // if libraryName is not found in table, do nothing
528 }
529
530 wxString footprintBasePath = wxEmptyString;
531
532 if( fpRow )
533 footprintBasePath = fpRow->GetFullURI( true );
534
535 wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, m_footprint );
536
537 if( fullPath.IsEmpty() )
538 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
539
540 if( !wxFileName::IsFileReadable( fullPath ) )
541 return MODEL_VALIDATE_ERRORS::OPEN_FAIL;
542
543 return MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR;
544}
545
546
547void PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath( wxCommandEvent& event )
548{
549 DIALOG_CONFIGURE_PATHS dlg( this );
550
551 if( dlg.ShowQuasiModal() == wxID_OK )
553}
554
555
557{
558 // Account for scroll bars
559 int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x;
560
561 int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN )
562 - m_modelsGrid->GetColSize( COL_PROBLEM );
563
564 if( width > 0 )
565 m_modelsGrid->SetColSize( COL_FILENAME, width );
566}
567
568
570{
572
573 event.Skip();
574}
575
576
577void PANEL_FP_PROPERTIES_3D_MODEL::OnUpdateUI( wxUpdateUIEvent& event )
578{
579 m_button3DShapeRemove->Enable( m_modelsGrid->GetNumberRows() > 0 );
580}
581
582
584{
585 if( DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( wxGetTopLevelParent( this ) ) )
586 dlg->OnModify();
587}
588
589
591{
592 postCustomPanelShownEventWithPredicate( static_cast<int>( aEvent.IsShown() ) );
593 aEvent.Skip();
594}
595
596
598{
600 && m_previewPane->IsShownOnScreen() );
601 aEvent.Skip();
602}
603
604
606{
607 wxCommandEvent event( wxCUSTOM_PANEL_SHOWN_EVENT );
608 event.SetEventObject( m_previewPane );
609 event.SetInt( static_cast<int>( predicate ) );
610 m_previewPane->ProcessWindowEvent( event );
611}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:52
int ShowQuasiModal()
Provide an extensible class to resolve 3D model paths.
bool ValidateFileName(const wxString &aFileName, bool &hasAlias) const
Return true if the given path is a valid aliased relative path.
void SetProgramBase(PGM_BASE *aBase)
Set a pointer to the application's PGM_BASE instance used to extract the local env vars.
wxString ResolvePath(const wxString &aFileName, const wxString &aWorkingPath, const EMBEDDED_FILES *aFiles)
Determine the full path of the given file name.
const LIB_ID & GetFPID() const
Definition: footprint.h:247
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:219
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:107
bool m_Show
Include model in rendering.
Definition: footprint.h:108
Hold a record identifying a library accessed by the appropriate footprint library #PLUGIN object in t...
Definition: fp_lib_table.h:42
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fall back table frag...
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
void SetTooltipEnable(int aCol, bool aEnable=true)
Enable the tooltip for a column.
Definition: grid_tricks.h:75
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
bool RemoveEmbeddedFile(const wxString &aFileName)
EMBEDDED_FILES::EMBEDDED_FILE * AddEmbeddedFile(const wxString &aFileName)
Class PANEL_FP_PROPERTIES_3D_MODEL_BASE.
void OnUpdateUI(wxUpdateUIEvent &event) override
void Cfg3DPath(wxCommandEvent &event) override
void OnRemove3DModel(wxCommandEvent &event) override
virtual void onShowEvent(wxShowEvent &aEvent)
void On3DModelCellChanged(wxGridEvent &aEvent) override
virtual void onDialogActivateEvent(wxActivateEvent &aEvent)
void OnGridSize(wxSizeEvent &event) override
void postCustomPanelShownEventWithPredicate(bool predicate)
MODEL_VALIDATE_ERRORS validateModelExists(const wxString &aFilename)
void OnAdd3DModel(wxCommandEvent &event) override
void OnAdd3DRow(wxCommandEvent &event) override
std::vector< FP_3DMODEL > m_shapes3D_list
PANEL_FP_PROPERTIES_3D_MODEL(PCB_BASE_EDIT_FRAME *aFrame, FOOTPRINT *aFootprint, DIALOG_SHIM *aDialogParent, PANEL_EMBEDDED_FILES *aFilesPanel, wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
void On3DModelSelected(wxGridEvent &) override
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
wxString m_lastFootprint3dDir
Common, abstract interface for edit frames.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
Definition: project_pcb.cpp:37
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
Definition: project_pcb.cpp:77
static FILENAME_RESOLVER * Get3DFilenameResolver(PROJECT *aProject)
Accessor for 3D path resolver.
Container for project specific data.
Definition: project.h:64
@ VIEWER_3D_FILTER_INDEX
Definition: project.h:225
@ VIEWER_3D_PATH
Definition: project.h:224
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:146
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
Definition: project.cpp:318
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
Definition: project.cpp:329
Cache for storing the 3D shapes.
Definition: 3d_cache.h:55
void FlushCache(bool closePlugins=true)
Free all data in the cache and by default closes all plugins.
Definition: 3d_cache.cpp:524
FILENAME_RESOLVER * GetResolver() noexcept
Definition: 3d_cache.cpp:512
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
bool Enable(bool aEnable=true) override
void SetBitmap(const wxBitmapBundle &aBmp)
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculate the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:776
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Definition: wx_grid.h:193
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:644
#define _(s)
Declaration of the eda_3d_viewer class.
Functions related to environment variables, including help functions.
KICOMMON_API wxString GetVersionedEnvVarName(const wxString &aBaseName)
Construct a versioned environment variable based on this KiCad major version.
Definition: env_vars.cpp:74
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: wxgtk/ui.cpp:252
wxDEFINE_EVENT(wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent)
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
VECTOR3I res