StatusBar.cpp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 "StatusBar.h"
  16. //[MiscUserDefs] You can add your own user definitions and misc code here...
  17. //[/MiscUserDefs]
  18. //==============================================================================
  19. StatusBar::StatusBar ()
  20. {
  21. setName ("StatusBar");
  22. addAndMakeVisible (statusLLabel = new Label ("statusLLabel",
  23. String()));
  24. statusLLabel->setFont (Font (15.00f, Font::plain));
  25. statusLLabel->setJustificationType (Justification::centredLeft);
  26. statusLLabel->setEditable (false, false, false);
  27. statusLLabel->setColour (Label::backgroundColourId, Colours::black);
  28. statusLLabel->setColour (Label::textColourId, Colours::grey);
  29. statusLLabel->setColour (Label::outlineColourId, Colours::white);
  30. statusLLabel->setColour (TextEditor::textColourId, Colours::black);
  31. statusLLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  32. addAndMakeVisible (statusRLabel = new Label ("statusRLabel",
  33. String()));
  34. statusRLabel->setFont (Font (15.00f, Font::plain));
  35. statusRLabel->setJustificationType (Justification::centredRight);
  36. statusRLabel->setEditable (false, false, false);
  37. statusRLabel->setColour (Label::backgroundColourId, Colours::black);
  38. statusRLabel->setColour (Label::textColourId, Colours::grey);
  39. statusRLabel->setColour (Label::outlineColourId, Colours::white);
  40. statusRLabel->setColour (TextEditor::textColourId, Colours::black);
  41. statusRLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  42. //[UserPreSize]
  43. this->statusLLabel->setText(String() , dontSendNotification) ;
  44. this->statusRLabel->setText(String() , dontSendNotification) ;
  45. //[/UserPreSize]
  46. setSize (622, 24);
  47. //[Constructor] You can add your own custom stuff here..
  48. //[/Constructor]
  49. }
  50. StatusBar::~StatusBar()
  51. {
  52. //[Destructor_pre]. You can add your own custom destruction code here..
  53. //[/Destructor_pre]
  54. statusLLabel = nullptr;
  55. statusRLabel = nullptr;
  56. //[Destructor]. You can add your own custom destruction code here..
  57. //[/Destructor]
  58. }
  59. //==============================================================================
  60. void StatusBar::paint (Graphics& g)
  61. {
  62. //[UserPrePaint] Add your own custom painting code here..
  63. //[/UserPrePaint]
  64. g.setColour (Colour (0xff101010));
  65. g.fillRoundedRectangle (0.0f, 0.0f, static_cast<float> (getWidth() - 0), static_cast<float> (getHeight() - 0), 10.000f);
  66. g.setColour (Colours::white);
  67. g.drawRoundedRectangle (0.0f, 0.0f, static_cast<float> (getWidth() - 0), static_cast<float> (getHeight() - 0), 10.000f, 1.000f);
  68. g.setColour (Colours::black);
  69. g.fillRect (168, 4, getWidth() - 336, 16);
  70. g.setColour (Colours::white);
  71. g.drawRect (168, 4, getWidth() - 336, 16, 1);
  72. //[UserPaint] Add your own custom painting code here..
  73. //[/UserPaint]
  74. }
  75. void StatusBar::resized()
  76. {
  77. statusLLabel->setBounds (4, 4, 160, 16);
  78. statusRLabel->setBounds (getWidth() - 164, 4, 160, 16);
  79. //[UserResized] Add your own custom resize handling here..
  80. //[/UserResized]
  81. }
  82. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  83. void StatusBar::setStatusL(String statusText)
  84. { this->statusLLabel->setText(statusText , juce::dontSendNotification) ; }
  85. void StatusBar::setStatusR(String statusText)
  86. { this->statusRLabel->setText(statusText , juce::dontSendNotification) ; }
  87. //[/MiscUserCode]
  88. //==============================================================================
  89. #if 0
  90. /* -- Introjucer information section --
  91. This is where the Introjucer stores the metadata that describe this GUI layout, so
  92. make changes in here at your peril!
  93. BEGIN_JUCER_METADATA
  94. <JUCER_COMPONENT documentType="Component" className="StatusBar" componentName="StatusBar"
  95. parentClasses="public Component" constructorParams="" variableInitialisers=""
  96. snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
  97. fixedSize="0" initialWidth="622" initialHeight="24">
  98. <BACKGROUND backgroundColour="0">
  99. <ROUNDRECT pos="0 0 0M 0M" cornerSize="10" fill="solid: ff101010" hasStroke="1"
  100. stroke="1, mitered, butt" strokeColour="solid: ffffffff"/>
  101. <RECT pos="168 4 336M 16" fill="solid: ff000000" hasStroke="1" stroke="1, mitered, butt"
  102. strokeColour="solid: ffffffff"/>
  103. </BACKGROUND>
  104. <LABEL name="statusLLabel" id="2b89e84fd708c8e0" memberName="statusLLabel"
  105. virtualName="" explicitFocusOrder="0" pos="4 4 160 16" bkgCol="ff000000"
  106. textCol="ff808080" outlineCol="ffffffff" edTextCol="ff000000"
  107. edBkgCol="0" labelText="" editableSingleClick="0" editableDoubleClick="0"
  108. focusDiscardsChanges="0" fontname="Default font" fontsize="15"
  109. bold="0" italic="0" justification="33"/>
  110. <LABEL name="statusRLabel" id="d9ab2c99c74ba401" memberName="statusRLabel"
  111. virtualName="" explicitFocusOrder="0" pos="164R 4 160 16" bkgCol="ff000000"
  112. textCol="ff808080" outlineCol="ffffffff" edTextCol="ff000000"
  113. edBkgCol="0" labelText="" editableSingleClick="0" editableDoubleClick="0"
  114. focusDiscardsChanges="0" fontname="Default font" fontsize="15"
  115. bold="0" italic="0" justification="34"/>
  116. </JUCER_COMPONENT>
  117. END_JUCER_METADATA
  118. */
  119. #endif
  120. //[EndFile] You can add extra defines here...
  121. //[/EndFile]