void HadronLabel::mouseDoubleClick(const MouseEvent& e) { if (use_modal_editor_) { if (isEditableOnDoubleClick() && ! e.mods.isPopupMenu()) { ModalComponentManager::Callback* userCallback = 0; ScopedPointer<ModalComponentManager::Callback> userCallbackDeleter (userCallback); Component::SafePointer<Component> prevFocused (Component::getCurrentlyFocusedComponent()); Component::SafePointer<Component> prevTopLevel ((prevFocused != 0) ? prevFocused->getTopLevelComponent() : 0); ScopedPointer <TextEditor> texteditor (createEditorComponent()); texteditor->setColour(TextEditor::backgroundColourId, Colours::white); texteditor->setWantsKeyboardFocus (true); texteditor->setAlwaysOnTop (true); // Find screen position Rectangle<int> sr (getBounds ()); sr.setPosition (getScreenX(), getScreenY()); int fontheight = static_cast<int>(texteditor->getFont().getHeight()) + 4; if (sr.getHeight() > fontheight) { sr.translate (0, (sr.getHeight() - fontheight)/2); sr.setHeight (fontheight); } texteditor->setBounds(sr); texteditor->setText(getText(),false); texteditor->setHighlightedRegion (Range <int> (0, getText().length ())); texteditor->setVisible (true); texteditor->grabKeyboardFocus(); texteditor->addToDesktop (ComponentPeer::windowIsTemporary, 0); texteditor->addListener (this); texteditor->enterModalState (false); texteditor->grabKeyboardFocus(); texteditor->runModalLoop(); if (prevTopLevel != 0) prevTopLevel->toFront (true); if (prevFocused != 0) prevFocused->grabKeyboardFocus(); } } else { Label::mouseDoubleClick(e); } }
AboutUsComponent() : csPlayerLabel(nullptr), csPlayerDetailTE(nullptr), csTeamTE(nullptr), csLicenceTE(nullptr), csPlayerSource(nullptr), csPlayerSite(nullptr), csPlayerGroupComponent(nullptr), csTeamgroupComponent(nullptr), csLicencegroupComponent(nullptr) { LookAndFeel::getDefaultLookAndFeel().setColour(TextEditor::textColourId, Colours::grey); setLookAndFeel(&LookAndFeel::getDefaultLookAndFeel()); addAndMakeVisible (csPlayerLabel = new Label ("scPlayer", "Server-Client Audio Player")); csPlayerLabel->setFont (Font (20.0000f, Font::bold)); csPlayerLabel->setJustificationType (Justification::centredLeft); csPlayerLabel->setEditable (false, false, false); csPlayerLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (csPlayerGroupComponent = new GroupComponent ("ScPlayer group", "ScPlayer")); addAndMakeVisible (csPlayerDetailTE = new TextEditor ("scPlayer Details")); csPlayerDetailTE->setFont (Font (13.30f, Font::plain)); csPlayerDetailTE->setReadOnly (true); csPlayerDetailTE->setMultiLine(true, true); csPlayerDetailTE->setText("ScPlayer \"Server Client Audio Player\" is C++ based " "Music player built using Juce and DrowAudio for Network " "teams to play their server placed " "music in the network. ScPlayer is Server " "Audio Player and Client player Manager kind of application."); csPlayerDetailTE->setColour (TextEditor::outlineColourId, Colour (0x0)); csPlayerDetailTE->setColour (TextEditor::focusedOutlineColourId, Colour (0x0)); csPlayerDetailTE->setColour (TextEditor::shadowColourId, Colour (0x0)); csPlayerDetailTE->setColour (TextEditor::textColourId, Colours::grey); csPlayerDetailTE->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (csTeamgroupComponent = new GroupComponent ("ScTeam group", "ScTeam")); addAndMakeVisible (csTeamTE = new TextEditor ("scTeam Details")); csTeamTE->setFont (Font (13.0000f, Font::plain)); csTeamTE->setMultiLine(true, true); csTeamTE->setText("ScTeam is group of people willingly developes ScPlayer. " "CyberCBM Owns most rights (Though GPUV2 Licence) and responsible for work inside ScPlayer. " "Other helping Members in CsTeam are NREZ, Hammer, PD, Vrushabh."); csTeamTE->setReadOnly (true); csTeamTE->setColour (TextEditor::outlineColourId, Colour (0x0)); csTeamTE->setColour (TextEditor::focusedOutlineColourId, Colour (0x0)); csTeamTE->setColour (TextEditor::shadowColourId, Colour (0x0)); csTeamTE->setColour (TextEditor::textColourId, Colours::grey); csTeamTE->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (csLicencegroupComponent = new GroupComponent ("Licence group", "Licence: GPU-V2")); addAndMakeVisible (csLicenceTE = new TextEditor ("scLicence Details")); csLicenceTE->setFont (Font (13.0000f, Font::plain)); csLicenceTE->setMultiLine(true, true); csLicenceTE->setText("This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " "the Free Software Foundation; either version 2 of the License, or " "(at your option) any later version.\n\n" "This program is distributed in the hope that it will be useful, " "but WITHOUT ANY WARRANTY; without even the implied warranty of " "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " "See the GNU General Public License for more details. "); csLicenceTE->setReadOnly (true); csLicenceTE->setColour (TextEditor::outlineColourId, Colour (0x0)); csLicenceTE->setColour (TextEditor::focusedOutlineColourId, Colour (0x0)); csLicenceTE->setColour (TextEditor::shadowColourId, Colour (0x0)); csLicenceTE->setColour (TextEditor::outlineColourId, Colour (0x0)); csLicenceTE->setColour (TextEditor::textColourId, Colours::grey); csLicenceTE->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (csPlayerSite = new HyperlinkButton ("ScPlayer", URL ("https://cybercbm.github.com/ScPlayer"))); csPlayerSite->setFont(Font (16.0000f, Font::bold), false, Justification::centred); addAndMakeVisible (csPlayerSource = new HyperlinkButton ("Get ScPlayer Source Code", URL ("https://github.com/cyberCBM/ScPlayer"))); csPlayerSource->setFont(Font (16.0000f, Font::bold), false, Justification::centred); }