Tchick/Source/MesurePanel.h
2026-02-04 11:51:22 +01:00

62 lines
2.0 KiB
C++

#pragma once
/*
==============================================================================
Copyright 2022 Nicolas Chambert
This program is free software : you can redistribute itand /or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see < http://www.gnu.org/licenses/>.
==============================================================================
*/
/*
==============================================================================
Gestion du nombre de temps par mesure.
==============================================================================
*/
#include <JuceHeader.h>
// Surcharge les boutons pour un rond plein ou vide
struct RoundCBLookAndFeel : public juce::LookAndFeel_V4
{
void drawToggleButton(juce::Graphics& g, juce::ToggleButton& button,
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
void drawTickBox(juce::Graphics& g, juce::Component& component,
float x, float y, float w, float h,
bool ticked, bool isEnabled,
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
};
// Panneau d'affichage de la mesure en cours
struct MesurePanel : public juce::Component
{
explicit MesurePanel(juce::Colour c);
~MesurePanel();
// Méthode de surcharge JUCE
void paint(juce::Graphics& g) override;
void resized() override;
// méthodes internes
void update(int nb, int cur);
// composants graphiques
juce::Colour backgroundColour;
juce::OwnedArray<juce::ToggleButton> buttons;
std::unique_ptr <RoundCBLookAndFeel> lef;
};