mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
56 lines
2.1 KiB
C++
56 lines
2.1 KiB
C++
#include "../JuceLibraryCode/JuceHeader.h"
|
|
#include "MainComponent.h"
|
|
|
|
|
|
//==============================================================================
|
|
class BlocksInfoApplication : public JUCEApplication
|
|
{
|
|
public:
|
|
//==============================================================================
|
|
BlocksInfoApplication() {}
|
|
|
|
const String getApplicationName() override { return ProjectInfo::projectName; }
|
|
const String getApplicationVersion() override { return ProjectInfo::versionString; }
|
|
|
|
//==============================================================================
|
|
void initialise (const String& /*commandLine*/) override { mainWindow = new MainWindow (getApplicationName()); }
|
|
void shutdown() override { mainWindow = nullptr; }
|
|
|
|
//==============================================================================
|
|
class MainWindow : public DocumentWindow
|
|
{
|
|
public:
|
|
MainWindow (String name) : DocumentWindow (name,
|
|
getLookAndFeel().findColour (ResizableWindow::backgroundColourId),
|
|
DocumentWindow::allButtons)
|
|
{
|
|
setUsingNativeTitleBar (true);
|
|
setContentOwned (new MainComponent(), true);
|
|
|
|
centreWithSize (getWidth(), getHeight());
|
|
setResizable (true, true);
|
|
setVisible (true);
|
|
|
|
#if JUCE_IOS
|
|
setFullScreen (true);
|
|
#endif
|
|
}
|
|
|
|
void closeButtonPressed() override
|
|
{
|
|
JUCEApplication::getInstance()->systemRequestedQuit();
|
|
}
|
|
|
|
private:
|
|
TooltipWindow tooltipWindow;
|
|
|
|
//==============================================================================
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
|
|
};
|
|
|
|
private:
|
|
ScopedPointer<MainWindow> mainWindow;
|
|
};
|
|
|
|
//==============================================================================
|
|
START_JUCE_APPLICATION (BlocksInfoApplication)
|