/*
  ==============================================================================

  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 "CommandLineSettingsComponent.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
CommandLineSettingsComponent::CommandLineSettingsComponent ()
{
    addAndMakeVisible (argumentsLabel = new Label ("argumentsLabel",
                                                   "Command Line Arguments:"));
    argumentsLabel->setFont (Font (15.00f, Font::plain));
    argumentsLabel->setJustificationType (Justification::centredLeft);
    argumentsLabel->setEditable (false, false, false);
    argumentsLabel->setColour (TextEditor::textColourId, Colours::black);
    argumentsLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (textEditor = new TextEditor ("new text editor"));
    textEditor->setMultiLine (true);
    textEditor->setReturnKeyStartsNewLine (false);
    textEditor->setReadOnly (false);
    textEditor->setScrollbarsShown (true);
    textEditor->setCaretVisible (true);
    textEditor->setPopupMenuEnabled (true);
    textEditor->setText (String::empty);


    //[UserPreSize]

	textEditor->addListener(this);

    //[/UserPreSize]

    setSize (600, 400);


    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}

CommandLineSettingsComponent::~CommandLineSettingsComponent()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    //[/Destructor_pre]

    argumentsLabel = nullptr;
    textEditor = nullptr;


    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void CommandLineSettingsComponent::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colour (0xffeeece1));

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void CommandLineSettingsComponent::resized()
{
    argumentsLabel->setBounds (8, 8, 183, 24);
    textEditor->setBounds (192, 8, getWidth() - 200, getHeight() - 16);
    //[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...

//------------------------------------------------------------------------------
void CommandLineSettingsComponent::textEditorTextChanged(TextEditor& editor)
{
	sendChangeMessage();
}

//------------------------------------------------------------------------------
void CommandLineSettingsComponent::setCommandLineArgs(const String& val)
{
    textEditor->setText(val, false);
}

//[/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

<JUCER_COMPONENT documentType="Component" className="CommandLineSettingsComponent"
                 componentName="" parentClasses="public Component, public ChangeBroadcaster, public TextEditor::Listener"
                 constructorParams="" variableInitialisers="" snapPixels="8" snapActive="1"
                 snapShown="1" overlayOpacity="0.330000013" fixedSize="0" initialWidth="600"
                 initialHeight="400">
  <BACKGROUND backgroundColour="ffeeece1"/>
  <LABEL name="argumentsLabel" id="801c3f4885868cd8" memberName="argumentsLabel"
         virtualName="" explicitFocusOrder="0" pos="8 8 183 24" edTextCol="ff000000"
         edBkgCol="0" labelText="Command Line Arguments:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="15" bold="0" italic="0" justification="33"/>
  <TEXTEDITOR name="new text editor" id="9a6f370fc229106" memberName="textEditor"
              virtualName="" explicitFocusOrder="0" pos="192 8 200M 16M" initialText=""
              multiline="1" retKeyStartsLine="0" readonly="0" scrollbars="1"
              caret="1" popupmenu="1"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif


//[EndFile] You can add extra defines here...
//[/EndFile]
