00001 #ifndef hpp_SourceOfPage_hpp
00002 #define hpp_SourceOfPage_hpp
00003
00004
00005 #include "../UZIBase.hpp"
00006
00007 namespace juce
00008 {
00009 class SourceCodeWindow;
00010 static SourceCodeWindow* sourceWindow = 0;
00011
00012
00013
00014 class SourceCodeWindow : public juce::DialogWindow
00015 {
00016 TextEditor* textBox;
00017
00018 public:
00019 SourceCodeWindow()
00020 : DialogWindow (JUCE_T("UZI last downloaded source page"),
00021 Colours::floralwhite,
00022 false)
00023 {
00024 setContentComponent (textBox = new TextEditor());
00025
00026 textBox->setColour (TextEditor::backgroundColourId, Colours::white);
00027 textBox->setMultiLine (true, true);
00028 textBox->setReturnKeyStartsNewLine (true);
00029
00030 setResizable (true, true);
00031
00032 }
00033
00034 ~SourceCodeWindow()
00035 {
00036
00037
00038
00039 sourceWindow = 0;
00040 }
00041
00042 void closeButtonPressed()
00043 {
00044 delete this;
00045 }
00046
00047 void updateSourceCode (const String& text)
00048 {
00049 Font font (14.0f);
00050 font.setTypefaceName (Font::getDefaultMonospacedFontName());
00051 textBox->setFont (font);
00052
00053 textBox->setText (text);
00054
00055 toFront (true);
00056 }
00057 };
00058
00059 }
00060
00061 #endif