KiCad PCB EDA Suite
rc_item.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) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
25#include <wx/wupdlock.h>
26#include <wx/dataview.h>
27#include <wx/settings.h>
28#include <widgets/ui_common.h>
29#include <marker_base.h>
30#include <eda_draw_frame.h>
31#include <rc_item.h>
32#include <eda_item.h>
33#include <base_units.h>
34
35#define WX_DATAVIEW_WINDOW_PADDING 6
36
37
39{
40 if( m_errorMessage.IsEmpty() )
41 return GetErrorText();
42 else
43 return m_errorMessage;
44}
45
46
47static wxString showCoord( UNITS_PROVIDER* aUnitsProvider, const VECTOR2I& aPos )
48{
49 return wxString::Format( wxT( "@(%s, %s)" ),
50 aUnitsProvider->MessageTextFromValue( aPos.x ),
51 aUnitsProvider->MessageTextFromValue( aPos.y ) );
52}
53
54
56{
57 m_ids.push_back( aItem->m_Uuid );
58}
59
60
61void RC_ITEM::SetItems( const EDA_ITEM* aItem, const EDA_ITEM* bItem,
62 const EDA_ITEM* cItem, const EDA_ITEM* dItem )
63{
64 m_ids.clear();
65
66 m_ids.push_back( aItem->m_Uuid );
67
68 if( bItem )
69 m_ids.push_back( bItem->m_Uuid );
70
71 if( cItem )
72 m_ids.push_back( cItem->m_Uuid );
73
74 if( dItem )
75 m_ids.push_back( dItem->m_Uuid );
76}
77
78
79wxString RC_ITEM::ShowReport( UNITS_PROVIDER* aUnitsProvider, SEVERITY aSeverity,
80 const std::map<KIID, EDA_ITEM*>& aItemMap ) const
81{
82 wxString severity;
83
84 switch( aSeverity )
85 {
86 case RPT_SEVERITY_ERROR: severity = wxT( "Severity: error" ); break;
87 case RPT_SEVERITY_WARNING: severity = wxT( "Severity: warning" ); break;
88 case RPT_SEVERITY_ACTION: severity = wxT( "Severity: action" ); break;
89 case RPT_SEVERITY_INFO: severity = wxT( "Severity: info" ); break;
90 case RPT_SEVERITY_EXCLUSION: severity = wxT( "Severity: exclusion" ); break;
91 case RPT_SEVERITY_DEBUG: severity = wxT( "Severity: debug" ); break;
92 default: ;
93 };
94
95 if( m_parent && m_parent->IsExcluded() )
96 severity += wxT( " (excluded)" );
97
98 EDA_ITEM* mainItem = nullptr;
99 EDA_ITEM* auxItem = nullptr;
100
101 auto ii = aItemMap.find( GetMainItemID() );
102
103 if( ii != aItemMap.end() )
104 mainItem = ii->second;
105
106 ii = aItemMap.find( GetAuxItemID() );
107
108 if( ii != aItemMap.end() )
109 auxItem = ii->second;
110
111 // Note: some customers machine-process these. So:
112 // 1) don't translate
113 // 2) try not to re-order or change syntax
114 // 3) report settings key (which should be more stable) in addition to message
115
116 if( mainItem && auxItem )
117 {
118 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n %s: %s\n" ),
122 severity,
123 showCoord( aUnitsProvider, mainItem->GetPosition()),
124 mainItem->GetItemDescription( aUnitsProvider ),
125 showCoord( aUnitsProvider, auxItem->GetPosition()),
126 auxItem->GetItemDescription( aUnitsProvider ) );
127 }
128 else if( mainItem )
129 {
130 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n" ),
134 severity,
135 showCoord( aUnitsProvider, mainItem->GetPosition()),
136 mainItem->GetItemDescription( aUnitsProvider ) );
137 }
138 else
139 {
140 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n" ),
144 severity );
145 }
146}
147
148
149KIID RC_TREE_MODEL::ToUUID( wxDataViewItem aItem )
150{
151 const RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aItem );
152
153 if( node && node->m_RcItem )
154 {
155 const std::shared_ptr<RC_ITEM> rc_item = node->m_RcItem;
156
157 switch( node->m_Type )
158 {
160 // rc_item->GetParent() can be null, if the parent is not existing
161 // when a RC item has no corresponding ERC/DRC marker
162 if( rc_item->GetParent() )
163 return rc_item->GetParent()->GetUUID();
164
165 break;
166
167 case RC_TREE_NODE::MAIN_ITEM: return rc_item->GetMainItemID();
168 case RC_TREE_NODE::AUX_ITEM: return rc_item->GetAuxItemID();
169 case RC_TREE_NODE::AUX_ITEM2: return rc_item->GetAuxItem2ID();
170 case RC_TREE_NODE::AUX_ITEM3: return rc_item->GetAuxItem3ID();
171 }
172 }
173
174 return niluuid;
175}
176
177
178RC_TREE_MODEL::RC_TREE_MODEL( EDA_DRAW_FRAME* aParentFrame, wxDataViewCtrl* aView ) :
179 m_editFrame( aParentFrame ),
180 m_view( aView ),
181 m_severities( 0 ),
182 m_rcItemsProvider( nullptr )
183{
184 m_view->GetMainWindow()->Connect( wxEVT_SIZE, wxSizeEventHandler( RC_TREE_MODEL::onSizeView ),
185 nullptr, this );
186}
187
188
190{
191 for( RC_TREE_NODE* topLevelNode : m_tree )
192 delete topLevelNode;
193}
194
195
196void RC_TREE_MODEL::rebuildModel( std::shared_ptr<RC_ITEMS_PROVIDER> aProvider, int aSeverities )
197{
198 wxWindowUpdateLocker updateLock( m_view );
199
200 std::shared_ptr<RC_ITEM> selectedRcItem = nullptr;
201
202 if( m_view )
203 {
204 RC_TREE_NODE* selectedNode = ToNode( m_view->GetSelection() );
205 selectedRcItem = selectedNode ? selectedNode->m_RcItem : nullptr;
206
207 // Even with the updateLock, wxWidgets sometimes ties its knickers in a knot trying
208 // to run a wxdataview_selection_changed_callback() on a row that has been deleted.
209 m_view->UnselectAll();
210 }
211
212 BeforeReset();
213
214 m_rcItemsProvider = aProvider;
215
216 if( aSeverities != m_severities )
217 m_severities = aSeverities;
218
220 m_rcItemsProvider->SetSeverities( m_severities );
221
222 for( RC_TREE_NODE* topLevelNode : m_tree )
223 delete topLevelNode;
224
225 m_tree.clear();
226
227 // wxDataView::ExpandAll() pukes with large lists
228 int count = 0;
229
231 count = std::min( 1000, m_rcItemsProvider->GetCount() );
232
233 for( int i = 0; i < count; ++i )
234 {
235 std::shared_ptr<RC_ITEM> rcItem = m_rcItemsProvider->GetItem( i );
236
237 m_tree.push_back( new RC_TREE_NODE( nullptr, rcItem, RC_TREE_NODE::MARKER ) );
238 RC_TREE_NODE* n = m_tree.back();
239
240 if( rcItem->GetMainItemID() != niluuid )
241 n->m_Children.push_back( new RC_TREE_NODE( n, rcItem, RC_TREE_NODE::MAIN_ITEM ) );
242
243 if( rcItem->GetAuxItemID() != niluuid )
244 n->m_Children.push_back( new RC_TREE_NODE( n, rcItem, RC_TREE_NODE::AUX_ITEM ) );
245
246 if( rcItem->GetAuxItem2ID() != niluuid )
247 n->m_Children.push_back( new RC_TREE_NODE( n, rcItem, RC_TREE_NODE::AUX_ITEM2 ) );
248
249 if( rcItem->GetAuxItem3ID() != niluuid )
250 n->m_Children.push_back( new RC_TREE_NODE( n, rcItem, RC_TREE_NODE::AUX_ITEM3 ) );
251 }
252
253 // Must be called after a significant change of items to force the
254 // wxDataViewModel to reread all of them, repopulating itself entirely.
255 AfterReset();
256
257#ifdef __WXGTK__
258 // The fastest method to update wxDataViewCtrl is to rebuild from
259 // scratch by calling Cleared(). Linux requires to reassociate model to
260 // display data, but Windows will create multiple associations.
261 // On MacOS, this crashes KiCad. See https://gitlab.com/kicad/code/kicad/issues/3666
262 // and https://gitlab.com/kicad/code/kicad/issues/3653
263 m_view->AssociateModel( this );
264#endif
265
266 m_view->ClearColumns();
267 int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
268 m_view->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, width );
269
270 ExpandAll();
271
272 // Most annoyingly wxWidgets won't tell us the scroll position (and no, all the usual
273 // routines don't work), so we can only restore the scroll position based on a selection.
274 if( selectedRcItem )
275 {
276 for( RC_TREE_NODE* candidate : m_tree )
277 {
278 if( candidate->m_RcItem == selectedRcItem )
279 {
280 m_view->Select( ToItem( candidate ) );
281 m_view->EnsureVisible( ToItem( candidate ) );
282 break;
283 }
284 }
285 }
286}
287
288
289void RC_TREE_MODEL::Update( std::shared_ptr<RC_ITEMS_PROVIDER> aProvider, int aSeverities )
290{
291 rebuildModel( aProvider, aSeverities );
292}
293
294
296{
297 for( RC_TREE_NODE* topLevelNode : m_tree )
298 m_view->Expand( ToItem( topLevelNode ) );
299}
300
301
302bool RC_TREE_MODEL::IsContainer( wxDataViewItem const& aItem ) const
303{
304 if( ToNode( aItem ) == nullptr ) // must be tree root...
305 return true;
306 else
307 return ToNode( aItem )->m_Type == RC_TREE_NODE::MARKER;
308}
309
310
311wxDataViewItem RC_TREE_MODEL::GetParent( wxDataViewItem const& aItem ) const
312{
313 return ToItem( ToNode( aItem)->m_Parent );
314}
315
316
317unsigned int RC_TREE_MODEL::GetChildren( wxDataViewItem const& aItem,
318 wxDataViewItemArray& aChildren ) const
319{
320 const RC_TREE_NODE* node = ToNode( aItem );
321 const std::vector<RC_TREE_NODE*>& children = node ? node->m_Children : m_tree;
322
323 for( const RC_TREE_NODE* child: children )
324 aChildren.push_back( ToItem( child ) );
325
326 return children.size();
327}
328
329
330void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
331 wxDataViewItem const& aItem,
332 unsigned int aCol ) const
333{
334 const RC_TREE_NODE* node = ToNode( aItem );
335 const std::shared_ptr<RC_ITEM> rcItem = node->m_RcItem;
336
337 switch( node->m_Type )
338 {
340 {
341 wxString prefix;
342
343 if( rcItem->GetParent() )
344 {
345 SEVERITY severity = rcItem->GetParent()->GetSeverity();
346
347 if( severity == RPT_SEVERITY_EXCLUSION )
348 {
349 if( m_editFrame->GetSeverity( rcItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
350 prefix = _( "Excluded warning: " );
351 else
352 prefix = _( "Excluded error: " );
353 }
354 else if( severity == RPT_SEVERITY_WARNING )
355 {
356 prefix = _( "Warning: " );
357 }
358 else
359 {
360 prefix = _( "Error: " );
361 }
362 }
363
364 aVariant = prefix + rcItem->GetErrorMessage();
365 }
366 break;
367
369 if( rcItem->GetParent() && rcItem->GetParent()->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
370 {
371 aVariant = _( "Drawing Sheet" );
372 break;
373 }
374 else
375 {
376 EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetMainItemID() );
377 aVariant = item->GetItemDescription( m_editFrame );
378 }
379
380 break;
381
383 {
384 EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetAuxItemID() );
385 aVariant = item->GetItemDescription( m_editFrame );
386 }
387 break;
388
390 {
391 EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetAuxItem2ID() );
392 aVariant = item->GetItemDescription( m_editFrame );
393 }
394 break;
395
397 {
398 EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetAuxItem3ID() );
399 aVariant = item->GetItemDescription( m_editFrame );
400 }
401 break;
402 }
403}
404
405
406bool RC_TREE_MODEL::GetAttr( wxDataViewItem const& aItem,
407 unsigned int aCol,
408 wxDataViewItemAttr& aAttr ) const
409{
410 const RC_TREE_NODE* node = ToNode( aItem );
411 wxASSERT( node );
412
413 bool ret = false;
414 bool heading = node->m_Type == RC_TREE_NODE::MARKER;
415
416 if( heading )
417 {
418 aAttr.SetBold( true );
419 ret = true;
420 }
421
422 if( node->m_RcItem->GetParent()
423 && node->m_RcItem->GetParent()->GetSeverity() == RPT_SEVERITY_EXCLUSION )
424 {
425 wxColour textColour = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXTEXT );
426 double brightness = KIGFX::COLOR4D( textColour ).GetBrightness();
427
428 if( brightness > 0.5 )
429 {
430 int lightness = static_cast<int>( brightness * ( heading ? 50 : 60 ) );
431 aAttr.SetColour( textColour.ChangeLightness( lightness ) );
432 }
433 else
434 {
435 aAttr.SetColour( textColour.ChangeLightness( heading ? 170 : 165 ) );
436 }
437
438 aAttr.SetItalic( true ); // Strikethrough would be better, if wxWidgets supported it
439 ret = true;
440 }
441
442 return ret;
443}
444
445
447{
449 {
450 ValueChanged( aNode->m_Parent );
451 }
452
453 if( aNode->m_Type == RC_TREE_NODE::MARKER )
454 {
455 wxDataViewModel::ValueChanged( ToItem( aNode ), 0 );
456
457 for( const RC_TREE_NODE* child : aNode->m_Children )
458 wxDataViewModel::ValueChanged( ToItem( child ), 0 );
459 }
460}
461
462
464{
465 DeleteItems( true, true, aDeep );
466}
467
468
469void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, bool aDeep )
470{
471 RC_TREE_NODE* current_node = m_view ? ToNode( m_view->GetCurrentItem() ) : nullptr;
472 const std::shared_ptr<RC_ITEM> current_item = current_node ? current_node->m_RcItem : nullptr;
473
475 std::vector<RC_TREE_NODE*> to_delete;
476
477 if( aCurrentOnly && !current_item )
478 {
479 wxBell();
480 return;
481 }
482
483 int lastGood = -1;
484 bool itemDeleted = false;
485
486 if( m_view )
487 {
488 m_view->UnselectAll();
489 wxSafeYield();
490 m_view->Freeze();
491 }
492
493 if( !m_rcItemsProvider )
494 return;
495
496 for( int i = m_rcItemsProvider->GetCount() - 1; i >= 0; --i )
497 {
498 std::shared_ptr<RC_ITEM> rcItem = m_rcItemsProvider->GetItem( i );
499 MARKER_BASE* marker = rcItem->GetParent();
500 bool excluded = false;
501
502 if( marker && marker->GetSeverity() == RPT_SEVERITY_EXCLUSION )
503 excluded = true;
504
505 if( aCurrentOnly && itemDeleted && lastGood >= 0 )
506 break;
507
508 if( aCurrentOnly && rcItem != current_item )
509 {
510 lastGood = i;
511 continue;
512 }
513
514 if( excluded && !aIncludeExclusions )
515 continue;
516
517 if( i < (int) m_tree.size() ) // Careful; tree is truncated for large datasets
518 {
519 wxDataViewItem markerItem = ToItem( m_tree[i] );
520 wxDataViewItemArray childItems;
521 wxDataViewItem parentItem = ToItem( m_tree[i]->m_Parent );
522
523 for( RC_TREE_NODE* child : m_tree[i]->m_Children )
524 {
525 childItems.push_back( ToItem( child ) );
526 to_delete.push_back( child );
527 }
528
529 m_tree[i]->m_Children.clear();
530 ItemsDeleted( markerItem, childItems );
531
532 to_delete.push_back( m_tree[i] );
533 m_tree.erase( m_tree.begin() + i );
534 ItemDeleted( parentItem, markerItem );
535 }
536
537 // Only deep delete the current item here; others will be done by the caller, which
538 // can more efficiently delete all markers on the board.
539 m_rcItemsProvider->DeleteItem( i, aDeep && aCurrentOnly );
540
541 if( lastGood > i )
542 lastGood--;
543
544 itemDeleted = true;
545 }
546
547 if( m_view && aCurrentOnly && lastGood >= 0 )
548 m_view->Select( ToItem( m_tree[ lastGood ] ) );
549
550 for( RC_TREE_NODE* item : to_delete )
551 delete( item );
552
553 if( m_view )
554 m_view->Thaw();
555}
556
557
559{
560 RC_TREE_NODE* currentNode = ToNode( m_view->GetCurrentItem() );
561 RC_TREE_NODE* prevMarker = nullptr;
562
563 while( currentNode && currentNode->m_Type != RC_TREE_NODE::MARKER )
564 currentNode = currentNode->m_Parent;
565
566 for( RC_TREE_NODE* candidate : m_tree )
567 {
568 if( candidate == currentNode )
569 break;
570 else
571 prevMarker = candidate;
572 }
573
574 if( prevMarker )
575 m_view->Select( ToItem( prevMarker ) );
576}
577
578
580{
581 RC_TREE_NODE* currentNode = ToNode( m_view->GetCurrentItem() );
582
583 while( currentNode && currentNode->m_Type != RC_TREE_NODE::MARKER )
584 currentNode = currentNode->m_Parent;
585
586 RC_TREE_NODE* nextMarker = nullptr;
587 bool trigger = currentNode == nullptr;
588
589 for( RC_TREE_NODE* candidate : m_tree )
590 {
591 if( candidate == currentNode )
592 {
593 trigger = true;
594 }
595 else if( trigger )
596 {
597 nextMarker = candidate;
598 break;
599 }
600 }
601
602 if( nextMarker )
603 m_view->Select( ToItem( nextMarker ) );
604}
605
606
608{
609 for( RC_TREE_NODE* candidate : m_tree )
610 {
611 if( candidate->m_RcItem->GetParent() == aMarker )
612 {
613 m_view->Select( ToItem( candidate ) );
614 return;
615 }
616 }
617}
618
619
621{
622 for( RC_TREE_NODE* candidate : m_tree )
623 {
624 if( candidate->m_RcItem->GetParent() == aMarker )
625 {
626 m_view->EnsureVisible( ToItem( candidate ) );
627 return;
628 }
629 }
630}
631
632
633void RC_TREE_MODEL::onSizeView( wxSizeEvent& aEvent )
634{
635 int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
636
637 if( m_view->GetColumnCount() > 0 )
638 m_view->GetColumn( 0 )->SetWidth( width );
639
640 // Pass size event to other widgets
641 aEvent.Skip();
642}
virtual SEVERITY GetSeverity(int aErrorCode) const
The base class for create windows for drawing purpose.
virtual EDA_ITEM * GetItem(const KIID &aId) const
Fetch an item by KIID.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249
const KIID m_Uuid
Definition: eda_item.h:492
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const
Return a user-visible description string of this item.
Definition: eda_item.cpp:108
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:102
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
Definition: color4d.h:331
Definition: kiid.h:48
virtual SEVERITY GetSeverity() const
Definition: marker_base.h:100
bool IsExcluded() const
Definition: marker_base.h:97
@ MARKER_DRAWING_SHEET
Definition: marker_base.h:55
void AddItem(EDA_ITEM *aItem)
Definition: rc_item.cpp:55
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:169
KIIDS m_ids
Definition: rc_item.h:171
virtual KIID GetMainItemID() const
Definition: rc_item.h:117
virtual KIID GetAuxItemID() const
Definition: rc_item.h:118
wxString GetErrorText() const
Definition: rc_item.h:149
virtual wxString ShowReport(UNITS_PROVIDER *aUnitsProvider, SEVERITY aSeverity, const std::map< KIID, EDA_ITEM * > &aItemMap) const
Translate this object into a text string suitable for saving to disk in a report.
Definition: rc_item.cpp:79
virtual wxString GetErrorMessage() const
Definition: rc_item.cpp:38
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:166
wxString GetSettingsKey() const
Definition: rc_item.h:154
virtual wxString GetViolatingRuleDesc() const
Definition: rc_item.h:159
void SetItems(const KIIDS &aIds)
Definition: rc_item.h:99
void ExpandAll()
Definition: rc_item.cpp:295
void PrevMarker()
Definition: rc_item.cpp:558
void onSizeView(wxSizeEvent &aEvent)
Definition: rc_item.cpp:633
int m_severities
Definition: rc_item.h:280
void GetValue(wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override
Called by the wxDataView to fetch an item's value.
Definition: rc_item.cpp:330
std::vector< RC_TREE_NODE * > m_tree
Definition: rc_item.h:283
unsigned int GetChildren(wxDataViewItem const &aItem, wxDataViewItemArray &aChildren) const override
Definition: rc_item.cpp:317
EDA_DRAW_FRAME * m_editFrame
Definition: rc_item.h:278
static wxDataViewItem ToItem(RC_TREE_NODE const *aNode)
Definition: rc_item.h:204
void SelectMarker(const MARKER_BASE *aMarker)
Definition: rc_item.cpp:607
RC_TREE_MODEL(EDA_DRAW_FRAME *aParentFrame, wxDataViewCtrl *aView)
Definition: rc_item.cpp:178
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition: rc_item.h:209
void Update(std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities)
Definition: rc_item.cpp:289
bool GetAttr(wxDataViewItem const &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override
Called by the wxDataView to fetch an item's formatting.
Definition: rc_item.cpp:406
void DeleteItems(bool aCurrentOnly, bool aIncludeExclusions, bool aDeep)
Deletes the current item or all items.
Definition: rc_item.cpp:469
void DeleteCurrentItem(bool aDeep)
Definition: rc_item.cpp:463
wxDataViewItem GetParent(wxDataViewItem const &aItem) const override
Definition: rc_item.cpp:311
void CenterMarker(const MARKER_BASE *aMarker)
Definition: rc_item.cpp:620
static KIID ToUUID(wxDataViewItem aItem)
Definition: rc_item.cpp:149
wxDataViewCtrl * m_view
Definition: rc_item.h:279
std::shared_ptr< RC_ITEMS_PROVIDER > m_rcItemsProvider
Definition: rc_item.h:281
void NextMarker()
Definition: rc_item.cpp:579
void ValueChanged(const RC_TREE_NODE *aNode)
Definition: rc_item.cpp:446
bool IsContainer(wxDataViewItem const &aItem) const override
Definition: rc_item.cpp:302
void rebuildModel(std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities)
Definition: rc_item.cpp:196
std::shared_ptr< RC_ITEM > m_RcItem
Definition: rc_item.h:194
RC_TREE_NODE * m_Parent
Definition: rc_item.h:196
std::vector< RC_TREE_NODE * > m_Children
Definition: rc_item.h:197
NODE_TYPE m_Type
Definition: rc_item.h:193
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
#define _(s)
KIID niluuid(0)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
static wxString showCoord(UNITS_PROVIDER *aUnitsProvider, const VECTOR2I &aPos)
Definition: rc_item.cpp:47
#define WX_DATAVIEW_WINDOW_PADDING
Definition: rc_item.cpp:35
SEVERITY
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_EXCLUSION
@ RPT_SEVERITY_DEBUG
@ RPT_SEVERITY_INFO
@ RPT_SEVERITY_ACTION
Functions to provide common constants and other functions to assist in making a consistent UI.