ConfigChat.cpp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. /*\
  2. |*| Copyright 2015-2016 bill-auger <https://github.com/bill-auger/av-caster/issues>
  3. |*|
  4. |*| This file is part of the AvCaster program.
  5. |*|
  6. |*| AvCaster is free software: you can redistribute it and/or modify
  7. |*| it under the terms of the GNU General Public License version 3
  8. |*| as published by the Free Software Foundation.
  9. |*|
  10. |*| AvCaster is distributed in the hope that it will be useful,
  11. |*| but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. |*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. |*| GNU General Public License for more details.
  14. |*|
  15. |*| You should have received a copy of the GNU General Public License
  16. |*| along with AvCaster. If not, see <http://www.gnu.org/licenses/>.
  17. \*/
  18. //[Headers] You can add your own extra header files here...
  19. //[/Headers]
  20. #include "ConfigChat.h"
  21. //[MiscUserDefs] You can add your own user definitions and misc code here...
  22. //[/MiscUserDefs]
  23. //==============================================================================
  24. ConfigChat::ConfigChat ()
  25. {
  26. addAndMakeVisible (timestampToggle = new ToggleButton ("timestampToggle"));
  27. timestampToggle->setExplicitFocusOrder (6);
  28. timestampToggle->setButtonText (TRANS("Show Timestamps"));
  29. timestampToggle->setColour (ToggleButton::textColourId, Colours::white);
  30. addAndMakeVisible (joinPartToggle = new ToggleButton ("joinPartToggle"));
  31. joinPartToggle->setExplicitFocusOrder (7);
  32. joinPartToggle->setButtonText (TRANS("Show Joins/Parts"));
  33. joinPartToggle->setToggleState (true, dontSendNotification);
  34. joinPartToggle->setColour (ToggleButton::textColourId, Colours::white);
  35. addAndMakeVisible (networkLabel = new Label ("networkLabel",
  36. TRANS("Host:")));
  37. networkLabel->setFont (Font (15.00f, Font::plain));
  38. networkLabel->setJustificationType (Justification::centredLeft);
  39. networkLabel->setEditable (false, false, false);
  40. networkLabel->setColour (Label::textColourId, Colours::white);
  41. networkLabel->setColour (TextEditor::textColourId, Colours::black);
  42. networkLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  43. addAndMakeVisible (portLabel = new Label ("portLabel",
  44. TRANS("Port:")));
  45. portLabel->setFont (Font (15.00f, Font::plain));
  46. portLabel->setJustificationType (Justification::centredLeft);
  47. portLabel->setEditable (false, false, false);
  48. portLabel->setColour (Label::textColourId, Colours::white);
  49. portLabel->setColour (TextEditor::textColourId, Colours::black);
  50. portLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  51. addAndMakeVisible (portText = new TextEditor ("portText"));
  52. portText->setExplicitFocusOrder (2);
  53. portText->setMultiLine (false);
  54. portText->setReturnKeyStartsNewLine (false);
  55. portText->setReadOnly (false);
  56. portText->setScrollbarsShown (true);
  57. portText->setCaretVisible (true);
  58. portText->setPopupMenuEnabled (true);
  59. portText->setText (String::empty);
  60. addAndMakeVisible (nickLabel = new Label ("nickLabel",
  61. TRANS("Nick:")));
  62. nickLabel->setFont (Font (15.00f, Font::plain));
  63. nickLabel->setJustificationType (Justification::centredLeft);
  64. nickLabel->setEditable (false, false, false);
  65. nickLabel->setColour (Label::textColourId, Colours::white);
  66. nickLabel->setColour (TextEditor::textColourId, Colours::black);
  67. nickLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  68. addAndMakeVisible (nickText = new TextEditor ("nickText"));
  69. nickText->setExplicitFocusOrder (3);
  70. nickText->setMultiLine (false);
  71. nickText->setReturnKeyStartsNewLine (false);
  72. nickText->setReadOnly (false);
  73. nickText->setScrollbarsShown (true);
  74. nickText->setCaretVisible (true);
  75. nickText->setPopupMenuEnabled (true);
  76. nickText->setText (String::empty);
  77. addAndMakeVisible (passLabel = new Label ("passLabel",
  78. TRANS("Password:")));
  79. passLabel->setFont (Font (15.00f, Font::plain));
  80. passLabel->setJustificationType (Justification::centredLeft);
  81. passLabel->setEditable (false, false, false);
  82. passLabel->setColour (Label::textColourId, Colours::white);
  83. passLabel->setColour (TextEditor::textColourId, Colours::black);
  84. passLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  85. addAndMakeVisible (passText = new TextEditor ("passText"));
  86. passText->setExplicitFocusOrder (4);
  87. passText->setMultiLine (false);
  88. passText->setReturnKeyStartsNewLine (false);
  89. passText->setReadOnly (false);
  90. passText->setScrollbarsShown (true);
  91. passText->setCaretVisible (true);
  92. passText->setPopupMenuEnabled (true);
  93. passText->setText (String::empty);
  94. addAndMakeVisible (channelLabel = new Label ("channelLabel",
  95. TRANS("Channel:")));
  96. channelLabel->setFont (Font (15.00f, Font::plain));
  97. channelLabel->setJustificationType (Justification::centredLeft);
  98. channelLabel->setEditable (false, false, false);
  99. channelLabel->setColour (Label::textColourId, Colours::white);
  100. channelLabel->setColour (TextEditor::textColourId, Colours::black);
  101. channelLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  102. addAndMakeVisible (channelText = new TextEditor ("channelText"));
  103. channelText->setExplicitFocusOrder (5);
  104. channelText->setMultiLine (false);
  105. channelText->setReturnKeyStartsNewLine (false);
  106. channelText->setReadOnly (false);
  107. channelText->setScrollbarsShown (true);
  108. channelText->setCaretVisible (true);
  109. channelText->setPopupMenuEnabled (true);
  110. channelText->setText (String::empty);
  111. addAndMakeVisible (greetingLabel = new Label ("greetingLabel",
  112. TRANS("Greeting:")));
  113. greetingLabel->setFont (Font (15.00f, Font::plain));
  114. greetingLabel->setJustificationType (Justification::centredLeft);
  115. greetingLabel->setEditable (false, false, false);
  116. greetingLabel->setColour (Label::textColourId, Colours::white);
  117. greetingLabel->setColour (TextEditor::textColourId, Colours::black);
  118. greetingLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  119. addAndMakeVisible (greetingText = new TextEditor ("greetingText"));
  120. greetingText->setExplicitFocusOrder (8);
  121. greetingText->setMultiLine (true);
  122. greetingText->setReturnKeyStartsNewLine (true);
  123. greetingText->setReadOnly (false);
  124. greetingText->setScrollbarsShown (true);
  125. greetingText->setCaretVisible (true);
  126. greetingText->setPopupMenuEnabled (true);
  127. greetingText->setText (String::empty);
  128. addAndMakeVisible (networkText = new TextEditor ("networkText"));
  129. networkText->setExplicitFocusOrder (1);
  130. networkText->setMultiLine (false);
  131. networkText->setReturnKeyStartsNewLine (false);
  132. networkText->setReadOnly (false);
  133. networkText->setScrollbarsShown (true);
  134. networkText->setCaretVisible (true);
  135. networkText->setPopupMenuEnabled (true);
  136. networkText->setText (String::empty);
  137. //[UserPreSize]
  138. //[/UserPreSize]
  139. setSize (1, 1);
  140. //[Constructor] You can add your own custom stuff here..
  141. //[/Constructor]
  142. }
  143. ConfigChat::~ConfigChat()
  144. {
  145. //[Destructor_pre]. You can add your own custom destruction code here..
  146. //[/Destructor_pre]
  147. timestampToggle = nullptr;
  148. joinPartToggle = nullptr;
  149. networkLabel = nullptr;
  150. portLabel = nullptr;
  151. portText = nullptr;
  152. nickLabel = nullptr;
  153. nickText = nullptr;
  154. passLabel = nullptr;
  155. passText = nullptr;
  156. channelLabel = nullptr;
  157. channelText = nullptr;
  158. greetingLabel = nullptr;
  159. greetingText = nullptr;
  160. networkText = nullptr;
  161. //[Destructor]. You can add your own custom destruction code here..
  162. //[/Destructor]
  163. }
  164. //==============================================================================
  165. void ConfigChat::paint (Graphics& g)
  166. {
  167. //[UserPrePaint] Add your own custom painting code here..
  168. //[/UserPrePaint]
  169. //[UserPaint] Add your own custom painting code here..
  170. //[/UserPaint]
  171. }
  172. void ConfigChat::resized()
  173. {
  174. //[UserPreResize] Add your own custom resize code here..
  175. //[/UserPreResize]
  176. timestampToggle->setBounds (234, 8, 128, 24);
  177. joinPartToggle->setBounds (376, 8, 128, 24);
  178. networkLabel->setBounds (0, 8, 80, 24);
  179. portLabel->setBounds (0, 48, 40, 24);
  180. portText->setBounds (80, 48, 56, 24);
  181. nickLabel->setBounds (0, 88, 40, 24);
  182. nickText->setBounds (80, 88, 136, 24);
  183. passLabel->setBounds (0, 128, 72, 24);
  184. passText->setBounds (80, 128, 136, 24);
  185. channelLabel->setBounds (0, 168, 80, 24);
  186. channelText->setBounds (80, 168, 136, 24);
  187. greetingLabel->setBounds (234, 48, 72, 24);
  188. greetingText->setBounds (234, 72, 270, 120);
  189. networkText->setBounds (80, 8, 136, 24);
  190. //[UserResized] Add your own custom resize handling here..
  191. //[/UserResized]
  192. }
  193. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  194. //[/MiscUserCode]
  195. //==============================================================================
  196. #if 0
  197. /* -- Introjucer information section --
  198. This is where the Introjucer stores the metadata that describe this GUI layout, so
  199. make changes in here at your peril!
  200. BEGIN_JUCER_METADATA
  201. <JUCER_COMPONENT documentType="Component" className="ConfigChat" componentName=""
  202. parentClasses="public Component" constructorParams="" variableInitialisers=""
  203. snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
  204. fixedSize="0" initialWidth="1" initialHeight="1">
  205. <BACKGROUND backgroundColour="0"/>
  206. <TOGGLEBUTTON name="timestampToggle" id="1ec45429906b24f5" memberName="timestampToggle"
  207. virtualName="" explicitFocusOrder="6" pos="234 8 128 24" txtcol="ffffffff"
  208. buttonText="Show Timestamps" connectedEdges="0" needsCallback="0"
  209. radioGroupId="0" state="0"/>
  210. <TOGGLEBUTTON name="joinPartToggle" id="b365bf54ac5a17da" memberName="joinPartToggle"
  211. virtualName="" explicitFocusOrder="7" pos="376 8 128 24" txtcol="ffffffff"
  212. buttonText="Show Joins/Parts" connectedEdges="0" needsCallback="0"
  213. radioGroupId="0" state="1"/>
  214. <LABEL name="networkLabel" id="17d2e75add77ef88" memberName="networkLabel"
  215. virtualName="" explicitFocusOrder="0" pos="0 8 80 24" textCol="ffffffff"
  216. edTextCol="ff000000" edBkgCol="0" labelText="Host:" editableSingleClick="0"
  217. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  218. fontsize="15" bold="0" italic="0" justification="33"/>
  219. <LABEL name="portLabel" id="c9766d1550ca03d" memberName="portLabel"
  220. virtualName="" explicitFocusOrder="0" pos="0 48 40 24" textCol="ffffffff"
  221. edTextCol="ff000000" edBkgCol="0" labelText="Port:" editableSingleClick="0"
  222. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  223. fontsize="15" bold="0" italic="0" justification="33"/>
  224. <TEXTEDITOR name="portText" id="884822c04a8baf5b" memberName="portText" virtualName=""
  225. explicitFocusOrder="2" pos="80 48 56 24" initialText="" multiline="0"
  226. retKeyStartsLine="0" readonly="0" scrollbars="1" caret="1" popupmenu="1"/>
  227. <LABEL name="nickLabel" id="2762611946169823" memberName="nickLabel"
  228. virtualName="" explicitFocusOrder="0" pos="0 88 40 24" textCol="ffffffff"
  229. edTextCol="ff000000" edBkgCol="0" labelText="Nick:" editableSingleClick="0"
  230. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  231. fontsize="15" bold="0" italic="0" justification="33"/>
  232. <TEXTEDITOR name="nickText" id="33c730fea5d389aa" memberName="nickText" virtualName=""
  233. explicitFocusOrder="3" pos="80 88 136 24" initialText="" multiline="0"
  234. retKeyStartsLine="0" readonly="0" scrollbars="1" caret="1" popupmenu="1"/>
  235. <LABEL name="passLabel" id="f5de0cc5921d9a6a" memberName="passLabel"
  236. virtualName="" explicitFocusOrder="0" pos="0 128 72 24" textCol="ffffffff"
  237. edTextCol="ff000000" edBkgCol="0" labelText="Password:" editableSingleClick="0"
  238. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  239. fontsize="15" bold="0" italic="0" justification="33"/>
  240. <TEXTEDITOR name="passText" id="af6a1e14762cfebf" memberName="passText" virtualName=""
  241. explicitFocusOrder="4" pos="80 128 136 24" initialText="" multiline="0"
  242. retKeyStartsLine="0" readonly="0" scrollbars="1" caret="1" popupmenu="1"/>
  243. <LABEL name="channelLabel" id="64c9a775a77af61c" memberName="channelLabel"
  244. virtualName="" explicitFocusOrder="0" pos="0 168 80 24" textCol="ffffffff"
  245. edTextCol="ff000000" edBkgCol="0" labelText="Channel:" editableSingleClick="0"
  246. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  247. fontsize="15" bold="0" italic="0" justification="33"/>
  248. <TEXTEDITOR name="channelText" id="ca5aa4f4a77b4469" memberName="channelText"
  249. virtualName="" explicitFocusOrder="5" pos="80 168 136 24" initialText=""
  250. multiline="0" retKeyStartsLine="0" readonly="0" scrollbars="1"
  251. caret="1" popupmenu="1"/>
  252. <LABEL name="greetingLabel" id="460772215644ef5" memberName="greetingLabel"
  253. virtualName="" explicitFocusOrder="0" pos="234 48 72 24" textCol="ffffffff"
  254. edTextCol="ff000000" edBkgCol="0" labelText="Greeting:" editableSingleClick="0"
  255. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  256. fontsize="15" bold="0" italic="0" justification="33"/>
  257. <TEXTEDITOR name="greetingText" id="7d47de6dcee921f5" memberName="greetingText"
  258. virtualName="" explicitFocusOrder="8" pos="234 72 270 120" initialText=""
  259. multiline="1" retKeyStartsLine="1" readonly="0" scrollbars="1"
  260. caret="1" popupmenu="1"/>
  261. <TEXTEDITOR name="networkText" id="a4f0c88c1e1ddb44" memberName="networkText"
  262. virtualName="" explicitFocusOrder="1" pos="80 8 136 24" initialText=""
  263. multiline="0" retKeyStartsLine="0" readonly="0" scrollbars="1"
  264. caret="1" popupmenu="1"/>
  265. </JUCER_COMPONENT>
  266. END_JUCER_METADATA
  267. */
  268. #endif
  269. //[EndFile] You can add extra defines here...
  270. //[/EndFile]