commit 20eeb9f0a9666a8cc1732fd37788b60c5767b989 Author: Jens Ahrensfeld Date: Fri Jan 9 19:07:03 2015 +0000 - initial version git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@122 b431acfa-c32f-4a4a-93f1-934dc6c82436 diff --git a/Source/Main.cpp b/Source/Main.cpp new file mode 100644 index 0000000..5cc0d31 --- /dev/null +++ b/Source/Main.cpp @@ -0,0 +1,99 @@ +/* + ============================================================================== + + This file was auto-generated by the Introjucer! + + It contains the basic startup code for a Juce application. + + ============================================================================== +*/ + +#include "../JuceLibraryCode/JuceHeader.h" +#include "MainComponent.h" + + +//============================================================================== +class FsTrackApplication : public JUCEApplication +{ +public: + //============================================================================== + FsTrackApplication() {} + + const String getApplicationName() override { return ProjectInfo::projectName; } + const String getApplicationVersion() override { return ProjectInfo::versionString; } + bool moreThanOneInstanceAllowed() override { return true; } + + //============================================================================== + void initialise (const String& commandLine) override + { + // This method is where you should put your application's initialisation code.. + + mainWindow = new MainWindow(); + } + + void shutdown() override + { + // Add your application's shutdown code here.. + + mainWindow = nullptr; // (deletes our window) + } + + //============================================================================== + void systemRequestedQuit() override + { + // This is called when the app is being asked to quit: you can ignore this + // request and let the app carry on running, or call quit() to allow the app to close. + quit(); + } + + void anotherInstanceStarted (const String& commandLine) override + { + // When another instance of the app is launched while this one is running, + // this method is invoked, and the commandLine parameter tells you what + // the other instance's command-line arguments were. + } + + //============================================================================== + /* + This class implements the desktop window that contains an instance of + our MainContentComponent class. + */ + class MainWindow : public DocumentWindow + { + public: + MainWindow() : DocumentWindow ("MainWindow", + Colours::lightgrey, + DocumentWindow::allButtons) + { + setContentOwned (new MainComponent(), true); + + centreWithSize (getWidth(), getHeight()); + setVisible (true); + } + + void closeButtonPressed() + { + // This is called when the user tries to close this window. Here, we'll just + // ask the app to quit when this happens, but you can change this to do + // whatever you need. + JUCEApplication::getInstance()->systemRequestedQuit(); + } + + /* Note: Be careful if you override any DocumentWindow methods - the base + class uses a lot of them, so by overriding you might break its functionality. + It's best to do all your work in your content component instead, but if + you really have to override any DocumentWindow methods, make sure your + subclass also calls the superclass's method. + */ + + private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow) + }; + +private: + ScopedPointer mainWindow; +}; + +//============================================================================== +// This macro generates the main() routine that launches the app. +START_JUCE_APPLICATION (FsTrackApplication) diff --git a/Source/MainComponent.cpp b/Source/MainComponent.cpp new file mode 100644 index 0000000..7a0abec --- /dev/null +++ b/Source/MainComponent.cpp @@ -0,0 +1,120 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Introjucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Introjucer version: 3.1.0 + + ------------------------------------------------------------------------------ + + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. + + ============================================================================== +*/ + +//[Headers] You can add your own extra header files here... +//[/Headers] + +#include "MainComponent.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +MainComponent::MainComponent () +{ + addAndMakeVisible (m_fsuipcStatus = new Label ("FSUIP Status", + TRANS("Unknown"))); + m_fsuipcStatus->setFont (Font (15.00f, Font::plain)); + m_fsuipcStatus->setJustificationType (Justification::centredLeft); + m_fsuipcStatus->setEditable (false, false, false); + m_fsuipcStatus->setColour (TextEditor::textColourId, Colours::black); + m_fsuipcStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + + //[UserPreSize] + //[/UserPreSize] + + setSize (400, 300); + + + //[Constructor] You can add your own custom stuff here.. + //[/Constructor] +} + +MainComponent::~MainComponent() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + m_fsuipcStatus = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void MainComponent::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + g.fillAll (Colours::white); + + //[UserPaint] Add your own custom painting code here.. + g.fillAll (Colour (0xffeeddff)); + + g.setFont (Font (16.0f)); + g.setColour (Colours::black); + g.drawText ("Hello World!", getLocalBounds(), Justification::centred, true); + //[/UserPaint] +} + +void MainComponent::resized() +{ + m_fsuipcStatus->setBounds (32, 256, 150, 24); + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Introjucer information section -- + + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + +END_JUCER_METADATA +*/ +#endif + + +//[EndFile] You can add extra defines here... +//[/EndFile] diff --git a/Source/MainComponent.h b/Source/MainComponent.h new file mode 100644 index 0000000..537a3a5 --- /dev/null +++ b/Source/MainComponent.h @@ -0,0 +1,68 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Introjucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Introjucer version: 3.1.0 + + ------------------------------------------------------------------------------ + + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. + + ============================================================================== +*/ + +#ifndef __JUCE_HEADER_9002020A4DD09B20__ +#define __JUCE_HEADER_9002020A4DD09B20__ + +//[Headers] -- You can add your own extra header files here -- +#include "JuceHeader.h" +//[/Headers] + + + +//============================================================================== +/** + //[Comments] + An auto-generated component, created by the Introjucer. + + Describe your class and how it works here! + //[/Comments] +*/ +class MainComponent : public Component +{ +public: + //============================================================================== + MainComponent (); + ~MainComponent(); + + //============================================================================== + //[UserMethods] -- You can add your own custom methods in this section. + //[/UserMethods] + + void paint (Graphics& g); + void resized(); + + + +private: + //[UserVariables] -- You can add your own custom variables in this section. + //[/UserVariables] + + //============================================================================== + ScopedPointer