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.

162 lines
5.5KB

  1. /*
  2. ==============================================================================
  3. This is an automatically generated GUI class created by the Introjucer!
  4. Be careful when adding custom code to these files, as only the code within
  5. the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  6. and re-saved.
  7. Created with Introjucer version: 3.1.0
  8. ------------------------------------------------------------------------------
  9. The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  10. Copyright 2004-13 by Raw Material Software Ltd.
  11. ==============================================================================
  12. */
  13. //[Headers] You can add your own extra header files here...
  14. //[/Headers]
  15. #include "MainComponent.h"
  16. //[MiscUserDefs] You can add your own user definitions and misc code here...
  17. //[/MiscUserDefs]
  18. //==============================================================================
  19. MainComponent::MainComponent ()
  20. {
  21. addAndMakeVisible (helloWorldLabel = new Label (String::empty,
  22. "Hello World!"));
  23. helloWorldLabel->setFont (Font (40.00f, Font::bold));
  24. helloWorldLabel->setJustificationType (Justification::centred);
  25. helloWorldLabel->setEditable (false, false, false);
  26. helloWorldLabel->setColour (Label::textColourId, Colours::black);
  27. helloWorldLabel->setColour (TextEditor::textColourId, Colours::black);
  28. helloWorldLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  29. addAndMakeVisible (quitButton = new TextButton (String::empty));
  30. quitButton->setButtonText ("Quit");
  31. quitButton->addListener (this);
  32. //[UserPreSize]
  33. //[/UserPreSize]
  34. setSize (600, 300);
  35. //[Constructor] You can add your own custom stuff here..
  36. //[/Constructor]
  37. }
  38. MainComponent::~MainComponent()
  39. {
  40. //[Destructor_pre]. You can add your own custom destruction code here..
  41. //[/Destructor_pre]
  42. helloWorldLabel = nullptr;
  43. quitButton = nullptr;
  44. //[Destructor]. You can add your own custom destruction code here..
  45. //[/Destructor]
  46. }
  47. //==============================================================================
  48. void MainComponent::paint (Graphics& g)
  49. {
  50. //[UserPrePaint] Add your own custom painting code here..
  51. //[/UserPrePaint]
  52. g.fillAll (Colour (0xffc1d0ff));
  53. g.setColour (Colours::white);
  54. g.fillPath (internalPath1);
  55. g.setColour (Colour (0xff6f6f6f));
  56. g.strokePath (internalPath1, PathStrokeType (5.200f));
  57. //[UserPaint] Add your own custom painting code here..
  58. //[/UserPaint]
  59. }
  60. void MainComponent::resized()
  61. {
  62. helloWorldLabel->setBounds (152, 80, 296, 48);
  63. quitButton->setBounds (getWidth() - 176, getHeight() - 60, 120, 32);
  64. internalPath1.clear();
  65. internalPath1.startNewSubPath (136.0f, 80.0f);
  66. internalPath1.quadraticTo (176.0f, 24.0f, 328.0f, 32.0f);
  67. internalPath1.quadraticTo (472.0f, 40.0f, 472.0f, 104.0f);
  68. internalPath1.quadraticTo (472.0f, 192.0f, 232.0f, 176.0f);
  69. internalPath1.lineTo (184.0f, 216.0f);
  70. internalPath1.lineTo (200.0f, 168.0f);
  71. internalPath1.quadraticTo (96.0f, 136.0f, 136.0f, 80.0f);
  72. internalPath1.closeSubPath();
  73. //[UserResized] Add your own custom resize handling here..
  74. //[/UserResized]
  75. }
  76. void MainComponent::buttonClicked (Button* buttonThatWasClicked)
  77. {
  78. //[UserbuttonClicked_Pre]
  79. //[/UserbuttonClicked_Pre]
  80. if (buttonThatWasClicked == quitButton)
  81. {
  82. //[UserButtonCode_quitButton] -- add your button handler code here..
  83. JUCEApplication::quit();
  84. //[/UserButtonCode_quitButton]
  85. }
  86. //[UserbuttonClicked_Post]
  87. //[/UserbuttonClicked_Post]
  88. }
  89. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  90. //[/MiscUserCode]
  91. //==============================================================================
  92. #if 0
  93. /* -- Introjucer information section --
  94. This is where the Introjucer stores the metadata that describe this GUI layout, so
  95. make changes in here at your peril!
  96. BEGIN_JUCER_METADATA
  97. <JUCER_COMPONENT documentType="Component" className="MainComponent" componentName=""
  98. parentClasses="public Component" constructorParams="" variableInitialisers=""
  99. snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330000013"
  100. fixedSize="1" initialWidth="600" initialHeight="300">
  101. <BACKGROUND backgroundColour="ffc1d0ff">
  102. <PATH pos="0 0 100 100" fill="solid: ffffffff" hasStroke="1" stroke="5.19999981, mitered, butt"
  103. strokeColour="solid: ff6f6f6f" nonZeroWinding="1">s 136 80 q 176 24 328 32 q 472 40 472 104 q 472 192 232 176 l 184 216 l 200 168 q 96 136 136 80 x</PATH>
  104. </BACKGROUND>
  105. <LABEL name="" id="be4f6f2e5725a063" memberName="helloWorldLabel" virtualName=""
  106. explicitFocusOrder="0" pos="152 80 296 48" textCol="ff000000"
  107. edTextCol="ff000000" edBkgCol="0" labelText="Hello World!" editableSingleClick="0"
  108. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  109. fontsize="40" bold="1" italic="0" justification="36"/>
  110. <TEXTBUTTON name="" id="bcf4f7b0888effe5" memberName="quitButton" virtualName=""
  111. explicitFocusOrder="0" pos="176R 60R 120 32" buttonText="Quit"
  112. connectedEdges="0" needsCallback="1" radioGroupId="0"/>
  113. </JUCER_COMPONENT>
  114. END_JUCER_METADATA
  115. */
  116. #endif
  117. //[EndFile] You can add extra defines here...
  118. //[/EndFile]