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_modelsGrid->SetDefaultRowSize( m_modelsGrid->GetDefaultRowSize() + 4 );
80
81 GRID_TRICKS* trick = new GRID_TRICKS( m_modelsGrid, [this]( wxCommandEvent& aEvent )
82 {
83 OnAdd3DRow( aEvent );
84 } );
86
87 m_modelsGrid->PushEventHandler( trick );
88
89 // Get the last 3D directory
91 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
92
93 if( cfg->m_lastFootprint3dDir.IsEmpty() )
94 {
95 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ),
97 }
98
99 // Icon showing warning/error information
100 wxGridCellAttr* attr = new wxGridCellAttr;
101 attr->SetReadOnly();
102 m_modelsGrid->SetColAttr( COL_PROBLEM, attr );
103
104 // Filename
105 attr = new wxGridCellAttr;
107 &cfg->m_lastFootprint3dDir, wxT( "*.*" ), true,
108 m_frame->Prj().GetProjectPath() ) );
109 m_modelsGrid->SetColAttr( COL_FILENAME, attr );
110
111 // Show checkbox
112 attr = new wxGridCellAttr;
113 attr->SetRenderer( new wxGridCellBoolRenderer() );
114 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
115 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
116 m_modelsGrid->SetColAttr( COL_SHOWN, attr );
117 m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );
118
120
123
124 m_LowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
125
126 // Configure button logos
127 m_button3DShapeAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
128 m_button3DShapeBrowse->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
129 m_button3DShapeRemove->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
130
131 Bind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
133 this );
134}
135
136
138{
139 // Delete the GRID_TRICKS.
140 m_modelsGrid->PopEventHandler( true );
141
142 // Unbind OnShowEvent to prevent unnecessary event handling.
143 Unbind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
144
145 // free the memory used by all models, otherwise models which were
146 // browsed but not used would consume memory
148
149 delete m_previewPane;
150}
151
152
154{
156 return true;
157}
158
159
161{
163}
164
165
167{
168 wxString default_path;
169 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &default_path );
170
171#ifdef __WINDOWS__
172 default_path.Replace( wxT( "/" ), wxT( "\\" ) );
173#endif
174
175 m_shapes3D_list.clear();
177
178 wxString origPath, alias, shortPath;
180
181 for( const FP_3DMODEL& model : m_footprint->Models() )
182 {
183 m_shapes3D_list.push_back( model );
184 origPath = model.m_Filename;
185
186 if( res && res->SplitAlias( origPath, alias, shortPath ) )
187 origPath = alias + wxT( ":" ) + shortPath;
188
189 m_modelsGrid->AppendRows( 1 );
190 int row = m_modelsGrid->GetNumberRows() - 1;
191 m_modelsGrid->SetCellValue( row, COL_FILENAME, origPath );
192 m_modelsGrid->SetCellValue( row, COL_SHOWN, model.m_Show ? wxT( "1" ) : wxT( "0" ) );
193
194 // Must be after the filename is set
196 }
197
198 select3DModel( 0 );
199
201 m_modelsGrid->SetColSize( COL_SHOWN, m_modelsGrid->GetVisibleWidth( COL_SHOWN, true, false ) );
202
203 Layout();
204}
205
206
208{
209 m_inSelect = true;
210
211 aModelIdx = std::max( 0, aModelIdx );
212 aModelIdx = std::min( aModelIdx, m_modelsGrid->GetNumberRows() - 1 );
213
214 if( m_modelsGrid->GetNumberRows() )
215 {
216 m_modelsGrid->SelectRow( aModelIdx );
217 m_modelsGrid->SetGridCursor( aModelIdx, COL_FILENAME );
218 }
219
220 m_previewPane->SetSelectedModel( aModelIdx );
221
222 m_inSelect = false;
223}
224
225
227{
228 if( !m_inSelect )
229 select3DModel( aEvent.GetRow() );
230}
231
232
234{
235 if( aEvent.GetCol() == COL_FILENAME )
236 {
237 bool hasAlias = false;
239 wxString filename = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_FILENAME );
240
241 // Perform cleanup and validation on the filename if it isn't empty
242 if( !filename.empty() )
243 {
244 filename.Replace( wxT( "\n" ), wxT( "" ) );
245 filename.Replace( wxT( "\r" ), wxT( "" ) );
246 filename.Replace( wxT( "\t" ), wxT( "" ) );
247
248 res->ValidateFileName( filename, hasAlias );
249
250 // If the user has specified an alias in the name then prepend ':'
251 if( hasAlias )
252 filename.insert( 0, wxT( ":" ) );
253
254#ifdef __WINDOWS__
255 // In KiCad files, filenames and paths are stored using Unix notation
256 filename.Replace( wxT( "\\" ), wxT( "/" ) );
257#endif
258
259 // Update the grid with the modified filename
260 m_modelsGrid->SetCellValue( aEvent.GetRow(), COL_FILENAME, filename );
261 }
262
263 // Save the filename in the 3D shapes table
264 m_shapes3D_list[ aEvent.GetRow() ].m_Filename = filename;
265
266 // Update the validation status
267 updateValidateStatus( aEvent.GetRow() );
268 }
269 else if( aEvent.GetCol() == COL_SHOWN )
270 {
271 wxString showValue = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_SHOWN );
272
273 m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT( "1" ) );
274 }
275
277 onModify();
278}
279
280
282{
284 return;
285
286 int idx = m_modelsGrid->GetGridCursorRow();
287
288 if( idx >= 0 && m_modelsGrid->GetNumberRows() && !m_shapes3D_list.empty() )
289 {
290 // Don't allow selection until we call select3DModel(), below. Otherwise wxWidgets
291 // has a tendency to get its knickers in a knot....
292 m_inSelect = true;
293
294 // Not all files are embedded but this will ignore the ones that are not
295 m_filesPanel->RemoveEmbeddedFile( m_shapes3D_list[ idx ].m_Filename );
296 m_shapes3D_list.erase( m_shapes3D_list.begin() + idx );
297 m_modelsGrid->DeleteRows( idx );
298
299 select3DModel( idx ); // will clamp idx within bounds
301 }
302
303 onModify();
304}
305
306
308{
310 return;
311
312 int selected = m_modelsGrid->GetGridCursorRow();
313
314 PROJECT& prj = m_frame->Prj();
315 FP_3DMODEL model;
318
319 wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
320 wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
321 int filter = 0;
322
323 // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the 3DMODEL_DIR environment
324 // variable and fall back to the project path if necessary.
325 if( initialpath.IsEmpty() )
326 {
327 if( !wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &initialpath )
328 || initialpath.IsEmpty() )
329 {
330 initialpath = prj.GetProjectPath();
331 }
332 }
333
334 if( !sidx.empty() )
335 {
336 long tmp;
337 sidx.ToLong( &tmp );
338
339 if( tmp > 0 && tmp <= INT_MAX )
340 filter = (int) tmp;
341 }
342
343
344 DIALOG_SELECT_3DMODEL dm( m_parentDialog, cache, &model, initialpath, filter );
345
346 // Use QuasiModal so that Configure3DPaths (and its help window) will work
347 int retval = dm.ShowQuasiModal();
348
349 if( retval != wxID_OK || model.m_Filename.empty() )
350 {
351 if( selected >= 0 )
352 {
353 select3DModel( selected );
354 updateValidateStatus( selected );
355 }
356
357 return;
358 }
359
360 if( dm.IsEmbedded3DModel() )
361 {
362 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
363 const FP_LIB_TABLE_ROW* fpRow = nullptr;
364
365 wxString footprintBasePath = wxEmptyString;
366
367 try
368 {
369 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
370
371 if( fpRow )
372 footprintBasePath = fpRow->GetFullURI( true );
373 }
374 catch( ... )
375 {
376 // if libraryName is not found in table, do nothing
377 }
378
379
380 wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, nullptr );
381 wxFileName fname( fullPath );
382
383 EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesPanel->AddEmbeddedFile( fname.GetFullPath() ); ;
384
385 if( !result )
386 {
387
388 wxString msg = wxString::Format( _( "Error adding 3D model" ) );
389 wxMessageBox( msg, _( "Error" ), wxICON_ERROR | wxOK, this );
390 return;
391 }
392
393 model.m_Filename = result->GetLink();
394 }
395
396
397 prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
398 sidx = wxString::Format( wxT( "%i" ), filter );
400
401 wxString alias;
402 wxString shortPath;
403 wxString filename = model.m_Filename;
404
405 if( res && res->SplitAlias( filename, alias, shortPath ) )
406 filename = alias + wxT( ":" ) + shortPath;
407
408#ifdef __WINDOWS__
409 // In KiCad files, filenames and paths are stored using Unix notation
410 model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
411#endif
412
413 model.m_Show = true;
414 m_shapes3D_list.push_back( model );
415
416 int idx = m_modelsGrid->GetNumberRows();
417 m_modelsGrid->AppendRows( 1 );
418 m_modelsGrid->SetCellValue( idx, COL_FILENAME, filename );
419 m_modelsGrid->SetCellValue( idx, COL_SHOWN, wxT( "1" ) );
420
421 select3DModel( idx );
423
425 onModify();
426}
427
428
430{
432 return;
433
434 FP_3DMODEL model;
435
436 model.m_Show = true;
437 m_shapes3D_list.push_back( model );
438
439 int row = m_modelsGrid->GetNumberRows();
440 m_modelsGrid->AppendRows( 1 );
441 m_modelsGrid->SetCellValue( row, COL_SHOWN, wxT( "1" ) );
442 m_modelsGrid->SetCellValue( row, COL_PROBLEM, "" );
443
444 select3DModel( row );
445
446 m_modelsGrid->SetFocus();
447 m_modelsGrid->MakeCellVisible( row, COL_FILENAME );
448 m_modelsGrid->SetGridCursor( row, COL_FILENAME );
449
450 m_modelsGrid->EnableCellEditControl( true );
451 m_modelsGrid->ShowCellEditControl();
452
454 onModify();
455}
456
457
459{
460 int icon = 0;
461 wxString errStr;
462
463 switch( validateModelExists( m_modelsGrid->GetCellValue( aRow, COL_FILENAME) ) )
464 {
465 case MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR:
466 icon = 0;
467 errStr = "";
468 break;
469
470 case MODEL_VALIDATE_ERRORS::NO_FILENAME:
471 icon = wxICON_WARNING;
472 errStr = _( "No filename entered" );
473 break;
474
475 case MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME:
476 icon = wxICON_ERROR;
477 errStr = _( "Illegal filename" );
478 break;
479
480 case MODEL_VALIDATE_ERRORS::RESOLVE_FAIL:
481 icon = wxICON_ERROR;
482 errStr = _( "File not found" );
483 break;
484
485 case MODEL_VALIDATE_ERRORS::OPEN_FAIL:
486 icon = wxICON_ERROR;
487 errStr = _( "Unable to open file" );
488 break;
489
490 default:
491 icon = wxICON_ERROR;
492 errStr = _( "Unknown error" );
493 break;
494 }
495
496 m_modelsGrid->SetCellValue( aRow, COL_PROBLEM, errStr );
497 m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM,
498 new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
499}
500
501
503{
504 if( aFilename.empty() )
505 return MODEL_VALIDATE_ERRORS::NO_FILENAME;
506
507 bool hasAlias = false;
509
510 if( !resolv )
511 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
512
513 if( !resolv->ValidateFileName( aFilename, hasAlias ) )
514 return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME;
515
516 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
517 const FP_LIB_TABLE_ROW* fpRow = nullptr;
518 try
519 {
520 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
521 }
522 catch( ... )
523 {
524 // if libraryName is not found in table, do nothing
525 }
526
527 wxString footprintBasePath = wxEmptyString;
528
529 if( fpRow )
530 footprintBasePath = fpRow->GetFullURI( true );
531
532 wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, m_footprint );
533
534 if( fullPath.IsEmpty() )
535 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
536
537 if( !wxFileName::IsFileReadable( fullPath ) )
538 return MODEL_VALIDATE_ERRORS::OPEN_FAIL;
539
540 return MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR;
541}
542
543
544void PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath( wxCommandEvent& event )
545{
546 DIALOG_CONFIGURE_PATHS dlg( this );
547
548 if( dlg.ShowQuasiModal() == wxID_OK )
550}
551
552
554{
555 // Account for scroll bars
556 int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x;
557
558 int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN )
559 - m_modelsGrid->GetColSize( COL_PROBLEM );
560
561 if( width > 0 )
562 m_modelsGrid->SetColSize( COL_FILENAME, width );
563}
564
565
567{
569
570 event.Skip();
571}
572
573
574void PANEL_FP_PROPERTIES_3D_MODEL::OnUpdateUI( wxUpdateUIEvent& event )
575{
576 m_button3DShapeRemove->Enable( m_modelsGrid->GetNumberRows() > 0 );
577}
578
579
581{
582 if( DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( wxGetTopLevelParent( this ) ) )
583 dlg->OnModify();
584}
585
586
588{
589 postCustomPanelShownEventWithPredicate( static_cast<int>( aEvent.IsShown() ) );
590 aEvent.Skip();
591}
592
593
595{
597 && m_previewPane->IsShownOnScreen() );
598 aEvent.Skip();
599}
600
601
603{
604 wxCommandEvent event( wxCUSTOM_PANEL_SHOWN_EVENT );
605 event.SetEventObject( m_previewPane );
606 event.SetInt( static_cast<int>( predicate ) );
607 m_previewPane->ProcessWindowEvent( event );
608}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
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:88
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:246
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:218
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:222
@ VIEWER_3D_PATH
Definition: project.h:221
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:778
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:646
#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