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.

54 lines
2.0KB

  1. #include "../JuceLibraryCode/JuceHeader.h"
  2. #include "MainComponent.h"
  3. //==============================================================================
  4. class BlocksInfoApplication : public JUCEApplication
  5. {
  6. public:
  7. //==============================================================================
  8. BlocksInfoApplication() {}
  9. const String getApplicationName() override { return ProjectInfo::projectName; }
  10. const String getApplicationVersion() override { return ProjectInfo::versionString; }
  11. //==============================================================================
  12. void initialise (const String& /*commandLine*/) override { mainWindow = new MainWindow (getApplicationName()); }
  13. void shutdown() override { mainWindow = nullptr; }
  14. //==============================================================================
  15. class MainWindow : public DocumentWindow
  16. {
  17. public:
  18. MainWindow (String name) : DocumentWindow (name,
  19. Colours::lightgrey,
  20. DocumentWindow::allButtons)
  21. {
  22. setUsingNativeTitleBar (true);
  23. setContentOwned (new MainComponent(), true);
  24. centreWithSize (getWidth(), getHeight());
  25. setResizable (true, true);
  26. setVisible (true);
  27. }
  28. void closeButtonPressed() override
  29. {
  30. JUCEApplication::getInstance()->systemRequestedQuit();
  31. }
  32. private:
  33. TooltipWindow tooltipWindow;
  34. //==============================================================================
  35. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
  36. };
  37. private:
  38. ScopedPointer<MainWindow> mainWindow;
  39. };
  40. //==============================================================================
  41. START_JUCE_APPLICATION (BlocksInfoApplication)