Chat.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.1
  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. #ifndef _CHAT_H_
  14. #define _CHAT_H_
  15. //[Headers] -- You can add your own extra header files here --
  16. #include "JuceHeader.h"
  17. //[/Headers]
  18. //==============================================================================
  19. /**
  20. //[Comments]
  21. Chat is a sub-section of the main jam "screen"
  22. it displays incoming chat text and handles outgoing chat entry
  23. //[/Comments]
  24. */
  25. class Chat : public Component,
  26. public TextEditor::Listener,
  27. public Value::Listener,
  28. public Label::Listener
  29. {
  30. public:
  31. //==============================================================================
  32. Chat (Value font_size);
  33. ~Chat();
  34. //==============================================================================
  35. //[UserMethods] -- You can add your own custom methods in this section.
  36. void setTopic( String topic_text) ;
  37. void addChatLine(String chat_user , String chat_text) ;
  38. //[/UserMethods]
  39. void paint (Graphics& g);
  40. void resized();
  41. void labelTextChanged (Label* labelThatHasChanged);
  42. private:
  43. //[UserVariables] -- You can add your own custom variables in this section.
  44. ValueTree guiStore ;
  45. Value fontSize ;
  46. String prevTopicText ;
  47. void valueChanged( Value& a_value) override ;
  48. void textEditorReturnKeyPressed(TextEditor& a_text_editor) override ;
  49. void setFontSize() ;
  50. int getFontSize() ;
  51. bool shouldShowTopic() ;
  52. //[/UserVariables]
  53. //==============================================================================
  54. ScopedPointer<TextEditor> chatText;
  55. ScopedPointer<TextEditor> chatEntryText;
  56. ScopedPointer<Label> topicLabel;
  57. //==============================================================================
  58. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Chat)
  59. };
  60. //[EndFile] You can add extra defines here...
  61. //[/EndFile]
  62. #endif // _CHAT_H_