TipJar.h (849B)
1 #pragma once 2 3 #include <JuceHeader.h> 4 5 class TipJar : public ComboBox, 6 private InAppPurchases::Listener 7 { 8 public: 9 TipJar(); 10 ~TipJar() override; 11 12 void productsInfoReturned (const Array<InAppPurchases::Product>& products) override; 13 void doTipPurchase (const String& id); 14 void setDisconnectedMenu(); 15 16 private: 17 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TipJar) 18 }; 19 20 class TipJarItem : public foleys::GuiItem 21 { 22 public: 23 FOLEYS_DECLARE_GUI_FACTORY (TipJarItem) 24 25 TipJarItem (foleys::MagicGUIBuilder& builder, const ValueTree& node) : foleys::GuiItem (builder, node) 26 { 27 addAndMakeVisible (tipJar); 28 } 29 30 void update() override {} 31 32 Component* getWrappedComponent() override { return &tipJar; } 33 34 private: 35 TipJar tipJar; 36 37 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TipJarItem) 38 };