MCPcopy Create free account
hub / github.com/audacity/audacity / ReCreateButtons

Method ReCreateButtons

src/AdornedRulerPanel.cpp:1381–1421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1379}
1380
1381void AdornedRulerPanel::ReCreateButtons()
1382{
1383 // TODO: Should we do this to destroy the grabber??
1384 // Get rid of any children we may have
1385 // DestroyChildren();
1386
1387 ToolBar::MakeButtonBackgroundsSmall();
1388 SetBackgroundColour(GetBackgroundColour());
1389
1390 for (auto & button : mButtons) {
1391 if (button)
1392 button->Destroy();
1393 button = nullptr;
1394 }
1395
1396 size_t iButton = 0;
1397 // Make the short row of time ruler push buttons.
1398 // Don't bother with sizers. Their sizes and positions are fixed.
1399 // Add a grabber converted to a spacer.
1400 // This makes it visually clearer that the button is a button.
1401
1402 wxPoint position( 12, 0 );
1403
1404 position.x = 12;
1405
1406 auto size = theTheme.ImageSize( bmpRecoloredUpSmall );
1407 size.y = std::min(size.y, GetRulerHeight(false));
1408
1409 const auto button = ToolBar::MakeButton(
1410 this,
1411 bmpRecoloredUpSmall, bmpRecoloredDownSmall,
1412 bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
1413 bmpCogwheel, bmpCogwheel, bmpCogwheel,
1414 OnTogglePinnedStateID, position, true, size
1415 );
1416
1417 position.x += size.GetWidth();
1418 mButtons[iButton++] = button;
1419
1420 UpdateButtonStates();
1421}
1422
1423void AdornedRulerPanel::InvalidateRuler()
1424{

Callers

nothing calls this directly

Calls 5

MakeButtonFunction · 0.85
ImageSizeMethod · 0.80
minFunction · 0.50
DestroyMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected