| 1379 | } |
| 1380 | |
| 1381 | void 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 | |
| 1423 | void AdornedRulerPanel::InvalidateRuler() |
| 1424 | { |
nothing calls this directly
no test coverage detected