MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / DrawHeader

Method DrawHeader

Source/PatternEditor.cpp:1451–1562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449}
1450
1451void CPatternEditor::DrawHeader(CDC &DC)
1452{
1453 // Draw the pattern header (channel names, meters...)
1454
1455 const COLORREF TEXT_COLOR = 0x404040;
1456
1457 CPoint ArrowPoints[3];
1458
1459 CBrush HoverBrush((COLORREF)0xFFFFFF);
1460 CBrush BlackBrush((COLORREF)0x505050);
1461 CPen HoverPen(PS_SOLID, 1, (COLORREF)0x80A080);
1462 CPen BlackPen(PS_SOLID, 1, (COLORREF)0x808080);
1463
1464 unsigned int Offset = m_iRowColumnWidth;
1465
1466 CSongView *pSongView = m_pView->GetSongView(); // // //
1467 auto *pSCS = FTEnv.GetSoundChipService();
1468
1469 CFont *pOldFont = DC.SelectObject(&m_fontHeader);
1470
1471 DC.SetBkMode(TRANSPARENT);
1472
1473 // Channel header background
1474 GradientRectTriple(DC, 0, HEADER_CHAN_START, m_iWinWidth, HEADER_CHAN_HEIGHT,
1475 m_colHead1, m_colHead2, m_pView->GetEditMode() ? m_colHead4 : m_colHead3); // // //
1476
1477 // Corner box
1478 DC.Draw3dRect(0, HEADER_CHAN_START, m_iRowColumnWidth, HEADER_CHAN_HEIGHT, STATIC_COLOR_SCHEME.FRAME_LIGHT, STATIC_COLOR_SCHEME.FRAME_DARK);
1479
1480 for (int i = 0; i < m_iChannelsVisible; ++i) {
1481 const int Channel = i + m_iFirstChannel;
1482 stChannelID ch = pSongView->GetChannelOrder().TranslateChannel(Channel);
1483 const bool bMuted = m_pView->IsChannelMuted(ch);
1484 const bool Pushed = bMuted || (m_iChannelPushed == Channel) && m_bChannelPushed;
1485
1486 // Frame
1487 if (Pushed) {
1488 GradientRectTriple(DC, Offset, HEADER_CHAN_START, m_iChannelWidths[Channel], HEADER_CHAN_HEIGHT,
1489 m_colHead1, m_colHead1, m_pView->GetEditMode() ? m_colHead4 : m_colHead3);
1490 DC.Draw3dRect(Offset, HEADER_CHAN_START, m_iChannelWidths[Channel], HEADER_CHAN_HEIGHT, BLEND(STATIC_COLOR_SCHEME.FRAME_LIGHT, STATIC_COLOR_SCHEME.FRAME_DARK, .5), STATIC_COLOR_SCHEME.FRAME_DARK);
1491 }
1492 else {
1493 if (ch == FTEnv.GetSoundGenerator()->GetRecordChannel()) // // //
1494 GradientRectTriple(DC, Offset, HEADER_CHAN_START, m_iChannelWidths[Channel], HEADER_CHAN_HEIGHT,
1495 m_colHead1, m_colHead2, m_colHead5);
1496 DC.Draw3dRect(Offset, HEADER_CHAN_START, m_iChannelWidths[Channel], HEADER_CHAN_HEIGHT, STATIC_COLOR_SCHEME.FRAME_LIGHT, STATIC_COLOR_SCHEME.FRAME_DARK);
1497 }
1498
1499 // Text
1500 auto pChanName = (m_bCompactMode && m_iCharWidth < 6) ? L"" :
1501 conv::to_wide((m_bCompactMode || m_iCharWidth < 9) ? pSCS->GetChannelShortName(ch) : pSCS->GetChannelFullName(ch)); // // //
1502
1503 COLORREF HeadTextCol = bMuted ? STATIC_COLOR_SCHEME.CHANNEL_MUTED : STATIC_COLOR_SCHEME.CHANNEL_NORMAL;
1504
1505 // Shadow
1506 if (m_bCompactMode) // // //
1507 DC.SetTextAlign(TA_CENTER);
1508

Callers

nothing calls this directly

Calls 15

GradientRectTripleFunction · 0.85
BLENDFunction · 0.85
to_wideFunction · 0.85
MakeRGBFunction · 0.85
FormattedWFunction · 0.85
GetSongViewMethod · 0.80
GetSoundChipServiceMethod · 0.80
GetEditModeMethod · 0.80
TranslateChannelMethod · 0.45
IsChannelMutedMethod · 0.45
GetRecordChannelMethod · 0.45
GetSoundGeneratorMethod · 0.45

Tested by

no test coverage detected