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.

159 lines
5.5KB

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