MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / update

Function update

JUCE/modules/juce_gui_basics/widgets/juce_TableListBox.cpp:70–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 void update (int newRow, bool isNowSelected)
71 {
72 jassert (newRow >= 0);
73
74 if (newRow != row || isNowSelected != isSelected)
75 {
76 row = newRow;
77 isSelected = isNowSelected;
78 repaint();
79 }
80
81 auto* tableModel = owner.getModel();
82
83 if (tableModel != nullptr && row < owner.getNumRows())
84 {
85 const Identifier columnProperty ("_tableColumnId");
86 auto numColumns = owner.getHeader().getNumColumns (true);
87
88 for (int i = 0; i < numColumns; ++i)
89 {
90 auto columnId = owner.getHeader().getColumnIdOfIndex (i, true);
91 auto* comp = columnComponents[i];
92
93 if (comp != nullptr && columnId != static_cast<int> (comp->getProperties() [columnProperty]))
94 {
95 columnComponents.set (i, nullptr);
96 comp = nullptr;
97 }
98
99 comp = tableModel->refreshComponentForCell (row, columnId, isSelected, comp);
100 columnComponents.set (i, comp, false);
101
102 if (comp != nullptr)
103 {
104 comp->getProperties().set (columnProperty, columnId);
105
106 addAndMakeVisible (comp);
107 resizeCustomComp (i);
108 }
109 }
110
111 columnComponents.removeRange (numColumns, columnComponents.size());
112 }
113 else
114 {
115 columnComponents.clear();
116 }
117 }
118
119 void resized() override
120 {

Callers

nothing calls this directly

Calls 13

resizeCustomCompFunction · 0.85
getHeaderMethod · 0.80
getColumnIdOfIndexMethod · 0.80
getPropertiesMethod · 0.80
repaintFunction · 0.50
getModelMethod · 0.45
getNumRowsMethod · 0.45
getNumColumnsMethod · 0.45
setMethod · 0.45
removeRangeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected