MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DrawModule

Method DrawModule

Source/EventCanvas.cpp:241–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void EventCanvas::DrawModule()
242{
243 if (Minimized() || IsVisible() == false)
244 return;
245
246 ofPushStyle();
247 ofFill();
248 for (int i = 0; i < mCanvas->GetNumVisibleRows(); ++i)
249 {
250 ofColor color = GetRowColor(i + mCanvas->GetRowOffset());
251 color.a = 50;
252 ofSetColor(color);
253
254 float boxHeight = (float(mCanvas->GetHeight()) / mCanvas->GetNumVisibleRows());
255 float y = mCanvas->GetPosition(true).y + i * boxHeight;
256 ofRect(mCanvas->GetPosition(true).x, y, mCanvas->GetWidth(), boxHeight);
257 }
258 ofPopStyle();
259
260 ofPushStyle();
261 ofSetColor(128, 128, 128);
262 mCanvas->Draw();
263 ofPopStyle();
264
265 mCanvasScrollbarHorizontal->Draw();
266
267 mCanvasControls->Draw();
268 mQuantizeButton->Draw();
269 mNumMeasuresEntry->Draw();
270 mIntervalSelector->Draw();
271 mRecordCheckbox->Draw();
272
273 ofRectangle canvasRect = mCanvas->GetRect(true);
274 for (int i = 0; i < mControlCables.size(); ++i)
275 {
276 if (mCanvas->IsRowVisible(i))
277 {
278 mControlCables[i]->SetManualPosition(GetRect().width, canvasRect.y + (canvasRect.height / mCanvas->GetNumVisibleRows()) * (i - mCanvas->GetRowOffset() + .5f));
279 mControlCables[i]->SetEnabled(true);
280 }
281 else
282 {
283 mControlCables[i]->SetEnabled(false);
284 }
285 }
286}
287
288void EventCanvas::SyncControlCablesToCanvas()
289{

Callers

nothing calls this directly

Calls 15

ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
GetNumVisibleRowsMethod · 0.80
GetRowOffsetMethod · 0.80
sizeMethod · 0.80
IsRowVisibleMethod · 0.80
SetManualPositionMethod · 0.80
GetHeightMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected