The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. class EULADialogue : public AlertWindow
  19. {
  20. public:
  21. EULADialogue()
  22. : AlertWindow ("End User Licence Agreement",
  23. "Please accept the End User Licence Agreement to run the Projucer.",
  24. AlertWindow::NoIcon,
  25. nullptr)
  26. {
  27. setColour (AlertWindow::backgroundColourId, ProjucerDialogLookAndFeel::getBackgroundColour());
  28. setColour (AlertWindow::textColourId, ProjucerDialogLookAndFeel::getBrightButtonColour());
  29. setLookAndFeel (&lookAndFeel);
  30. addButton ("Accept", EULADialogue::accepted);
  31. addButton ("Decline", EULADialogue::declined);
  32. addCustomComponent (&component);
  33. }
  34. enum EULADialogueResult
  35. {
  36. accepted,
  37. declined
  38. };
  39. private:
  40. struct EULADialogueComponent : public Component
  41. {
  42. EULADialogueComponent()
  43. {
  44. setSize (700, 550);
  45. editor.setSize (getWidth(), getHeight() - 50);
  46. editor.setReadOnly (true);
  47. editor.setCaretVisible (false);
  48. editor.setMultiLine (true, true);
  49. editor.setScrollbarsShown (true);
  50. editor.setFont (Font (Font::getDefaultMonospacedFontName(), 13.0f, Font::plain));
  51. editor.setText (String (BinaryData::projucer_EULA_txt));
  52. addAndMakeVisible (editor);
  53. }
  54. TextEditor editor;
  55. };
  56. EULADialogueComponent component;
  57. ProjucerDialogLookAndFeel lookAndFeel;
  58. };